mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-218906 Compiling evaluator does not work for decompiled files
GitOrigin-RevId: 868d4b77366e5d80b77fe077b6dd09dd8bfc04fe
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f96ca1b495
commit
18831fb5b5
+5
-8
@@ -148,9 +148,10 @@ public class CompilingEvaluatorImpl extends CompilingEvaluator {
|
||||
try {
|
||||
XDebugSession currentSession = XDebuggerManager.getInstance(project).getCurrentSession();
|
||||
JavaSdkVersion javaVersion = getJavaVersion(currentSession);
|
||||
PsiElement physicalContext = findPhysicalContext(psiContext);
|
||||
ExtractLightMethodObjectHandler.ExtractedData data = ExtractLightMethodObjectHandler.extractLightMethodObject(
|
||||
project,
|
||||
findPhysicalContext(psiContext),
|
||||
physicalContext != null ? physicalContext : psiContext,
|
||||
fragmentFactory.apply(psiContext),
|
||||
getGeneratedClassName(),
|
||||
javaVersion);
|
||||
@@ -167,14 +168,10 @@ public class CompilingEvaluatorImpl extends CompilingEvaluator {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Nullable
|
||||
private static PsiElement findPhysicalContext(@NotNull PsiElement element) {
|
||||
while (!element.isPhysical()) {
|
||||
PsiElement context = element.getContext();
|
||||
if (context == null) {
|
||||
break;
|
||||
}
|
||||
element = context;
|
||||
while (element != null && !element.isPhysical()) {
|
||||
element = element.getContext();
|
||||
}
|
||||
return element;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user