void () { myValuePattern = new LanguageTextField(RegExpLanguage.INSTANCE, myProject, myOrigInjection.getValuePattern(), new LanguageTextField.SimpleDocumentCreator() { @Override public void customizePsiFile(PsiFile psiFile) { psiFile.putCopyableUserData(ValueRegExpAnnotator.KEY, Boolean.TRUE); } }); // don't even bother to look up the language when xpath-evaluation isn't possible final XPathSupportProxy proxy = XPathSupportProxy.getInstance(); myXPathCondition = new LanguageTextField(proxy != null ? InjectedLanguage.findLanguageById("XPath") : null, myProject, myOrigInjection.getXPathCondition(), new LanguageTextField.SimpleDocumentCreator() { @Override public void customizePsiFile(PsiFile psiFile) { // important to get proper validation & completion for Jaxen's built-in and PSI functions // like lower-case(), file-type(), file-ext(), file-name(), etc. if (proxy != null) { proxy.attachContext(psiFile); } } }); }