void (String error, PsiFile psiFile, @NotNull String externalName) { int offset = psiFile.getText().indexOf(XmlUtil.escape(externalName)); int line = PsiDocumentManager.getInstance(psiFile.getProject()).getDocument(psiFile).getLineNumber(offset); fail(error + "\nFile: " + psiFile.getVirtualFile().getPath() + ":" + (line+1) + " (offset: "+offset+")"); }