void () { if (injectionHighlighter != null) return; synchronized (this) { if (injectionHighlighter != null) return; PsiFile file = myPopup.myFile; Editor editor = myPopup.myEditor; boolean committed = PsiDocumentManager.getInstance(file.getProject()).isCommitted(editor.getDocument()); injectedFile = committed ? InjectedLanguageUtil.findInjectedPsiNoCommit(file, editor.getCaretModel().getOffset()) : null; injectedEditor = InjectedLanguageUtil.getInjectedEditorForInjectedFile(editor, injectedFile); highlighter = new ScopeHighlighter(editor); injectionHighlighter = new ScopeHighlighter(injectedEditor); } }