file level higlighting disappears on typing

This commit is contained in:
Alexey Kudravtsev
2014-11-28 14:26:05 +03:00
parent 4cb053be35
commit 49083ec178
2 changed files with 10 additions and 1 deletions
@@ -430,6 +430,13 @@ public class LightAdvHighlightingTest extends LightDaemonAnalyzerTestCase {
HighlightInfo info = assertOneElement(fileLevel);
assertEquals("top level", info.getDescription());
type("\n\n");
doHighlighting();
fileLevel =
((DaemonCodeAnalyzerImpl)DaemonCodeAnalyzer.getInstance(ourProject)).getFileLevelHighlights(getProject(), getFile());
info = assertOneElement(fileLevel);
assertEquals("top level", info.getDescription());
type("//xxx"); //disable top level annotation
List<HighlightInfo> warnings = doHighlighting(HighlightSeverity.WARNING);
assertEmpty(warnings);
@@ -167,7 +167,9 @@ public class UpdateHighlightersUtil {
ApplicationManager.getApplication().assertIsDispatchThread();
final DaemonCodeAnalyzerEx codeAnalyzer = DaemonCodeAnalyzerEx.getInstanceEx(project);
codeAnalyzer.cleanFileLevelHighlights(project, group, psiFile);
if (startOffset == 0 && endOffset == document.getTextLength()) {
codeAnalyzer.cleanFileLevelHighlights(project, group, psiFile);
}
final MarkupModel markup = DocumentMarkupModel.forDocument(document, project, true);
assertMarkupConsistent(markup, project);