Skip to content

Commit b798643

Browse files
author
Yaroslav Lepenkin
committed
run inside write action
1 parent 08c1a0b commit b798643

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/com/jetbrains/idear/asr/ASRServiceImpl.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,15 +273,17 @@ private void applyAction(String c) {
273273
if (r.isMatching(c)) {
274274
DataManager.getInstance()
275275
.getDataContextFromFocus()
276-
.doWhenDone((Consumer<DataContext>) dataContext -> ApplicationManager
277-
.getApplication()
278-
.runWriteAction(() -> {
279-
r.getActionInfo(c, dataContext);
280-
}));
276+
.doWhenDone((Consumer<DataContext>) dataContext -> run(r, c, dataContext));
281277
}
282278
}
283279
}
284280

281+
private void run(SurroundWithNoNullCheckRecognizer rec, String c, DataContext dataContext) {
282+
ApplicationManager.getApplication().runWriteAction(() -> {
283+
rec.getActionInfo(c, dataContext);
284+
});
285+
}
286+
285287
private void tellJoke() {
286288
ServiceManager
287289
.getService(TTSService.class)

0 commit comments

Comments
 (0)