mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-67498 XSLT: changing value of version does not change XPath highlighting and completion until project reopening
This commit is contained in:
+11
-1
@@ -87,10 +87,20 @@ public abstract class XsltContextProviderBase extends ContextProvider {
|
||||
protected XsltContextProviderBase(XmlElement element) {
|
||||
final Project project = element.getProject();
|
||||
myFileAssociationsManager = FileAssociationsManager.getInstance(project);
|
||||
myContextElement = SmartPointerManager.getInstance(project).createLazyPointer(element);
|
||||
myContextElement = SmartPointerManager.getInstance(project).createSmartPsiElementPointer(element);
|
||||
attachTo(element);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isValid() {
|
||||
return super.isValid() && matchContextType();
|
||||
}
|
||||
|
||||
private boolean matchContextType() {
|
||||
final PsiFile file = myContextElement.getContainingFile();
|
||||
return file != null && XsltSupport.getXsltLanguageLevel(file).getXPathVersion() == getContextType().getVersion();
|
||||
}
|
||||
|
||||
private static void fillFromSchema(PsiFile file, ElementNames names) {
|
||||
if (!(file instanceof XmlFile)) return;
|
||||
final XmlFile f = (XmlFile)file;
|
||||
|
||||
@@ -16,12 +16,23 @@
|
||||
|
||||
package org.intellij.lang.xpath.xslt.impl;
|
||||
|
||||
import org.intellij.lang.xpath.context.XPathVersion;
|
||||
import org.intellij.lang.xpath.xslt.XsltSupport;
|
||||
|
||||
import com.intellij.util.xml.NanoXmlUtil;
|
||||
|
||||
public class XsltChecker extends NanoXmlUtil.IXMLBuilderAdapter {
|
||||
public enum LanguageLevel { NONE, V1, V2 }
|
||||
public enum LanguageLevel { NONE(null), V1(XPathVersion.V1), V2(XPathVersion.V2);
|
||||
private final XPathVersion myVersion;
|
||||
|
||||
LanguageLevel(XPathVersion version) {
|
||||
myVersion = version;
|
||||
}
|
||||
|
||||
public XPathVersion getXPathVersion() {
|
||||
return myVersion;
|
||||
}
|
||||
}
|
||||
|
||||
enum State {
|
||||
YES, SIMPLIFIED, NO, POSSIBLY, POSSIBLY_SIMPLIFIED_SYNTAX, VERSION2
|
||||
|
||||
Reference in New Issue
Block a user