boolean (int offset, TextRange textRange, PsiElement element, int shiftOffset) { InjectedLanguageManager injectedLanguageManager = InjectedLanguageManager.getInstance(myProject); PsiLanguageInjectionHost injectionHost = injectedLanguageManager.getInjectionHost(element); if (injectionHost != null) { PsiElement nameIdentifier = getNameIdentifier(); PsiLanguageInjectionHost initialInjectedHost = nameIdentifier != null ? injectedLanguageManager.getInjectionHost(nameIdentifier) : null; if (initialInjectedHost != null && initialInjectedHost != injectionHost) { return false; } return injectedLanguageManager.injectedToHost(element, textRange).shiftRight(shiftOffset).containsOffset(offset); } return textRange.shiftRight(shiftOffset).containsOffset(offset); }