use of com.intellij.codeInsight.daemon.impl.HighlightInfo in project intellij-community by JetBrains.
the class LossyEncodingTest method testInconsistentLineSeparators.
public void testInconsistentLineSeparators() throws Exception {
VirtualFile virtualFile = getVirtualFile(BASE_PATH + "/" + getTestName(false) + ".txt");
configureByExistingFile(virtualFile);
FileDocumentManager.getInstance().saveAllDocuments();
final Document document = FileDocumentManager.getInstance().getDocument(virtualFile);
assertFalse(FileDocumentManager.getInstance().isDocumentUnsaved(document));
doHighlighting();
List<HighlightInfo> infos = DaemonCodeAnalyzerEx.getInstanceEx(getProject()).getFileLevelHighlights(getProject(), getFile());
assertEmpty(infos);
}
use of com.intellij.codeInsight.daemon.impl.HighlightInfo in project intellij-community by JetBrains.
the class LossyEncodingTest method testTyping.
public void testTyping() throws Exception {
doTest("Simple.xml");
type("US-ASCII");
Collection<HighlightInfo> infos = doHighlighting();
assertEquals(1, infos.size());
boolean found = false;
for (HighlightInfo info : infos) {
if (info.getDescription().equals("Unsupported characters for the charset 'US-ASCII'")) {
found = true;
break;
}
}
assertTrue(found);
}
use of com.intellij.codeInsight.daemon.impl.HighlightInfo in project intellij-community by JetBrains.
the class LossyEncodingTest method testText.
public void testText() throws Exception {
doTest("Text.txt");
Charset ascii = CharsetToolkit.forName("US-ASCII");
VirtualFile myVFile = myFile.getVirtualFile();
FileDocumentManager.getInstance().saveAllDocuments();
EncodingManager.getInstance().setEncoding(myVFile, ascii);
// wait for reload requests to bubble up
UIUtil.dispatchAllInvocationEvents();
assertEquals(ascii, myVFile.getCharset());
int start = myEditor.getCaretModel().getOffset();
type((char) 0x445);
type((char) 0x438);
int end = myEditor.getCaretModel().getOffset();
Collection<HighlightInfo> infos = doHighlighting();
HighlightInfo info = assertOneElement(infos);
assertEquals("Unsupported characters for the charset 'US-ASCII'", info.getDescription());
assertEquals(start, info.startOffset);
assertEquals(end, info.endOffset);
backspace();
backspace();
doDoTest(true, false);
}
use of com.intellij.codeInsight.daemon.impl.HighlightInfo in project intellij-community by JetBrains.
the class AdvHighlightingTest method testSameFQNClasses.
public void testSameFQNClasses() throws Exception {
String path = PathManagerEx.getTestDataPath() + BASE_PATH + "/" + getTestName(true);
VirtualFile root = LocalFileSystem.getInstance().findFileByIoFile(new File(path));
assert root != null : path;
loadAllModulesUnder(root);
configureByExistingFile(root.findFileByRelativePath("client/src/BugTest.java"));
Collection<HighlightInfo> infos = highlightErrors();
assertEmpty(infos);
}
use of com.intellij.codeInsight.daemon.impl.HighlightInfo in project intellij-community by JetBrains.
the class AdvHighlightingTest method testMultiJDKConflict.
public void testMultiJDKConflict() throws Exception {
String path = PathManagerEx.getTestDataPath() + BASE_PATH + "/" + getTestName(true);
VirtualFile root = LocalFileSystem.getInstance().findFileByIoFile(new File(path));
assert root != null : path;
loadAllModulesUnder(root);
ModuleManager moduleManager = ModuleManager.getInstance(getProject());
Module java4 = moduleManager.findModuleByName("java4");
Module java5 = moduleManager.findModuleByName("java5");
ModuleRootModificationUtil.setModuleSdk(java4, IdeaTestUtil.getMockJdk17("java 1.4"));
ModuleRootModificationUtil.setModuleSdk(java5, IdeaTestUtil.getMockJdk17("java 1.5"));
ModuleRootModificationUtil.addDependency(java5, java4);
configureByExistingFile(root.findFileByRelativePath("moduleJava5/com/Java5.java"));
Collection<HighlightInfo> infos = highlightErrors();
assertEmpty(infos);
}
Aggregations