Refactor: rename short name indices

This commit is contained in:
Pavel V. Talanov
2013-08-07 21:27:28 +04:00
parent 1859ce6124
commit 22b714cef8
12 changed files with 63 additions and 63 deletions
+6 -6
View File
@@ -330,17 +330,17 @@
<stubElementTypeHolder class="org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes"/> <stubElementTypeHolder class="org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes"/>
<stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetAllPackagesIndex"/> <stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetAllPackagesIndex"/>
<stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetClassByPackageIndex"/> <stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetClassByPackageIndex"/>
<stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetShortClassNameIndex"/> <stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetClassShortNameIndex"/>
<stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetFullClassNameIndex"/> <stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetFullClassNameIndex"/>
<stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetShortFunctionNameIndex"/> <stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetTopLevelNonExtensionFunctionShortNameIndex"/>
<stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetShortPropertiesNameIndex"/> <stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetPropertyShortNameIndex"/>
<stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetExtensionFunctionNameIndex"/> <stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetTopLevelExtensionFunctionShortNameIndex"/>
<stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetAllShortFunctionNameIndex"/> <stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetFunctionShortNameIndex"/>
<stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetSuperClassIndex"/> <stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetSuperClassIndex"/>
<stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetTopLevelFunctionsFqnNameIndex"/> <stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetTopLevelFunctionsFqnNameIndex"/>
<stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetTopLevelPropertiesFqnNameIndex"/> <stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetTopLevelPropertiesFqnNameIndex"/>
<stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetAnnotationsIndex"/> <stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetAnnotationsIndex"/>
<stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetTopLevelShortObjectNameIndex"/> <stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetTopLevelObjectShortNameIndex"/>
<psi.classFileDecompiler implementation="org.jetbrains.jet.plugin.libraries.JetClassFileDecompiler"/> <psi.classFileDecompiler implementation="org.jetbrains.jet.plugin.libraries.JetClassFileDecompiler"/>
<psi.classFileDecompiler implementation="org.jetbrains.jet.plugin.libraries.JetDecompilerForWrongAbiVersion"/> <psi.classFileDecompiler implementation="org.jetbrains.jet.plugin.libraries.JetDecompilerForWrongAbiVersion"/>
@@ -24,7 +24,7 @@ import com.intellij.util.ArrayUtil;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.psi.*;
import org.jetbrains.jet.lang.resolve.name.FqName; import org.jetbrains.jet.lang.resolve.name.FqName;
import org.jetbrains.jet.plugin.stubindex.JetShortClassNameIndex; import org.jetbrains.jet.plugin.stubindex.JetClassShortNameIndex;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
@@ -52,14 +52,14 @@ public class JetGotoClassContributor implements GotoClassContributor {
@NotNull @NotNull
@Override @Override
public String[] getNames(Project project, boolean includeNonProjectItems) { public String[] getNames(Project project, boolean includeNonProjectItems) {
return ArrayUtil.toObjectArray(JetShortClassNameIndex.getInstance().getAllKeys(project), String.class); return ArrayUtil.toObjectArray(JetClassShortNameIndex.getInstance().getAllKeys(project), String.class);
} }
@NotNull @NotNull
@Override @Override
public NavigationItem[] getItemsByName(String name, String pattern, Project project, boolean includeNonProjectItems) { public NavigationItem[] getItemsByName(String name, String pattern, Project project, boolean includeNonProjectItems) {
GlobalSearchScope scope = includeNonProjectItems ? GlobalSearchScope.allScope(project) : GlobalSearchScope.projectScope(project); GlobalSearchScope scope = includeNonProjectItems ? GlobalSearchScope.allScope(project) : GlobalSearchScope.projectScope(project);
Collection<JetClassOrObject> classesOrObjects = JetShortClassNameIndex.getInstance().get(name, project, scope); Collection<JetClassOrObject> classesOrObjects = JetClassShortNameIndex.getInstance().get(name, project, scope);
if (classesOrObjects.isEmpty()) { if (classesOrObjects.isEmpty()) {
return NavigationItem.EMPTY_NAVIGATION_ITEM_ARRAY; return NavigationItem.EMPTY_NAVIGATION_ITEM_ARRAY;
@@ -25,8 +25,8 @@ import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.stubs.StubIndex; import com.intellij.psi.stubs.StubIndex;
import com.intellij.util.ArrayUtil; import com.intellij.util.ArrayUtil;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.plugin.stubindex.JetAllShortFunctionNameIndex; import org.jetbrains.jet.plugin.stubindex.JetFunctionShortNameIndex;
import org.jetbrains.jet.plugin.stubindex.JetShortPropertiesNameIndex; import org.jetbrains.jet.plugin.stubindex.JetPropertyShortNameIndex;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
@@ -36,8 +36,8 @@ public class JetGotoSymbolContributor implements ChooseByNameContributor {
@NotNull @NotNull
@Override @Override
public String[] getNames(Project project, boolean includeNonProjectItems) { public String[] getNames(Project project, boolean includeNonProjectItems) {
Collection<String> items = StubIndex.getInstance().getAllKeys(JetAllShortFunctionNameIndex.getInstance().getKey(), project); Collection<String> items = StubIndex.getInstance().getAllKeys(JetFunctionShortNameIndex.getInstance().getKey(), project);
items.addAll(StubIndex.getInstance().getAllKeys(JetShortPropertiesNameIndex.getInstance().getKey(), project)); items.addAll(StubIndex.getInstance().getAllKeys(JetPropertyShortNameIndex.getInstance().getKey(), project));
return ArrayUtil.toStringArray(items); return ArrayUtil.toStringArray(items);
} }
@@ -48,10 +48,10 @@ public class JetGotoSymbolContributor implements ChooseByNameContributor {
GlobalSearchScope scope = includeNonProjectItems ? GlobalSearchScope.allScope(project) : GlobalSearchScope.projectScope(project); GlobalSearchScope scope = includeNonProjectItems ? GlobalSearchScope.allScope(project) : GlobalSearchScope.projectScope(project);
Collection<? extends NavigationItem> functions = StubIndex.getInstance().get( Collection<? extends NavigationItem> functions = StubIndex.getInstance().get(
JetAllShortFunctionNameIndex.getInstance().getKey(), name, project, scope); JetFunctionShortNameIndex.getInstance().getKey(), name, project, scope);
Collection<? extends NavigationItem> properties = StubIndex.getInstance().get( Collection<? extends NavigationItem> properties = StubIndex.getInstance().get(
JetShortPropertiesNameIndex.getInstance().getKey(), name, project, scope); JetPropertyShortNameIndex.getInstance().getKey(), name, project, scope);
List<NavigationItem> items = new ArrayList<NavigationItem>(Collections2.filter(functions, Predicates.notNull())); List<NavigationItem> items = new ArrayList<NavigationItem>(Collections2.filter(functions, Predicates.notNull()));
items.addAll(properties); items.addAll(properties);
@@ -85,7 +85,7 @@ public class JetShortNamesCache extends PsiShortNamesCache {
@NotNull @NotNull
@Override @Override
public String[] getAllClassNames() { public String[] getAllClassNames() {
Collection<String> classNames = JetShortClassNameIndex.getInstance().getAllKeys(project); Collection<String> classNames = JetClassShortNameIndex.getInstance().getAllKeys(project);
// package classes can not be indexed, since they have no explicit declarations // package classes can not be indexed, since they have no explicit declarations
IDELightClassGenerationSupport lightClassGenerationSupport = IDELightClassGenerationSupport.getInstanceForIDE(project); IDELightClassGenerationSupport lightClassGenerationSupport = IDELightClassGenerationSupport.getInstanceForIDE(project);
@@ -119,7 +119,7 @@ public class JetShortNamesCache extends PsiShortNamesCache {
} }
// Quick check for classes from getAllClassNames() // Quick check for classes from getAllClassNames()
Collection<JetClassOrObject> classOrObjects = JetShortClassNameIndex.getInstance().get(name, project, scope); Collection<JetClassOrObject> classOrObjects = JetClassShortNameIndex.getInstance().get(name, project, scope);
if (classOrObjects.isEmpty()) { if (classOrObjects.isEmpty()) {
return result.toArray(new PsiClass[result.size()]); return result.toArray(new PsiClass[result.size()]);
} }
@@ -154,7 +154,7 @@ public class JetShortNamesCache extends PsiShortNamesCache {
@NotNull @NotNull
public Collection<String> getAllTopLevelFunctionNames() { public Collection<String> getAllTopLevelFunctionNames() {
Set<String> functionNames = new HashSet<String>(); Set<String> functionNames = new HashSet<String>();
functionNames.addAll(JetShortFunctionNameIndex.getInstance().getAllKeys(project)); functionNames.addAll(JetTopLevelNonExtensionFunctionShortNameIndex.getInstance().getAllKeys(project));
functionNames.addAll(JetFromJavaDescriptorHelper.getPossiblePackageDeclarationsNames(project, GlobalSearchScope.allScope(project))); functionNames.addAll(JetFromJavaDescriptorHelper.getPossiblePackageDeclarationsNames(project, GlobalSearchScope.allScope(project)));
return functionNames; return functionNames;
} }
@@ -162,7 +162,7 @@ public class JetShortNamesCache extends PsiShortNamesCache {
@NotNull @NotNull
public Collection<String> getAllTopLevelObjectNames() { public Collection<String> getAllTopLevelObjectNames() {
Set<String> topObjectNames = new HashSet<String>(); Set<String> topObjectNames = new HashSet<String>();
topObjectNames.addAll(JetTopLevelShortObjectNameIndex.getInstance().getAllKeys(project)); topObjectNames.addAll(JetTopLevelObjectShortNameIndex.getInstance().getAllKeys(project));
Collection<PsiClass> classObjects = Collection<PsiClass> classObjects =
JetFromJavaDescriptorHelper.getCompiledClassesForTopLevelObjects(project, GlobalSearchScope.allScope(project)); JetFromJavaDescriptorHelper.getCompiledClassesForTopLevelObjects(project, GlobalSearchScope.allScope(project));
@@ -193,7 +193,7 @@ public class JetShortNamesCache extends PsiShortNamesCache {
Set<ClassDescriptor> result = Sets.newHashSet(); Set<ClassDescriptor> result = Sets.newHashSet();
Collection<JetObjectDeclaration> topObjects = JetTopLevelShortObjectNameIndex.getInstance().get(name, project, scope); Collection<JetObjectDeclaration> topObjects = JetTopLevelObjectShortNameIndex.getInstance().get(name, project, scope);
for (JetObjectDeclaration objectDeclaration : topObjects) { for (JetObjectDeclaration objectDeclaration : topObjects) {
FqName fqName = JetPsiUtil.getFQName(objectDeclaration); FqName fqName = JetPsiUtil.getFQName(objectDeclaration);
assert fqName != null : "Local object declaration in JetTopLevelShortObjectNameIndex:" + objectDeclaration.getText(); assert fqName != null : "Local object declaration in JetTopLevelShortObjectNameIndex:" + objectDeclaration.getText();
@@ -254,7 +254,7 @@ public class JetShortNamesCache extends PsiShortNamesCache {
Set<FqName> affectedPackages = Sets.newHashSet(); Set<FqName> affectedPackages = Sets.newHashSet();
Collection<JetNamedFunction> jetNamedFunctions = Collection<JetNamedFunction> jetNamedFunctions =
JetShortFunctionNameIndex.getInstance().get(referenceName.asString(), project, scope); JetTopLevelNonExtensionFunctionShortNameIndex.getInstance().get(referenceName.asString(), project, scope);
for (JetNamedFunction jetNamedFunction : jetNamedFunctions) { for (JetNamedFunction jetNamedFunction : jetNamedFunctions) {
PsiFile containingFile = jetNamedFunction.getContainingFile(); PsiFile containingFile = jetNamedFunction.getContainingFile();
if (containingFile instanceof JetFile) { if (containingFile instanceof JetFile) {
@@ -278,7 +278,7 @@ public class JetShortNamesCache extends PsiShortNamesCache {
private Collection<PsiElement> getJetExtensionFunctionsByName(@NotNull String name, @NotNull GlobalSearchScope scope) { private Collection<PsiElement> getJetExtensionFunctionsByName(@NotNull String name, @NotNull GlobalSearchScope scope) {
HashSet<PsiElement> functions = new HashSet<PsiElement>(); HashSet<PsiElement> functions = new HashSet<PsiElement>();
functions.addAll(JetExtensionFunctionNameIndex.getInstance().get(name, project, scope)); functions.addAll(JetTopLevelExtensionFunctionShortNameIndex.getInstance().get(name, project, scope));
return functions; return functions;
} }
@@ -329,7 +329,7 @@ public class JetShortNamesCache extends PsiShortNamesCache {
@NotNull Condition<String> acceptedNameCondition, @NotNull Condition<String> acceptedNameCondition,
@NotNull GlobalSearchScope searchScope @NotNull GlobalSearchScope searchScope
) { ) {
Set<String> extensionFunctionNames = new HashSet<String>(JetExtensionFunctionNameIndex.getInstance().getAllKeys(project)); Set<String> extensionFunctionNames = new HashSet<String>(JetTopLevelExtensionFunctionShortNameIndex.getInstance().getAllKeys(project));
Set<FqName> functionFQNs = new java.util.HashSet<FqName>(); Set<FqName> functionFQNs = new java.util.HashSet<FqName>();
@@ -421,7 +421,7 @@ public class JetShortNamesCache extends PsiShortNamesCache {
@Override @Override
public void getAllMethodNames(@NotNull HashSet<String> set) { public void getAllMethodNames(@NotNull HashSet<String> set) {
set.addAll(JetShortFunctionNameIndex.getInstance().getAllKeys(project)); set.addAll(JetTopLevelNonExtensionFunctionShortNameIndex.getInstance().getAllKeys(project));
} }
@NotNull @NotNull
@@ -38,7 +38,7 @@ import org.jetbrains.jet.lang.types.JetType;
import org.jetbrains.jet.plugin.JetPluginUtil; import org.jetbrains.jet.plugin.JetPluginUtil;
import org.jetbrains.jet.plugin.caches.resolve.KotlinCacheManagerUtil; import org.jetbrains.jet.plugin.caches.resolve.KotlinCacheManagerUtil;
import org.jetbrains.jet.plugin.libraries.JetSourceNavigationHelper; import org.jetbrains.jet.plugin.libraries.JetSourceNavigationHelper;
import org.jetbrains.jet.plugin.stubindex.JetShortClassNameIndex; import org.jetbrains.jet.plugin.stubindex.JetClassShortNameIndex;
import org.jetbrains.jet.renderer.DescriptorRenderer; import org.jetbrains.jet.renderer.DescriptorRenderer;
import java.util.Collection; import java.util.Collection;
@@ -78,7 +78,7 @@ public class KotlinTypeHierarchyProvider extends JavaTypeHierarchyProvider {
String returnTypeText = DescriptorRenderer.TEXT.renderType(type); String returnTypeText = DescriptorRenderer.TEXT.renderType(type);
if (returnTypeText.equals(functionName)) { if (returnTypeText.equals(functionName)) {
Collection<JetClassOrObject> classOrObjects = Collection<JetClassOrObject> classOrObjects =
JetShortClassNameIndex.getInstance().get(functionName, project, GlobalSearchScope.allScope(project)); JetClassShortNameIndex.getInstance().get(functionName, project, GlobalSearchScope.allScope(project));
if (classOrObjects.size() == 1) { if (classOrObjects.size() == 1) {
JetClassOrObject classOrObject = classOrObjects.iterator().next(); JetClassOrObject classOrObject = classOrObjects.iterator().next();
return JetSourceNavigationHelper.getOriginalPsiClassOrCreateLightClass(classOrObject); return JetSourceNavigationHelper.getOriginalPsiClassOrCreateLightClass(classOrObject);
@@ -25,16 +25,16 @@ import org.jetbrains.jet.lang.psi.JetClassOrObject;
import java.util.Collection; import java.util.Collection;
public class JetShortClassNameIndex extends StringStubIndexExtension<JetClassOrObject> { public class JetClassShortNameIndex extends StringStubIndexExtension<JetClassOrObject> {
private static final StubIndexKey<String, JetClassOrObject> KEY = KotlinIndexUtil.createIndexKey(JetShortClassNameIndex.class); private static final StubIndexKey<String, JetClassOrObject> KEY = KotlinIndexUtil.createIndexKey(JetClassShortNameIndex.class);
private static final JetShortClassNameIndex ourInstance = new JetShortClassNameIndex(); private static final JetClassShortNameIndex ourInstance = new JetClassShortNameIndex();
public static JetShortClassNameIndex getInstance() { public static JetClassShortNameIndex getInstance() {
return ourInstance; return ourInstance;
} }
private JetShortClassNameIndex() {} private JetClassShortNameIndex() {}
@NotNull @NotNull
@Override @Override
@@ -25,16 +25,16 @@ import org.jetbrains.jet.lang.psi.JetNamedFunction;
import java.util.Collection; import java.util.Collection;
public class JetShortFunctionNameIndex extends StringStubIndexExtension<JetNamedFunction> { public class JetFunctionShortNameIndex extends StringStubIndexExtension<JetNamedFunction> {
private static final StubIndexKey<String, JetNamedFunction> KEY = KotlinIndexUtil.createIndexKey(JetShortFunctionNameIndex.class); private static final StubIndexKey<String, JetNamedFunction> KEY = KotlinIndexUtil.createIndexKey(JetFunctionShortNameIndex.class);
private static final JetShortFunctionNameIndex ourInstance = new JetShortFunctionNameIndex(); private static final JetFunctionShortNameIndex ourInstance = new JetFunctionShortNameIndex();
public static JetShortFunctionNameIndex getInstance() { public static JetFunctionShortNameIndex getInstance() {
return ourInstance; return ourInstance;
} }
private JetShortFunctionNameIndex() {} private JetFunctionShortNameIndex() {}
@NotNull @NotNull
@Override @Override
@@ -25,16 +25,16 @@ import org.jetbrains.jet.lang.psi.JetProperty;
import java.util.Collection; import java.util.Collection;
public class JetShortPropertiesNameIndex extends StringStubIndexExtension<JetProperty> { public class JetPropertyShortNameIndex extends StringStubIndexExtension<JetProperty> {
private static final StubIndexKey<String, JetProperty> KEY = KotlinIndexUtil.createIndexKey(JetShortPropertiesNameIndex.class); private static final StubIndexKey<String, JetProperty> KEY = KotlinIndexUtil.createIndexKey(JetPropertyShortNameIndex.class);
private static final JetShortPropertiesNameIndex ourInstance = new JetShortPropertiesNameIndex(); private static final JetPropertyShortNameIndex ourInstance = new JetPropertyShortNameIndex();
public static JetShortPropertiesNameIndex getInstance() { public static JetPropertyShortNameIndex getInstance() {
return ourInstance; return ourInstance;
} }
private JetShortPropertiesNameIndex() {} private JetPropertyShortNameIndex() {}
@NotNull @NotNull
@Override @Override
@@ -21,16 +21,16 @@ import com.intellij.psi.stubs.StubIndexKey;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetNamedFunction; import org.jetbrains.jet.lang.psi.JetNamedFunction;
public class JetExtensionFunctionNameIndex extends StringStubIndexExtension<JetNamedFunction> { public class JetTopLevelExtensionFunctionShortNameIndex extends StringStubIndexExtension<JetNamedFunction> {
private static final StubIndexKey<String, JetNamedFunction> KEY = KotlinIndexUtil.createIndexKey(JetExtensionFunctionNameIndex.class); private static final StubIndexKey<String, JetNamedFunction> KEY = KotlinIndexUtil.createIndexKey(JetTopLevelExtensionFunctionShortNameIndex.class);
private static final JetExtensionFunctionNameIndex instance = new JetExtensionFunctionNameIndex(); private static final JetTopLevelExtensionFunctionShortNameIndex instance = new JetTopLevelExtensionFunctionShortNameIndex();
public static JetExtensionFunctionNameIndex getInstance() { public static JetTopLevelExtensionFunctionShortNameIndex getInstance() {
return instance; return instance;
} }
private JetExtensionFunctionNameIndex() {} private JetTopLevelExtensionFunctionShortNameIndex() {}
@NotNull @NotNull
@Override @Override
@@ -25,16 +25,16 @@ import org.jetbrains.jet.lang.psi.JetNamedFunction;
import java.util.Collection; import java.util.Collection;
public class JetAllShortFunctionNameIndex extends StringStubIndexExtension<JetNamedFunction> { public class JetTopLevelNonExtensionFunctionShortNameIndex extends StringStubIndexExtension<JetNamedFunction> {
private static final StubIndexKey<String, JetNamedFunction> KEY = KotlinIndexUtil.createIndexKey(JetAllShortFunctionNameIndex.class); private static final StubIndexKey<String, JetNamedFunction> KEY = KotlinIndexUtil.createIndexKey(JetTopLevelNonExtensionFunctionShortNameIndex.class);
private static final JetAllShortFunctionNameIndex ourInstance = new JetAllShortFunctionNameIndex(); private static final JetTopLevelNonExtensionFunctionShortNameIndex ourInstance = new JetTopLevelNonExtensionFunctionShortNameIndex();
public static JetAllShortFunctionNameIndex getInstance() { public static JetTopLevelNonExtensionFunctionShortNameIndex getInstance() {
return ourInstance; return ourInstance;
} }
private JetAllShortFunctionNameIndex() {} private JetTopLevelNonExtensionFunctionShortNameIndex() {}
@NotNull @NotNull
@Override @Override
@@ -25,16 +25,16 @@ import org.jetbrains.jet.lang.psi.JetObjectDeclaration;
import java.util.Collection; import java.util.Collection;
public class JetTopLevelShortObjectNameIndex extends StringStubIndexExtension<JetObjectDeclaration> { public class JetTopLevelObjectShortNameIndex extends StringStubIndexExtension<JetObjectDeclaration> {
private static final StubIndexKey<String, JetObjectDeclaration> KEY = KotlinIndexUtil.createIndexKey(JetTopLevelShortObjectNameIndex.class); private static final StubIndexKey<String, JetObjectDeclaration> KEY = KotlinIndexUtil.createIndexKey(JetTopLevelObjectShortNameIndex.class);
private static final JetTopLevelShortObjectNameIndex ourInstance = new JetTopLevelShortObjectNameIndex(); private static final JetTopLevelObjectShortNameIndex ourInstance = new JetTopLevelObjectShortNameIndex();
public static JetTopLevelShortObjectNameIndex getInstance() { public static JetTopLevelObjectShortNameIndex getInstance() {
return ourInstance; return ourInstance;
} }
private JetTopLevelShortObjectNameIndex() {} private JetTopLevelObjectShortNameIndex() {}
@NotNull @NotNull
@Override @Override
@@ -45,7 +45,7 @@ public class StubIndexServiceImpl implements StubIndexService {
public void indexClass(PsiJetClassStub stub, IndexSink sink) { public void indexClass(PsiJetClassStub stub, IndexSink sink) {
String name = stub.getName(); String name = stub.getName();
if (name != null) { if (name != null) {
sink.occurrence(JetShortClassNameIndex.getInstance().getKey(), name); sink.occurrence(JetClassShortNameIndex.getInstance().getKey(), name);
} }
FqName fqn = stub.getFqName(); FqName fqn = stub.getFqName();
@@ -75,10 +75,10 @@ public class StubIndexServiceImpl implements StubIndexService {
} }
if (name != null) { if (name != null) {
sink.occurrence(JetShortClassNameIndex.getInstance().getKey(), name); sink.occurrence(JetClassShortNameIndex.getInstance().getKey(), name);
if (stub.isTopLevel()) { if (stub.isTopLevel()) {
sink.occurrence(JetTopLevelShortObjectNameIndex.getInstance().getKey(), name); sink.occurrence(JetTopLevelObjectShortNameIndex.getInstance().getKey(), name);
} }
} }
@@ -114,10 +114,10 @@ public class StubIndexServiceImpl implements StubIndexService {
if (stub.isTopLevel()) { if (stub.isTopLevel()) {
// Collection only top level functions as only they are expected in completion without explicit import // Collection only top level functions as only they are expected in completion without explicit import
if (!stub.isExtension()) { if (!stub.isExtension()) {
sink.occurrence(JetShortFunctionNameIndex.getInstance().getKey(), name); sink.occurrence(JetTopLevelNonExtensionFunctionShortNameIndex.getInstance().getKey(), name);
} }
else { else {
sink.occurrence(JetExtensionFunctionNameIndex.getInstance().getKey(), name); sink.occurrence(JetTopLevelExtensionFunctionShortNameIndex.getInstance().getKey(), name);
} }
FqName topFQName = stub.getTopFQName(); FqName topFQName = stub.getTopFQName();
@@ -126,7 +126,7 @@ public class StubIndexServiceImpl implements StubIndexService {
} }
} }
sink.occurrence(JetAllShortFunctionNameIndex.getInstance().getKey(), name); sink.occurrence(JetFunctionShortNameIndex.getInstance().getKey(), name);
} }
} }
@@ -141,7 +141,7 @@ public class StubIndexServiceImpl implements StubIndexService {
} }
} }
sink.occurrence(JetShortPropertiesNameIndex.getInstance().getKey(), propertyName); sink.occurrence(JetPropertyShortNameIndex.getInstance().getKey(), propertyName);
} }
} }