QuickEditHandler (@NotNull PsiFile injectedFile) { DocumentWindow documentWindow = InjectedLanguageUtil.getDocumentWindow(injectedFile); if (documentWindow == null) return null; Segment[] hostRanges = documentWindow.getHostRanges(); TextRange hostRange = TextRange.create(hostRanges[0].getStartOffset(), hostRanges[hostRanges.length - 1].getEndOffset()); for (Editor editor : EditorFactory.getInstance().getAllEditors()) { QuickEditHandler handler = editor.getUserData(QUICK_EDIT_HANDLER); if (handler != null && handler.tryReuse(injectedFile, hostRange)) return handler; } return null; }