Search in sources :

Example 1 with DaemonCodeAnalyzerSettings

use of com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings in project intellij-community by JetBrains.

the class ToggleDistractionFreeModeAction method actionPerformed.

@Override
public void actionPerformed(@NotNull AnActionEvent e) {
    Project project = e.getProject();
    alternateCurrentDistractionFreeModeSetting();
    boolean enter = isDistractionFreeModeEnabled();
    if (project == null)
        return;
    PropertiesComponent p = PropertiesComponent.getInstance();
    UISettings ui = UISettings.getInstance();
    EditorSettingsExternalizable.OptionSet eo = EditorSettingsExternalizable.getInstance().getOptions();
    DaemonCodeAnalyzerSettings ds = DaemonCodeAnalyzerSettings.getInstance();
    String before = "BEFORE.DISTRACTION.MODE.";
    String after = "AFTER.DISTRACTION.MODE.";
    if (enter) {
        applyAndSave(p, ui, eo, ds, before, after, false);
        TogglePresentationModeAction.storeToolWindows(project);
    } else {
        applyAndSave(p, ui, eo, ds, after, before, true);
        TogglePresentationModeAction.restoreToolWindows(project, true, false);
    }
    UISettings.getInstance().fireUISettingsChanged();
    LafManager.getInstance().updateUI();
    EditorUtil.reinitSettings();
    DaemonCodeAnalyzer.getInstance(project).settingsChanged();
    EditorFactory.getInstance().refreshAllEditors();
}
Also used : DaemonCodeAnalyzerSettings(com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings) Project(com.intellij.openapi.project.Project) UISettings(com.intellij.ide.ui.UISettings) PropertiesComponent(com.intellij.ide.util.PropertiesComponent) EditorSettingsExternalizable(com.intellij.openapi.editor.ex.EditorSettingsExternalizable)

Example 2 with DaemonCodeAnalyzerSettings

use of com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings in project intellij-community by JetBrains.

the class GotoNextErrorHandler method gotoNextError.

private void gotoNextError(Project project, Editor editor, PsiFile file, int caretOffset) {
    final SeverityRegistrar severityRegistrar = SeverityRegistrar.getSeverityRegistrar(project);
    DaemonCodeAnalyzerSettings settings = DaemonCodeAnalyzerSettings.getInstance();
    int maxSeverity = settings.NEXT_ERROR_ACTION_GOES_TO_ERRORS_FIRST ? severityRegistrar.getSeveritiesCount() - 1 : SeverityRegistrar.SHOWN_SEVERITIES_OFFSET;
    for (int idx = maxSeverity; idx >= SeverityRegistrar.SHOWN_SEVERITIES_OFFSET; idx--) {
        final HighlightSeverity minSeverity = severityRegistrar.getSeverityByIndex(idx);
        HighlightInfo infoToGo = findInfo(project, editor, caretOffset, minSeverity);
        if (infoToGo != null) {
            navigateToError(project, editor, infoToGo);
            return;
        }
    }
    showMessageWhenNoHighlights(project, file, editor);
}
Also used : DaemonCodeAnalyzerSettings(com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings) HighlightSeverity(com.intellij.lang.annotation.HighlightSeverity)

Example 3 with DaemonCodeAnalyzerSettings

use of com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings in project intellij-community by JetBrains.

the class ErrorHighlightingPanel method reset.

public void reset() {
    DaemonCodeAnalyzerSettings settings = DaemonCodeAnalyzerSettings.getInstance();
    myAutoreparseDelayField.setText(Integer.toString(settings.AUTOREPARSE_DELAY));
    myMarkMinHeight.setText(Integer.toString(settings.ERROR_STRIPE_MARK_MIN_HEIGHT));
    myNextErrorGoesToErrorsFirst.setSelected(settings.NEXT_ERROR_ACTION_GOES_TO_ERRORS_FIRST);
    for (ErrorOptionsProvider optionsProvider : myExtensions) {
        optionsProvider.reset();
    }
}
Also used : DaemonCodeAnalyzerSettings(com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings) ErrorOptionsProvider(com.intellij.profile.codeInspection.ui.ErrorOptionsProvider)

Example 4 with DaemonCodeAnalyzerSettings

use of com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings in project intellij-community by JetBrains.

the class JavaAutoImportOptions method apply.

public void apply() {
    CodeInsightSettings codeInsightSettings = CodeInsightSettings.getInstance();
    DaemonCodeAnalyzerSettings daemonSettings = DaemonCodeAnalyzerSettings.getInstance();
    codeInsightSettings.ADD_IMPORTS_ON_PASTE = getSmartPasteValue();
    daemonSettings.setImportHintEnabled(myCbShowImportPopup.isSelected());
    CodeInsightWorkspaceSettings.getInstance(myProject).optimizeImportsOnTheFly = myCbOptimizeImports.isSelected();
    codeInsightSettings.ADD_UNAMBIGIOUS_IMPORTS_ON_THE_FLY = myCbAddUnambiguousImports.isSelected();
    codeInsightSettings.ADD_MEMBER_IMPORTS_ON_THE_FLY = myCbAddMethodImports.isSelected();
    myExcludePackagesTable.apply();
    for (Project project : ProjectManager.getInstance().getOpenProjects()) {
        DaemonCodeAnalyzer.getInstance(project).restart();
    }
}
Also used : DaemonCodeAnalyzerSettings(com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings) CodeInsightSettings(com.intellij.codeInsight.CodeInsightSettings) Project(com.intellij.openapi.project.Project)

Example 5 with DaemonCodeAnalyzerSettings

use of com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings in project intellij-plugins by JetBrains.

the class ActionScriptHighlightingTest method testNoOverrideForInternal.

@JSTestOptions({ JSTestOption.WithLineMarkers })
public void testNoOverrideForInternal() throws Exception {
    DaemonCodeAnalyzerSettings myDaemonCodeAnalyzerSettings = DaemonCodeAnalyzerSettings.getInstance();
    myDaemonCodeAnalyzerSettings.SHOW_METHOD_SEPARATORS = true;
    try {
        defaultTest();
    } finally {
        myDaemonCodeAnalyzerSettings.SHOW_METHOD_SEPARATORS = false;
    }
}
Also used : DaemonCodeAnalyzerSettings(com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings)

Aggregations

DaemonCodeAnalyzerSettings (com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings)10 CodeInsightSettings (com.intellij.codeInsight.CodeInsightSettings)3 Project (com.intellij.openapi.project.Project)3 ErrorOptionsProvider (com.intellij.profile.codeInspection.ui.ErrorOptionsProvider)3 UISettings (com.intellij.ide.ui.UISettings)1 PropertiesComponent (com.intellij.ide.util.PropertiesComponent)1 HighlightSeverity (com.intellij.lang.annotation.HighlightSeverity)1 EditorSettingsExternalizable (com.intellij.openapi.editor.ex.EditorSettingsExternalizable)1 ExtensionPoint (com.intellij.openapi.extensions.ExtensionPoint)1 ProcessCanceledException (com.intellij.openapi.progress.ProcessCanceledException)1 NotNull (org.jetbrains.annotations.NotNull)1 TestOnly (org.jetbrains.annotations.TestOnly)1