diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/stubindex/IdeStubIndexService.java b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/stubindex/IdeStubIndexService.java index a9b36e4de9c..1fcc8264abf 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/stubindex/IdeStubIndexService.java +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/stubindex/IdeStubIndexService.java @@ -46,6 +46,7 @@ public class IdeStubIndexService extends StubIndexService { FqName facadeFqName = ((KotlinFileStubForIde) stub).getFacadeFqName(); if (facadeFqName != null) { sink.occurrence(JetFileFacadeFqNameIndex.INSTANCE.getKey(), facadeFqName.asString()); + sink.occurrence(JetFileFacadeShortNameIndex.INSTANCE.getKey(), facadeFqName.shortName().asString()); sink.occurrence(JetFileFacadeClassByPackageIndex.INSTANCE.getKey(), packageFqName.asString()); } diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/stubindex/JetFileFacadeShortNameIndex.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/stubindex/JetFileFacadeShortNameIndex.kt new file mode 100644 index 00000000000..597a86dacd3 --- /dev/null +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/stubindex/JetFileFacadeShortNameIndex.kt @@ -0,0 +1,36 @@ +/* + * Copyright 2010-2015 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.kotlin.idea.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.kotlin.psi.JetFile + +public class JetFileFacadeShortNameIndex private constructor() : StringStubIndexExtension() { + override fun getKey(): StubIndexKey = KEY + + override fun get(key: String, project: Project, scope: GlobalSearchScope) = + super.get(key, project, JetSourceFilterScope.kotlinSourcesAndLibraries(scope, project)) + + companion object { + private val KEY = KotlinIndexUtil.createIndexKey(JetFileFacadeShortNameIndex::class.java) + public val INSTANCE: JetFileFacadeShortNameIndex = JetFileFacadeShortNameIndex() + public @jvmStatic fun getInstance(): JetFileFacadeShortNameIndex = INSTANCE + } +} \ No newline at end of file diff --git a/idea/src/META-INF/plugin.xml b/idea/src/META-INF/plugin.xml index e4f8854cc3e..568f990e650 100644 --- a/idea/src/META-INF/plugin.xml +++ b/idea/src/META-INF/plugin.xml @@ -503,6 +503,7 @@ +