mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-130195 Code fragments in debugger can no longer evaluate Grails domain methods
This commit is contained in:
+3
@@ -52,6 +52,9 @@ public class CodeFragmentInputComponent extends EvaluationInputComponent {
|
||||
editorPanel.add(ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, group, false).getComponent(), BorderLayout.EAST);
|
||||
myMainPanel.add(new JLabel(XDebuggerBundle.message("xdebugger.label.text.code.fragment")), BorderLayout.NORTH);
|
||||
myMainPanel.add(editorPanel, BorderLayout.CENTER);
|
||||
if (statements != null) {
|
||||
myMultilineEditor.setExpression(statements);
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -98,9 +98,10 @@ public abstract class XDebuggerEditorBase {
|
||||
private ListPopup createLanguagePopup() {
|
||||
DefaultActionGroup actions = new DefaultActionGroup();
|
||||
for (final Language language : getEditorsProvider().getSupportedLanguages(myProject, mySourcePosition)) {
|
||||
//noinspection ConstantConditions
|
||||
actions.add(new AnAction(language.getDisplayName(), null, language.getAssociatedFileType().getIcon()) {
|
||||
@Override
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
public void actionPerformed(@NotNull AnActionEvent e) {
|
||||
XExpression currentExpression = getExpression();
|
||||
setExpression(new XExpressionImpl(currentExpression.getExpression(), language, currentExpression.getCustomInfo()));
|
||||
IdeFocusManager.getInstance(getProject()).requestFocus(getComponent(), true);
|
||||
@@ -127,7 +128,7 @@ public abstract class XDebuggerEditorBase {
|
||||
public void setSourcePosition(@Nullable XSourcePosition sourcePosition) {
|
||||
if (mySourcePosition != sourcePosition) {
|
||||
mySourcePosition = sourcePosition;
|
||||
setExpression(getExpression(), false);
|
||||
setExpression(getExpression());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,16 +145,9 @@ public abstract class XDebuggerEditorBase {
|
||||
protected abstract void doSetText(XExpression text);
|
||||
|
||||
public void setExpression(@Nullable XExpression text) {
|
||||
setExpression(text, true);
|
||||
}
|
||||
|
||||
private void setExpression(@Nullable XExpression text, boolean saveInHistory) {
|
||||
if (text == null) {
|
||||
text = getMode() == EvaluationMode.EXPRESSION ? XExpressionImpl.EMPTY_EXPRESSION : XExpressionImpl.EMPTY_CODE_FRAGMENT;
|
||||
}
|
||||
if (saveInHistory) {
|
||||
saveTextInHistory(text);
|
||||
}
|
||||
Language language = text.getLanguage();
|
||||
if (language == null) {
|
||||
if (mySourcePosition != null) {
|
||||
|
||||
+9
-2
@@ -15,8 +15,10 @@
|
||||
*/
|
||||
package com.intellij.xdebugger.impl.ui;
|
||||
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.ex.EditorEx;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.ui.EditorTextField;
|
||||
import com.intellij.xdebugger.XExpression;
|
||||
@@ -34,6 +36,7 @@ import javax.swing.*;
|
||||
* @author nik
|
||||
*/
|
||||
public class XDebuggerMultilineEditor extends XDebuggerEditorBase {
|
||||
private final JComponent myComponent;
|
||||
private final EditorTextField myEditorTextField;
|
||||
private XExpression myExpression;
|
||||
|
||||
@@ -57,16 +60,20 @@ public class XDebuggerMultilineEditor extends XDebuggerEditorBase {
|
||||
}
|
||||
};
|
||||
myEditorTextField.setFontInheritedFromLAF(false);
|
||||
myComponent = addChooseFactoryLabel(myEditorTextField, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent getComponent() {
|
||||
return myEditorTextField;
|
||||
return myComponent;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doSetText(XExpression text) {
|
||||
myEditorTextField.setText(text.getExpression());
|
||||
myExpression = text;
|
||||
Language language = text.getLanguage();
|
||||
FileType fileType = language != null ? language.getAssociatedFileType() : getEditorsProvider().getFileType();
|
||||
myEditorTextField.setNewDocumentAndFileType(fileType, createDocument(text));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user