Factory method introduced
This commit is contained in:
@@ -50,6 +50,6 @@ public class JetAllPackagesIndex extends StringStubIndexExtension<JetFile> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<JetFile> get(final String fqName, final Project project, @NotNull final GlobalSearchScope scope) {
|
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
|
@Override
|
||||||
public Collection<JetNamedFunction> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
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
|
@Override
|
||||||
public Collection<JetAnnotationEntry> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
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
|
@Override
|
||||||
public Collection<JetClassOrObject> get(final String fqName, final Project project, @NotNull final GlobalSearchScope scope) {
|
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
|
@Override
|
||||||
public Collection<JetClassOrObject> get(final String fqName, final Project project, @NotNull final GlobalSearchScope scope) {
|
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
|
@Override
|
||||||
public Collection<JetFile> get(final String fqName, final Project project, @NotNull final GlobalSearchScope scope) {
|
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
|
@Override
|
||||||
public Collection<JetClassOrObject> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
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
|
@Override
|
||||||
public Collection<JetNamedFunction> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
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
|
@Override
|
||||||
public Collection<JetProperty> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
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;
|
import org.jetbrains.jet.plugin.JetFileType;
|
||||||
|
|
||||||
public class JetSourceFilterScope extends DelegatingGlobalSearchScope {
|
public class JetSourceFilterScope extends DelegatingGlobalSearchScope {
|
||||||
|
public static JetSourceFilterScope kotlinSourcesAndLibraries(@NotNull GlobalSearchScope delegate) {
|
||||||
|
return new JetSourceFilterScope(delegate);
|
||||||
|
}
|
||||||
|
|
||||||
private final ProjectFileIndex myIndex;
|
private final ProjectFileIndex myIndex;
|
||||||
|
|
||||||
public JetSourceFilterScope(@NotNull final GlobalSearchScope delegate) {
|
private JetSourceFilterScope(@NotNull final GlobalSearchScope delegate) {
|
||||||
super(delegate);
|
super(delegate);
|
||||||
myIndex = ProjectRootManager.getInstance(getProject()).getFileIndex();
|
myIndex = ProjectRootManager.getInstance(getProject()).getFileIndex();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,6 @@ public class JetSuperClassIndex extends StringStubIndexExtension<JetClassOrObjec
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<JetClassOrObject> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
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
|
@Override
|
||||||
public Collection<JetNamedFunction> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
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
|
@Override
|
||||||
public Collection<JetProperty> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
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
|
@Override
|
||||||
public Collection<JetObjectDeclaration> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) {
|
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