@Override
    public CachedValueProvider.Result<XsltChecker.LanguageLevel> compute(PsiFile psiFile) {
      if (!(psiFile instanceof XmlFile xmlFile)) {
        return CachedValueProvider.Result.create(XsltChecker.LanguageLevel.NONE, PsiModificationTracker.MODIFICATION_COUNT);
      }

      if (psiFile instanceof PsiFileEx) {
        if (((PsiFileEx)psiFile).isContentsLoaded()) {
          final XmlDocument doc = xmlFile.getDocument();
          if (doc != null) {
            final XmlTag rootTag = doc.getRootTag();
            if (rootTag != null) {
              XmlAttribute v;
              XsltChecker.LanguageLevel level;
              if (isXsltRootTag(rootTag)) {
                v = rootTag.getAttribute("version");
                level = v != null ? XsltChecker.getLanguageLevel(v.getValue()) : XsltChecker.LanguageLevel.NONE;
              }
              else {
                v = rootTag.getAttribute("version", XSLT_NS);
                level = v != null ? XsltChecker.getLanguageLevel(v.getValue()) : XsltChecker.LanguageLevel.NONE;
              }
              return CachedValueProvider.Result.create(level, rootTag);
            }
          }
        }
      }

      final XsltChecker xsltChecker = new XsltChecker();
      CharSequenceReader reader = new CharSequenceReader(psiFile.getViewProvider().getContents());
      NanoXmlUtil.parse(reader, xsltChecker);
      return CachedValueProvider.Result.create(xsltChecker.getLanguageLevel(), psiFile);
    }
@Override
    public CachedValueProvider.Result<XsltChecker.LanguageLevel> compute(PsiFile psiFile)