mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
require write action to commit non-physical documents
it was allowed to omit write action to prevent write-unsafe context warnings from completion & live templates, but those have been fixed in another way
This commit is contained in:
@@ -696,7 +696,7 @@ public class DocumentCommitThread implements Runnable, Disposable, DocumentCommi
|
||||
return false; // optimistic locking failed
|
||||
}
|
||||
|
||||
if (file.isPhysical() && !ApplicationManager.getApplication().isWriteAccessAllowed()) {
|
||||
if (!ApplicationManager.getApplication().isWriteAccessAllowed()) {
|
||||
VirtualFile vFile = viewProvider.getVirtualFile();
|
||||
LOG.error("Write action expected" +
|
||||
"; document=" + document1 +
|
||||
|
||||
@@ -454,12 +454,7 @@ public abstract class PsiDocumentManagerBase extends PsiDocumentManager implemen
|
||||
assert !isInUncommittedSet(document) : "Document :" + document;
|
||||
};
|
||||
|
||||
if (AbstractFileViewProvider.isFreeThreaded(psiFile.getViewProvider())) {
|
||||
runnable.run();
|
||||
}
|
||||
else {
|
||||
ApplicationManager.getApplication().runWriteAction(runnable);
|
||||
}
|
||||
ApplicationManager.getApplication().runWriteAction(runnable);
|
||||
}
|
||||
|
||||
// true if the PSI is being modified and events being sent
|
||||
|
||||
Reference in New Issue
Block a user