mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
RIDER-99712 fix debugger documents by allowing to use LanguageTextField.createDocument from NonBlockingReadAction
Changes from 5eff26f55a72870872e71c8f8f7416fc55a93d85 moved document creation logic for debugger evaluation fields from EDT to NonBlockingReadAction. Current change allows to avoid running write action which isn't allowed from NonBlockingReadAction and initialize text during document creation. GitOrigin-RevId: 799956842791ac99bc54969820a3b8b6b29bc8a3
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8bb4d145d6
commit
f5691cec11
@@ -95,7 +95,7 @@ public class LanguageTextField extends EditorTextField {
|
||||
final PsiFileFactory factory = PsiFileFactory.getInstance(notNullProject);
|
||||
|
||||
final long stamp = LocalTimeCounter.currentTime();
|
||||
final PsiFile psiFile = factory.createFileFromText("Dummy." + fileType.getDefaultExtension(), fileType, "", stamp, true, false);
|
||||
final PsiFile psiFile = factory.createFileFromText("Dummy." + fileType.getDefaultExtension(), fileType, value, stamp, true, false);
|
||||
documentCreator.customizePsiFile(psiFile);
|
||||
|
||||
// No need to guess project in getDocument - we already know it
|
||||
@@ -104,12 +104,6 @@ public class LanguageTextField extends EditorTextField {
|
||||
document = ReadAction.compute(() -> PsiDocumentManager.getInstance(notNullProject).getDocument(psiFile));
|
||||
}
|
||||
assert document != null;
|
||||
|
||||
if (!value.isEmpty()) {
|
||||
ApplicationManager.getApplication().runWriteAction(() -> {
|
||||
document.setText(value); // do not put initial value into backing LightVirtualFile.contentsToByteArray
|
||||
});
|
||||
}
|
||||
return document;
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user