use of com.intellij.codeInsight.daemon.DaemonCodeAnalyzer in project intellij-community by JetBrains.
the class StatusBarUpdater method updateStatus.
private void updateStatus() {
Editor editor = FileEditorManager.getInstance(myProject).getSelectedTextEditor();
if (editor == null || !editor.getContentComponent().hasFocus()) {
return;
}
final Document document = editor.getDocument();
if (document instanceof DocumentEx && ((DocumentEx) document).isInBulkUpdate())
return;
int offset = editor.getCaretModel().getOffset();
DaemonCodeAnalyzer codeAnalyzer = DaemonCodeAnalyzer.getInstance(myProject);
HighlightInfo info = ((DaemonCodeAnalyzerImpl) codeAnalyzer).findHighlightByOffset(document, offset, false, MIN);
String text = info != null && info.getDescription() != null ? info.getDescription() : "";
StatusBar statusBar = WindowManager.getInstance().getStatusBar(editor.getContentComponent(), myProject);
if (statusBar != null && !text.equals(statusBar.getInfo())) {
statusBar.setInfo(text, "updater");
}
}
use of com.intellij.codeInsight.daemon.DaemonCodeAnalyzer in project intellij-community by JetBrains.
the class ShowErrorDescriptionAction method isEnabledForFile.
private static boolean isEnabledForFile(Project project, Editor editor, PsiFile file) {
DaemonCodeAnalyzer codeAnalyzer = DaemonCodeAnalyzer.getInstance(project);
HighlightInfo info = ((DaemonCodeAnalyzerImpl) codeAnalyzer).findHighlightByOffset(editor.getDocument(), editor.getCaretModel().getOffset(), false);
return info != null && info.getDescription() != null;
}
Aggregations