use of com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings in project intellij-community by JetBrains.
the class CodeInsightTestFixtureImpl method instantiateAndRun.
@NotNull
@TestOnly
public static List<HighlightInfo> instantiateAndRun(@NotNull PsiFile file, @NotNull Editor editor, @NotNull int[] toIgnore, boolean canChangeDocument) {
ApplicationManager.getApplication().assertIsDispatchThread();
Project project = file.getProject();
ensureIndexesUpToDate(project);
DaemonCodeAnalyzerImpl codeAnalyzer = (DaemonCodeAnalyzerImpl) DaemonCodeAnalyzer.getInstance(project);
TextEditor textEditor = TextEditorProvider.getInstance().getTextEditor(editor);
DaemonCodeAnalyzerSettings settings = DaemonCodeAnalyzerSettings.getInstance();
ProcessCanceledException exception = null;
for (int i = 0; i < 1000; i++) {
int oldDelay = settings.AUTOREPARSE_DELAY;
try {
settings.AUTOREPARSE_DELAY = 0;
List<HighlightInfo> infos = codeAnalyzer.runPasses(file, editor.getDocument(), textEditor, toIgnore, canChangeDocument, null);
infos.addAll(DaemonCodeAnalyzerEx.getInstanceEx(project).getFileLevelHighlights(project, file));
return infos;
} catch (ProcessCanceledException e) {
PsiDocumentManager.getInstance(project).commitAllDocuments();
UIUtil.dispatchAllInvocationEvents();
exception = e;
} finally {
settings.AUTOREPARSE_DELAY = oldDelay;
}
}
// unable to highlight after 100 retries
throw exception;
}
use of com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings in project intellij-community by JetBrains.
the class ErrorHighlightingPanel method apply.
public void apply() throws ConfigurationException {
DaemonCodeAnalyzerSettings settings = DaemonCodeAnalyzerSettings.getInstance();
settings.AUTOREPARSE_DELAY = getAutoReparseDelay();
settings.ERROR_STRIPE_MARK_MIN_HEIGHT = getErrorStripeMarkMinHeight();
settings.NEXT_ERROR_ACTION_GOES_TO_ERRORS_FIRST = myNextErrorGoesToErrorsFirst.isSelected();
for (ErrorOptionsProvider optionsProvider : myExtensions) {
optionsProvider.apply();
}
UISettings.getInstance().fireUISettingsChanged();
}
use of com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings in project intellij-community by JetBrains.
the class ErrorHighlightingPanel method isModified.
public boolean isModified() {
DaemonCodeAnalyzerSettings settings = DaemonCodeAnalyzerSettings.getInstance();
boolean isModified = settings.AUTOREPARSE_DELAY != getAutoReparseDelay();
isModified |= getErrorStripeMarkMinHeight() != settings.ERROR_STRIPE_MARK_MIN_HEIGHT;
isModified |= myNextErrorGoesToErrorsFirst.isSelected() != settings.NEXT_ERROR_ACTION_GOES_TO_ERRORS_FIRST;
for (ErrorOptionsProvider optionsProvider : myExtensions) {
isModified |= optionsProvider.isModified();
}
if (isModified)
return true;
return false;
}
use of com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings in project intellij-community by JetBrains.
the class JavaAutoImportOptions method isModified.
public boolean isModified() {
CodeInsightSettings codeInsightSettings = CodeInsightSettings.getInstance();
DaemonCodeAnalyzerSettings daemonSettings = DaemonCodeAnalyzerSettings.getInstance();
boolean isModified = isModified(myCbShowImportPopup, daemonSettings.isImportHintEnabled());
isModified |= isModified(myCbOptimizeImports, CodeInsightWorkspaceSettings.getInstance(myProject).optimizeImportsOnTheFly);
isModified |= isModified(myCbAddUnambiguousImports, codeInsightSettings.ADD_UNAMBIGIOUS_IMPORTS_ON_THE_FLY);
isModified |= isModified(myCbAddMethodImports, codeInsightSettings.ADD_MEMBER_IMPORTS_ON_THE_FLY);
isModified |= getSmartPasteValue() != codeInsightSettings.ADD_IMPORTS_ON_PASTE;
isModified |= myExcludePackagesTable.isModified();
return isModified;
}
use of com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings in project intellij-community by JetBrains.
the class JavaAutoImportOptions method reset.
public void reset() {
CodeInsightSettings codeInsightSettings = CodeInsightSettings.getInstance();
DaemonCodeAnalyzerSettings daemonSettings = DaemonCodeAnalyzerSettings.getInstance();
switch(codeInsightSettings.ADD_IMPORTS_ON_PASTE) {
case CodeInsightSettings.YES:
mySmartPasteCombo.setSelectedItem(INSERT_IMPORTS_ALWAYS);
break;
case CodeInsightSettings.NO:
mySmartPasteCombo.setSelectedItem(INSERT_IMPORTS_NONE);
break;
case CodeInsightSettings.ASK:
mySmartPasteCombo.setSelectedItem(INSERT_IMPORTS_ASK);
break;
}
myCbShowImportPopup.setSelected(daemonSettings.isImportHintEnabled());
myCbOptimizeImports.setSelected(CodeInsightWorkspaceSettings.getInstance(myProject).optimizeImportsOnTheFly);
myCbAddUnambiguousImports.setSelected(codeInsightSettings.ADD_UNAMBIGIOUS_IMPORTS_ON_THE_FLY);
myCbAddMethodImports.setSelected(codeInsightSettings.ADD_MEMBER_IMPORTS_ON_THE_FLY);
myExcludePackagesTable.reset();
}
Aggregations