mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
debugger editor: don't commit document, take text from it directly
This commit is contained in:
@@ -41,7 +41,6 @@ import java.util.Collections;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class JavaDebuggerEditorsProvider extends XDebuggerEditorsProviderBase {
|
||||
@NotNull
|
||||
@Override
|
||||
public FileType getFileType() {
|
||||
return JavaFileType.INSTANCE;
|
||||
@@ -70,10 +69,9 @@ public class JavaDebuggerEditorsProvider extends XDebuggerEditorsProviderBase {
|
||||
@NotNull
|
||||
@Override
|
||||
public XExpression createExpression(@NotNull Project project, @NotNull Document document, @Nullable Language language, @NotNull EvaluationMode mode) {
|
||||
PsiDocumentManager.getInstance(project).commitDocument(document);
|
||||
PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(document);
|
||||
if (psiFile != null) {
|
||||
return new XExpressionImpl(psiFile.getText(), language, StringUtil.nullize(((JavaCodeFragment)psiFile).importsToString()), mode);
|
||||
return new XExpressionImpl(document.getText(), language, StringUtil.nullize(((JavaCodeFragment)psiFile).importsToString()), mode);
|
||||
}
|
||||
return super.createExpression(project, document, language, mode);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user