mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 21:01:48 +07:00
[java-incomplete-model] Support known constructors with unresolved components
GitOrigin-RevId: 12f529c3eae1abba306c6318f189d08c877f9aa7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b6771f471e
commit
7b5b0bd4e4
+6
-4
@@ -41,10 +41,7 @@ import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.psi.util.*;
|
||||
import com.intellij.refactoring.util.RefactoringChangeUtil;
|
||||
import com.intellij.ui.ColorUtil;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.JavaPsiConstructorUtil;
|
||||
import com.intellij.util.ObjectUtils;
|
||||
import com.intellij.util.VisibilityUtil;
|
||||
import com.intellij.util.*;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.MostlySingularMultiMap;
|
||||
import com.intellij.util.ui.StartupUiUtil;
|
||||
@@ -1959,6 +1956,11 @@ public final class HighlightMethodUtil {
|
||||
}
|
||||
boolean reported = false;
|
||||
if (constructor == null) {
|
||||
if (IncompleteModelUtil.isIncompleteModel(list) &&
|
||||
ContainerUtil.exists(results, r -> r instanceof MethodCandidateInfo info && info.isPotentiallyCompatible() == ThreeState.YES) &&
|
||||
ContainerUtil.exists(list.getExpressions(), e -> IncompleteModelUtil.mayHaveUnknownTypeDueToPendingReference(e))) {
|
||||
return;
|
||||
}
|
||||
String name = aClass.getName();
|
||||
name += buildArgTypesList(list, true);
|
||||
String description = JavaErrorBundle.message("cannot.resolve.constructor", name);
|
||||
|
||||
+6
@@ -23,6 +23,12 @@ public class Simple {
|
||||
System.out.println(s.<error descr="Cannot resolve symbol 'field'">field</error>);
|
||||
}
|
||||
|
||||
void callKnownCtor(<info descr="Not resolved until the project is fully loaded">Cls</info> cls) {
|
||||
new IOException(cls);
|
||||
// No three-arg ctor anyway
|
||||
new IOException<error descr="Cannot resolve constructor 'IOException(Cls, Cls, Cls)'">(cls, cls, cls)</error>;
|
||||
}
|
||||
|
||||
void testImports(<info descr="Not resolved until the project is fully loaded">Cls</info>.<info descr="Not resolved until the project is fully loaded">UnusedClass</info> inner) {
|
||||
<info descr="null">var</info> x = <error descr="Cannot resolve symbol 'Value'">Value</error>;
|
||||
System.out.println(<info descr="Not resolved until the project is fully loaded">UsedInClassObject</info>.class);
|
||||
|
||||
Reference in New Issue
Block a user