diff --git a/idea/src/META-INF/plugin.xml b/idea/src/META-INF/plugin.xml index 196efef5488..030ead5ad98 100644 --- a/idea/src/META-INF/plugin.xml +++ b/idea/src/META-INF/plugin.xml @@ -330,17 +330,17 @@ - + - - - - + + + + - + diff --git a/idea/src/org/jetbrains/jet/plugin/caches/JetGotoClassContributor.java b/idea/src/org/jetbrains/jet/plugin/caches/JetGotoClassContributor.java index 094099e4b93..3fc5d5a588b 100644 --- a/idea/src/org/jetbrains/jet/plugin/caches/JetGotoClassContributor.java +++ b/idea/src/org/jetbrains/jet/plugin/caches/JetGotoClassContributor.java @@ -24,7 +24,7 @@ import com.intellij.util.ArrayUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.lang.psi.*; 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.Collection; @@ -52,14 +52,14 @@ public class JetGotoClassContributor implements GotoClassContributor { @NotNull @Override 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 @Override public NavigationItem[] getItemsByName(String name, String pattern, Project project, boolean includeNonProjectItems) { GlobalSearchScope scope = includeNonProjectItems ? GlobalSearchScope.allScope(project) : GlobalSearchScope.projectScope(project); - Collection classesOrObjects = JetShortClassNameIndex.getInstance().get(name, project, scope); + Collection classesOrObjects = JetClassShortNameIndex.getInstance().get(name, project, scope); if (classesOrObjects.isEmpty()) { return NavigationItem.EMPTY_NAVIGATION_ITEM_ARRAY; diff --git a/idea/src/org/jetbrains/jet/plugin/caches/JetGotoSymbolContributor.java b/idea/src/org/jetbrains/jet/plugin/caches/JetGotoSymbolContributor.java index e5082e92f4a..c9340b0c800 100644 --- a/idea/src/org/jetbrains/jet/plugin/caches/JetGotoSymbolContributor.java +++ b/idea/src/org/jetbrains/jet/plugin/caches/JetGotoSymbolContributor.java @@ -25,8 +25,8 @@ import com.intellij.psi.search.GlobalSearchScope; import com.intellij.psi.stubs.StubIndex; import com.intellij.util.ArrayUtil; import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.plugin.stubindex.JetAllShortFunctionNameIndex; -import org.jetbrains.jet.plugin.stubindex.JetShortPropertiesNameIndex; +import org.jetbrains.jet.plugin.stubindex.JetFunctionShortNameIndex; +import org.jetbrains.jet.plugin.stubindex.JetPropertyShortNameIndex; import java.util.ArrayList; import java.util.Collection; @@ -36,8 +36,8 @@ public class JetGotoSymbolContributor implements ChooseByNameContributor { @NotNull @Override public String[] getNames(Project project, boolean includeNonProjectItems) { - Collection items = StubIndex.getInstance().getAllKeys(JetAllShortFunctionNameIndex.getInstance().getKey(), project); - items.addAll(StubIndex.getInstance().getAllKeys(JetShortPropertiesNameIndex.getInstance().getKey(), project)); + Collection items = StubIndex.getInstance().getAllKeys(JetFunctionShortNameIndex.getInstance().getKey(), project); + items.addAll(StubIndex.getInstance().getAllKeys(JetPropertyShortNameIndex.getInstance().getKey(), project)); return ArrayUtil.toStringArray(items); } @@ -48,10 +48,10 @@ public class JetGotoSymbolContributor implements ChooseByNameContributor { GlobalSearchScope scope = includeNonProjectItems ? GlobalSearchScope.allScope(project) : GlobalSearchScope.projectScope(project); Collection functions = StubIndex.getInstance().get( - JetAllShortFunctionNameIndex.getInstance().getKey(), name, project, scope); + JetFunctionShortNameIndex.getInstance().getKey(), name, project, scope); Collection properties = StubIndex.getInstance().get( - JetShortPropertiesNameIndex.getInstance().getKey(), name, project, scope); + JetPropertyShortNameIndex.getInstance().getKey(), name, project, scope); List items = new ArrayList(Collections2.filter(functions, Predicates.notNull())); items.addAll(properties); diff --git a/idea/src/org/jetbrains/jet/plugin/caches/JetShortNamesCache.java b/idea/src/org/jetbrains/jet/plugin/caches/JetShortNamesCache.java index 04c0f9912cc..75fbdb4f7cc 100644 --- a/idea/src/org/jetbrains/jet/plugin/caches/JetShortNamesCache.java +++ b/idea/src/org/jetbrains/jet/plugin/caches/JetShortNamesCache.java @@ -85,7 +85,7 @@ public class JetShortNamesCache extends PsiShortNamesCache { @NotNull @Override public String[] getAllClassNames() { - Collection classNames = JetShortClassNameIndex.getInstance().getAllKeys(project); + Collection classNames = JetClassShortNameIndex.getInstance().getAllKeys(project); // package classes can not be indexed, since they have no explicit declarations IDELightClassGenerationSupport lightClassGenerationSupport = IDELightClassGenerationSupport.getInstanceForIDE(project); @@ -119,7 +119,7 @@ public class JetShortNamesCache extends PsiShortNamesCache { } // Quick check for classes from getAllClassNames() - Collection classOrObjects = JetShortClassNameIndex.getInstance().get(name, project, scope); + Collection classOrObjects = JetClassShortNameIndex.getInstance().get(name, project, scope); if (classOrObjects.isEmpty()) { return result.toArray(new PsiClass[result.size()]); } @@ -154,7 +154,7 @@ public class JetShortNamesCache extends PsiShortNamesCache { @NotNull public Collection getAllTopLevelFunctionNames() { Set functionNames = new HashSet(); - functionNames.addAll(JetShortFunctionNameIndex.getInstance().getAllKeys(project)); + functionNames.addAll(JetTopLevelNonExtensionFunctionShortNameIndex.getInstance().getAllKeys(project)); functionNames.addAll(JetFromJavaDescriptorHelper.getPossiblePackageDeclarationsNames(project, GlobalSearchScope.allScope(project))); return functionNames; } @@ -162,7 +162,7 @@ public class JetShortNamesCache extends PsiShortNamesCache { @NotNull public Collection getAllTopLevelObjectNames() { Set topObjectNames = new HashSet(); - topObjectNames.addAll(JetTopLevelShortObjectNameIndex.getInstance().getAllKeys(project)); + topObjectNames.addAll(JetTopLevelObjectShortNameIndex.getInstance().getAllKeys(project)); Collection classObjects = JetFromJavaDescriptorHelper.getCompiledClassesForTopLevelObjects(project, GlobalSearchScope.allScope(project)); @@ -193,7 +193,7 @@ public class JetShortNamesCache extends PsiShortNamesCache { Set result = Sets.newHashSet(); - Collection topObjects = JetTopLevelShortObjectNameIndex.getInstance().get(name, project, scope); + Collection topObjects = JetTopLevelObjectShortNameIndex.getInstance().get(name, project, scope); for (JetObjectDeclaration objectDeclaration : topObjects) { FqName fqName = JetPsiUtil.getFQName(objectDeclaration); assert fqName != null : "Local object declaration in JetTopLevelShortObjectNameIndex:" + objectDeclaration.getText(); @@ -254,7 +254,7 @@ public class JetShortNamesCache extends PsiShortNamesCache { Set affectedPackages = Sets.newHashSet(); Collection jetNamedFunctions = - JetShortFunctionNameIndex.getInstance().get(referenceName.asString(), project, scope); + JetTopLevelNonExtensionFunctionShortNameIndex.getInstance().get(referenceName.asString(), project, scope); for (JetNamedFunction jetNamedFunction : jetNamedFunctions) { PsiFile containingFile = jetNamedFunction.getContainingFile(); if (containingFile instanceof JetFile) { @@ -278,7 +278,7 @@ public class JetShortNamesCache extends PsiShortNamesCache { private Collection getJetExtensionFunctionsByName(@NotNull String name, @NotNull GlobalSearchScope scope) { HashSet functions = new HashSet(); - functions.addAll(JetExtensionFunctionNameIndex.getInstance().get(name, project, scope)); + functions.addAll(JetTopLevelExtensionFunctionShortNameIndex.getInstance().get(name, project, scope)); return functions; } @@ -329,7 +329,7 @@ public class JetShortNamesCache extends PsiShortNamesCache { @NotNull Condition acceptedNameCondition, @NotNull GlobalSearchScope searchScope ) { - Set extensionFunctionNames = new HashSet(JetExtensionFunctionNameIndex.getInstance().getAllKeys(project)); + Set extensionFunctionNames = new HashSet(JetTopLevelExtensionFunctionShortNameIndex.getInstance().getAllKeys(project)); Set functionFQNs = new java.util.HashSet(); @@ -421,7 +421,7 @@ public class JetShortNamesCache extends PsiShortNamesCache { @Override public void getAllMethodNames(@NotNull HashSet set) { - set.addAll(JetShortFunctionNameIndex.getInstance().getAllKeys(project)); + set.addAll(JetTopLevelNonExtensionFunctionShortNameIndex.getInstance().getAllKeys(project)); } @NotNull diff --git a/idea/src/org/jetbrains/jet/plugin/hierarchy/KotlinTypeHierarchyProvider.java b/idea/src/org/jetbrains/jet/plugin/hierarchy/KotlinTypeHierarchyProvider.java index de7c5605383..ac31bffa34f 100644 --- a/idea/src/org/jetbrains/jet/plugin/hierarchy/KotlinTypeHierarchyProvider.java +++ b/idea/src/org/jetbrains/jet/plugin/hierarchy/KotlinTypeHierarchyProvider.java @@ -38,7 +38,7 @@ import org.jetbrains.jet.lang.types.JetType; import org.jetbrains.jet.plugin.JetPluginUtil; import org.jetbrains.jet.plugin.caches.resolve.KotlinCacheManagerUtil; 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 java.util.Collection; @@ -78,7 +78,7 @@ public class KotlinTypeHierarchyProvider extends JavaTypeHierarchyProvider { String returnTypeText = DescriptorRenderer.TEXT.renderType(type); if (returnTypeText.equals(functionName)) { Collection classOrObjects = - JetShortClassNameIndex.getInstance().get(functionName, project, GlobalSearchScope.allScope(project)); + JetClassShortNameIndex.getInstance().get(functionName, project, GlobalSearchScope.allScope(project)); if (classOrObjects.size() == 1) { JetClassOrObject classOrObject = classOrObjects.iterator().next(); return JetSourceNavigationHelper.getOriginalPsiClassOrCreateLightClass(classOrObject); diff --git a/idea/src/org/jetbrains/jet/plugin/stubindex/JetShortClassNameIndex.java b/idea/src/org/jetbrains/jet/plugin/stubindex/JetClassShortNameIndex.java similarity index 81% rename from idea/src/org/jetbrains/jet/plugin/stubindex/JetShortClassNameIndex.java rename to idea/src/org/jetbrains/jet/plugin/stubindex/JetClassShortNameIndex.java index d32f098ea75..ea2d4449a63 100644 --- a/idea/src/org/jetbrains/jet/plugin/stubindex/JetShortClassNameIndex.java +++ b/idea/src/org/jetbrains/jet/plugin/stubindex/JetClassShortNameIndex.java @@ -25,16 +25,16 @@ import org.jetbrains.jet.lang.psi.JetClassOrObject; import java.util.Collection; -public class JetShortClassNameIndex extends StringStubIndexExtension { - private static final StubIndexKey KEY = KotlinIndexUtil.createIndexKey(JetShortClassNameIndex.class); +public class JetClassShortNameIndex extends StringStubIndexExtension { + private static final StubIndexKey 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; } - private JetShortClassNameIndex() {} + private JetClassShortNameIndex() {} @NotNull @Override diff --git a/idea/src/org/jetbrains/jet/plugin/stubindex/JetShortFunctionNameIndex.java b/idea/src/org/jetbrains/jet/plugin/stubindex/JetFunctionShortNameIndex.java similarity index 81% rename from idea/src/org/jetbrains/jet/plugin/stubindex/JetShortFunctionNameIndex.java rename to idea/src/org/jetbrains/jet/plugin/stubindex/JetFunctionShortNameIndex.java index 6bcc5f0fd35..97d30a191be 100644 --- a/idea/src/org/jetbrains/jet/plugin/stubindex/JetShortFunctionNameIndex.java +++ b/idea/src/org/jetbrains/jet/plugin/stubindex/JetFunctionShortNameIndex.java @@ -25,16 +25,16 @@ import org.jetbrains.jet.lang.psi.JetNamedFunction; import java.util.Collection; -public class JetShortFunctionNameIndex extends StringStubIndexExtension { - private static final StubIndexKey KEY = KotlinIndexUtil.createIndexKey(JetShortFunctionNameIndex.class); +public class JetFunctionShortNameIndex extends StringStubIndexExtension { + private static final StubIndexKey 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; } - private JetShortFunctionNameIndex() {} + private JetFunctionShortNameIndex() {} @NotNull @Override diff --git a/idea/src/org/jetbrains/jet/plugin/stubindex/JetShortPropertiesNameIndex.java b/idea/src/org/jetbrains/jet/plugin/stubindex/JetPropertyShortNameIndex.java similarity index 79% rename from idea/src/org/jetbrains/jet/plugin/stubindex/JetShortPropertiesNameIndex.java rename to idea/src/org/jetbrains/jet/plugin/stubindex/JetPropertyShortNameIndex.java index ea69e932e28..66437c0b188 100644 --- a/idea/src/org/jetbrains/jet/plugin/stubindex/JetShortPropertiesNameIndex.java +++ b/idea/src/org/jetbrains/jet/plugin/stubindex/JetPropertyShortNameIndex.java @@ -25,16 +25,16 @@ import org.jetbrains.jet.lang.psi.JetProperty; import java.util.Collection; -public class JetShortPropertiesNameIndex extends StringStubIndexExtension { - private static final StubIndexKey KEY = KotlinIndexUtil.createIndexKey(JetShortPropertiesNameIndex.class); +public class JetPropertyShortNameIndex extends StringStubIndexExtension { + private static final StubIndexKey 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; } - private JetShortPropertiesNameIndex() {} + private JetPropertyShortNameIndex() {} @NotNull @Override diff --git a/idea/src/org/jetbrains/jet/plugin/stubindex/JetExtensionFunctionNameIndex.java b/idea/src/org/jetbrains/jet/plugin/stubindex/JetTopLevelExtensionFunctionShortNameIndex.java similarity index 69% rename from idea/src/org/jetbrains/jet/plugin/stubindex/JetExtensionFunctionNameIndex.java rename to idea/src/org/jetbrains/jet/plugin/stubindex/JetTopLevelExtensionFunctionShortNameIndex.java index 84a3db4de71..1aea0e7ed60 100644 --- a/idea/src/org/jetbrains/jet/plugin/stubindex/JetExtensionFunctionNameIndex.java +++ b/idea/src/org/jetbrains/jet/plugin/stubindex/JetTopLevelExtensionFunctionShortNameIndex.java @@ -21,16 +21,16 @@ import com.intellij.psi.stubs.StubIndexKey; import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.lang.psi.JetNamedFunction; -public class JetExtensionFunctionNameIndex extends StringStubIndexExtension { - private static final StubIndexKey KEY = KotlinIndexUtil.createIndexKey(JetExtensionFunctionNameIndex.class); +public class JetTopLevelExtensionFunctionShortNameIndex extends StringStubIndexExtension { + private static final StubIndexKey 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; } - private JetExtensionFunctionNameIndex() {} + private JetTopLevelExtensionFunctionShortNameIndex() {} @NotNull @Override diff --git a/idea/src/org/jetbrains/jet/plugin/stubindex/JetAllShortFunctionNameIndex.java b/idea/src/org/jetbrains/jet/plugin/stubindex/JetTopLevelNonExtensionFunctionShortNameIndex.java similarity index 74% rename from idea/src/org/jetbrains/jet/plugin/stubindex/JetAllShortFunctionNameIndex.java rename to idea/src/org/jetbrains/jet/plugin/stubindex/JetTopLevelNonExtensionFunctionShortNameIndex.java index 71b7bd24370..215179da551 100644 --- a/idea/src/org/jetbrains/jet/plugin/stubindex/JetAllShortFunctionNameIndex.java +++ b/idea/src/org/jetbrains/jet/plugin/stubindex/JetTopLevelNonExtensionFunctionShortNameIndex.java @@ -25,16 +25,16 @@ import org.jetbrains.jet.lang.psi.JetNamedFunction; import java.util.Collection; -public class JetAllShortFunctionNameIndex extends StringStubIndexExtension { - private static final StubIndexKey KEY = KotlinIndexUtil.createIndexKey(JetAllShortFunctionNameIndex.class); +public class JetTopLevelNonExtensionFunctionShortNameIndex extends StringStubIndexExtension { + private static final StubIndexKey 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; } - private JetAllShortFunctionNameIndex() {} + private JetTopLevelNonExtensionFunctionShortNameIndex() {} @NotNull @Override diff --git a/idea/src/org/jetbrains/jet/plugin/stubindex/JetTopLevelShortObjectNameIndex.java b/idea/src/org/jetbrains/jet/plugin/stubindex/JetTopLevelObjectShortNameIndex.java similarity index 80% rename from idea/src/org/jetbrains/jet/plugin/stubindex/JetTopLevelShortObjectNameIndex.java rename to idea/src/org/jetbrains/jet/plugin/stubindex/JetTopLevelObjectShortNameIndex.java index 388c1c07961..c39a83b2963 100644 --- a/idea/src/org/jetbrains/jet/plugin/stubindex/JetTopLevelShortObjectNameIndex.java +++ b/idea/src/org/jetbrains/jet/plugin/stubindex/JetTopLevelObjectShortNameIndex.java @@ -25,16 +25,16 @@ import org.jetbrains.jet.lang.psi.JetObjectDeclaration; import java.util.Collection; -public class JetTopLevelShortObjectNameIndex extends StringStubIndexExtension { - private static final StubIndexKey KEY = KotlinIndexUtil.createIndexKey(JetTopLevelShortObjectNameIndex.class); +public class JetTopLevelObjectShortNameIndex extends StringStubIndexExtension { + private static final StubIndexKey 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; } - private JetTopLevelShortObjectNameIndex() {} + private JetTopLevelObjectShortNameIndex() {} @NotNull @Override diff --git a/idea/src/org/jetbrains/jet/plugin/stubindex/StubIndexServiceImpl.java b/idea/src/org/jetbrains/jet/plugin/stubindex/StubIndexServiceImpl.java index 3c9295b73f8..b946f7d631e 100644 --- a/idea/src/org/jetbrains/jet/plugin/stubindex/StubIndexServiceImpl.java +++ b/idea/src/org/jetbrains/jet/plugin/stubindex/StubIndexServiceImpl.java @@ -45,7 +45,7 @@ public class StubIndexServiceImpl implements StubIndexService { public void indexClass(PsiJetClassStub stub, IndexSink sink) { String name = stub.getName(); if (name != null) { - sink.occurrence(JetShortClassNameIndex.getInstance().getKey(), name); + sink.occurrence(JetClassShortNameIndex.getInstance().getKey(), name); } FqName fqn = stub.getFqName(); @@ -75,10 +75,10 @@ public class StubIndexServiceImpl implements StubIndexService { } if (name != null) { - sink.occurrence(JetShortClassNameIndex.getInstance().getKey(), name); + sink.occurrence(JetClassShortNameIndex.getInstance().getKey(), name); 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()) { // Collection only top level functions as only they are expected in completion without explicit import if (!stub.isExtension()) { - sink.occurrence(JetShortFunctionNameIndex.getInstance().getKey(), name); + sink.occurrence(JetTopLevelNonExtensionFunctionShortNameIndex.getInstance().getKey(), name); } else { - sink.occurrence(JetExtensionFunctionNameIndex.getInstance().getKey(), name); + sink.occurrence(JetTopLevelExtensionFunctionShortNameIndex.getInstance().getKey(), name); } 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); } }