mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
IDEA-74190 Debugger:Evaluate: Code Fragment mode parsing is broken
This commit is contained in:
@@ -121,13 +121,17 @@ public class EvaluateActionHandler extends DebuggerActionHandler {
|
||||
defaultExpression = new TextWithImportsImpl(CodeFragmentKind.EXPRESSION, "");
|
||||
}
|
||||
|
||||
CodeFragmentKind kind = DebuggerSettings.EVALUATE_FRAGMENT.equals(dialogType) ? CodeFragmentKind.CODE_BLOCK : CodeFragmentKind.EXPRESSION;
|
||||
|
||||
DebuggerSettings.getInstance().EVALUATION_DIALOG_TYPE = dialogType;
|
||||
TextWithImportsImpl text = new TextWithImportsImpl(kind, defaultExpression.getText(), defaultExpression.getImports(), defaultExpression.getFileType());
|
||||
|
||||
final DialogWrapper dialog;
|
||||
if(DebuggerSettings.EVALUATE_FRAGMENT.equals(dialogType)) {
|
||||
dialog = new StatementEvaluationDialog(project, defaultExpression);
|
||||
dialog = new StatementEvaluationDialog(project, text);
|
||||
}
|
||||
else {
|
||||
dialog = new ExpressionEvaluationDialog(project, defaultExpression);
|
||||
dialog = new ExpressionEvaluationDialog(project, text);
|
||||
}
|
||||
|
||||
dialog.show();
|
||||
|
||||
+2
-1
@@ -27,6 +27,7 @@ import com.intellij.psi.PsiExpression;
|
||||
import com.intellij.psi.PsiExpressionCodeFragment;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public final class TextWithImportsImpl implements TextWithImports{
|
||||
|
||||
@@ -52,7 +53,7 @@ public final class TextWithImportsImpl implements TextWithImports{
|
||||
}
|
||||
}
|
||||
|
||||
public TextWithImportsImpl (CodeFragmentKind kind, @NotNull String text, @NotNull String imports, @NotNull FileType fileType) {
|
||||
public TextWithImportsImpl (CodeFragmentKind kind, @NotNull String text, @NotNull String imports, @Nullable FileType fileType) {
|
||||
myKind = kind;
|
||||
myText = text;
|
||||
myImports = imports;
|
||||
|
||||
Reference in New Issue
Block a user