private @Nullable XmlExtension getXmlExtension() {
      Document document = myEditor.getDocument();
      VirtualFile file = FileDocumentManager.getInstance().getFile(document);
      PsiFile psiFile = file != null && file.isValid() ? PsiManager.getInstance(myProject).findFile(file) : null;
      if (psiFile == null) {
        return null;
      }
      return XmlExtension.getExtension(psiFile);
    }
private @Nullable XmlExtension getXmlExtension()