mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
deprecate AbstractProjectComponent (part 2)
This commit is contained in:
+1
-5
@@ -5,17 +5,13 @@ import com.intellij.codeHighlighting.TextEditorHighlightingPass
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPassFactory
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar
|
||||
import com.intellij.lang.java.lexer.JavaLexer
|
||||
import com.intellij.openapi.components.AbstractProjectComponent
|
||||
import com.intellij.openapi.editor.Document
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.progress.ProgressIndicator
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.pom.java.LanguageLevel
|
||||
import com.intellij.psi.*
|
||||
|
||||
class JavaSoftKeywordHighlightingPassFactory(project: Project, registrar: TextEditorHighlightingPassRegistrar) :
|
||||
AbstractProjectComponent(project), TextEditorHighlightingPassFactory {
|
||||
|
||||
class JavaSoftKeywordHighlightingPassFactory(registrar: TextEditorHighlightingPassRegistrar) : TextEditorHighlightingPassFactory {
|
||||
init {
|
||||
registrar.registerTextEditorHighlightingPass(this, null, null, false, -1)
|
||||
}
|
||||
|
||||
@@ -4,16 +4,12 @@ package com.intellij.codeInsight.hints
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPass
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPassFactory
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar
|
||||
import com.intellij.openapi.components.AbstractProjectComponent
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.util.Key
|
||||
import com.intellij.psi.PsiFile
|
||||
import com.intellij.psi.PsiJavaFile
|
||||
|
||||
class MethodChainHintsPassFactory(project: Project, registrar: TextEditorHighlightingPassRegistrar) : AbstractProjectComponent(
|
||||
project), TextEditorHighlightingPassFactory {
|
||||
|
||||
class MethodChainHintsPassFactory(registrar: TextEditorHighlightingPassRegistrar) : TextEditorHighlightingPassFactory {
|
||||
init {
|
||||
registrar.registerTextEditorHighlightingPass(this, null, null, false, -1)
|
||||
}
|
||||
@@ -28,5 +24,4 @@ class MethodChainHintsPassFactory(project: Project, registrar: TextEditorHighlig
|
||||
companion object {
|
||||
val modificationStampHolder: ModificationStampHolder = ModificationStampHolder(Key.create("METHOD_CHAIN_PASS_LAST_MODIFICATION_TIMESTAMP"))
|
||||
}
|
||||
|
||||
}
|
||||
+1
-2
@@ -1,13 +1,12 @@
|
||||
// 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.
|
||||
package com.intellij.codeHighlighting;
|
||||
|
||||
import com.intellij.openapi.components.ProjectComponent;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public interface TextEditorHighlightingPassFactory extends ProjectComponent {
|
||||
public interface TextEditorHighlightingPassFactory {
|
||||
@Nullable
|
||||
TextEditorHighlightingPass createHighlightingPass(@NotNull PsiFile file, @NotNull final Editor editor);
|
||||
}
|
||||
|
||||
-8
@@ -13,7 +13,6 @@ import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.util.ui.update.MergingUpdateQueue;
|
||||
import com.intellij.util.ui.update.Update;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -31,13 +30,6 @@ public class ExternalToolPassFactory implements TextEditorHighlightingPassFactor
|
||||
myExternalActivitiesQueue.setPassThrough(ApplicationManager.getApplication().isUnitTestMode());
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNls
|
||||
@NotNull
|
||||
public String getComponentName() {
|
||||
return "ExternalToolPassFactory";
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public TextEditorHighlightingPass createHighlightingPass(@NotNull PsiFile file, @NotNull final Editor editor) {
|
||||
|
||||
+9
-31
@@ -1,53 +1,31 @@
|
||||
/*
|
||||
* Copyright 2000-2014 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.
|
||||
*/
|
||||
|
||||
// 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.
|
||||
package com.intellij.codeInsight.daemon.impl;
|
||||
|
||||
import com.intellij.codeHighlighting.*;
|
||||
import com.intellij.codeHighlighting.MainHighlightingPassFactory;
|
||||
import com.intellij.codeHighlighting.Pass;
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPass;
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar;
|
||||
import com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.EmptyPass;
|
||||
import com.intellij.openapi.components.AbstractProjectComponent;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.ProperTextRange;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author cdr
|
||||
*/
|
||||
public class GeneralHighlightingPassFactory extends AbstractProjectComponent implements MainHighlightingPassFactory {
|
||||
public class GeneralHighlightingPassFactory implements MainHighlightingPassFactory {
|
||||
private final Project myProject;
|
||||
|
||||
public GeneralHighlightingPassFactory(Project project, TextEditorHighlightingPassRegistrar highlightingPassRegistrar, DefaultHighlightVisitor dhi) {
|
||||
super(project);
|
||||
myProject = project;
|
||||
highlightingPassRegistrar.registerTextEditorHighlightingPass(this,
|
||||
null,
|
||||
new int[]{Pass.UPDATE_FOLDING}, false, Pass.UPDATE_ALL);
|
||||
assert dhi != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNls
|
||||
@NotNull
|
||||
public String getComponentName() {
|
||||
return "GeneralHighlightingPassFactory";
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public TextEditorHighlightingPass createHighlightingPass(@NotNull PsiFile file, @NotNull final Editor editor) {
|
||||
|
||||
+5
-22
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2014 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.
|
||||
*/
|
||||
// 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.
|
||||
package com.intellij.codeInsight.daemon.impl;
|
||||
|
||||
import com.intellij.codeHighlighting.Pass;
|
||||
@@ -21,7 +7,6 @@ import com.intellij.codeHighlighting.TextEditorHighlightingPassFactory;
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar;
|
||||
import com.intellij.codeInsight.CodeInsightSettings;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.components.AbstractProjectComponent;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.DumbService;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -29,16 +14,14 @@ import com.intellij.psi.PsiFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class IdentifierHighlighterPassFactory extends AbstractProjectComponent implements TextEditorHighlightingPassFactory {
|
||||
public class IdentifierHighlighterPassFactory implements TextEditorHighlightingPassFactory {
|
||||
private static final int[] AFTER_PASSES = {Pass.UPDATE_ALL};
|
||||
|
||||
private static boolean ourTestingIdentifierHighlighting;
|
||||
|
||||
private final Project myProject;
|
||||
|
||||
public IdentifierHighlighterPassFactory(Project project, TextEditorHighlightingPassRegistrar highlightingPassRegistrar) {
|
||||
super(project);
|
||||
myProject = project;
|
||||
highlightingPassRegistrar.registerTextEditorHighlightingPass(this, null, AFTER_PASSES, false, -1);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class IndentsPassFactory implements TextEditorHighlightingPassFactory {
|
||||
@@ -20,13 +19,6 @@ public class IndentsPassFactory implements TextEditorHighlightingPassFactory {
|
||||
highlightingPassRegistrar.registerTextEditorHighlightingPass(this, TextEditorHighlightingPassRegistrar.Anchor.BEFORE, Pass.UPDATE_FOLDING, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNls
|
||||
@NotNull
|
||||
public String getComponentName() {
|
||||
return "IndentsPassFactory";
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public TextEditorHighlightingPass createHighlightingPass(@NotNull PsiFile file, @NotNull final Editor editor) {
|
||||
|
||||
-8
@@ -8,7 +8,6 @@ import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class InjectedCodeFoldingPassFactory implements TextEditorHighlightingPassFactory {
|
||||
@@ -19,13 +18,6 @@ public class InjectedCodeFoldingPassFactory implements TextEditorHighlightingPas
|
||||
highlightingPassRegistrar.registerTextEditorHighlightingPass(this, new int[]{Pass.UPDATE_ALL}, null, false, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNls
|
||||
@NotNull
|
||||
public String getComponentName() {
|
||||
return "InjectedCodeFoldingPassFactory";
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public TextEditorHighlightingPass createHighlightingPass(@NotNull PsiFile file, @NotNull final Editor editor) {
|
||||
|
||||
-8
@@ -11,7 +11,6 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.ProperTextRange;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -23,13 +22,6 @@ public class InjectedGeneralHighlightingPassFactory implements MainHighlightingP
|
||||
highlightingPassRegistrar.registerTextEditorHighlightingPass(this, null, new int[]{Pass.UPDATE_ALL}, false, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNls
|
||||
@NotNull
|
||||
public String getComponentName() {
|
||||
return "InjectedGeneralHighlightingPassFactory";
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public TextEditorHighlightingPass createHighlightingPass(@NotNull PsiFile file, @NotNull final Editor editor) {
|
||||
|
||||
+5
-30
@@ -1,26 +1,10 @@
|
||||
/*
|
||||
* Copyright 2000-2016 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.
|
||||
*/
|
||||
|
||||
// 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.
|
||||
package com.intellij.codeInsight.daemon.impl;
|
||||
|
||||
import com.intellij.codeHighlighting.Pass;
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPass;
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPassFactory;
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar;
|
||||
import com.intellij.openapi.components.AbstractProjectComponent;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.impl.MarkupModelImpl;
|
||||
@@ -28,26 +12,17 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.ProperTextRange;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author cdr
|
||||
*/
|
||||
public class LineMarkersPassFactory extends AbstractProjectComponent implements TextEditorHighlightingPassFactory {
|
||||
public class LineMarkersPassFactory implements TextEditorHighlightingPassFactory {
|
||||
private final Project myProject;
|
||||
|
||||
public LineMarkersPassFactory(Project project, TextEditorHighlightingPassRegistrar highlightingPassRegistrar) {
|
||||
super(project);
|
||||
myProject = project;
|
||||
highlightingPassRegistrar.registerTextEditorHighlightingPass(this, null, new int[]{Pass.UPDATE_ALL}, false, Pass.LINE_MARKERS);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNls
|
||||
@NotNull
|
||||
public String getComponentName() {
|
||||
return "LineMarkersPassFactory";
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public TextEditorHighlightingPass createHighlightingPass(@NotNull PsiFile file, @NotNull final Editor editor) {
|
||||
|
||||
+8
-31
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2016 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.
|
||||
*/
|
||||
// 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.
|
||||
|
||||
package com.intellij.codeInsight.daemon.impl;
|
||||
|
||||
@@ -22,7 +8,6 @@ import com.intellij.codeHighlighting.TextEditorHighlightingPass;
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar;
|
||||
import com.intellij.codeInspection.ex.InspectionProfileWrapper;
|
||||
import com.intellij.codeInspection.ex.LocalInspectionToolWrapper;
|
||||
import com.intellij.openapi.components.AbstractProjectComponent;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
@@ -30,28 +15,20 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.util.PsiUtilCore;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author cdr
|
||||
*/
|
||||
public class LocalInspectionsPassFactory extends AbstractProjectComponent implements MainHighlightingPassFactory {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.daemon.impl.LocalInspectionsPassFactory");
|
||||
public LocalInspectionsPassFactory(Project project, TextEditorHighlightingPassRegistrar highlightingPassRegistrar) {
|
||||
super(project);
|
||||
highlightingPassRegistrar.registerTextEditorHighlightingPass(this, null, new int[]{Pass.UPDATE_ALL}, true, Pass.LOCAL_INSPECTIONS);
|
||||
}
|
||||
public class LocalInspectionsPassFactory implements MainHighlightingPassFactory {
|
||||
private static final Logger LOG = Logger.getInstance(LocalInspectionsPassFactory.class);
|
||||
|
||||
@Override
|
||||
@NonNls
|
||||
@NotNull
|
||||
public String getComponentName() {
|
||||
return "LocalInspectionsPassFactory";
|
||||
private final Project myProject;
|
||||
|
||||
public LocalInspectionsPassFactory(Project project, TextEditorHighlightingPassRegistrar highlightingPassRegistrar) {
|
||||
myProject = project;
|
||||
highlightingPassRegistrar.registerTextEditorHighlightingPass(this, null, new int[]{Pass.UPDATE_ALL}, true, Pass.LOCAL_INSPECTIONS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-1
@@ -16,6 +16,7 @@ import com.intellij.notification.NotificationType;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.components.ProjectComponent;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
@@ -39,7 +40,7 @@ import org.jetbrains.annotations.TestOnly;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class FrameworkDetectionManager implements FrameworkDetectionIndexListener, TextEditorHighlightingPassFactory, Disposable {
|
||||
public class FrameworkDetectionManager implements FrameworkDetectionIndexListener, TextEditorHighlightingPassFactory, Disposable, ProjectComponent {
|
||||
private static final Logger LOG = Logger.getInstance(FrameworkDetectionManager.class);
|
||||
private static final NotificationGroup FRAMEWORK_DETECTION_NOTIFICATION = NotificationGroup.balloonGroup("Framework Detection");
|
||||
private final Update myDetectionUpdate = new Update("detection") {
|
||||
|
||||
@@ -1,37 +1,15 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
// 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.
|
||||
package com.intellij.ide;
|
||||
|
||||
import com.intellij.openapi.components.AbstractProjectComponent;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author nik
|
||||
*/
|
||||
public abstract class GeneratedSourceFileChangeTracker extends AbstractProjectComponent {
|
||||
public abstract class GeneratedSourceFileChangeTracker {
|
||||
@NotNull
|
||||
public static GeneratedSourceFileChangeTracker getInstance(@NotNull Project project) {
|
||||
return project.getComponent(GeneratedSourceFileChangeTracker.class);
|
||||
}
|
||||
|
||||
protected GeneratedSourceFileChangeTracker(Project project) {
|
||||
super(project);
|
||||
}
|
||||
|
||||
public abstract boolean isEditedGeneratedFile(@NotNull VirtualFile file);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ package com.intellij.ide;
|
||||
import com.intellij.AppTopics;
|
||||
import com.intellij.ProjectTopics;
|
||||
import com.intellij.openapi.application.ReadAction;
|
||||
import com.intellij.openapi.components.ProjectComponent;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.EditorFactory;
|
||||
import com.intellij.openapi.editor.event.DocumentEvent;
|
||||
@@ -30,15 +31,16 @@ import java.util.*;
|
||||
/**
|
||||
* @author nik
|
||||
*/
|
||||
public class GeneratedSourceFileChangeTrackerImpl extends GeneratedSourceFileChangeTracker {
|
||||
public class GeneratedSourceFileChangeTrackerImpl extends GeneratedSourceFileChangeTracker implements ProjectComponent {
|
||||
private final Project myProject;
|
||||
private final FileDocumentManager myDocumentManager;
|
||||
private final EditorNotifications myEditorNotifications;
|
||||
private final MergingUpdateQueue myCheckingQueue;
|
||||
private final Set<VirtualFile> myFilesToCheck = Collections.synchronizedSet(new HashSet<VirtualFile>());
|
||||
private final Set<VirtualFile> myEditedGeneratedFiles = Collections.synchronizedSet(new HashSet<VirtualFile>());
|
||||
private final Set<VirtualFile> myFilesToCheck = Collections.synchronizedSet(new HashSet<>());
|
||||
private final Set<VirtualFile> myEditedGeneratedFiles = Collections.synchronizedSet(new HashSet<>());
|
||||
|
||||
public GeneratedSourceFileChangeTrackerImpl(Project project, FileDocumentManager documentManager, EditorNotifications editorNotifications) {
|
||||
super(project);
|
||||
myProject = project;
|
||||
myDocumentManager = documentManager;
|
||||
myEditorNotifications = editorNotifications;
|
||||
myCheckingQueue = new MergingUpdateQueue("Checking for changes in generated sources", 500, false, null, project, null, Alarm.ThreadToUse.POOLED_THREAD);
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.intellij.notification.NotificationDisplayType;
|
||||
import com.intellij.notification.NotificationListener;
|
||||
import com.intellij.notification.impl.NotificationsConfigurationImpl;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.components.AbstractProjectComponent;
|
||||
import com.intellij.openapi.externalSystem.service.notification.ExternalSystemNotificationManager;
|
||||
import com.intellij.openapi.externalSystem.service.notification.NotificationCategory;
|
||||
import com.intellij.openapi.externalSystem.service.notification.NotificationData;
|
||||
@@ -31,19 +30,16 @@ import java.util.stream.Collectors;
|
||||
|
||||
import static org.jetbrains.idea.maven.indices.MavenIndicesManager.IndexUpdatingState.IDLE;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
* @since 10/28/13
|
||||
*/
|
||||
public class MavenRepositoriesHolder extends AbstractProjectComponent {
|
||||
public class MavenRepositoriesHolder {
|
||||
private static final String UNINDEXED_MAVEN_REPOSITORIES_NOTIFICATION_GROUP = "Unindexed maven repositories gradle detection";
|
||||
private static final Key<String> NOTIFICATION_KEY = Key.create(UNINDEXED_MAVEN_REPOSITORIES_NOTIFICATION_GROUP);
|
||||
private final Project myProject;
|
||||
|
||||
private volatile Set<MavenRemoteRepository> myRemoteRepositories;
|
||||
private volatile Set<String> myNotIndexedUrls;
|
||||
|
||||
public MavenRepositoriesHolder(Project project) {
|
||||
super(project);
|
||||
myProject = project;
|
||||
myRemoteRepositories = Collections.emptySet();
|
||||
myNotIndexedUrls = Collections.emptySet();
|
||||
}
|
||||
|
||||
+3
-11
@@ -1,14 +1,10 @@
|
||||
/*
|
||||
* Copyright 2000-2017 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-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.
|
||||
package org.jetbrains.plugins.groovy.annotator;
|
||||
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPass;
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPassFactory;
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar;
|
||||
import com.intellij.openapi.components.AbstractProjectComponent;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.GroovyLanguage;
|
||||
@@ -17,12 +13,8 @@ import org.jetbrains.plugins.groovy.lang.psi.GroovyFile;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.GroovyFileBase;
|
||||
import org.jetbrains.plugins.groovy.util.GrFileIndexUtil;
|
||||
|
||||
/**
|
||||
* @author Max Medvedev
|
||||
*/
|
||||
public class GrReferenceHighlighterFactory extends AbstractProjectComponent implements TextEditorHighlightingPassFactory {
|
||||
public GrReferenceHighlighterFactory(Project project, TextEditorHighlightingPassRegistrar registrar) {
|
||||
super(project);
|
||||
public class GrReferenceHighlighterFactory implements TextEditorHighlightingPassFactory {
|
||||
public GrReferenceHighlighterFactory(TextEditorHighlightingPassRegistrar registrar) {
|
||||
registrar.registerTextEditorHighlightingPass(this, null, null, false, -1);
|
||||
}
|
||||
|
||||
|
||||
+2
-6
@@ -1,15 +1,13 @@
|
||||
// Copyright 2000-2017 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-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.
|
||||
package org.jetbrains.plugins.groovy.highlighter
|
||||
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPass
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPassFactory
|
||||
import com.intellij.codeHighlighting.TextEditorHighlightingPassRegistrar
|
||||
import com.intellij.openapi.components.AbstractProjectComponent
|
||||
import com.intellij.openapi.editor.Document
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.editor.colors.TextAttributesKey
|
||||
import com.intellij.openapi.progress.ProgressIndicator
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.psi.*
|
||||
import org.jetbrains.plugins.groovy.annotator.GrHighlightUtil.isReassigned
|
||||
import org.jetbrains.plugins.groovy.highlighter.GroovySyntaxHighlighter.*
|
||||
@@ -27,9 +25,7 @@ import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrAnonymousC
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrTraitTypeDefinition
|
||||
import org.jetbrains.plugins.groovy.lang.resolve.ResolveUtil.isScriptField
|
||||
|
||||
class GroovyDeclarationHighlightingPassFactory(project: Project, registrar: TextEditorHighlightingPassRegistrar)
|
||||
: AbstractProjectComponent(project), TextEditorHighlightingPassFactory {
|
||||
|
||||
class GroovyDeclarationHighlightingPassFactory(registrar: TextEditorHighlightingPassRegistrar) : TextEditorHighlightingPassFactory {
|
||||
init {
|
||||
registrar.registerTextEditorHighlightingPass(this, null, null, false, -1)
|
||||
}
|
||||
|
||||
@@ -1,34 +1,14 @@
|
||||
/*
|
||||
* Copyright 2000-2015 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.
|
||||
*/
|
||||
// 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.
|
||||
package org.jetbrains.plugins.groovy.compiler;
|
||||
|
||||
import com.intellij.openapi.compiler.CompilerManager;
|
||||
import com.intellij.openapi.components.AbstractProjectComponent;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import com.intellij.openapi.components.ProjectComponent;
|
||||
import org.jetbrains.plugins.groovy.GroovyFileType;
|
||||
|
||||
/**
|
||||
* @author ilyas
|
||||
*/
|
||||
public class GroovyCompilerLoader extends AbstractProjectComponent {
|
||||
public class GroovyCompilerLoader implements ProjectComponent {
|
||||
private final CompilerManager myCompilerManager;
|
||||
|
||||
public GroovyCompilerLoader(Project project, CompilerManager manager) {
|
||||
super(project);
|
||||
public GroovyCompilerLoader(CompilerManager manager) {
|
||||
myCompilerManager = manager;
|
||||
}
|
||||
|
||||
@@ -36,10 +16,4 @@ public class GroovyCompilerLoader extends AbstractProjectComponent {
|
||||
public void projectOpened() {
|
||||
myCompilerManager.addCompilableFileType(GroovyFileType.GROOVY_FILE_TYPE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getComponentName() {
|
||||
return "GroovyCompilerLoader";
|
||||
}
|
||||
}
|
||||
|
||||
+7
-10
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2017 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-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.
|
||||
package org.jetbrains.plugins.groovy.mvc;
|
||||
|
||||
import com.intellij.ProjectTopics;
|
||||
@@ -8,7 +6,7 @@ import com.intellij.codeInsight.actions.ReformatCodeProcessor;
|
||||
import com.intellij.openapi.application.Application;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ModalityState;
|
||||
import com.intellij.openapi.components.AbstractProjectComponent;
|
||||
import com.intellij.openapi.components.ProjectComponent;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleManager;
|
||||
import com.intellij.openapi.module.ModuleUtilCore;
|
||||
@@ -40,17 +38,16 @@ import com.intellij.util.messages.MessageBusConnection;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
import org.jetbrains.plugins.groovy.mvc.MvcModuleStructureSynchronizer.SyncAction;
|
||||
import org.jetbrains.plugins.groovy.mvc.projectView.MvcToolWindowDescriptor;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public class MvcModuleStructureSynchronizer extends AbstractProjectComponent {
|
||||
public class MvcModuleStructureSynchronizer implements ProjectComponent {
|
||||
private static final ExecutorService ourExecutor = SequentialTaskExecutor.createSequentialApplicationPoolExecutor("MvcModuleStructureSynchronizer Pool");
|
||||
private final Set<Pair<Object, SyncAction>> myOrders = new LinkedHashSet<>();
|
||||
private final Project myProject;
|
||||
|
||||
private Set<VirtualFile> myPluginRoots = Collections.emptySet();
|
||||
|
||||
@@ -61,7 +58,7 @@ public class MvcModuleStructureSynchronizer extends AbstractProjectComponent {
|
||||
private final SimpleModificationTracker myModificationTracker = new SimpleModificationTracker();
|
||||
|
||||
public MvcModuleStructureSynchronizer(Project project) {
|
||||
super(project);
|
||||
myProject = project;
|
||||
}
|
||||
|
||||
public SimpleModificationTracker getFileAndRootsModificationTracker() {
|
||||
@@ -259,7 +256,7 @@ public class MvcModuleStructureSynchronizer extends AbstractProjectComponent {
|
||||
final Set<Pair<Object, SyncAction>> orderSnapshot = takeOrderSnapshot();
|
||||
ReadTask task = new ReadTask() {
|
||||
|
||||
@Nullable
|
||||
@NotNull
|
||||
@Override
|
||||
public Continuation performInReadAction(@NotNull final ProgressIndicator indicator) throws ProcessCanceledException {
|
||||
final Set<Trinity<Module, SyncAction, MvcFramework>> actions = isUpToDate() ? computeRawActions(orderSnapshot)
|
||||
|
||||
Reference in New Issue
Block a user