Revert obsolete code introduced in KT-12402
The classes being filtered have been renamed months ago. The change committed in KT-12402 is no longer relevant as the underlying issue has been fixed.
This commit is contained in:
-19
@@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2016 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.resolve.jvm
|
|
||||||
|
|
||||||
interface GlobalSearchScopeWithModuleSources
|
|
||||||
+1
-29
@@ -44,7 +44,6 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
import org.jetbrains.kotlin.asJava.KtLightClassMarker;
|
import org.jetbrains.kotlin.asJava.KtLightClassMarker;
|
||||||
import org.jetbrains.kotlin.idea.KotlinLanguage;
|
import org.jetbrains.kotlin.idea.KotlinLanguage;
|
||||||
import org.jetbrains.kotlin.load.java.JavaClassFinder;
|
import org.jetbrains.kotlin.load.java.JavaClassFinder;
|
||||||
import org.jetbrains.kotlin.load.java.JavaClassFinderImpl;
|
|
||||||
import org.jetbrains.kotlin.load.java.structure.JavaClass;
|
import org.jetbrains.kotlin.load.java.structure.JavaClass;
|
||||||
import org.jetbrains.kotlin.load.java.structure.impl.JavaClassImpl;
|
import org.jetbrains.kotlin.load.java.structure.impl.JavaClassImpl;
|
||||||
import org.jetbrains.kotlin.name.ClassId;
|
import org.jetbrains.kotlin.name.ClassId;
|
||||||
@@ -126,30 +125,7 @@ public class KotlinJavaPsiFacade {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
PsiClass aClass = finder.findClass(qualifiedName, scope);
|
PsiClass aClass = finder.findClass(qualifiedName, scope);
|
||||||
if (aClass != null) {
|
if (aClass != null) return createJavaClass(classId, aClass);
|
||||||
if (scope instanceof JavaClassFinderImpl.FilterOutKotlinSourceFilesScope) {
|
|
||||||
GlobalSearchScope baseScope = ((JavaClassFinderImpl.FilterOutKotlinSourceFilesScope) scope).getBase();
|
|
||||||
boolean isSourcesScope = baseScope instanceof GlobalSearchScopeWithModuleSources;
|
|
||||||
|
|
||||||
if (!isSourcesScope) {
|
|
||||||
Object originalFinder = (finder instanceof KotlinPsiElementFinderWrapperImpl)
|
|
||||||
? ((KotlinPsiElementFinderWrapperImpl) finder).getOriginal()
|
|
||||||
: finder;
|
|
||||||
|
|
||||||
// Temporary fix for #KT-12402
|
|
||||||
boolean isAndroidDataBindingClassWriter = originalFinder.getClass().getName()
|
|
||||||
.equals("com.android.tools.idea.databinding.DataBindingClassFinder");
|
|
||||||
boolean isAndroidDataBindingComponentClassWriter = originalFinder.getClass().getName()
|
|
||||||
.equals("com.android.tools.idea.databinding.DataBindingComponentClassFinder");
|
|
||||||
|
|
||||||
if (isAndroidDataBindingClassWriter || isAndroidDataBindingComponentClassWriter) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return createJavaClass(classId, aClass);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -341,10 +317,6 @@ public class KotlinJavaPsiFacade {
|
|||||||
this.finder = finder;
|
this.finder = finder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PsiElementFinder getOriginal() {
|
|
||||||
return finder;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PsiClass findClass(@NotNull String qualifiedName, @NotNull GlobalSearchScope scope) {
|
public PsiClass findClass(@NotNull String qualifiedName, @NotNull GlobalSearchScope scope) {
|
||||||
return finder.findClass(qualifiedName, scope);
|
return finder.findClass(qualifiedName, scope);
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ import org.jetbrains.kotlin.idea.util.rootManager
|
|||||||
import org.jetbrains.kotlin.name.Name
|
import org.jetbrains.kotlin.name.Name
|
||||||
import org.jetbrains.kotlin.platform.idePlatformKind
|
import org.jetbrains.kotlin.platform.idePlatformKind
|
||||||
import org.jetbrains.kotlin.resolve.TargetPlatform
|
import org.jetbrains.kotlin.resolve.TargetPlatform
|
||||||
import org.jetbrains.kotlin.resolve.jvm.GlobalSearchScopeWithModuleSources
|
|
||||||
import org.jetbrains.kotlin.utils.addIfNotNull
|
import org.jetbrains.kotlin.utils.addIfNotNull
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
@@ -217,7 +216,7 @@ private fun Module.hasTestRoots() = hasRootsOfType(JavaSourceRootType.TEST_SOURC
|
|||||||
private fun Module.hasRootsOfType(sourceRootType: JpsModuleSourceRootType<*>): Boolean =
|
private fun Module.hasRootsOfType(sourceRootType: JpsModuleSourceRootType<*>): Boolean =
|
||||||
rootManager.contentEntries.any { it.getSourceFolders(sourceRootType).isNotEmpty() }
|
rootManager.contentEntries.any { it.getSourceFolders(sourceRootType).isNotEmpty() }
|
||||||
|
|
||||||
private abstract class ModuleSourceScope(val module: Module) : GlobalSearchScope(module.project), GlobalSearchScopeWithModuleSources {
|
private abstract class ModuleSourceScope(val module: Module) : GlobalSearchScope(module.project) {
|
||||||
override fun compare(file1: VirtualFile, file2: VirtualFile) = 0
|
override fun compare(file1: VirtualFile, file2: VirtualFile) = 0
|
||||||
override fun isSearchInModuleContent(aModule: Module) = aModule == module
|
override fun isSearchInModuleContent(aModule: Module) = aModule == module
|
||||||
override fun isSearchInLibraries() = false
|
override fun isSearchInLibraries() = false
|
||||||
|
|||||||
Reference in New Issue
Block a user