diff --git a/platform/analysis-impl/src/com/intellij/packageDependencies/DependencyValidationManagerImpl.java b/platform/analysis-impl/src/com/intellij/packageDependencies/DependencyValidationManagerImpl.java index 26d69599b815..3913b84e1ec7 100644 --- a/platform/analysis-impl/src/com/intellij/packageDependencies/DependencyValidationManagerImpl.java +++ b/platform/analysis-impl/src/com/intellij/packageDependencies/DependencyValidationManagerImpl.java @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.packageDependencies; import com.intellij.icons.AllIcons; @@ -58,8 +58,9 @@ public class DependencyValidationManagerImpl extends DependencyValidationManager @NonNls private static final String UNNAMED_SCOPE = "unnamed_scope"; @NonNls private static final String VALUE = "value"; - public DependencyValidationManagerImpl(final Project project, NamedScopeManager namedScopeManager) { + public DependencyValidationManagerImpl(@NotNull Project project, @NotNull NamedScopeManager namedScopeManager) { super(project); + myNamedScopeManager = namedScopeManager; namedScopeManager.addScopeListener(() -> reloadScopes()); } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java index 9ad28190b9c1..49b326b1b12c 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java @@ -1,5 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. - +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.codeInsight.daemon.impl; import com.intellij.codeHighlighting.BackgroundEditorHighlighter; @@ -53,7 +52,6 @@ import com.intellij.openapi.vfs.newvfs.RefreshQueueImpl; import com.intellij.packageDependencies.DependencyValidationManager; import com.intellij.psi.*; import com.intellij.psi.impl.PsiDocumentManagerBase; -import com.intellij.psi.search.scope.packageSet.NamedScopeManager; import com.intellij.psi.util.PsiModificationTracker; import com.intellij.psi.util.PsiUtilCore; import com.intellij.util.*; @@ -114,8 +112,8 @@ public class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzerEx implements Pers @NotNull DaemonCodeAnalyzerSettings daemonCodeAnalyzerSettings, @NotNull EditorTracker editorTracker, @NotNull PsiDocumentManager psiDocumentManager, - @NotNull final NamedScopeManager namedScopeManager, - @NotNull final DependencyValidationManager dependencyValidationManager) { + // DependencyValidationManagerImpl adds scope listener, so, we need to force service creation + @SuppressWarnings("unused") @NotNull DependencyValidationManager dependencyValidationManager) { myProject = project; mySettings = daemonCodeAnalyzerSettings; myEditorTracker = editorTracker; @@ -911,8 +909,7 @@ public class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzerEx implements Pers ApplicationManager.getApplication().assertIsDispatchThread(); // Editors in modal context - List editors = getActiveEditors(); - + List editors = myEditorTracker.getActiveEditors(); Collection activeTextEditors = new THashSet<>(editors.size()); for (Editor editor : editors) { if (editor.isDisposed()) continue; @@ -947,11 +944,6 @@ public class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzerEx implements Pers return result; } - @NotNull - private List getActiveEditors() { - return myEditorTracker.getActiveEditors(); - } - @TestOnly private static void wrap(@NotNull ThrowableRunnable runnable) { try {