From 07935c837aa732357f2170bab40364f8adb82f46 Mon Sep 17 00:00:00 2001 From: "Pavel V. Talanov" Date: Wed, 20 Aug 2014 17:39:45 +0400 Subject: [PATCH] Drop JetAllPackagesIndex --- .../plugin/stubindex/JetAllPackagesIndex.java | 57 ------------------- .../stubindex/StubIndexServiceImpl.java | 8 --- idea/src/META-INF/plugin.xml | 1 - .../debugger/PositionManagerTestCase.java | 3 - 4 files changed, 69 deletions(-) delete mode 100644 idea/idea-analysis/src/org/jetbrains/jet/plugin/stubindex/JetAllPackagesIndex.java diff --git a/idea/idea-analysis/src/org/jetbrains/jet/plugin/stubindex/JetAllPackagesIndex.java b/idea/idea-analysis/src/org/jetbrains/jet/plugin/stubindex/JetAllPackagesIndex.java deleted file mode 100644 index 2da344fa3d1..00000000000 --- a/idea/idea-analysis/src/org/jetbrains/jet/plugin/stubindex/JetAllPackagesIndex.java +++ /dev/null @@ -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 { - private static final StubIndexKey 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 getKey() { - return KEY; - } - - @NotNull - @Override - public Collection get(String fqName, Project project, @NotNull GlobalSearchScope scope) { - return super.get(fqName, project, JetSourceFilterScope.kotlinSourcesAndLibraries(scope, project)); - } -} diff --git a/idea/idea-analysis/src/org/jetbrains/jet/plugin/stubindex/StubIndexServiceImpl.java b/idea/idea-analysis/src/org/jetbrains/jet/plugin/stubindex/StubIndexServiceImpl.java index d1a777b4a90..aabf3d520ce 100644 --- a/idea/idea-analysis/src/org/jetbrains/jet/plugin/stubindex/StubIndexServiceImpl.java +++ b/idea/idea-analysis/src/org/jetbrains/jet/plugin/stubindex/StubIndexServiceImpl.java @@ -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 diff --git a/idea/src/META-INF/plugin.xml b/idea/src/META-INF/plugin.xml index 4c4fdefca56..15026ca1ce4 100644 --- a/idea/src/META-INF/plugin.xml +++ b/idea/src/META-INF/plugin.xml @@ -361,7 +361,6 @@ - diff --git a/idea/tests/org/jetbrains/jet/plugin/debugger/PositionManagerTestCase.java b/idea/tests/org/jetbrains/jet/plugin/debugger/PositionManagerTestCase.java index 6acbdbb93d1..69f91edc14f 100644 --- a/idea/tests/org/jetbrains/jet/plugin/debugger/PositionManagerTestCase.java +++ b/idea/tests/org/jetbrains/jet/plugin/debugger/PositionManagerTestCase.java @@ -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.*;