Dynamic queryExecutor EPs

GitOrigin-RevId: bde157c3f47d2084b11bd1178d62d8b9595f6a13
This commit is contained in:
Dmitry Jemerov
2020-01-29 20:10:06 +01:00
committed by intellij-monorepo-bot
parent 90d15bfaf0
commit 1bd0ed0834
11 changed files with 44 additions and 82 deletions

View File

@@ -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-2020 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.
/*
* @author max
@@ -30,9 +16,13 @@ import com.intellij.util.QueryExecutor;
import org.jetbrains.annotations.NotNull;
public class AllClassesSearch extends ExtensibleQueryFactory<PsiClass, AllClassesSearch.SearchParameters> {
public static final ExtensionPointName<QueryExecutor> EP_NAME = ExtensionPointName.create("com.intellij.allClassesSearch");
public static final ExtensionPointName<QueryExecutor<PsiClass, AllClassesSearch.SearchParameters>> EP_NAME = ExtensionPointName.create("com.intellij.allClassesSearch");
public static final AllClassesSearch INSTANCE = new AllClassesSearch();
private AllClassesSearch() {
super(EP_NAME);
}
public static class SearchParameters {
private final SearchScope myScope;
private final Project myProject;

View File

@@ -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-2020 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.searches;
@@ -35,7 +21,7 @@ import org.jetbrains.annotations.NotNull;
* (method in original class, overriding method)
*/
public class AllOverridingMethodsSearch extends ExtensibleQueryFactory<Pair<PsiMethod, PsiMethod>, AllOverridingMethodsSearch.SearchParameters> {
public static final ExtensionPointName<QueryExecutor> EP_NAME = ExtensionPointName.create("com.intellij.allOverridingMethodsSearch");
public static final ExtensionPointName<QueryExecutor<Pair<PsiMethod, PsiMethod>, AllOverridingMethodsSearch.SearchParameters>> EP_NAME = ExtensionPointName.create("com.intellij.allOverridingMethodsSearch");
public static final AllOverridingMethodsSearch INSTANCE = new AllOverridingMethodsSearch();
public static class SearchParameters {
@@ -59,6 +45,7 @@ public class AllOverridingMethodsSearch extends ExtensibleQueryFactory<Pair<PsiM
}
private AllOverridingMethodsSearch() {
super(EP_NAME);
}
@NotNull

View File

@@ -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-2020 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.searches;
import com.intellij.openapi.extensions.ExtensionPointName;
@@ -24,7 +10,7 @@ import com.intellij.util.QueryExecutor;
import org.jetbrains.annotations.NotNull;
public class AnnotatedElementsSearch extends ExtensibleQueryFactory<PsiModifierListOwner, AnnotatedElementsSearch.Parameters> {
public static final ExtensionPointName<QueryExecutor> EP_NAME = ExtensionPointName.create("com.intellij.annotatedElementsSearch");
public static final ExtensionPointName<QueryExecutor<PsiModifierListOwner, AnnotatedElementsSearch.Parameters>> EP_NAME = ExtensionPointName.create("com.intellij.annotatedElementsSearch");
public static final AnnotatedElementsSearch INSTANCE = new AnnotatedElementsSearch();
public static class Parameters {
@@ -67,6 +53,10 @@ public class AnnotatedElementsSearch extends ExtensibleQueryFactory<PsiModifierL
}
}
private AnnotatedElementsSearch() {
super(EP_NAME);
}
@SafeVarargs
public static <T extends PsiModifierListOwner> Query<T> searchElements(@NotNull PsiClass annotationClass, @NotNull SearchScope scope, Class<? extends T> @NotNull ... types) {
//noinspection unchecked

View File

@@ -18,7 +18,7 @@ import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
public class ClassInheritorsSearch extends ExtensibleQueryFactory<PsiClass, ClassInheritorsSearch.SearchParameters> {
public static final ExtensionPointName<QueryExecutor> EP_NAME = ExtensionPointName.create("com.intellij.classInheritorsSearch");
public static final ExtensionPointName<QueryExecutor<PsiClass, ClassInheritorsSearch.SearchParameters>> EP_NAME = ExtensionPointName.create("com.intellij.classInheritorsSearch");
public static final ClassInheritorsSearch INSTANCE = new ClassInheritorsSearch();
public static class SearchParameters implements QueryParameters {
@@ -125,7 +125,9 @@ public class ClassInheritorsSearch extends ExtensibleQueryFactory<PsiClass, Clas
}
}
private ClassInheritorsSearch() {}
private ClassInheritorsSearch() {
super(EP_NAME);
}
@NotNull
public static Query<PsiClass> search(@NotNull final PsiClass aClass, @NotNull SearchScope scope, final boolean checkDeep, final boolean checkInheritance, boolean includeAnonymous) {

View File

@@ -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-2020 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.searches;
import com.intellij.openapi.extensions.ExtensionPointName;
@@ -28,9 +14,13 @@ import org.jetbrains.annotations.NotNull;
* @author yole
*/
public class ClassesWithAnnotatedMembersSearch extends ExtensibleQueryFactory<PsiClass, ClassesWithAnnotatedMembersSearch.Parameters> {
public static final ExtensionPointName<QueryExecutor> EP_NAME = ExtensionPointName.create("com.intellij.classesWithAnnotatedMembersSearch");
public static final ExtensionPointName<QueryExecutor<PsiClass, ClassesWithAnnotatedMembersSearch.Parameters>> EP_NAME = ExtensionPointName.create("com.intellij.classesWithAnnotatedMembersSearch");
public static final ClassesWithAnnotatedMembersSearch INSTANCE = new ClassesWithAnnotatedMembersSearch();
private ClassesWithAnnotatedMembersSearch() {
super(EP_NAME);
}
public static class Parameters {
private final PsiClass myAnnotationClass;
private final SearchScope myScope;

View File

@@ -13,7 +13,7 @@ import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
public class DirectClassInheritorsSearch extends ExtensibleQueryFactory<PsiClass, DirectClassInheritorsSearch.SearchParameters> {
public static final ExtensionPointName<QueryExecutor> EP_NAME = ExtensionPointName.create("com.intellij.directClassInheritorsSearch");
public static final ExtensionPointName<QueryExecutor<PsiClass, DirectClassInheritorsSearch.SearchParameters>> EP_NAME = ExtensionPointName.create("com.intellij.directClassInheritorsSearch");
public static final DirectClassInheritorsSearch INSTANCE = new DirectClassInheritorsSearch();
public static class SearchParameters {
@@ -62,6 +62,7 @@ public class DirectClassInheritorsSearch extends ExtensibleQueryFactory<PsiClass
}
private DirectClassInheritorsSearch() {
super(EP_NAME);
}
@NotNull

View File

@@ -12,7 +12,7 @@ import com.intellij.util.QueryExecutor;
import org.jetbrains.annotations.NotNull;
public class OverridingMethodsSearch extends ExtensibleQueryFactory<PsiMethod, OverridingMethodsSearch.SearchParameters> {
public static final ExtensionPointName<QueryExecutor> EP_NAME = ExtensionPointName.create("com.intellij.overridingMethodsSearch");
public static final ExtensionPointName<QueryExecutor<PsiMethod, OverridingMethodsSearch.SearchParameters>> EP_NAME = ExtensionPointName.create("com.intellij.overridingMethodsSearch");
public static final OverridingMethodsSearch INSTANCE = new OverridingMethodsSearch();
public static class SearchParameters {
@@ -42,6 +42,7 @@ public class OverridingMethodsSearch extends ExtensibleQueryFactory<PsiMethod, O
}
private OverridingMethodsSearch() {
super(EP_NAME);
}
@NotNull