deprecate Extensions.getExtensions(ExtensionPointName, AreaInstance) in favour of ExtensionPointName.getExtensionList(AreaInstance)

This commit is contained in:
Vladimir Krivosheev
2018-09-25 17:50:17 +02:00
parent eb832b090d
commit b82a61d7b7
78 changed files with 171 additions and 734 deletions
@@ -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 com.intellij.compiler;
import com.intellij.CommonBundle;
@@ -24,7 +22,6 @@ import com.intellij.openapi.components.ProjectComponent;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
@@ -453,7 +450,7 @@ public class CompilerConfigurationImpl extends CompilerConfiguration implements
}
final Set<FileType> types = new HashSet<>();
for (BackendCompiler compiler : Extensions.getExtensions(BackendCompiler.EP_NAME, myProject)) {
for (BackendCompiler compiler : BackendCompiler.EP_NAME.getExtensions(myProject)) {
myRegisteredCompilers.add(compiler);
types.addAll(compiler.getCompilableFileTypes());
}
@@ -11,7 +11,6 @@ import com.intellij.openapi.compiler.*;
import com.intellij.openapi.compiler.util.InspectionValidator;
import com.intellij.openapi.compiler.util.InspectionValidatorWrapper;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.StdFileTypes;
import com.intellij.openapi.module.Module;
@@ -72,7 +71,7 @@ public class CompilerManagerImpl extends CompilerManager {
myEventPublisher = messageBus.syncPublisher(CompilerTopics.COMPILATION_STATUS);
// predefined compilers
for(Compiler compiler: Extensions.getExtensions(Compiler.EP_NAME, myProject)) {
for(Compiler compiler: Compiler.EP_NAME.getExtensions(myProject)) {
addCompiler(compiler);
}
for (CompilerFactory factory : CompilerFactory.EP_NAME.getExtensionList(project)) {
@@ -1,23 +1,8 @@
/*
* 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.compiler.options;
import com.intellij.compiler.CompilerSettingsFactory;
import com.intellij.openapi.compiler.CompilerBundle;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.options.SearchableConfigurable;
@@ -89,7 +74,7 @@ public class CompilerConfigurable implements SearchableConfigurable.Parent, Conf
@Override
public Configurable[] getConfigurables() {
if (myKids == null) {
final CompilerSettingsFactory[] factories = Extensions.getExtensions(CompilerSettingsFactory.EP_NAME, myProject);
final CompilerSettingsFactory[] factories = CompilerSettingsFactory.EP_NAME.getExtensions(myProject);
myKids = ContainerUtil.mapNotNull(factories,
(NullableFunction<CompilerSettingsFactory, Configurable>)factory -> factory.create(myProject), new Configurable[0]);
}
@@ -1,22 +1,8 @@
/*
* Copyright 2000-2009 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.openapi.compiler;
import com.intellij.openapi.extensions.ProjectExtensionPointName;
import org.jetbrains.annotations.NotNull;
import com.intellij.openapi.extensions.ExtensionPointName;
/**
* Base interface for a custom compiler which participates in the IDEA build process.
@@ -25,8 +11,8 @@ import com.intellij.openapi.extensions.ExtensionPointName;
* @see CompilerManager#removeCompiler(Compiler)
*/
public interface Compiler {
ExtensionPointName<Compiler> EP_NAME = ExtensionPointName.create("com.intellij.compiler");
ProjectExtensionPointName<Compiler> EP_NAME = new ProjectExtensionPointName<>("com.intellij.compiler");
/**
* Returns the description of the compiler. All registered compilers should have unique description.
*
@@ -37,7 +23,7 @@ public interface Compiler {
/**
* Called before compilation starts. If at least one of registered compilers returned false, compilation won't start.
*
*
* @param scope the scope on which the compilation is started.
* @return true if everything is ok, false otherwise
*/
@@ -24,7 +24,6 @@ import com.intellij.debugger.ui.overhead.OverheadTimings;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.MessageType;
@@ -349,7 +348,7 @@ public class DebugProcessEvents extends DebugProcessImpl {
.map(factory -> factory.fun(this))
.filter(Objects::nonNull)
.forEach(this::appendPositionManager);
Stream.of(Extensions.getExtensions(PositionManagerFactory.EP_NAME, getProject()))
Stream.of(PositionManagerFactory.EP_NAME.getExtensions(getProject()))
.map(factory -> factory.createPositionManager(this))
.filter(Objects::nonNull)
.forEach(this::appendPositionManager);
@@ -34,7 +34,6 @@ import java.util.Objects;
public class ApplicationConfiguration extends ModuleBasedConfiguration<JavaRunConfigurationModule, Element>
implements CommonJavaRunConfigurationParameters, ConfigurationWithCommandLineShortener, SingleClassConfiguration,
RefactoringListenerProvider, InputRedirectAware {
/* deprecated, but 3rd-party used variables */
@SuppressWarnings("DeprecatedIsStillUsed")
@Deprecated public String MAIN_CLASS_NAME;
@@ -1,6 +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-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.openapi.roots.ui.configuration;
import com.intellij.facet.impl.ProjectFacetsConfigurator;
@@ -10,7 +8,6 @@ import com.intellij.openapi.actionSystem.LangDataKeys;
import com.intellij.openapi.components.ServiceKt;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleConfigurationEditor;
import com.intellij.openapi.module.impl.ModuleConfigurationStateImpl;
@@ -39,8 +36,8 @@ import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.*;
import java.util.List;
import java.util.*;
/**
* @author Eugene Zhuravlev
@@ -224,7 +221,7 @@ public abstract class ModuleEditor implements Place.Navigator, Disposable {
for (ModuleConfigurationEditorProvider component : result) {
reportDeprecatedModuleEditor(component.getClass());
}
ContainerUtil.addAll(result, Extensions.getExtensions(ModuleConfigurationEditorProvider.EP_NAME, module));
ContainerUtil.addAll(result, ModuleConfigurationEditorProvider.EP_NAME.getExtensions(module));
return result.toArray(new ModuleConfigurationEditorProvider[0]);
}
@@ -1,23 +1,8 @@
/*
* 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.find.findUsages;
import com.intellij.ide.util.SuperMethodWarningUtil;
import com.intellij.lang.java.JavaFindUsagesProvider;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import com.intellij.psi.*;
import com.intellij.util.containers.ContainerUtil;
@@ -34,7 +19,7 @@ public class JavaFindUsagesHandlerFactory extends FindUsagesHandlerFactory {
private final JavaVariableFindUsagesOptions myFindVariableOptions;
public static JavaFindUsagesHandlerFactory getInstance(@NotNull Project project) {
return ContainerUtil.findInstance(Extensions.getExtensions(EP_NAME, project), JavaFindUsagesHandlerFactory.class);
return ContainerUtil.findInstance(EP_NAME.getExtensions(project), JavaFindUsagesHandlerFactory.class);
}
public JavaFindUsagesHandlerFactory(Project project) {
@@ -1,7 +1,7 @@
// 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.psi;
import com.intellij.ide.highlighter.JavaFileType;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ProjectFileIndex;
import com.intellij.openapi.vfs.VfsUtilCore;
@@ -26,7 +26,7 @@ public class NonClasspathResolveScopeEnlarger extends ResolveScopeEnlarger {
String fileExtension = file.getExtension();
if ("class".equals(fileExtension) || JavaFileType.DEFAULT_EXTENSION.equals(fileExtension)) {
for (PsiElementFinder finder : Extensions.getExtensions(PsiElementFinder.EP_NAME, project)) {
for (PsiElementFinder finder : PsiElementFinder.EP_NAME.getExtensions(project)) {
if (finder instanceof NonClasspathClassFinder) {
final List<VirtualFile> roots = ((NonClasspathClassFinder)finder).getClassRoots();
for (VirtualFile root : roots) {
@@ -1,7 +1,6 @@
// 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.psi.impl;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.text.StringUtil;
@@ -78,7 +77,7 @@ public class PackagePrefixElementFinder extends PsiElementFinder implements Dumb
}
public static PackagePrefixElementFinder getInstance(Project project) {
for (PsiElementFinder o : Extensions.getExtensions(PsiElementFinder.EP_NAME, project)) {
for (PsiElementFinder o : PsiElementFinder.EP_NAME.getExtensions(project)) {
if (o instanceof PackagePrefixElementFinder) {
return (PackagePrefixElementFinder) o;
}
@@ -1,22 +1,7 @@
/*
* Copyright 2000-2017 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.psi;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.impl.PackageDirectoryCache;
import com.intellij.openapi.util.LowMemoryWatcher;
@@ -70,7 +55,7 @@ public abstract class NonClasspathClassFinder extends PsiElementFinder {
LowMemoryWatcher.register(() -> clearCache(), project);
}
@NotNull
@NotNull
protected PackageDirectoryCache getCache(@Nullable GlobalSearchScope scope) {
PackageDirectoryCache cache = myCache;
if (cache == null) {
@@ -95,7 +80,7 @@ public abstract class NonClasspathClassFinder extends PsiElementFinder {
public void clearCache() {
myCache = null;
}
protected List<VirtualFile> getClassRoots(@Nullable GlobalSearchScope scope) {
return getCache(scope).getDirectoriesByPackageName("");
}
@@ -213,7 +198,7 @@ public abstract class NonClasspathClassFinder extends PsiElementFinder {
@NotNull
public static GlobalSearchScope addNonClasspathScope(@NotNull Project project, @NotNull GlobalSearchScope base) {
List<GlobalSearchScope> nonClasspathScopes = new SmartList<>();
for (PsiElementFinder finder : Extensions.getExtensions(EP_NAME, project)) {
for (PsiElementFinder finder : EP_NAME.getExtensions(project)) {
if (finder instanceof NonClasspathClassFinder) {
nonClasspathScopes.add(NonClasspathDirectoriesScope.compose(((NonClasspathClassFinder)finder).getClassRoots()));
}
@@ -2,7 +2,6 @@
package com.intellij.psi.impl.source.javadoc;
import com.intellij.codeInspection.SuppressionUtilCore;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import com.intellij.pom.java.LanguageLevel;
import com.intellij.psi.*;
@@ -58,7 +57,7 @@ public class JavadocManagerImpl implements JavadocManager {
myInfos.add(new ServiceReferenceTagInfo("uses"));
myInfos.add(new ValueDocTagInfo());
Collections.addAll(myInfos, Extensions.getExtensions(JavadocTagInfo.EP_NAME, project));
Collections.addAll(myInfos, JavadocTagInfo.EP_NAME.getExtensions(project));
for (CustomJavadocTagProvider extension : CustomJavadocTagProvider.EP_NAME.getExtensionList()) {
myInfos.addAll(extension.getSupportedTags());
@@ -13,7 +13,6 @@ import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ex.PathManagerEx;
import com.intellij.openapi.command.WriteCommandAction;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.roots.LanguageLevelProjectExtension;
import com.intellij.pom.java.LanguageLevel;
@@ -156,7 +155,7 @@ public class PsiConcurrencyStressTest extends DaemonAnalyzerTestCase {
super.visitElement(element);
final HighlightInfoHolder infoHolder = new HighlightInfoHolder(myFile);
for (HighlightVisitor visitor : Extensions.getExtensions(HighlightVisitor.EP_HIGHLIGHT_VISITOR, getProject())) {
for (HighlightVisitor visitor : HighlightVisitor.EP_HIGHLIGHT_VISITOR.getExtensions(getProject())) {
HighlightVisitor v = visitor.clone(); // to avoid race for com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.myAnnotationHolder
v.analyze(myFile, true, infoHolder, () -> v.visit(element));
}
@@ -1,21 +1,6 @@
/*
* 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.psi.search.scope.packageSet;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
@@ -46,7 +31,7 @@ public abstract class CustomScopesProviderEx implements CustomScopesProvider {
public static void filterNoSettingsScopes(Project project, List<NamedScope> scopes) {
for (Iterator<NamedScope> iterator = scopes.iterator(); iterator.hasNext(); ) {
final NamedScope scope = iterator.next();
for (CustomScopesProvider provider : Extensions.getExtensions(CUSTOM_SCOPES_PROVIDER, project)) {
for (CustomScopesProvider provider : CUSTOM_SCOPES_PROVIDER.getExtensions(project)) {
if (provider instanceof CustomScopesProviderEx && ((CustomScopesProviderEx)provider).isVetoed(scope, ScopePlace.SETTING)) {
iterator.remove();
break;
@@ -7,7 +7,6 @@ import com.intellij.codeInsight.highlighting.HighlightErrorFilter;
import com.intellij.lang.LanguageUtil;
import com.intellij.lang.annotation.Annotation;
import com.intellij.lang.annotation.Annotator;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.DumbService;
@@ -51,7 +50,7 @@ class DefaultHighlightVisitor implements HighlightVisitor, DumbAware {
myHighlightErrorElements = highlightErrorElements;
myRunAnnotators = runAnnotators;
myCachedAnnotators = cachedAnnotators;
myErrorFilters = Extensions.getExtensions(HighlightErrorFilter.EP_NAME, project);
myErrorFilters = HighlightErrorFilter.EP_NAME.getExtensions(project);
myDumbService = DumbService.getInstance(project);
myBatchMode = batchMode;
}
@@ -20,7 +20,6 @@ import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.colors.EditorColorsManager;
import com.intellij.openapi.editor.colors.EditorColorsScheme;
import com.intellij.openapi.editor.markup.TextAttributes;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.ProgressManager;
@@ -113,7 +112,7 @@ public class GeneralHighlightingPass extends ProgressableTextEditorHighlightingP
@NotNull
private HighlightVisitor[] cloneHighlightVisitors() {
int oldCount = incVisitorUsageCount(1);
HighlightVisitor[] highlightVisitors = Extensions.getExtensions(HighlightVisitor.EP_HIGHLIGHT_VISITOR, myProject);
HighlightVisitor[] highlightVisitors = HighlightVisitor.EP_HIGHLIGHT_VISITOR.getExtensions(myProject);
if (oldCount != 0) {
HighlightVisitor[] clones = new HighlightVisitor[highlightVisitors.length];
for (int i = 0; i < highlightVisitors.length; i++) {
@@ -144,7 +143,7 @@ public class GeneralHighlightingPass extends ProgressableTextEditorHighlightingP
LOG.error("No visitors registered. list=" +
list +
"; all visitors are:" +
Arrays.asList(Extensions.getExtensions(HighlightVisitor.EP_HIGHLIGHT_VISITOR, myProject)));
Arrays.asList(HighlightVisitor.EP_HIGHLIGHT_VISITOR.getExtensions(myProject)));
}
return visitors.toArray(new HighlightVisitor[0]);
@@ -1,22 +1,7 @@
/*
* Copyright 2000-2012 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.openapi.vfs;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;
@@ -40,7 +25,7 @@ public abstract class WritingAccessProvider {
@NotNull
public static WritingAccessProvider[] getProvidersForProject(Project project) {
return project == null || project.isDefault() ? new WritingAccessProvider[0] : Extensions.getExtensions(EP_NAME, project);
return project == null || project.isDefault() ? new WritingAccessProvider[0] : EP_NAME.getExtensions(project);
}
public static boolean isPotentiallyWritable(VirtualFile file, Project project) {
@@ -1,23 +1,8 @@
/*
* 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.psi;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.extensions.Extensions;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -32,7 +17,7 @@ public abstract class FileContextProvider {
@Nullable
public static FileContextProvider getProvider(@NotNull final PsiFile file) {
for (FileContextProvider provider: Extensions.getExtensions(EP_NAME, file.getProject())) {
for (FileContextProvider provider: EP_NAME.getExtensions(file.getProject())) {
if (provider.isAvailable(file)) {
return provider;
}
@@ -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.psi.impl;
@@ -21,7 +7,6 @@ import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.WriteAction;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.progress.ProgressIndicatorProvider;
import com.intellij.openapi.project.Project;
@@ -208,7 +193,7 @@ public class PsiManagerImpl extends PsiManagerEx {
private static String logPsi(@Nullable PsiElement element) {
return element == null ? " null" : element.getClass().getName();
}
@Override
public void beforeChildAddition(@NotNull PsiTreeChangeEventImpl event) {
beforeChange(true);
@@ -355,7 +340,7 @@ public class PsiManagerImpl extends PsiManagerEx {
preprocessor.treeChanged(event);
}
boolean enableOutOfCodeBlockTracking = ((PsiModificationTrackerImpl)myModificationTracker).isEnableCodeBlockTracker();
for (PsiTreeChangePreprocessor preprocessor : Extensions.getExtensions(PsiTreeChangePreprocessor.EP_NAME, myProject)) {
for (PsiTreeChangePreprocessor preprocessor : PsiTreeChangePreprocessor.EP_NAME.getExtensions(myProject)) {
if (!enableOutOfCodeBlockTracking && preprocessor instanceof PsiTreeChangePreprocessorBase) continue;
try {
preprocessor.treeChanged(event);
@@ -365,7 +350,7 @@ public class PsiManagerImpl extends PsiManagerEx {
}
}
if (!enableOutOfCodeBlockTracking) {
for (PsiTreeChangePreprocessor preprocessor : Extensions.getExtensions(PsiTreeChangePreprocessor.EP_NAME, myProject)) {
for (PsiTreeChangePreprocessor preprocessor : PsiTreeChangePreprocessor.EP_NAME.getExtensions(myProject)) {
if (!(preprocessor instanceof PsiTreeChangePreprocessorBase)) continue;
try {
((PsiTreeChangePreprocessorBase)preprocessor).onOutOfCodeBlockModification(event);
@@ -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.dvcs;
import com.intellij.dvcs.push.PushSupport;
@@ -25,7 +11,6 @@ import com.intellij.openapi.application.AccessToken;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.fileEditor.FileEditorManager;
@@ -459,7 +444,7 @@ public class DvcsUtil {
@Nullable
public static PushSupport getPushSupport(@NotNull final AbstractVcs vcs) {
return ContainerUtil.find(Extensions.getExtensions(PushSupport.PUSH_SUPPORT_EP, vcs.getProject()),
return ContainerUtil.find(PushSupport.PUSH_SUPPORT_EP.getExtensions(vcs.getProject()),
support -> support.getVcs().equals(vcs));
}
@@ -1,30 +1,18 @@
/*
* 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 com.intellij.dvcs.cherrypick;
import com.google.common.collect.Lists;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.progress.BackgroundTaskQueue;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.Task;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.*;
import com.intellij.openapi.vcs.AbstractVcs;
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
import com.intellij.openapi.vcs.VcsKey;
import com.intellij.openapi.vcs.VcsNotifier;
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vcs.changes.ChangeListManagerEx;
import com.intellij.util.containers.ContainerUtil;
@@ -73,7 +61,7 @@ public class VcsCherryPickManager {
@Nullable
public VcsCherryPicker getCherryPickerFor(@NotNull final VcsKey key) {
return ContainerUtil.find(Extensions.getExtensions(VcsCherryPicker.EXTENSION_POINT_NAME, myProject),
return ContainerUtil.find(VcsCherryPicker.EXTENSION_POINT_NAME.getExtensions(myProject),
picker -> picker.getSupportedVcs().equals(key));
}
@@ -2,7 +2,6 @@
package com.intellij.dvcs.repo;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.progress.util.BackgroundTaskUtil;
import com.intellij.openapi.project.Project;
@@ -49,7 +48,7 @@ public class VcsRepositoryManager implements Disposable, VcsListener {
public VcsRepositoryManager(@NotNull Project project, @NotNull ProjectLevelVcsManager vcsManager) {
myProject = project;
myVcsManager = vcsManager;
myRepositoryCreators = Arrays.asList(Extensions.getExtensions(VcsRepositoryCreator.EXTENSION_POINT_NAME, project));
myRepositoryCreators = Arrays.asList(VcsRepositoryCreator.EXTENSION_POINT_NAME.getExtensions(project));
project.getMessageBus().connect().subscribe(ProjectLevelVcsManager.VCS_CONFIGURATION_CHANGED, this);
}
@@ -13,6 +13,7 @@ import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.TestOnly;
import java.util.Map;
import java.util.Objects;
public class Extensions {
public static final ExtensionPointName<AreaListener> AREA_LISTENER_EXTENSION_POINT = new ExtensionPointName<>("com.intellij.arealistener");
@@ -80,12 +81,16 @@ public class Extensions {
@Deprecated
@NotNull
public static <T> T[] getExtensions(@NotNull ExtensionPointName<T> extensionPointName) {
return getExtensions(extensionPointName, null);
return extensionPointName.getExtensions();
}
/**
* @deprecated Use {@link ProjectExtensionPointName#getExtensions(AreaInstance)} )}
*/
@Deprecated
@NotNull
public static <T> T[] getExtensions(@NotNull ExtensionPointName<T> extensionPointName, @Nullable AreaInstance areaInstance) {
return getExtensions(extensionPointName.getName(), areaInstance);
return extensionPointName.getExtensions(areaInstance);
}
@NotNull
@@ -108,7 +113,7 @@ public class Extensions {
@NotNull
public static <T, U extends T> U findExtension(@NotNull ExtensionPointName<T> extensionPointName, AreaInstance areaInstance, @NotNull Class<U> extClass) {
for (T t : getExtensions(extensionPointName, areaInstance)) {
for (T t : extensionPointName.getExtensions(areaInstance)) {
if (extClass.isInstance(t)) {
//noinspection unchecked
return (U) t;
@@ -123,7 +128,7 @@ public class Extensions {
throw new IllegalArgumentException("Area class is not registered: " + areaClass);
}
ExtensionsArea parentArea = getArea(parentAreaInstance);
if (!equals(parentArea.getAreaClass(), configuration.getParentClassName())) {
if (!Objects.equals(parentArea.getAreaClass(), configuration.getParentClassName())) {
throw new IllegalArgumentException("Wrong parent area. Expected class: " + configuration.getParentClassName() + " actual class: " + parentArea.getAreaClass());
}
ExtensionsAreaImpl area = new ExtensionsAreaImpl(areaClass, areaInstance, parentArea.getPicoContainer());
@@ -144,7 +149,7 @@ public class Extensions {
if (ourAreaClass2Configuration.containsKey(areaClass)) {
// allow duplicate area class registrations if they are the same - fixing duplicate registration in tests is much more trouble
AreaClassConfiguration configuration = ourAreaClass2Configuration.get(areaClass);
if (!equals(configuration.getParentClassName(), parentAreaClass)) {
if (!Objects.equals(configuration.getParentClassName(), parentAreaClass)) {
throw new RuntimeException("Area class already registered: " + areaClass + ", "+ configuration);
}
else {
@@ -172,10 +177,6 @@ public class Extensions {
}
}
private static boolean equals(@Nullable Object object1, @Nullable Object object2) {
return object1 == object2 || object1 != null && object1.equals(object2);
}
private static class AreaClassConfiguration {
private final String myClassName;
private final String myParentClassName;
@@ -1,26 +1,12 @@
/*
* Copyright 2000-2012 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.execution.configurations;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.extensions.ProjectExtensionPointName;
import com.intellij.openapi.options.UnnamedConfigurable;
import org.jetbrains.annotations.NotNull;
public interface RunConfigurationsSettings {
ExtensionPointName<RunConfigurationsSettings> EXTENSION_POINT = ExtensionPointName.create("com.intellij.runConfigurationsSettings");
ProjectExtensionPointName<RunConfigurationsSettings> EXTENSION_POINT = new ProjectExtensionPointName<>("com.intellij.runConfigurationsSettings");
@NotNull
UnnamedConfigurable createConfigurable();
@@ -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;
@@ -27,7 +13,6 @@ import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.EditorBundle;
import com.intellij.openapi.editor.HectorComponentPanel;
import com.intellij.openapi.editor.HectorComponentPanelsProvider;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.options.ShowSettingsUtil;
import com.intellij.openapi.options.ex.ConfigurableExtensionPointUtil;
@@ -153,7 +138,7 @@ public class HectorComponent extends JPanel {
gc.insets.right = 0;
gc.fill = GridBagConstraints.HORIZONTAL;
myAdditionalPanels = new ArrayList<>();
for (HectorComponentPanelsProvider provider : Extensions.getExtensions(HectorComponentPanelsProvider.EP_NAME, project)) {
for (HectorComponentPanelsProvider provider : HectorComponentPanelsProvider.EP_NAME.getExtensions(project)) {
final HectorComponentPanel componentPanel = provider.createConfigurable(file);
if (componentPanel != null) {
myAdditionalPanels.add(componentPanel);
@@ -8,7 +8,6 @@ import com.intellij.lang.annotation.HighlightSeverity;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.ReadAction;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.fileEditor.FileEditorManager;
@@ -26,7 +25,9 @@ import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.FileStatusListener;
import com.intellij.openapi.vcs.FileStatusManager;
import com.intellij.openapi.vfs.*;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.openapi.vfs.newvfs.BulkFileListener;
import com.intellij.openapi.vfs.newvfs.events.VFileDeleteEvent;
import com.intellij.openapi.vfs.newvfs.events.VFileEvent;
@@ -337,7 +338,7 @@ public class WolfTheProblemSolverImpl extends WolfTheProblemSolver {
synchronized (myFilters) {
if (!myFiltersLoaded) {
myFiltersLoaded = true;
myFilters.addAll(Arrays.asList(Extensions.getExtensions(FILTER_EP_NAME, myProject)));
myFilters.addAll(Arrays.asList(FILTER_EP_NAME.getExtensions(myProject)));
}
}
for (final Condition<VirtualFile> filter : myFilters) {
@@ -12,7 +12,6 @@ import com.intellij.openapi.Disposable
import com.intellij.openapi.actionSystem.*
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.diagnostic.logger
import com.intellij.openapi.extensions.Extensions
import com.intellij.openapi.options.Configurable
import com.intellij.openapi.options.ConfigurationException
import com.intellij.openapi.options.SettingsEditorConfigurable
@@ -545,7 +544,7 @@ open class RunConfigurable @JvmOverloads constructor(private val project: Projec
}
override fun createComponent(): JComponent? {
for (each in Extensions.getExtensions(RunConfigurationsSettings.EXTENSION_POINT, project)) {
for (each in RunConfigurationsSettings.EXTENSION_POINT.getExtensions(project)) {
val configurable = each.createConfigurable()
additionalSettings.add(Pair.create(configurable, configurable.createComponent()))
}
@@ -17,7 +17,6 @@ import com.intellij.openapi.application.ReadAction;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.fileEditor.FileEditorLocation;
import com.intellij.openapi.fileEditor.TextEditor;
@@ -90,7 +89,7 @@ public class FindUsagesManager {
}
public boolean canFindUsages(@NotNull final PsiElement element) {
for (FindUsagesHandlerFactory factory : Extensions.getExtensions(FindUsagesHandlerFactory.EP_NAME, myProject)) {
for (FindUsagesHandlerFactory factory : FindUsagesHandlerFactory.EP_NAME.getExtensions(myProject)) {
try {
if (factory.canFindUsages(element)) {
return true;
@@ -156,7 +155,7 @@ public class FindUsagesManager {
@Nullable
public FindUsagesHandler getFindUsagesHandler(@NotNull PsiElement element, final boolean forHighlightUsages) {
for (FindUsagesHandlerFactory factory : Extensions.getExtensions(FindUsagesHandlerFactory.EP_NAME, myProject)) {
for (FindUsagesHandlerFactory factory : FindUsagesHandlerFactory.EP_NAME.getExtensions(myProject)) {
if (factory.canFindUsages(element)) {
final FindUsagesHandler handler = factory.createFindUsagesHandler(element, forHighlightUsages);
if (handler == FindUsagesHandler.NULL_HANDLER) return null;
@@ -170,7 +169,7 @@ public class FindUsagesManager {
@Nullable
public FindUsagesHandler getNewFindUsagesHandler(@NotNull PsiElement element, final boolean forHighlightUsages) {
for (FindUsagesHandlerFactory factory : Extensions.getExtensions(FindUsagesHandlerFactory.EP_NAME, myProject)) {
for (FindUsagesHandlerFactory factory : FindUsagesHandlerFactory.EP_NAME.getExtensions(myProject)) {
if (factory.canFindUsages(element)) {
Class<? extends FindUsagesHandlerFactory> aClass = factory.getClass();
FindUsagesHandlerFactory copy = (FindUsagesHandlerFactory)new CachingConstructorInjectionComponentAdapter(aClass.getName(), aClass)
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 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.favoritesTreeView;
@@ -25,7 +11,6 @@ import com.intellij.ide.util.treeView.AbstractTreeNode;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.components.ProjectComponent;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.project.Project;
@@ -69,7 +54,7 @@ public class FavoritesManager implements ProjectComponent, JDOMExternalizable {
if (myProviders != null) return myProviders;
myProviders = new HashMap<>();
if (!ApplicationManager.getApplication().isUnitTestMode()) {
final FavoritesListProvider[] providers = Extensions.getExtensions(EP_NAME, myProject);
final FavoritesListProvider[] providers = EP_NAME.getExtensions(myProject);
for (FavoritesListProvider provider : providers) {
myProviders.put(provider.getListName(myProject), provider);
}
@@ -337,7 +322,7 @@ public class FavoritesManager implements ProjectComponent, JDOMExternalizable {
if (toReorder == index + 1 && !above) return false;
return true;
}
@Override
@NotNull
public String getComponentName() {
@@ -407,7 +392,7 @@ public class FavoritesManager implements ProjectComponent, JDOMExternalizable {
final String urlValue = element.getAttributeValue(ATTRIBUTE_URL);
final String moduleName = element.getAttributeValue(ATTRIBUTE_MODULE);
for (FavoriteNodeProvider nodeProvider : Extensions.getExtensions(FavoriteNodeProvider.EP_NAME, project)) {
for (FavoriteNodeProvider nodeProvider : FavoriteNodeProvider.EP_NAME.getExtensions(project)) {
if (nodeProvider.getFavoriteTypeId().equals(type)) {
return new AbstractUrlFavoriteAdapter(urlValue, moduleName, nodeProvider);
}
@@ -436,7 +421,7 @@ public class FavoritesManager implements ProjectComponent, JDOMExternalizable {
public static AbstractUrl createUrlByElement(Object element, final Project project) {
if (element instanceof SmartPsiElementPointer) element = ((SmartPsiElementPointer)element).getElement();
for (FavoriteNodeProvider nodeProvider : Extensions.getExtensions(FavoriteNodeProvider.EP_NAME, project)) {
for (FavoriteNodeProvider nodeProvider : FavoriteNodeProvider.EP_NAME.getExtensions(project)) {
String url = nodeProvider.getElementUrl(element);
if (url != null) {
return new AbstractUrlFavoriteAdapter(url, nodeProvider.getElementModuleName(element), nodeProvider);
@@ -549,7 +534,7 @@ public class FavoritesManager implements ProjectComponent, JDOMExternalizable {
}
for (FavoriteNodeProvider provider : Extensions.getExtensions(FavoriteNodeProvider.EP_NAME, myProject)) {
for (FavoriteNodeProvider provider : FavoriteNodeProvider.EP_NAME.getExtensions(myProject)) {
if (provider.elementContainsFile(element, vFile)) {
return true;
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2009 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.favoritesTreeView;
@@ -22,7 +8,6 @@ import com.intellij.ide.projectView.impl.nodes.NamedLibraryElement;
import com.intellij.ide.util.treeView.AbstractTreeNode;
import com.intellij.ide.util.treeView.NodeDescriptor;
import com.intellij.ide.util.treeView.PresentableNodeDescriptor;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VfsUtil;
@@ -87,7 +72,7 @@ public class FavoritesTreeNodeDescriptor extends PresentableNodeDescriptor<Abstr
return VfsUtilCore.getRelativeLocation(VfsUtil.findFileByIoFile((File)nodeElement, false), project.getBaseDir());
}
final FavoriteNodeProvider[] nodeProviders = Extensions.getExtensions(FavoriteNodeProvider.EP_NAME, project);
final FavoriteNodeProvider[] nodeProviders = FavoriteNodeProvider.EP_NAME.getExtensions(project);
for (FavoriteNodeProvider provider : nodeProviders) {
String location = provider.getElementLocation(nodeElement);
if (location != null) return location;
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 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.favoritesTreeView;
@@ -27,7 +13,6 @@ import com.intellij.ide.projectView.impl.nodes.PsiFileNode;
import com.intellij.ide.util.treeView.AbstractTreeNode;
import com.intellij.ide.util.treeView.NodeDescriptor;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiElement;
@@ -97,7 +82,7 @@ public class FavoritesTreeStructure extends ProjectTreeStructure {
if (value instanceof SmartPsiElementPointer && ((SmartPsiElementPointer)value).getElement() == null) continue;
boolean invalid = false;
for (FavoriteNodeProvider nodeProvider : Extensions.getExtensions(FavoriteNodeProvider.EP_NAME, myProject)) {
for (FavoriteNodeProvider nodeProvider : FavoriteNodeProvider.EP_NAME.getExtensions(myProject)) {
if (nodeProvider.isInvalidElement(value)) {
invalid = true;
break;
@@ -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 com.intellij.ide.favoritesTreeView;
@@ -27,7 +25,6 @@ import com.intellij.navigation.ItemPresentation;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.fileEditor.OpenFileDescriptor;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
@@ -356,7 +353,7 @@ public class FavoritesTreeViewPanel extends JPanel implements DataProvider, Dock
return ((SmartPsiElementPointer)element).getElement();
}
else if (element != null) {
for (FavoriteNodeProvider provider : Extensions.getExtensions(FavoriteNodeProvider.EP_NAME, myProject)) {
for (FavoriteNodeProvider provider : FavoriteNodeProvider.EP_NAME.getExtensions(myProject)) {
PsiElement psiElement = provider.getPsiElement(element);
if (psiElement != null) {
return psiElement;
@@ -664,7 +661,7 @@ public class FavoritesTreeViewPanel extends JPanel implements DataProvider, Dock
if (myBuilder == null) return null;
final Object[] selectedNodeElements = getSelectedNodeElements();
if (selectedNodeElements.length != 1) return null;
for (FavoriteNodeProvider nodeProvider : Extensions.getExtensions(FavoriteNodeProvider.EP_NAME, myProject)) {
for (FavoriteNodeProvider nodeProvider : FavoriteNodeProvider.EP_NAME.getExtensions(myProject)) {
final PsiElement psiElement = nodeProvider.getPsiElement(selectedNodeElements[0]);
if (psiElement instanceof PsiDirectory) {
return new PsiDirectory[]{(PsiDirectory)psiElement};
@@ -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.ide.favoritesTreeView.actions;
@@ -28,7 +14,6 @@ import com.intellij.ide.projectView.impl.nodes.*;
import com.intellij.ide.util.treeView.AbstractTreeNode;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
@@ -76,7 +61,7 @@ public class AddToFavoritesAction extends AnAction implements DumbAware {
Module moduleContext = LangDataKeys.MODULE_CONTEXT.getData(dataContext);
Collection<AbstractTreeNode> nodesToAdd = null;
for (FavoriteNodeProvider provider : Extensions.getExtensions(FavoriteNodeProvider.EP_NAME, project)) {
for (FavoriteNodeProvider provider : FavoriteNodeProvider.EP_NAME.getExtensions(project)) {
Collection<AbstractTreeNode> nodes = provider.getFavoriteNodes(dataContext, ViewSettings.DEFAULT);
if (nodes != null && !nodes.isEmpty()) {
nodesToAdd = nodes;
@@ -148,7 +133,7 @@ public class AddToFavoritesAction extends AnAction implements DumbAware {
ViewSettings favoritesConfig) {
if (project == null) return Collections.emptyList();
ArrayList<AbstractTreeNode> result = new ArrayList<>();
for (FavoriteNodeProvider provider : Extensions.getExtensions(FavoriteNodeProvider.EP_NAME, project)) {
for (FavoriteNodeProvider provider : FavoriteNodeProvider.EP_NAME.getExtensions(project)) {
final AbstractTreeNode treeNode = provider.createNode(project, object, favoritesConfig);
if (treeNode != null) {
result.add(treeNode);
@@ -10,7 +10,6 @@ import com.intellij.ide.projectView.TreeStructureProvider;
import com.intellij.ide.projectView.impl.AbstractProjectViewPane;
import com.intellij.ide.projectView.impl.ProjectViewImpl;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.ActionCallback;
@@ -140,7 +139,7 @@ public abstract class ProjectViewSelectInTarget extends SelectInTargetPsiWrapper
}
private TreeStructureProvider[] getProvidersDumbAware() {
TreeStructureProvider[] allProviders = Extensions.getExtensions(TreeStructureProvider.EP_NAME, myProject);
TreeStructureProvider[] allProviders = TreeStructureProvider.EP_NAME.getExtensions(myProject);
List<TreeStructureProvider> dumbAware = DumbService.getInstance(myProject).filterByDumbAwareness(allProviders);
return dumbAware.toArray(new TreeStructureProvider[0]);
}
@@ -1,24 +1,9 @@
/*
* Copyright 2000-2009 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.projectView.impl;
import com.intellij.ide.projectView.TreeStructureProvider;
import com.intellij.ide.util.treeView.AbstractTreeStructureBase;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import java.util.Arrays;
@@ -34,7 +19,7 @@ public abstract class ProjectAbstractTreeStructureBase extends AbstractTreeStruc
@Override
public List<TreeStructureProvider> getProviders() {
if (myProviders == null) {
final TreeStructureProvider[] providers = Extensions.getExtensions(TreeStructureProvider.EP_NAME, myProject);
final TreeStructureProvider[] providers = TreeStructureProvider.EP_NAME.getExtensions(myProject);
myProviders = Arrays.asList(providers);
}
return myProviders;
@@ -29,7 +29,6 @@ import com.intellij.openapi.components.Storage;
import com.intellij.openapi.components.StoragePathMacros;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.fileEditor.TextEditor;
@@ -90,8 +89,8 @@ import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath;
import java.awt.*;
import java.util.*;
import java.util.List;
import java.util.*;
@State(name = "ProjectView", storages = @Storage(StoragePathMacros.WORKSPACE_FILE))
public class ProjectViewImpl extends ProjectView implements PersistentStateComponent<Element>, Disposable, QuickActionProvider, BusyObject {
@@ -515,7 +514,7 @@ public class ProjectViewImpl extends ProjectView implements PersistentStateCompo
private void ensurePanesLoaded() {
if (myExtensionsLoaded) return;
myExtensionsLoaded = true;
AbstractProjectViewPane[] extensions = Extensions.getExtensions(AbstractProjectViewPane.EP_NAME, myProject);
AbstractProjectViewPane[] extensions = AbstractProjectViewPane.EP_NAME.getExtensions(myProject);
Arrays.sort(extensions, PANE_WEIGHT_COMPARATOR);
for(AbstractProjectViewPane pane: extensions) {
if (myUninitializedPaneState.containsKey(pane.getId())) {
@@ -27,7 +27,6 @@ import com.intellij.openapi.editor.colors.CodeInsightColors;
import com.intellij.openapi.editor.colors.EditorColorsManager;
import com.intellij.openapi.editor.markup.EffectType;
import com.intellij.openapi.editor.markup.TextAttributes;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.fileTypes.StdFileTypes;
import com.intellij.openapi.ide.CopyPasteManager;
import com.intellij.openapi.module.Module;
@@ -237,7 +236,7 @@ public class ScopeTreeViewPanel extends JPanel implements Disposable {
new TreeSpeedSearch(myTree);
myCopyPasteDelegator = new CopyPasteDelegator(myProject, this);
myTreeExpansionMonitor = PackageTreeExpansionMonitor.install(myTree, myProject);
final ScopeTreeStructureExpander[] extensions = Extensions.getExtensions(ScopeTreeStructureExpander.EP_NAME, myProject);
final ScopeTreeStructureExpander[] extensions = ScopeTreeStructureExpander.EP_NAME.getExtensions(myProject);
for (ScopeTreeStructureExpander expander : extensions) {
myTree.addTreeWillExpandListener(expander);
}
@@ -1,13 +1,11 @@
// 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.internal.performance
import com.intellij.execution.filters.Filter
import com.intellij.execution.filters.TextConsoleBuilderFactory
import com.intellij.execution.ui.ConsoleView
import com.intellij.execution.ui.ConsoleViewContentType
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.extensions.Extensions
import com.intellij.openapi.fileChooser.FileChooserFactory
import com.intellij.openapi.fileChooser.FileSaverDescriptor
import com.intellij.openapi.project.Project
@@ -105,7 +103,7 @@ class TypingLatencyReportDialog(
private fun createThreadDumpBrowser(): JComponent {
val builder = TextConsoleBuilderFactory.getInstance().createBuilder(project)
builder.filters(*Extensions.getExtensions<Filter>(AnalyzeStacktraceUtil.EP_NAME, project))
builder.filters(AnalyzeStacktraceUtil.EP_NAME.getExtensions(project))
consoleView = builder.console
Disposer.register(disposable, consoleView)
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 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.openapi.roots.impl;
import com.intellij.ProjectTopics;
@@ -22,7 +8,6 @@ import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.components.ProjectComponent;
import com.intellij.openapi.components.impl.stores.BatchUpdateListener;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.fileTypes.FileTypeEvent;
import com.intellij.openapi.fileTypes.FileTypeListener;
import com.intellij.openapi.fileTypes.FileTypeManager;
@@ -217,7 +202,7 @@ public class ProjectRootManagerComponent extends ProjectRootManagerImpl implemen
recursive.addAll(ContainerUtil.map(extension.getRootsToWatch(myProject), VirtualFile::getPath));
}
for (WatchedRootsProvider extension : Extensions.getExtensions(WatchedRootsProvider.EP_NAME, myProject)) {
for (WatchedRootsProvider extension : WatchedRootsProvider.EP_NAME.getExtensions(myProject)) {
recursive.addAll(extension.getRootsToWatch());
}
@@ -1,4 +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 com.intellij.psi.search;
import com.intellij.ide.IdeBundle;
@@ -13,7 +13,6 @@ import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ReadAction;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.SelectionModel;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.module.*;
import com.intellij.openapi.project.Project;
@@ -63,7 +62,7 @@ public class PredefinedSearchScopeProviderImpl extends PredefinedSearchScopeProv
result.add(GlobalSearchScope.allScope(project));
}
for (SearchScopeProvider each : Extensions.getExtensions(SearchScopeProvider.EP, project)) {
for (SearchScopeProvider each : SearchScopeProvider.EP.getExtensions(project)) {
result.addAll(each.getGeneralProjectScopes());
}
@@ -1,22 +1,7 @@
/*
* Copyright 2000-2009 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.refactoring.listeners.impl;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import com.intellij.refactoring.listeners.RefactoringElementListenerProvider;
import com.intellij.refactoring.listeners.RefactoringListenerManager;
@@ -50,7 +35,7 @@ public class RefactoringListenerManagerImpl extends RefactoringListenerManager {
public RefactoringTransaction startTransaction() {
List<RefactoringElementListenerProvider> providers = new ArrayList<>(myListenerProviders);
Collections.addAll(providers, Extensions.getExtensions(RefactoringElementListenerProvider.EP_NAME, myProject));
Collections.addAll(providers, RefactoringElementListenerProvider.EP_NAME.getExtensions(myProject));
return new RefactoringTransactionImpl(myProject, providers);
}
}
@@ -1,18 +1,4 @@
/*
* 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 com.intellij.unscramble;
@@ -36,8 +22,7 @@ import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.EditorFactory;
import com.intellij.openapi.editor.EditorSettings;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.extensions.ProjectExtensionPointName;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.text.StringUtil;
@@ -54,7 +39,7 @@ import static com.intellij.openapi.application.ex.ClipboardUtil.getTextInClipboa
* @author yole
*/
public class AnalyzeStacktraceUtil {
public static final ExtensionPointName<Filter> EP_NAME = ExtensionPointName.create("com.intellij.analyzeStacktraceFilter");
public static final ProjectExtensionPointName<Filter> EP_NAME = new ProjectExtensionPointName<>("com.intellij.analyzeStacktraceFilter");
private AnalyzeStacktraceUtil() {
}
@@ -84,7 +69,7 @@ public class AnalyzeStacktraceUtil {
String text,
@Nullable Icon icon) {
final TextConsoleBuilder builder = TextConsoleBuilderFactory.getInstance().createBuilder(project);
builder.filters(Extensions.getExtensions(EP_NAME, project));
builder.filters(EP_NAME.getExtensions(project));
final ConsoleView consoleView = builder.getConsole();
final DefaultActionGroup toolbarActions = new DefaultActionGroup();
@@ -2,7 +2,6 @@
package com.intellij.ide;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NonNls;
@@ -51,7 +50,7 @@ public class SelectInManager {
private void checkLoadExtensions() {
if (!myLoadedExtensions) {
myLoadedExtensions = true;
Collections.addAll(myTargets, Extensions.getExtensions(SelectInTarget.EP_NAME, myProject));
Collections.addAll(myTargets, SelectInTarget.EP_NAME.getExtensions(myProject));
}
}
@@ -4,7 +4,6 @@ package com.intellij.openapi.fileEditor.impl;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.Application;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.fileEditor.ex.IdeDocumentHistory;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
@@ -39,7 +38,7 @@ import java.util.stream.Stream;
public class NonProjectFileWritingAccessProvider extends WritingAccessProvider {
private static final Key<Boolean> ENABLE_IN_TESTS = Key.create("NON_PROJECT_FILE_ACCESS_ENABLE_IN_TESTS");
private static final Key<Boolean> HONOUR_RECENT_FILES_IN_TESTS = Key.create("NON_PROJECT_FILE_ACCESS_HONOUR_RECENT_FILES_IN_TESTS");
private static final NotNullLazyKey<AtomicInteger, UserDataHolder> ACCESS_ALLOWED
= NotNullLazyKey.create("NON_PROJECT_FILE_ACCESS", holder -> new AtomicInteger());
@@ -133,7 +132,7 @@ public class NonProjectFileWritingAccessProvider extends WritingAccessProvider {
}
private static boolean isProjectFile(@NotNull VirtualFile file, @NotNull Project project) {
for (NonProjectFileWritingAccessExtension each : Extensions.getExtensions(NonProjectFileWritingAccessExtension.EP_NAME, project)) {
for (NonProjectFileWritingAccessExtension each : NonProjectFileWritingAccessExtension.EP_NAME.getExtensions(project)) {
if(each.isWritable(file)) return true;
if(each.isNotWritable(file)) return false;
}
@@ -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.openapi.fileEditor.impl.text;
import com.intellij.ide.dnd.FileCopyPasteUtil;
@@ -21,8 +7,10 @@ import com.intellij.openapi.editor.CustomFileDropHandler;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.EditorDropHandler;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.fileEditor.*;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.fileEditor.TextEditor;
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx;
import com.intellij.openapi.fileEditor.impl.EditorWindow;
import com.intellij.openapi.fileEditor.impl.EditorWithProviderComposite;
@@ -59,7 +47,7 @@ public class FileDropHandler implements EditorDropHandler {
if (project != null) {
final List<File> fileList = FileCopyPasteUtil.getFileList(t);
if (fileList != null) {
boolean dropResult = ContainerUtil.process(Extensions.getExtensions(CustomFileDropHandler.CUSTOM_DROP_HANDLER_EP, project),
boolean dropResult = ContainerUtil.process(CustomFileDropHandler.CUSTOM_DROP_HANDLER_EP.getExtensions(project),
handler -> !(handler.canHandle(t, myEditor) && handler.handleDrop(t, myEditor, project)));
if (!dropResult) return;
@@ -78,7 +66,7 @@ public class FileDropHandler implements EditorDropHandler {
final FileEditorManagerEx fileEditorManager = (FileEditorManagerEx) FileEditorManager.getInstance(project);
if (vFile != null) {
NonProjectFileWritingAccessProvider.allowWriting(vFile);
if (editorWindow != null) {
fileEditorManager.openFileWithProviders(vFile, true, editorWindow);
}
@@ -15,7 +15,6 @@ import com.intellij.openapi.editor.colors.EditorColorsManager;
import com.intellij.openapi.editor.colors.EditorColorsScheme;
import com.intellij.openapi.editor.event.DocumentEvent;
import com.intellij.openapi.editor.event.DocumentListener;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.project.DumbAwareRunnable;
import com.intellij.openapi.project.Project;
@@ -53,7 +52,7 @@ public class FileStatusManagerImpl extends FileStatusManager implements ProjectC
@NotNull
@Override
protected FileStatusProvider[] compute() {
return Extensions.getExtensions(FileStatusProvider.EP_NAME, myProject);
return FileStatusProvider.EP_NAME.getExtensions(myProject);
}
};
@@ -1,21 +1,6 @@
/*
* Copyright 2000-2009 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.openapi.vcs.readOnlyHandler;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.ListWithSelection;
@@ -28,7 +13,7 @@ class FileInfo {
myFile = file;
myHandleType.add(HandleType.USE_FILE_SYSTEM);
myHandleType.selectFirst();
for(HandleTypeFactory factory: Extensions.getExtensions(HandleTypeFactory.EP_NAME, project)) {
for(HandleTypeFactory factory: HandleTypeFactory.EP_NAME.getExtensions(project)) {
final HandleType handleType = factory.createHandleType(file);
if (handleType != null) {
myHandleType.add(handleType);
@@ -14,7 +14,6 @@ import com.intellij.openapi.Disposable;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.actionSystem.ex.ActionManagerEx;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.Disposer;
@@ -296,7 +295,7 @@ public class IdeRootPane extends JRootPane implements UISettingsListener, Dispos
}
void installNorthComponents(final Project project) {
ContainerUtil.addAll(myNorthComponents, Extensions.getExtensions(IdeRootPaneNorthExtension.EP_NAME, project));
ContainerUtil.addAll(myNorthComponents, IdeRootPaneNorthExtension.EP_NAME.getExtensions(project));
for (IdeRootPaneNorthExtension northComponent : myNorthComponents) {
myNorthPanel.add(northComponent.getComponent());
northComponent.uiSettingsChanged(UISettings.getInstance());
@@ -1,23 +1,8 @@
/*
* Copyright 2000-2017 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.openapi.roots.impl;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.roots.ContentEntry;
import com.intellij.openapi.roots.ContentFolder;
import com.intellij.openapi.roots.ExcludeFolder;
@@ -165,7 +150,7 @@ public class ContentEntryImpl extends RootModelComponentBase implements ContentE
for (ExcludeFolder folder : myExcludeFolders) {
excluded.add(folder.getUrl());
}
for (DirectoryIndexExcludePolicy excludePolicy : Extensions.getExtensions(DirectoryIndexExcludePolicy.EP_NAME, getRootModel().getProject())) {
for (DirectoryIndexExcludePolicy excludePolicy : DirectoryIndexExcludePolicy.EP_NAME.getExtensions(getRootModel().getProject())) {
for (VirtualFilePointer pointer : excludePolicy.getExcludeRootsForModule(getRootModel())) {
excluded.add(pointer.getUrl());
}
@@ -181,7 +166,7 @@ public class ContentEntryImpl extends RootModelComponentBase implements ContentE
for (ExcludeFolder excludeFolder : getExcludeFolders()) {
ContainerUtil.addIfNotNull(result, excludeFolder.getFile());
}
for (DirectoryIndexExcludePolicy excludePolicy : Extensions.getExtensions(DirectoryIndexExcludePolicy.EP_NAME, getRootModel().getProject())) {
for (DirectoryIndexExcludePolicy excludePolicy : DirectoryIndexExcludePolicy.EP_NAME.getExtensions(getRootModel().getProject())) {
for (VirtualFilePointer pointer : excludePolicy.getExcludeRootsForModule(getRootModel())) {
ContainerUtil.addIfNotNull(result, pointer.getFile());
}
@@ -1,24 +1,9 @@
/*
* Copyright 2000-2009 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.openapi.roots.impl;
import com.intellij.openapi.extensions.AreaInstance;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.roots.ModuleRootModel;
import com.intellij.openapi.vfs.VirtualFile;
@@ -48,6 +33,6 @@ public interface DirectoryIndexExcludePolicy {
@NotNull
static DirectoryIndexExcludePolicy[] getExtensions(@NotNull AreaInstance areaInstance) {
return Extensions.getExtensions(EP_NAME, areaInstance);
return EP_NAME.getExtensions(areaInstance);
}
}
@@ -8,7 +8,6 @@ import com.intellij.openapi.application.WriteAction;
import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.State;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.project.Project;
@@ -223,7 +222,7 @@ public class ProjectRootManagerImpl extends ProjectRootManagerEx implements Pers
incModificationCount();
mergeRootsChangesDuring(() -> myProjectJdkEventDispatcher.getMulticaster().projectJdkChanged());
Sdk sdk = getProjectSdk();
for (ProjectExtension extension : Extensions.getExtensions(ProjectExtension.EP_NAME, myProject)) {
for (ProjectExtension extension : ProjectExtension.EP_NAME.getExtensions(myProject)) {
extension.projectSdkChanged(sdk);
}
}
@@ -248,7 +247,7 @@ public class ProjectRootManagerImpl extends ProjectRootManagerEx implements Pers
@Override
public void loadState(@NotNull Element element) {
for (ProjectExtension extension : Extensions.getExtensions(ProjectExtension.EP_NAME, myProject)) {
for (ProjectExtension extension : ProjectExtension.EP_NAME.getExtensions(myProject)) {
extension.readExternal(element);
}
myProjectSdkName = element.getAttributeValue(PROJECT_JDK_NAME_ATTR);
@@ -260,7 +259,7 @@ public class ProjectRootManagerImpl extends ProjectRootManagerEx implements Pers
public Element getState() {
Element element = new Element("state");
element.setAttribute(ATTRIBUTE_VERSION, "2");
for (ProjectExtension extension : Extensions.getExtensions(ProjectExtension.EP_NAME, myProject)) {
for (ProjectExtension extension : ProjectExtension.EP_NAME.getExtensions(myProject)) {
extension.writeExternal(element);
}
if (myProjectSdkName != null) {
@@ -3,7 +3,6 @@ package com.intellij.openapi.roots.impl;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.fileTypes.FileTypeRegistry;
import com.intellij.openapi.fileTypes.impl.FileTypeAssocTable;
import com.intellij.openapi.module.Module;
@@ -203,7 +202,7 @@ public class RootIndex {
}
}
}
for (DirectoryIndexExcludePolicy policy : Extensions.getExtensions(DirectoryIndexExcludePolicy.EP_NAME, project)) {
for (DirectoryIndexExcludePolicy policy : DirectoryIndexExcludePolicy.EP_NAME.getExtensions(project)) {
info.excludedFromProject.addAll(ContainerUtil.filter(policy.getExcludeRootsForProject(), file -> ensureValid(file, policy)));
Function<Sdk, List<VirtualFile>> fun = policy.getExcludeSdkRootsStrategy();
@@ -8,7 +8,6 @@ import com.intellij.openapi.Disposable;
import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.PersistentStateComponentWithModificationTracker;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.projectRoots.Sdk;
@@ -72,7 +71,7 @@ public class RootModelImpl extends RootModelBase implements ModifiableRootModel
addSourceOrderEntries();
myModuleLibraryTable = new ModuleLibraryTable(this, myProjectRootManager);
for (ModuleExtension extension : Extensions.getExtensions(ModuleExtension.EP_NAME, moduleRootManager.getModule())) {
for (ModuleExtension extension : ModuleExtension.EP_NAME.getExtensions(moduleRootManager.getModule())) {
ModuleExtension model = extension.getModifiableModel(false);
registerOnDispose(model);
myExtensions.add(model);
@@ -1,22 +1,7 @@
/*
* Copyright 2000-2012 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.project.model.impl.module.content;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.roots.ContentEntry;
import com.intellij.openapi.roots.ContentFolder;
import com.intellij.openapi.roots.ExcludeFolder;
@@ -147,8 +132,7 @@ public class JpsContentEntry implements ContentEntry, Disposable {
for (JpsExcludeFolder folder : myExcludeFolders) {
excluded.add(folder.getUrl());
}
for (DirectoryIndexExcludePolicy excludePolicy : Extensions
.getExtensions(DirectoryIndexExcludePolicy.EP_NAME, myRootModel.getProject())) {
for (DirectoryIndexExcludePolicy excludePolicy : DirectoryIndexExcludePolicy.EP_NAME.getExtensions(myRootModel.getProject())) {
for (VirtualFilePointer pointer : excludePolicy.getExcludeRootsForModule(myRootModel)) {
excluded.add(pointer.getUrl());
}
@@ -163,7 +147,7 @@ public class JpsContentEntry implements ContentEntry, Disposable {
for (JpsExcludeFolder folder : myExcludeFolders) {
ContainerUtil.addIfNotNull(excluded, folder.getFile());
}
for (DirectoryIndexExcludePolicy excludePolicy : Extensions.getExtensions(DirectoryIndexExcludePolicy.EP_NAME, myRootModel.getProject())) {
for (DirectoryIndexExcludePolicy excludePolicy : DirectoryIndexExcludePolicy.EP_NAME.getExtensions(myRootModel.getProject())) {
for (VirtualFilePointer pointer : excludePolicy.getExcludeRootsForModule(myRootModel)) {
ContainerUtil.addIfNotNull(excluded, pointer.getFile());
}
@@ -1,23 +1,8 @@
/*
* Copyright 2000-2009 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.tasks.context;
import com.intellij.ide.projectView.impl.AbstractProjectViewPane;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.WriteExternalException;
@@ -35,7 +20,7 @@ public class ProjectViewContextProvider extends WorkingContextProvider {
private final AbstractProjectViewPane[] myPanes;
public ProjectViewContextProvider(Project project) {
myPanes = Extensions.getExtensions(AbstractProjectViewPane.EP_NAME, project);
myPanes = AbstractProjectViewPane.EP_NAME.getExtensions(project);
}
@NotNull
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 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.tasks.context;
@@ -22,7 +8,6 @@ import com.intellij.notification.Notifications;
import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.WriteExternalException;
@@ -73,7 +58,7 @@ public class WorkingContextManager {
}
public void loadContext(Element fromElement) {
for (WorkingContextProvider provider : Extensions.getExtensions(WorkingContextProvider.EP_NAME, myProject)) {
for (WorkingContextProvider provider : WorkingContextProvider.EP_NAME.getExtensions(myProject)) {
try {
Element child = fromElement.getChild(provider.getId());
if (child != null) {
@@ -87,7 +72,7 @@ public class WorkingContextManager {
}
public void saveContext(Element toElement) {
for (WorkingContextProvider provider : Extensions.getExtensions(WorkingContextProvider.EP_NAME, myProject)) {
for (WorkingContextProvider provider : WorkingContextProvider.EP_NAME.getExtensions(myProject)) {
try {
Element child = new Element(provider.getId());
provider.saveContext(child);
@@ -100,7 +85,7 @@ public class WorkingContextManager {
}
public void clearContext() {
for (WorkingContextProvider provider : Extensions.getExtensions(WorkingContextProvider.EP_NAME, myProject)) {
for (WorkingContextProvider provider : WorkingContextProvider.EP_NAME.getExtensions(myProject)) {
provider.clearContext();
}
}
@@ -13,7 +13,6 @@ import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ReadAction;
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.util.ProgressIndicatorUtils;
import com.intellij.openapi.progress.util.ProgressWrapper;
@@ -541,7 +540,7 @@ public class UsageViewImpl implements UsageViewEx {
}
};
UsageContextPanel.Provider[] extensions = Extensions.getExtensions(UsageContextPanel.Provider.EP_NAME, myProject);
UsageContextPanel.Provider[] extensions = UsageContextPanel.Provider.EP_NAME.getExtensions(myProject);
myUsageContextPanelProviders = ContainerUtil.filter(extensions, provider -> provider.isAvailableFor(this));
Map<String, JComponent> components = new LinkedHashMap<>();
for (UsageContextPanel.Provider provider : myUsageContextPanelProviders) {
@@ -1,28 +1,12 @@
/*
* 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 com.intellij.openapi.diff.impl.patch;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.changes.CommitContext;
import com.intellij.util.ObjectUtils;
import java.util.HashMap;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -32,6 +16,7 @@ import java.io.IOException;
import java.io.Writer;
import java.text.MessageFormat;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -54,7 +39,7 @@ public class UnifiedDiffWriter {
@NotNull
public static PatchEP[] getPatchExtensions(@Nullable Project project) {
return project == null ? new PatchEP[0] : Extensions.getExtensions(PatchEP.EP_NAME, project);
return project == null ? new PatchEP[0] : PatchEP.EP_NAME.getExtensions(project);
}
public static void write(@Nullable Project project, Collection<FilePatch> patches, Writer writer, final String lineSeparator,
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2011 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.openapi.vcs.changes.patch;
import com.intellij.openapi.diff.impl.patch.BinaryFilePatch;
@@ -20,7 +6,6 @@ import com.intellij.openapi.diff.impl.patch.FilePatch;
import com.intellij.openapi.diff.impl.patch.PatchEP;
import com.intellij.openapi.diff.impl.patch.PatchSyntaxException;
import com.intellij.openapi.diff.impl.patch.formove.PatchApplier;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.MessageType;
import com.intellij.openapi.util.ThrowableComputable;
@@ -79,7 +64,7 @@ public class ApplyPatchDefaultExecutor implements ApplyPatchExecutor<AbstractFil
public static void applyAdditionalInfoBefore(final Project project,
@Nullable ThrowableComputable<Map<String, Map<String, CharSequence>>, PatchSyntaxException> additionalInfo,
@Nullable CommitContext commitContext) {
final PatchEP[] extensions = Extensions.getExtensions(PatchEP.EP_NAME, project);
final PatchEP[] extensions = PatchEP.EP_NAME.getExtensions(project);
if (extensions.length == 0 || additionalInfo == null) return;
try {
Map<String, Map<String, CharSequence>> additionalInfoMap = additionalInfo.compute();
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2011 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.openapi.vcs.changes.patch;
import com.intellij.application.options.CodeStyle;
@@ -20,7 +6,6 @@ import com.intellij.openapi.diff.impl.patch.BinaryFilePatch;
import com.intellij.openapi.diff.impl.patch.FilePatch;
import com.intellij.openapi.diff.impl.patch.PatchEP;
import com.intellij.openapi.diff.impl.patch.UnifiedDiffWriter;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.ide.CopyPasteManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.changes.Change;
@@ -69,7 +54,7 @@ public class PatchWriter {
@Nullable CommitContext commitContext, boolean includeBinaries) throws IOException {
final String lineSeparator = CodeStyle.getSettings(project).getLineSeparator();
UnifiedDiffWriter
.write(project, basePath, patches, writer, lineSeparator, Extensions.getExtensions(PatchEP.EP_NAME, project), commitContext);
.write(project, basePath, patches, writer, lineSeparator, PatchEP.EP_NAME.getExtensions(project), commitContext);
if (includeBinaries) {
BinaryPatchWriter.writeBinaries(basePath, ContainerUtil.findAll(patches, BinaryFilePatch.class), writer);
}
@@ -14,7 +14,6 @@ import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.DataProvider;
import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.project.Project;
@@ -443,7 +442,7 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
updateOnListSelection();
myCommitMessageArea.requestFocusInMessage();
for (EditChangelistSupport support : Extensions.getExtensions(EditChangelistSupport.EP_NAME, project)) {
for (EditChangelistSupport support : EditChangelistSupport.EP_NAME.getExtensions(project)) {
support.installSearch(myCommitMessageArea.getEditorField(), myCommitMessageArea.getEditorField());
}
@@ -4,7 +4,6 @@ package com.intellij.openapi.vcs.changes.ui;
import com.intellij.openapi.editor.SpellCheckingEditorCustomizationProvider;
import com.intellij.openapi.editor.event.DocumentEvent;
import com.intellij.openapi.editor.event.DocumentListener;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.fileTypes.FileTypes;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.VcsBundle;
@@ -94,7 +93,7 @@ public abstract class NewEditChangelistPanel extends JPanel {
public void init(final LocalChangeList initial) {
myMakeActiveCheckBox.setSelected(VcsConfiguration.getInstance(myProject).MAKE_NEW_CHANGELIST_ACTIVE);
for (EditChangelistSupport support : Extensions.getExtensions(EditChangelistSupport.EP_NAME, myProject)) {
for (EditChangelistSupport support : EditChangelistSupport.EP_NAME.getExtensions(myProject)) {
support.installSearch(myNameTextField, myDescriptionTextArea);
myConsumer = support.addControls(myAdditionalControlsPanel, initial);
}
@@ -4,7 +4,6 @@ package com.intellij.openapi.vcs.impl.projectlevelman;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.AbstractVcs;
import com.intellij.openapi.vcs.VcsException;
@@ -28,7 +27,7 @@ public class AllVcses implements AllVcsesI, Disposable {
myVcses = new HashMap<>();
myLock = new Object();
final VcsEP[] vcsEPs = Extensions.getExtensions(VcsEP.EP_NAME, myProject);
final VcsEP[] vcsEPs = VcsEP.EP_NAME.getExtensions(myProject);
final HashMap<String, VcsEP> map = new HashMap<>();
for (VcsEP vcsEP : vcsEPs) {
map.put(vcsEP.name, vcsEP);
@@ -1,22 +1,7 @@
/*
* Copyright 2000-2017 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.vcs.log.history;
import com.google.common.util.concurrent.SettableFuture;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.Conditions;
import com.intellij.openapi.vcs.FilePath;
@@ -85,7 +70,7 @@ public class FileHistoryUi extends AbstractVcsLogUi {
? ContainerUtil.newHashSet(MyCommitsHighlighter.Factory.ID,
CurrentBranchHighlighter.Factory.ID)
: Collections.singleton(MyCommitsHighlighter.Factory.ID);
for (VcsLogHighlighterFactory factory : ContainerUtil.filter(Extensions.getExtensions(LOG_HIGHLIGHTER_FACTORY_EP, myProject),
for (VcsLogHighlighterFactory factory : ContainerUtil.filter(LOG_HIGHLIGHTER_FACTORY_EP.getExtensions(myProject),
f -> isHighlighterEnabled(f.getId()))) {
getTable().addHighlighter(factory.createHighlighter(logData, this));
}
@@ -4,7 +4,6 @@ package com.intellij.vcs.log.impl;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.MessageType;
import com.intellij.openapi.util.Disposer;
@@ -143,7 +142,7 @@ public class VcsLogManager implements Disposable {
@NotNull
public static Map<VirtualFile, VcsLogProvider> findLogProviders(@NotNull Collection<VcsRoot> roots, @NotNull Project project) {
Map<VirtualFile, VcsLogProvider> logProviders = ContainerUtil.newHashMap();
VcsLogProvider[] allLogProviders = Extensions.getExtensions(VcsLogProvider.LOG_PROVIDER_EP, project);
VcsLogProvider[] allLogProviders = VcsLogProvider.LOG_PROVIDER_EP.getExtensions(project);
for (VcsRoot root: roots) {
AbstractVcs vcs = root.getVcs();
VirtualFile path = root.getPath();
@@ -5,7 +5,6 @@ import com.intellij.internal.statistic.beans.UsageDescriptor;
import com.intellij.internal.statistic.service.fus.collectors.ProjectUsagesCollector;
import com.intellij.internal.statistic.service.fus.collectors.UsageDescriptorKeyValidator;
import com.intellij.internal.statistic.utils.StatisticsUtilKt;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.vcs.log.graph.PermanentGraph;
@@ -53,7 +52,7 @@ public class VcsLogFeaturesCollector extends ProjectUsagesCollector {
usages.add(StatisticsUtilKt.getBooleanUsage("textFilter.regex", properties.get(TEXT_FILTER_REGEX)));
usages.add(StatisticsUtilKt.getBooleanUsage("textFilter.matchCase", properties.get(TEXT_FILTER_MATCH_CASE)));
for (VcsLogHighlighterFactory factory : Extensions.getExtensions(LOG_HIGHLIGHTER_FACTORY_EP, project)) {
for (VcsLogHighlighterFactory factory : LOG_HIGHLIGHTER_FACTORY_EP.getExtensions(project)) {
if (factory.showMenuItem()) {
VcsLogHighlighterProperty property = VcsLogHighlighterProperty.get(factory.getId());
usages.add(StatisticsUtilKt.getBooleanUsage("highlighter." + UsageDescriptorKeyValidator.ensureProperKey(factory.getId()),
@@ -1,8 +1,8 @@
// 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.vcs.log.ui;
import com.google.common.util.concurrent.SettableFuture;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.ui.MessageType;
import com.intellij.openapi.util.NamedRunnable;
@@ -47,7 +47,7 @@ public class VcsLogUiImpl extends AbstractVcsLogUi {
myUiProperties = uiProperties;
myMainFrame = new MainFrame(logData, this, uiProperties, myLog, myVisiblePack);
for (VcsLogHighlighterFactory factory : Extensions.getExtensions(LOG_HIGHLIGHTER_FACTORY_EP, myProject)) {
for (VcsLogHighlighterFactory factory : LOG_HIGHLIGHTER_FACTORY_EP.getExtensions(myProject)) {
getTable().addHighlighter(factory.createHighlighter(logData, this));
}
@@ -1,25 +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.vcs.log.ui.actions;
import com.intellij.openapi.actionSystem.ActionGroup;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Separator;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.DumbAware;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.vcs.log.impl.VcsLogUiProperties;
@@ -42,7 +27,7 @@ public class HighlightersActionGroup extends ActionGroup implements DumbAware {
if (e != null) {
if (e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES) != null) {
actions.add(new Separator("Highlight"));
for (VcsLogHighlighterFactory factory : Extensions.getExtensions(AbstractVcsLogUi.LOG_HIGHLIGHTER_FACTORY_EP, e.getProject())) {
for (VcsLogHighlighterFactory factory : AbstractVcsLogUi.LOG_HIGHLIGHTER_FACTORY_EP.getExtensions(e.getProject())) {
if (factory.showMenuItem()) {
actions.add(new EnableHighlighterAction(factory));
}
@@ -9,7 +9,6 @@ import com.intellij.ide.util.SuperMethodWarningUtil;
import com.intellij.openapi.application.TransactionGuard;
import com.intellij.openapi.command.WriteCommandAction;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
@@ -390,7 +389,7 @@ public class BoundedWildcardInspection extends AbstractBaseJavaLocalInspectionTo
private static boolean errorChecks(@NotNull PsiElement method, @NotNull List<PsiElement> elementsToIgnore) {
HighlightVisitor visitor = ContainerUtil.find(Extensions.getExtensions(HighlightVisitor.EP_HIGHLIGHT_VISITOR, method.getProject()), h -> h instanceof HighlightVisitorImpl).clone();
HighlightVisitor visitor = ContainerUtil.find(HighlightVisitor.EP_HIGHLIGHT_VISITOR.getExtensions(method.getProject()), h -> h instanceof HighlightVisitorImpl).clone();
HighlightInfoHolder holder = new HighlightInfoHolder(method.getContainingFile());
visitor.analyze(method.getContainingFile(), false, holder, ()->{
method.accept(new PsiRecursiveElementWalkingVisitor() {
@@ -1,21 +1,6 @@
/*
* 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.coverage;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.options.SearchableConfigurable;
import com.intellij.openapi.project.Project;
@@ -97,7 +82,7 @@ public class CoverageOptionsConfigurable implements SearchableConfigurable {
@NotNull
private CoverageOptions[] getExtensions() {
return Extensions.getExtensions(CoverageOptions.EP_NAME, myProject);
return CoverageOptions.EP_NAME.getExtensions(myProject);
}
@Override
@@ -1,24 +1,9 @@
/*
* 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.
@file:JvmName("GitTestUtil")
package git4idea.test
import com.intellij.dvcs.push.PushSpec
import com.intellij.openapi.extensions.Extensions
import com.intellij.openapi.project.Project
import com.intellij.openapi.vcs.Executor.*
import com.intellij.openapi.vcs.ProjectLevelVcsManager
@@ -126,13 +111,13 @@ fun registerRepo(project: Project, root: String): GitRepository {
val file = LocalFileSystem.getInstance().findFileByIoFile(File(root))
assertFalse(vcsManager.allVcsRoots.isEmpty())
val repository = GitUtil.getRepositoryManager(project).getRepositoryForRoot(file)
assertNotNull("Couldn't find repository for root " + root, repository)
assertNotNull("Couldn't find repository for root $root", repository)
return repository!!
}
fun assumeSupportedGitVersion(vcs: GitVcs) {
val version = vcs.version
assumeTrue("Unsupported Git version: " + version, version.isSupported)
assumeTrue("Unsupported Git version: $version", version.isSupported)
}
fun GitPlatformTest.readAllRefs(root: VirtualFile, objectsFactory: VcsLogObjectsFactory): Set<VcsRef> {
@@ -151,7 +136,7 @@ fun GitPlatformTest.makeCommit(file: String): String {
}
fun findGitLogProvider(project: Project): GitLogProvider {
val providers = Extensions.getExtensions(VcsLogProvider.LOG_PROVIDER_EP, project)
val providers = VcsLogProvider.LOG_PROVIDER_EP.getExtensions(project)
.filter { provider -> provider.supportedVcs == GitVcs.getKey() }
assertEquals("Incorrect number of GitLogProviders", 1, providers.size)
return providers[0] as GitLogProvider
@@ -1,10 +1,7 @@
/*
* 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.gradle.service;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.externalSystem.ExternalSystemManager;
import com.intellij.openapi.externalSystem.model.project.ExternalModuleBuildClasspathPojo;
import com.intellij.openapi.externalSystem.model.project.ExternalProjectBuildClasspathPojo;
@@ -88,7 +85,7 @@ public class GradleBuildClasspathManager {
set.addAll(virtualFiles);
}
allFilesCache = ContainerUtil.newArrayList(set);
for (PsiElementFinder finder : Extensions.getExtensions(PsiElementFinder.EP_NAME, myProject)) {
for (PsiElementFinder finder : PsiElementFinder.EP_NAME.getExtensions(myProject)) {
if (finder instanceof GradleClassFinder) {
((GradleClassFinder)finder).clearCache();
break;
@@ -1,7 +1,6 @@
// 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 hg4idea.test.log;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.vcs.log.VcsLogProvider;
@@ -77,7 +76,7 @@ public class HgUserFilterTest extends HgPlatformTest {
public static HgLogProvider findLogProvider(@NotNull Project project) {
List<VcsLogProvider> providers =
ContainerUtil.filter(Extensions.getExtensions(VcsLogProvider.LOG_PROVIDER_EP, project),
ContainerUtil.filter(VcsLogProvider.LOG_PROVIDER_EP.getExtensions(project),
provider -> provider.getSupportedVcs().equals(HgVcs.getKey()));
TestCase.assertEquals("Incorrect number of HgLogProviders", 1, providers.size());
return (HgLogProvider)providers.get(0);
@@ -4,7 +4,6 @@ package org.jetbrains.idea.svn.dialogs;
import com.intellij.openapi.actionSystem.ActionManager;
import com.intellij.openapi.actionSystem.ActionPopupMenu;
import com.intellij.openapi.actionSystem.DefaultActionGroup;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.changes.ChangeListManager;
@@ -233,7 +232,7 @@ public class ShareDialog extends RepositoryBrowserDialog {
myCommitMessage.setText(text);
panel.add(myCommitMessage, gb);
myCommitMessage.setSeparatorText("Commit Comment Prefix");
for (EditChangelistSupport support : Extensions.getExtensions(EditChangelistSupport.EP_NAME, project)) {
for (EditChangelistSupport support : EditChangelistSupport.EP_NAME.getExtensions(project)) {
support.installSearch(myCommitMessage.getEditorField(), myCommitMessage.getEditorField());
}
@@ -7,7 +7,6 @@ import com.intellij.ide.palette.PaletteItem;
import com.intellij.ide.palette.PaletteItemProvider;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.PopupHandler;
@@ -64,7 +63,7 @@ public class PaletteWindow extends JPanel implements LightToolWindowContent, Dat
public PaletteWindow(Project project) {
myProject = project;
myProviders = Extensions.getExtensions(PaletteItemProvider.EP_NAME, project);
myProviders = PaletteItemProvider.EP_NAME.getExtensions(project);
setLayout(new GridLayout(1, 1));
myScrollPane.addMouseListener(new MyScrollPanePopupHandler());
@@ -341,14 +341,14 @@ public class PyCharmEduInitialConfigurator {
ExtensionsArea projectArea = Extensions.getArea(project);
for (SelectInTarget target : Extensions.getExtensions(SelectInTarget.EP_NAME, project)) {
for (SelectInTarget target : SelectInTarget.EP_NAME.getExtensions(project)) {
if (ToolWindowId.FAVORITES_VIEW.equals(target.getToolWindowId()) ||
ToolWindowId.STRUCTURE_VIEW.equals(target.getToolWindowId())) {
projectArea.getExtensionPoint(SelectInTarget.EP_NAME).unregisterExtension(target);
}
}
for (AbstractProjectViewPane pane : Extensions.getExtensions(AbstractProjectViewPane.EP_NAME, project)) {
for (AbstractProjectViewPane pane : AbstractProjectViewPane.EP_NAME.getExtensions(project)) {
if (pane.getId().equals(ScopeViewPane.ID)) {
Disposer.dispose(pane);
projectArea.getExtensionPoint(AbstractProjectViewPane.EP_NAME).unregisterExtension(pane);
@@ -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.jetbrains.python.testing;
import com.intellij.execution.ExecutionException;
@@ -129,7 +115,6 @@ public class PyRerunFailedTestsAction extends AbstractRerunFailedTestsAction {
@NotNull
@Override
protected List<String> getTestSpecs() {
final List<Pair<Location<?>, AbstractTestProxy>> failedTestLocations = new ArrayList<>();
final List<AbstractTestProxy> failedTests = getFailedTests(myProject);
for (final AbstractTestProxy failedTest : failedTests) {
@@ -16,7 +16,6 @@ import com.intellij.openapi.editor.ex.EditorGutterComponentEx;
import com.intellij.openapi.editor.impl.ComplementaryFontsRegistry;
import com.intellij.openapi.editor.markup.RangeHighlighter;
import com.intellij.openapi.editor.markup.TextAttributes;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.util.ProgressIndicatorBase;
@@ -167,7 +166,7 @@ public class BreadcrumbsXmlWrapper extends JComponent implements Disposable {
}
private FileBreadcrumbsCollector findBreadcrumbsCollector() {
for (FileBreadcrumbsCollector extension : Extensions.getExtensions(FileBreadcrumbsCollector.EP_NAME, myProject)) {
for (FileBreadcrumbsCollector extension : FileBreadcrumbsCollector.EP_NAME.getExtensions(myProject)) {
if (extension.handlesFile(myFile)) {
return extension;
}