mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
[r=cdr] fix regression: empty default log message text when add breakpoint action with shift-click
This commit is contained in:
@@ -18,6 +18,7 @@ package com.intellij.debugger.impl;
|
||||
import com.intellij.debugger.engine.evaluation.TextWithImports;
|
||||
import com.intellij.lang.LanguageExtension;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Provides text in the editor for Evaluate expression action
|
||||
@@ -26,5 +27,6 @@ import com.intellij.psi.PsiElement;
|
||||
public interface EditorTextProvider {
|
||||
LanguageExtension<EditorTextProvider> EP = new LanguageExtension<EditorTextProvider>("com.intellij.debuggerEditorTextProvider");
|
||||
|
||||
@Nullable
|
||||
TextWithImports getEditorText(PsiElement elementAtCaret);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
public class JavaEditorTextProviderImpl implements EditorTextProvider {
|
||||
@Override
|
||||
public TextWithImports getEditorText(PsiElement elementAtCaret) {
|
||||
String result = "";
|
||||
String result = null;
|
||||
PsiElement element = findExpression(elementAtCaret);
|
||||
if (element != null) {
|
||||
if (element instanceof PsiReferenceExpression) {
|
||||
@@ -43,11 +43,11 @@ public class JavaEditorTextProviderImpl implements EditorTextProvider {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (result.length() == 0) {
|
||||
if (result == null) {
|
||||
result = element.getText();
|
||||
}
|
||||
}
|
||||
return new TextWithImportsImpl(CodeFragmentKind.EXPRESSION, result);
|
||||
return result != null? new TextWithImportsImpl(CodeFragmentKind.EXPRESSION, result) : null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
Reference in New Issue
Block a user