mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't commit documents in TargetElementUtil called during action update via getData
This commit is contained in:
@@ -112,6 +112,7 @@ public class ChangeSignatureGestureTest extends LightCodeInsightFixtureTestCase
|
||||
public void testAddParamChangeReturnType() {
|
||||
doTest(() -> {
|
||||
myFixture.type("int param");
|
||||
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
|
||||
CaretModel model = myFixture.getEditor().getCaretModel();
|
||||
PsiElement element = myFixture.getElementAtCaret();
|
||||
PsiMethod method = PsiTreeUtil.getParentOfType(element, PsiMethod.class, false);
|
||||
|
||||
@@ -140,18 +140,7 @@ public class TargetElementUtil extends TargetElementUtilBase {
|
||||
|
||||
private static PsiFile getFile(Project project, Document document) {
|
||||
PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(document);
|
||||
|
||||
if (file != null) {
|
||||
if (ApplicationManager.getApplication().isDispatchThread()) {
|
||||
PsiDocumentManager.getInstance(project).commitAllDocuments();
|
||||
}
|
||||
|
||||
if (file instanceof PsiCompiledFile) {
|
||||
file = ((PsiCompiledFile)file).getDecompiledPsiFile();
|
||||
}
|
||||
}
|
||||
|
||||
return file;
|
||||
return file instanceof PsiCompiledFile ? ((PsiCompiledFile)file).getDecompiledPsiFile() : file;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user