[FIR] KT-57207 Avoid FirJavaFacade.knownClassNamesInPackage in the IDE
- `FirJavaFacade.knownClassNamesInPackage` cannot be computed in the IDE using the current strategy because there are multiple finders and there is no `CliFinder`. However, the cache was still used, which caused it to be filled with `null` values and additionally caused worse performance in `JavaSymbolProvider` due to hash map accesses via `hasTopLevelClassOf`. - Rewriting the strategy is non-trivial as additional indices are needed on the IDE side. See KTIJ-24642.
This commit is contained in:
committed by
Space Team
parent
624164e183
commit
288606868e
+6
-1
@@ -220,13 +220,18 @@ public class KotlinJavaPsiFacade implements Disposable {
|
||||
|
||||
KotlinPsiElementFinderWrapper[] finders = finders();
|
||||
|
||||
if (finders.length == 1 && finders[0] instanceof CliFinder) {
|
||||
if (canComputeKnownClassNamesInPackage()) {
|
||||
return ((CliFinder) finders[0]).knownClassNamesInPackage(packageFqName);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public Boolean canComputeKnownClassNamesInPackage() {
|
||||
KotlinPsiElementFinderWrapper[] finders = finders();
|
||||
return finders.length == 1 && finders[0] instanceof CliFinder;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private PsiClass[] findClassesInDumbMode(@NotNull String qualifiedName, @NotNull GlobalSearchScope scope) {
|
||||
String packageName = StringUtil.getPackageName(qualifiedName);
|
||||
|
||||
Reference in New Issue
Block a user