private void setLocation(PsiElement text) {
    final PsiFile psiFile = text.getContainingFile();
    final Document document = PsiDocumentManager.getInstance(text.getProject()).getDocument(psiFile);
    if (document == null) {
      return;
    }
    final VirtualFile virtualFile = psiFile.getVirtualFile();
    if (virtualFile == null) {
      return;
    }

    final Locator2Impl locator = new Locator2Impl();
    locator.setSystemId(VfsUtilCore.fixIDEAUrl(virtualFile.getUrl()));

    final int offset = text.getTextRange().getEndOffset();
    final int lineNumber = document.getLineNumber(offset);

    locator.setLineNumber(lineNumber + 1);
    locator.setColumnNumber(1 + offset - document.getLineStartOffset(lineNumber));

    myHandler.setDocumentLocator(locator);
  }
private void setLocation(PsiElement text)