mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-184821 Parameter info accesses PSI invalidated during completion
This commit is contained in:
+5
-7
@@ -247,15 +247,13 @@ public class MethodParameterInfoHandler implements ParameterInfoHandlerWithTabAc
|
||||
for (int i = 0; i < candidates.length; i++) {
|
||||
CandidateInfo candidate = (CandidateInfo)candidates[i];
|
||||
PsiMethod method = (PsiMethod)candidate.getElement();
|
||||
if (!method.isValid()) continue;
|
||||
PsiSubstitutor substitutor = getCandidateInfoSubstitutor(o, candidate, method == realResolve);
|
||||
assert substitutor != null;
|
||||
|
||||
if (!method.isValid() || !substitutor.isValid()) {
|
||||
// this may sometimes happen e,g, when editing method call in field initializer candidates in the same file get invalidated
|
||||
if (!method.isValid() || !candidate.getSubstitutor().isValid()) {
|
||||
// this may sometimes happen e,g, when editing method call in field initializer candidates in the same file get invalidated
|
||||
context.setUIComponentEnabled(i, false);
|
||||
continue;
|
||||
}
|
||||
PsiSubstitutor substitutor = getCandidateInfoSubstitutor(o, candidate, method == realResolve);
|
||||
assert substitutor != null;
|
||||
|
||||
PsiParameter[] parms = method.getParameterList().getParameters();
|
||||
boolean enabled = true;
|
||||
@@ -728,7 +726,7 @@ public class MethodParameterInfoHandler implements ParameterInfoHandlerWithTabAc
|
||||
if (p instanceof CandidateInfo) {
|
||||
CandidateInfo info = (CandidateInfo)p;
|
||||
PsiMethod method = (PsiMethod)info.getElement();
|
||||
if (!method.isValid()) {
|
||||
if (!method.isValid() || !info.getSubstitutor().isValid()) {
|
||||
context.setUIComponentEnabled(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user