From ba24c4b4ee2a667f1158998d9d50cece3f3a5fcd Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Mon, 6 May 2013 13:45:37 +0400 Subject: [PATCH] daemon settings moved to analysis --- .../daemon/DaemonCodeAnalyzerSettings.java | 55 +++++++++++++++++++ ...va => DaemonCodeAnalyzerSettingsImpl.java} | 35 +++--------- .../daemon/impl/DaemonCodeAnalyzerImpl.java | 9 +-- .../src/META-INF/LangExtensions.xml | 2 +- 4 files changed, 66 insertions(+), 35 deletions(-) create mode 100644 platform/analysis-impl/src/com/intellij/codeInsight/daemon/DaemonCodeAnalyzerSettings.java rename platform/lang-impl/src/com/intellij/codeInsight/daemon/{DaemonCodeAnalyzerSettings.java => DaemonCodeAnalyzerSettingsImpl.java} (76%) diff --git a/platform/analysis-impl/src/com/intellij/codeInsight/daemon/DaemonCodeAnalyzerSettings.java b/platform/analysis-impl/src/com/intellij/codeInsight/daemon/DaemonCodeAnalyzerSettings.java new file mode 100644 index 000000000000..4cc19cebef7b --- /dev/null +++ b/platform/analysis-impl/src/com/intellij/codeInsight/daemon/DaemonCodeAnalyzerSettings.java @@ -0,0 +1,55 @@ +/* + * Copyright 2000-2013 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.intellij.codeInsight.daemon; + +import com.intellij.openapi.components.ServiceManager; +import org.jetbrains.annotations.NonNls; + +public class DaemonCodeAnalyzerSettings { + public static DaemonCodeAnalyzerSettings getInstance() { + return ServiceManager.getService(DaemonCodeAnalyzerSettings.class); + } + + public boolean NEXT_ERROR_ACTION_GOES_TO_ERRORS_FIRST = false; + public int AUTOREPARSE_DELAY = 300; + public boolean SHOW_ADD_IMPORT_HINTS = true; + @NonNls public String NO_AUTO_IMPORT_PATTERN = "[a-z].?"; + public boolean SUPPRESS_WARNINGS = true; + public boolean SHOW_METHOD_SEPARATORS = false; + public int ERROR_STRIPE_MARK_MIN_HEIGHT = 3; + public boolean SHOW_SMALL_ICONS_IN_GUTTER = true; + + public boolean isCodeHighlightingChanged(DaemonCodeAnalyzerSettings oldSettings) { + return false; + } + + public boolean isImportHintEnabled() { + return SHOW_ADD_IMPORT_HINTS; + } + + public void setImportHintEnabled(boolean isImportHintEnabled) { + SHOW_ADD_IMPORT_HINTS = isImportHintEnabled; + } + + public boolean isSuppressWarnings() { + return SUPPRESS_WARNINGS; + } + + public void setSuppressWarnings(boolean suppressWarnings) { + SUPPRESS_WARNINGS = suppressWarnings; + } +} diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/DaemonCodeAnalyzerSettings.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/DaemonCodeAnalyzerSettingsImpl.java similarity index 76% rename from platform/lang-impl/src/com/intellij/codeInsight/daemon/DaemonCodeAnalyzerSettings.java rename to platform/lang-impl/src/com/intellij/codeInsight/daemon/DaemonCodeAnalyzerSettingsImpl.java index 7040ee1d3967..ea65c53a81ab 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/DaemonCodeAnalyzerSettings.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/DaemonCodeAnalyzerSettingsImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ import java.io.File; file = StoragePathMacros.APP_CONFIG + "/editor.codeinsight.xml" )} ) -public class DaemonCodeAnalyzerSettings implements PersistentStateComponent, Cloneable, ExportableComponent { +public class DaemonCodeAnalyzerSettingsImpl extends DaemonCodeAnalyzerSettings implements PersistentStateComponent, Cloneable, ExportableComponent { private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings"); @NonNls private static final String ROOT_TAG = "root"; @NonNls private static final String PROFILE_ATT = "profile"; @@ -45,15 +45,10 @@ public class DaemonCodeAnalyzerSettings implements PersistentStateComponent + serviceImplementation="com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettingsImpl"/>