Factory method introduced
This commit is contained in:
@@ -50,6 +50,6 @@ public class JetAllPackagesIndex extends StringStubIndexExtension<JetFile> {
|
||||
|
||||
@Override
|
||||
public Collection<JetFile> get(final String fqName, final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return super.get(fqName, project, new JetSourceFilterScope(scope));
|
||||
return super.get(fqName, project, JetSourceFilterScope.kotlinSourcesAndLibraries(scope));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,6 @@ public class JetAllShortFunctionNameIndex extends StringStubIndexExtension<JetNa
|
||||
|
||||
@Override
|
||||
public Collection<JetNamedFunction> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return super.get(s, project, new JetSourceFilterScope(scope));
|
||||
return super.get(s, project, JetSourceFilterScope.kotlinSourcesAndLibraries(scope));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,6 @@ public class JetAnnotationsIndex extends StringStubIndexExtension<JetAnnotationE
|
||||
|
||||
@Override
|
||||
public Collection<JetAnnotationEntry> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return super.get(s, project, new JetSourceFilterScope(scope));
|
||||
return super.get(s, project, JetSourceFilterScope.kotlinSourcesAndLibraries(scope));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,6 @@ public class JetClassByPackageIndex extends StringStubIndexExtension<JetClassOrO
|
||||
|
||||
@Override
|
||||
public Collection<JetClassOrObject> get(final String fqName, final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return super.get(fqName, project, new JetSourceFilterScope(scope));
|
||||
return super.get(fqName, project, JetSourceFilterScope.kotlinSourcesAndLibraries(scope));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,6 @@ public class JetFullClassNameIndex extends StringStubIndexExtension<JetClassOrOb
|
||||
|
||||
@Override
|
||||
public Collection<JetClassOrObject> get(final String fqName, final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return super.get(fqName, project, new JetSourceFilterScope(scope));
|
||||
return super.get(fqName, project, JetSourceFilterScope.kotlinSourcesAndLibraries(scope));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,6 @@ public class JetPackageDeclarationIndex extends StringStubIndexExtension<JetFile
|
||||
|
||||
@Override
|
||||
public Collection<JetFile> get(final String fqName, final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return super.get(fqName, project, new JetSourceFilterScope(scope));
|
||||
return super.get(fqName, project, JetSourceFilterScope.kotlinSourcesAndLibraries(scope));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,6 @@ public class JetShortClassNameIndex extends StringStubIndexExtension<JetClassOrO
|
||||
|
||||
@Override
|
||||
public Collection<JetClassOrObject> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return super.get(s, project, new JetSourceFilterScope(scope));
|
||||
return super.get(s, project, JetSourceFilterScope.kotlinSourcesAndLibraries(scope));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,6 @@ public class JetShortFunctionNameIndex extends StringStubIndexExtension<JetNamed
|
||||
|
||||
@Override
|
||||
public Collection<JetNamedFunction> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return super.get(s, project, new JetSourceFilterScope(scope));
|
||||
return super.get(s, project, JetSourceFilterScope.kotlinSourcesAndLibraries(scope));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,6 @@ public class JetShortPropertiesNameIndex extends StringStubIndexExtension<JetPro
|
||||
|
||||
@Override
|
||||
public Collection<JetProperty> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return super.get(s, project, new JetSourceFilterScope(scope));
|
||||
return super.get(s, project, JetSourceFilterScope.kotlinSourcesAndLibraries(scope));
|
||||
}
|
||||
}
|
||||
@@ -26,9 +26,13 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.plugin.JetFileType;
|
||||
|
||||
public class JetSourceFilterScope extends DelegatingGlobalSearchScope {
|
||||
public static JetSourceFilterScope kotlinSourcesAndLibraries(@NotNull GlobalSearchScope delegate) {
|
||||
return new JetSourceFilterScope(delegate);
|
||||
}
|
||||
|
||||
private final ProjectFileIndex myIndex;
|
||||
|
||||
public JetSourceFilterScope(@NotNull final GlobalSearchScope delegate) {
|
||||
private JetSourceFilterScope(@NotNull final GlobalSearchScope delegate) {
|
||||
super(delegate);
|
||||
myIndex = ProjectRootManager.getInstance(getProject()).getFileIndex();
|
||||
}
|
||||
|
||||
@@ -44,6 +44,6 @@ public class JetSuperClassIndex extends StringStubIndexExtension<JetClassOrObjec
|
||||
|
||||
@Override
|
||||
public Collection<JetClassOrObject> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return super.get(s, project, new JetSourceFilterScope(scope));
|
||||
return super.get(s, project, JetSourceFilterScope.kotlinSourcesAndLibraries(scope));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,6 @@ public class JetTopLevelFunctionsFqnNameIndex extends StringStubIndexExtension<J
|
||||
|
||||
@Override
|
||||
public Collection<JetNamedFunction> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return super.get(s, project, new JetSourceFilterScope(scope));
|
||||
return super.get(s, project, JetSourceFilterScope.kotlinSourcesAndLibraries(scope));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,6 @@ public class JetTopLevelPropertiesFqnNameIndex extends StringStubIndexExtension<
|
||||
|
||||
@Override
|
||||
public Collection<JetProperty> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return super.get(s, project, new JetSourceFilterScope(scope));
|
||||
return super.get(s, project, JetSourceFilterScope.kotlinSourcesAndLibraries(scope));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,6 @@ public class JetTopLevelShortObjectNameIndex extends StringStubIndexExtension<Je
|
||||
|
||||
@Override
|
||||
public Collection<JetObjectDeclaration> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
||||
return super.get(s, project, new JetSourceFilterScope(scope));
|
||||
return super.get(s, project, JetSourceFilterScope.kotlinSourcesAndLibraries(scope));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user