Drop JetAllPackagesIndex

This commit is contained in:
Pavel V. Talanov
2014-08-20 17:39:45 +04:00
parent 5acd23e880
commit 07935c837a
4 changed files with 0 additions and 69 deletions
@@ -1,57 +0,0 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.jet.plugin.stubindex;
import com.intellij.openapi.project.Project;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.stubs.StringStubIndexExtension;
import com.intellij.psi.stubs.StubIndexKey;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetFile;
import java.util.Collection;
/**
* Contains all packages, i.e. if a file declares
* package a.b.c
*
* Three packages "a", "a.b" and "a.b.c" will be registered in this index
*/
public class JetAllPackagesIndex extends StringStubIndexExtension<JetFile> {
private static final StubIndexKey<String, JetFile> KEY = KotlinIndexUtil.createIndexKey(JetAllPackagesIndex.class);
private static final JetAllPackagesIndex ourInstance = new JetAllPackagesIndex();
@NotNull
public static JetAllPackagesIndex getInstance() {
return ourInstance;
}
private JetAllPackagesIndex() {}
@NotNull
@Override
public StubIndexKey<String, JetFile> getKey() {
return KEY;
}
@NotNull
@Override
public Collection<JetFile> get(String fqName, Project project, @NotNull GlobalSearchScope scope) {
return super.get(fqName, project, JetSourceFilterScope.kotlinSourcesAndLibraries(scope, project));
}
}
@@ -32,14 +32,6 @@ public class StubIndexServiceImpl implements StubIndexService {
FqName packageFqName = stub.getPackageFqName();
sink.occurrence(JetExactPackagesIndex.getInstance().getKey(), packageFqName.asString());
while (true) {
sink.occurrence(JetAllPackagesIndex.getInstance().getKey(), packageFqName.asString());
if (packageFqName.isRoot()) {
return;
}
packageFqName = packageFqName.parent();
}
}
@Override
-1
View File
@@ -361,7 +361,6 @@
<java.shortNamesCache implementation="org.jetbrains.jet.plugin.caches.JetShortNamesCache"/>
<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.JetExactPackagesIndex"/>
<stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetClassByPackageIndex"/>
<stubIndex implementation="org.jetbrains.jet.plugin.stubindex.JetClassShortNameIndex"/>
@@ -29,7 +29,6 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.refactoring.MultiFileTestCase;
import com.intellij.testFramework.PsiTestUtil;
import com.sun.jdi.Location;
@@ -40,9 +39,7 @@ import org.jetbrains.jet.OutputFileCollection;
import org.jetbrains.jet.codegen.GenerationUtils;
import org.jetbrains.jet.codegen.state.GenerationState;
import org.jetbrains.jet.lang.psi.JetFile;
import org.jetbrains.jet.lang.resolve.name.FqName;
import org.jetbrains.jet.plugin.project.PluginJetFilesProvider;
import org.jetbrains.jet.plugin.stubindex.JetAllPackagesIndex;
import org.jetbrains.jet.utils.UtilsPackage;
import java.util.*;