int (@NotNull Usage usage) { if (!(usage instanceof UsageInfo2UsageAdapter)) return -1; PsiElement element = ((UsageInfo2UsageAdapter)usage).getElement(); if (element == null) return -1; InjectedLanguageManager injectionManager = InjectedLanguageManager.getInstance(element.getProject()); if (injectionManager.isInjectedFragment(element.getContainingFile())) { return injectionManager.injectedToHost(element, element.getTextRange().getStartOffset()); } return element.getTextRange().getStartOffset(); }