Renamed two index classes for consistency

This commit is contained in:
Valentin Kipyatkov
2014-11-28 20:05:16 +03:00
parent a50f9863b3
commit 1431167afb
9 changed files with 31 additions and 34 deletions
@@ -61,8 +61,8 @@ import org.jetbrains.jet.lang.resolve.name.Name;
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
import org.jetbrains.jet.lexer.JetTokens;
import org.jetbrains.jet.plugin.stubindex.JetFullClassNameIndex;
import org.jetbrains.jet.plugin.stubindex.JetTopLevelFunctionsFqnNameIndex;
import org.jetbrains.jet.plugin.stubindex.JetTopLevelPropertiesFqnNameIndex;
import org.jetbrains.jet.plugin.stubindex.JetTopLevelFunctionFqnNameIndex;
import org.jetbrains.jet.plugin.stubindex.JetTopLevelPropertyFqnNameIndex;
import java.util.Collection;
import java.util.Collections;
@@ -301,10 +301,10 @@ public class JetSourceNavigationHelper {
@NotNull JetNamedDeclaration decompiledDeclaration
) {
if (decompiledDeclaration instanceof JetNamedFunction) {
return JetTopLevelFunctionsFqnNameIndex.getInstance();
return JetTopLevelFunctionFqnNameIndex.getInstance();
}
if (decompiledDeclaration instanceof JetProperty) {
return JetTopLevelPropertiesFqnNameIndex.getInstance();
return JetTopLevelPropertyFqnNameIndex.getInstance();
}
throw new IllegalArgumentException("Neither function nor declaration: " + decompiledDeclaration.getClass().getName());
}
@@ -28,17 +28,17 @@ import java.util.Collection;
/**
* Stores package top level function (both extension and non-extension) full qualified names.
*/
public class JetTopLevelFunctionsFqnNameIndex extends StringStubIndexExtension<JetNamedFunction> {
private static final StubIndexKey<String, JetNamedFunction> KEY = KotlinIndexUtil.createIndexKey(JetTopLevelFunctionsFqnNameIndex.class);
public class JetTopLevelFunctionFqnNameIndex extends StringStubIndexExtension<JetNamedFunction> {
private static final StubIndexKey<String, JetNamedFunction> KEY = KotlinIndexUtil.createIndexKey(JetTopLevelFunctionFqnNameIndex.class);
private static final JetTopLevelFunctionsFqnNameIndex INSTANCE = new JetTopLevelFunctionsFqnNameIndex();
private static final JetTopLevelFunctionFqnNameIndex INSTANCE = new JetTopLevelFunctionFqnNameIndex();
@NotNull
public static JetTopLevelFunctionsFqnNameIndex getInstance() {
public static JetTopLevelFunctionFqnNameIndex getInstance() {
return INSTANCE;
}
private JetTopLevelFunctionsFqnNameIndex() {}
private JetTopLevelFunctionFqnNameIndex() {}
@NotNull
@Override
@@ -25,17 +25,17 @@ import org.jetbrains.jet.lang.psi.JetProperty;
import java.util.Collection;
public class JetTopLevelPropertiesFqnNameIndex extends StringStubIndexExtension<JetProperty> {
private static final StubIndexKey<String, JetProperty> KEY = KotlinIndexUtil.createIndexKey(JetTopLevelPropertiesFqnNameIndex.class);
public class JetTopLevelPropertyFqnNameIndex extends StringStubIndexExtension<JetProperty> {
private static final StubIndexKey<String, JetProperty> KEY = KotlinIndexUtil.createIndexKey(JetTopLevelPropertyFqnNameIndex.class);
private static final JetTopLevelPropertiesFqnNameIndex INSTANCE = new JetTopLevelPropertiesFqnNameIndex();
private static final JetTopLevelPropertyFqnNameIndex INSTANCE = new JetTopLevelPropertyFqnNameIndex();
@NotNull
public static JetTopLevelPropertiesFqnNameIndex getInstance() {
public static JetTopLevelPropertyFqnNameIndex getInstance() {
return INSTANCE;
}
private JetTopLevelPropertiesFqnNameIndex() {}
private JetTopLevelPropertyFqnNameIndex() {}
@NotNull
@Override
@@ -120,7 +120,7 @@ public class StubIndexServiceImpl implements StubIndexService {
// can have special fq name in case of syntactically incorrect function with no name
FqName fqName = stub.getFqName();
if (fqName != null) {
sink.occurrence(JetTopLevelFunctionsFqnNameIndex.getInstance().getKey(), fqName.asString());
sink.occurrence(JetTopLevelFunctionFqnNameIndex.getInstance().getKey(), fqName.asString());
sink.occurrence(JetTopLevelFunctionByPackageIndex.getInstance().getKey(), fqName.parent().asString());
}
}
@@ -151,7 +151,7 @@ public class StubIndexServiceImpl implements StubIndexService {
FqName fqName = stub.getFqName();
// can have special fq name in case of syntactically incorrect property with no name
if (fqName != null) {
sink.occurrence(JetTopLevelPropertiesFqnNameIndex.getInstance().getKey(), fqName.asString());
sink.occurrence(JetTopLevelPropertyFqnNameIndex.getInstance().getKey(), fqName.asString());
sink.occurrence(JetTopLevelPropertyByPackageIndex.getInstance().getKey(), fqName.parent().asString());
}
}
@@ -23,8 +23,6 @@ import org.jetbrains.jet.lang.resolve.lazy.declarations.PackageMemberDeclaration
import org.jetbrains.jet.lang.resolve.name.FqName
import org.jetbrains.jet.lang.resolve.name.Name
import org.jetbrains.jet.plugin.stubindex.JetFullClassNameIndex
import org.jetbrains.jet.plugin.stubindex.JetTopLevelFunctionsFqnNameIndex
import org.jetbrains.jet.plugin.stubindex.JetTopLevelPropertiesFqnNameIndex
import org.jetbrains.jet.plugin.stubindex.PackageIndexUtil
import org.jetbrains.jet.lang.resolve.lazy.data.JetClassLikeInfo
import org.jetbrains.jet.lang.resolve.lazy.data.JetClassInfoUtil
@@ -34,6 +32,9 @@ import org.jetbrains.jet.lang.resolve.scopes.DescriptorKindFilter
import org.jetbrains.jet.plugin.stubindex.JetTopLevelFunctionByPackageIndex
import com.intellij.psi.stubs.StringStubIndexExtension
import org.jetbrains.jet.plugin.stubindex.JetTopLevelPropertyByPackageIndex
import org.jetbrains.jet.plugin.stubindex.JetTopLevelPropertyFqnNameIndex
import org.jetbrains.jet.plugin.stubindex.JetTopLevelFunctionFqnNameIndex
import org.jetbrains.jet.plugin.stubindex.JetTopLevelClassByPackageIndex
public class StubBasedPackageMemberDeclarationProvider(
private val fqName: FqName,
@@ -49,7 +50,7 @@ public class StubBasedPackageMemberDeclarationProvider(
}
if (kindFilter.acceptsKinds(DescriptorKindFilter.CLASSIFIERS_MASK)) {
addFromIndex(org.jetbrains.jet.plugin.stubindex.JetTopLevelClassByPackageIndex.getInstance())
addFromIndex(JetTopLevelClassByPackageIndex.getInstance())
}
if (kindFilter.acceptsKinds(DescriptorKindFilter.FUNCTIONS_MASK)) {
@@ -69,11 +70,11 @@ public class StubBasedPackageMemberDeclarationProvider(
}
override fun getFunctionDeclarations(name: Name): Collection<JetNamedFunction> {
return JetTopLevelFunctionsFqnNameIndex.getInstance().get(childName(name), project, searchScope)
return JetTopLevelFunctionFqnNameIndex.getInstance().get(childName(name), project, searchScope)
}
override fun getPropertyDeclarations(name: Name): Collection<JetProperty> {
return JetTopLevelPropertiesFqnNameIndex.getInstance().get(childName(name), project, searchScope)
return JetTopLevelPropertyFqnNameIndex.getInstance().get(childName(name), project, searchScope)
}
override fun getAllDeclaredSubPackages(): Collection<FqName> {