mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
move relaxng dom registration to plugin.xml
This commit is contained in:
@@ -55,7 +55,7 @@
|
||||
<lang.namesValidator language="RELAX-NG" implementationClass="org.intellij.plugins.relaxNG.compact.RngCompactLanguage$MyNamesValidator" />
|
||||
<lang.syntaxHighlighterFactory key="RELAX-NG" implementationClass="org.intellij.plugins.relaxNG.compact.RngCompactLanguage$MySyntaxHighlighterFactory" />
|
||||
|
||||
<lang.elementManipulator forClass="org.intellij.plugins.relaxNG.compact.psi.RncFileReference" implementationClass="org.intellij.plugins.relaxNG.ProjectLoader$RncFileReferenceManipulator" />
|
||||
<lang.elementManipulator forClass="org.intellij.plugins.relaxNG.compact.psi.RncFileReference" implementationClass="org.intellij.plugins.relaxNG.RncFileReferenceManipulator" />
|
||||
|
||||
<lang.documentationProvider language="RELAX-NG" implementationClass="org.intellij.plugins.relaxNG.compact.RngCompactLanguage$MyDocumentationProvider" />
|
||||
|
||||
@@ -65,12 +65,20 @@
|
||||
<externalAnnotator language="XML" implementationClass="org.intellij.plugins.relaxNG.validation.RngSchemaValidator" />
|
||||
<lang.documentationProvider language="XML" implementationClass="org.intellij.plugins.relaxNG.RngDocumentationProvider" />
|
||||
<psi.referenceContributor implementation="org.intellij.plugins.relaxNG.RelaxNGReferenceContributor"/>
|
||||
|
||||
<dom.fileDescription implementation="org.intellij.plugins.relaxNG.RngDomFileDescription$RngChoiceDescription"/>
|
||||
<dom.fileDescription implementation="org.intellij.plugins.relaxNG.RngDomFileDescription$RngElementDescription"/>
|
||||
<dom.fileDescription implementation="org.intellij.plugins.relaxNG.RngDomFileDescription$RngGrammarDescription"/>
|
||||
<dom.fileDescription implementation="org.intellij.plugins.relaxNG.RngDomFileDescription$RngGroupDescription"/>
|
||||
<dom.fileDescription implementation="org.intellij.plugins.relaxNG.RngDomFileDescription$RngInterleaveDescription"/>
|
||||
|
||||
<dom.implementation interfaceClass="org.intellij.plugins.relaxNG.xml.dom.RngDefine" implementationClass="org.intellij.plugins.relaxNG.xml.dom.impl.RngDefineImpl"/>
|
||||
<dom.implementation interfaceClass="org.intellij.plugins.relaxNG.xml.dom.RngGrammar" implementationClass="org.intellij.plugins.relaxNG.xml.dom.impl.RngGrammarImpl"/>
|
||||
<dom.implementation interfaceClass="org.intellij.plugins.relaxNG.xml.dom.RngInclude" implementationClass="org.intellij.plugins.relaxNG.xml.dom.impl.RngIncludeImpl"/>
|
||||
<dom.implementation interfaceClass="org.intellij.plugins.relaxNG.xml.dom.RngRef" implementationClass="org.intellij.plugins.relaxNG.xml.dom.impl.RngRefImpl"/>
|
||||
</extensions>
|
||||
|
||||
<project-components>
|
||||
<component>
|
||||
<implementation-class>org.intellij.plugins.relaxNG.ProjectLoader</implementation-class>
|
||||
</component>
|
||||
<component>
|
||||
<interface-class>org.intellij.plugins.relaxNG.config.NoNamespaceConfig</interface-class>
|
||||
<implementation-class>org.intellij.plugins.relaxNG.config.NoNamespaceConfigImpl</implementation-class>
|
||||
|
||||
@@ -52,6 +52,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
public class ApplicationLoader implements ApplicationComponent, InspectionToolProvider {
|
||||
private static final String RNG_EXT = "rng";
|
||||
private static final String VALIDATE_XML = "ValidateXml";
|
||||
public static final String RNG_NAMESPACE = "http://relaxng.org/ns/structure/1.0";
|
||||
|
||||
@NonNls
|
||||
@NotNull
|
||||
@@ -79,7 +80,7 @@ public class ApplicationLoader implements ApplicationComponent, InspectionToolPr
|
||||
final MetaDataRegistrar registrar = MetaDataRegistrar.getInstance();
|
||||
registrar.registerMetaData(
|
||||
new AndFilter(
|
||||
new NamespaceFilter(ProjectLoader.RNG_NAMESPACE),
|
||||
new NamespaceFilter(RNG_NAMESPACE),
|
||||
new ClassFilter(XmlDocument.class)
|
||||
),
|
||||
RngNsDescriptor.class);
|
||||
@@ -116,7 +117,7 @@ public class ApplicationLoader implements ApplicationComponent, InspectionToolPr
|
||||
|
||||
public class ResourceProvider implements StandardResourceProvider {
|
||||
public void registerResources(ResourceRegistrar registrar) {
|
||||
registrar.addStdResource(ProjectLoader.RNG_NAMESPACE, "resources/relaxng.rng", getClass());
|
||||
registrar.addStdResource(RNG_NAMESPACE, "resources/relaxng.rng", getClass());
|
||||
registrar.addIgnoredResource("http://relaxng.org/ns/compatibility/annotations/1.0");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
/*
|
||||
* Copyright 2007 Sascha Weinreuter
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.intellij.plugins.relaxNG;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.openapi.components.ProjectComponent;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.psi.AbstractElementManipulator;
|
||||
import com.intellij.psi.PsiManager;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.xml.DomFileDescription;
|
||||
import com.intellij.util.xml.DomManager;
|
||||
import com.intellij.util.xml.highlighting.DomElementsAnnotator;
|
||||
import org.intellij.plugins.relaxNG.compact.RncTokenTypes;
|
||||
import org.intellij.plugins.relaxNG.compact.psi.RncFileReference;
|
||||
import org.intellij.plugins.relaxNG.compact.psi.util.RenameUtil;
|
||||
import org.intellij.plugins.relaxNG.model.annotation.ModelAnnotator;
|
||||
import org.intellij.plugins.relaxNG.xml.dom.*;
|
||||
import org.intellij.plugins.relaxNG.xml.dom.impl.RngDefineImpl;
|
||||
import org.intellij.plugins.relaxNG.xml.dom.impl.RngGrammarImpl;
|
||||
import org.intellij.plugins.relaxNG.xml.dom.impl.RngIncludeImpl;
|
||||
import org.intellij.plugins.relaxNG.xml.dom.impl.RngRefImpl;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Created by IntelliJ IDEA.
|
||||
* User: sweinreuter
|
||||
* Date: 16.07.2007
|
||||
*/
|
||||
public class ProjectLoader implements ProjectComponent {
|
||||
public static final String RNG_NAMESPACE = "http://relaxng.org/ns/structure/1.0";
|
||||
|
||||
private final Project myProject;
|
||||
|
||||
public ProjectLoader(Project project) {
|
||||
myProject = project;
|
||||
}
|
||||
|
||||
@NonNls
|
||||
@NotNull
|
||||
public String getComponentName() {
|
||||
return "RELAX-NG";
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "deprecation" })
|
||||
public void initComponent() {
|
||||
final DomManager mgr = DomManager.getDomManager(myProject);
|
||||
mgr.registerFileDescription(new MyFileDescription<RngGrammar>(RngGrammar.class, "grammar"));
|
||||
mgr.registerFileDescription(new MyFileDescription<RngElement>(RngElement.class, "element"));
|
||||
mgr.registerFileDescription(new MyFileDescription<RngChoice>(RngChoice.class, "choice"));
|
||||
mgr.registerFileDescription(new MyFileDescription<RngGroup>(RngGroup.class, "group"));
|
||||
mgr.registerFileDescription(new MyFileDescription<RngInterleave>(RngInterleave.class, "interleave"));
|
||||
}
|
||||
|
||||
public void disposeComponent() {
|
||||
}
|
||||
|
||||
public void projectOpened() {
|
||||
}
|
||||
|
||||
public void projectClosed() {
|
||||
}
|
||||
|
||||
private static class MyFileDescription<T> extends DomFileDescription<T> {
|
||||
public MyFileDescription(Class<T> elementClass, String rootTagName) {
|
||||
super(elementClass, rootTagName);
|
||||
registerNamespacePolicy("RELAX-NG", RNG_NAMESPACE);
|
||||
registerImplementation(RngDefine.class, RngDefineImpl.class);
|
||||
registerImplementation(RngGrammar.class, RngGrammarImpl.class);
|
||||
registerImplementation(RngInclude.class, RngIncludeImpl.class);
|
||||
registerImplementation(RngRef.class, RngRefImpl.class);
|
||||
}
|
||||
|
||||
public boolean isAutomaticHighlightingEnabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public DomElementsAnnotator createAnnotator() {
|
||||
return new ModelAnnotator();
|
||||
}
|
||||
}
|
||||
|
||||
public static class RncFileReferenceManipulator extends AbstractElementManipulator<RncFileReference> {
|
||||
public RncFileReference handleContentChange(RncFileReference element, TextRange range, String newContent) throws IncorrectOperationException {
|
||||
final ASTNode node = element.getNode();
|
||||
assert node != null;
|
||||
|
||||
final ASTNode literal = node.findChildByType(RncTokenTypes.LITERAL);
|
||||
if (literal != null) {
|
||||
assert range.equals(element.getReferenceRange());
|
||||
final PsiManager manager = PsiManager.getInstance(element.getProject());
|
||||
final ASTNode newChild = RenameUtil.createLiteralNode(manager, newContent);
|
||||
literal.getTreeParent().replaceChild(literal, newChild);
|
||||
}
|
||||
return element;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextRange getRangeInElement(RncFileReference element) {
|
||||
return element.getReferenceRange();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ import static com.intellij.patterns.XmlPatterns.xmlTag;
|
||||
* @author peter
|
||||
*/
|
||||
public class RelaxNGReferenceContributor extends PsiReferenceContributor {
|
||||
private static final XmlNamedElementPattern RNG_TAG_PATTERN = xmlTag().withNamespace(string().equalTo(ProjectLoader.RNG_NAMESPACE));
|
||||
private static final XmlNamedElementPattern RNG_TAG_PATTERN = xmlTag().withNamespace(string().equalTo(ApplicationLoader.RNG_NAMESPACE));
|
||||
|
||||
private static final XmlNamedElementPattern.XmlAttributePattern NAME_ATTR_PATTERN = xmlAttribute("name");
|
||||
private static final StringPattern ELEMENT_OR_ATTRIBUTE_PATTERN = string().oneOf("element", "attribute");
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package org.intellij.plugins.relaxNG;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.psi.AbstractElementManipulator;
|
||||
import com.intellij.psi.PsiManager;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.intellij.plugins.relaxNG.compact.RncTokenTypes;
|
||||
import org.intellij.plugins.relaxNG.compact.psi.RncFileReference;
|
||||
import org.intellij.plugins.relaxNG.compact.psi.util.RenameUtil;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public class RncFileReferenceManipulator extends AbstractElementManipulator<RncFileReference> {
|
||||
public RncFileReference handleContentChange(RncFileReference element, TextRange range, String newContent) throws
|
||||
IncorrectOperationException {
|
||||
final ASTNode node = element.getNode();
|
||||
assert node != null;
|
||||
|
||||
final ASTNode literal = node.findChildByType(RncTokenTypes.LITERAL);
|
||||
if (literal != null) {
|
||||
assert range.equals(element.getReferenceRange());
|
||||
final PsiManager manager = PsiManager.getInstance(element.getProject());
|
||||
final ASTNode newChild = RenameUtil.createLiteralNode(manager, newContent);
|
||||
literal.getTreeParent().replaceChild(literal, newChild);
|
||||
}
|
||||
return element;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextRange getRangeInElement(RncFileReference element) {
|
||||
return element.getReferenceRange();
|
||||
}
|
||||
}
|
||||
@@ -102,7 +102,7 @@ public class RngDocumentationProvider implements DocumentationProvider {
|
||||
}
|
||||
|
||||
private static StringBuilder getDocumentationFromTag(XmlTag tag, String localName, String kind) {
|
||||
if (tag.getNamespace().equals(ProjectLoader.RNG_NAMESPACE)) {
|
||||
if (tag.getNamespace().equals(ApplicationLoader.RNG_NAMESPACE)) {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append(kind).append(": <b>").append(localName).append("</b><br>");
|
||||
final XmlTag[] docTags = tag.findSubTags("documentation", COMPATIBILITY_ANNOTATIONS_1_0);
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package org.intellij.plugins.relaxNG;
|
||||
|
||||
import com.intellij.util.xml.DomFileDescription;
|
||||
import com.intellij.util.xml.highlighting.DomElementsAnnotator;
|
||||
import org.intellij.plugins.relaxNG.model.annotation.ModelAnnotator;
|
||||
import org.intellij.plugins.relaxNG.xml.dom.*;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public class RngDomFileDescription<T> extends DomFileDescription<T> {
|
||||
public RngDomFileDescription(Class<T> elementClass, String rootTagName) {
|
||||
super(elementClass, rootTagName);
|
||||
registerNamespacePolicy("RELAX-NG", ApplicationLoader.RNG_NAMESPACE);
|
||||
}
|
||||
|
||||
public boolean isAutomaticHighlightingEnabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public DomElementsAnnotator createAnnotator() {
|
||||
return new ModelAnnotator();
|
||||
}
|
||||
|
||||
public static class RngGrammarDescription extends RngDomFileDescription<RngGrammar> {
|
||||
public RngGrammarDescription() {
|
||||
super(RngGrammar.class, "grammar");
|
||||
}
|
||||
}
|
||||
|
||||
public static class RngElementDescription extends RngDomFileDescription<RngElement> {
|
||||
public RngElementDescription() {
|
||||
super(RngElement.class, "element");
|
||||
}
|
||||
}
|
||||
|
||||
public static class RngChoiceDescription extends RngDomFileDescription<RngChoice> {
|
||||
public RngChoiceDescription() {
|
||||
super(RngChoice.class, "choice");
|
||||
}
|
||||
}
|
||||
|
||||
public static class RngGroupDescription extends RngDomFileDescription<RngGroup> {
|
||||
public RngGroupDescription() {
|
||||
super(RngGroup.class, "group");
|
||||
}
|
||||
}
|
||||
|
||||
public static class RngInterleaveDescription extends RngDomFileDescription<RngInterleave> {
|
||||
public RngInterleaveDescription() {
|
||||
super(RngInterleave.class, "interleave");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ import com.intellij.psi.PsiManager;
|
||||
import com.intellij.psi.xml.XmlDocument;
|
||||
import com.intellij.psi.xml.XmlFile;
|
||||
import com.intellij.psi.xml.XmlTag;
|
||||
import org.intellij.plugins.relaxNG.ProjectLoader;
|
||||
import org.intellij.plugins.relaxNG.ApplicationLoader;
|
||||
import org.intellij.plugins.relaxNG.compact.RncFileType;
|
||||
import org.intellij.plugins.relaxNG.validation.ValidateAction;
|
||||
|
||||
@@ -71,7 +71,7 @@ public class ConvertSchemaAction extends AnAction {
|
||||
final XmlTag rootTag = document.getRootTag();
|
||||
assert rootTag != null;
|
||||
final String uri = rootTag.getNamespace();
|
||||
if (ProjectLoader.RNG_NAMESPACE.equals(uri) && files.length == 1) {
|
||||
if (ApplicationLoader.RNG_NAMESPACE.equals(uri) && files.length == 1) {
|
||||
return SchemaType.RNG;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -40,7 +40,7 @@ import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.Query;
|
||||
import com.intellij.util.xml.DomElement;
|
||||
import com.intellij.util.xml.DomManager;
|
||||
import org.intellij.plugins.relaxNG.ProjectLoader;
|
||||
import org.intellij.plugins.relaxNG.ApplicationLoader;
|
||||
import org.intellij.plugins.relaxNG.compact.psi.RncDefine;
|
||||
import org.intellij.plugins.relaxNG.compact.psi.RncElementVisitor;
|
||||
import org.intellij.plugins.relaxNG.compact.psi.RncGrammar;
|
||||
@@ -135,7 +135,7 @@ public class UnusedDefineInspection extends BaseInspection {
|
||||
if (!tag.getLocalName().equals("define")) {
|
||||
return;
|
||||
}
|
||||
if (!tag.getNamespace().equals(ProjectLoader.RNG_NAMESPACE)) {
|
||||
if (!tag.getNamespace().equals(ApplicationLoader.RNG_NAMESPACE)) {
|
||||
return;
|
||||
}
|
||||
if (tag.getAttribute("combine") != null) {
|
||||
|
||||
+2
-2
@@ -39,7 +39,7 @@ import com.intellij.util.Function;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.xml.XmlElementDescriptor;
|
||||
import com.intellij.xml.XmlNSDescriptor;
|
||||
import org.intellij.plugins.relaxNG.ProjectLoader;
|
||||
import org.intellij.plugins.relaxNG.ApplicationLoader;
|
||||
import org.intellij.plugins.relaxNG.model.resolve.RelaxIncludeIndex;
|
||||
import org.intellij.plugins.relaxNG.validation.RngParser;
|
||||
import org.intellij.plugins.relaxNG.validation.XmlInstanceValidator;
|
||||
@@ -243,7 +243,7 @@ public class RngNsDescriptor implements XmlNSDescriptor, Validator {
|
||||
return;
|
||||
}
|
||||
// RNG XML itself is validated by parsing it with Jing, so we don't want to schema-validate it
|
||||
if (!ProjectLoader.RNG_NAMESPACE.equals(rootTag.getNamespace())) {
|
||||
if (!ApplicationLoader.RNG_NAMESPACE.equals(rootTag.getNamespace())) {
|
||||
XmlInstanceValidator.doValidation(doc, host, getDescriptorFile());
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ import com.intellij.psi.impl.include.FileIncludeInfo;
|
||||
import com.intellij.psi.impl.include.FileIncludeProvider;
|
||||
import com.intellij.util.indexing.FileContent;
|
||||
import com.intellij.util.xml.NanoXmlUtil;
|
||||
import org.intellij.plugins.relaxNG.ProjectLoader;
|
||||
import org.intellij.plugins.relaxNG.ApplicationLoader;
|
||||
import org.intellij.plugins.relaxNG.compact.RncFileType;
|
||||
import org.intellij.plugins.relaxNG.compact.psi.RncElement;
|
||||
import org.intellij.plugins.relaxNG.compact.psi.RncElementVisitor;
|
||||
@@ -72,7 +72,7 @@ public class RelaxIncludeProvider extends FileIncludeProvider {
|
||||
|
||||
@Override
|
||||
public void startElement(String name, String nsPrefix, String nsURI, String systemID, int lineNr) throws Exception {
|
||||
boolean isRngTag = ProjectLoader.RNG_NAMESPACE.equals(nsURI);
|
||||
boolean isRngTag = ApplicationLoader.RNG_NAMESPACE.equals(nsURI);
|
||||
if (!isRNG) { // analyzing start tag
|
||||
if (!isRngTag) {
|
||||
throw new NanoXmlUtil.ParserStoppedException();
|
||||
|
||||
+3
-3
@@ -23,7 +23,7 @@ import com.intellij.util.io.KeyDescriptor;
|
||||
import com.intellij.util.text.CharArrayUtil;
|
||||
import com.intellij.util.text.CharSequenceReader;
|
||||
import com.intellij.util.xml.NanoXmlUtil;
|
||||
import org.intellij.plugins.relaxNG.ProjectLoader;
|
||||
import org.intellij.plugins.relaxNG.ApplicationLoader;
|
||||
import org.intellij.plugins.relaxNG.compact.RncFileType;
|
||||
import org.intellij.plugins.relaxNG.model.CommonElement;
|
||||
import org.intellij.plugins.relaxNG.model.Define;
|
||||
@@ -68,7 +68,7 @@ public class RelaxSymbolIndex extends ScalarIndexExtension<String> {
|
||||
final HashMap<String, Void> map = new HashMap<String, Void>();
|
||||
if (inputData.getFileType() == XmlFileType.INSTANCE) {
|
||||
CharSequence inputDataContentAsText = inputData.getContentAsText();
|
||||
if (CharArrayUtil.indexOf(inputDataContentAsText, ProjectLoader.RNG_NAMESPACE, 0) == -1) return Collections.EMPTY_MAP;
|
||||
if (CharArrayUtil.indexOf(inputDataContentAsText, ApplicationLoader.RNG_NAMESPACE, 0) == -1) return Collections.EMPTY_MAP;
|
||||
NanoXmlUtil.parse(new CharSequenceReader(inputDataContentAsText), new NanoXmlUtil.IXMLBuilderAdapter() {
|
||||
NanoXmlUtil.IXMLBuilderAdapter attributeHandler;
|
||||
int depth;
|
||||
@@ -83,7 +83,7 @@ public class RelaxSymbolIndex extends ScalarIndexExtension<String> {
|
||||
@Override
|
||||
public void startElement(String name, String nsPrefix, String nsURI, String systemID, int lineNr) throws Exception {
|
||||
attributeHandler = null;
|
||||
if (depth == 1 && ProjectLoader.RNG_NAMESPACE.equals(nsURI)) {
|
||||
if (depth == 1 && ApplicationLoader.RNG_NAMESPACE.equals(nsURI)) {
|
||||
if ("define".equals(name)) {
|
||||
attributeHandler = new NanoXmlUtil.IXMLBuilderAdapter() {
|
||||
@Override
|
||||
|
||||
@@ -31,7 +31,7 @@ import com.intellij.psi.*;
|
||||
import com.intellij.psi.search.PsiElementProcessor;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.xml.*;
|
||||
import org.intellij.plugins.relaxNG.ProjectLoader;
|
||||
import org.intellij.plugins.relaxNG.ApplicationLoader;
|
||||
import org.intellij.plugins.relaxNG.compact.RncFileType;
|
||||
import org.intellij.plugins.relaxNG.compact.psi.RncFile;
|
||||
import org.intellij.plugins.relaxNG.model.resolve.RelaxIncludeIndex;
|
||||
@@ -66,7 +66,7 @@ public class RngSchemaValidator implements ExternalAnnotator {
|
||||
if (rootTag == null) {
|
||||
return;
|
||||
}
|
||||
if (!ProjectLoader.RNG_NAMESPACE.equals(rootTag.getNamespace())) {
|
||||
if (!ApplicationLoader.RNG_NAMESPACE.equals(rootTag.getNamespace())) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.xml.XmlTag;
|
||||
import com.intellij.psi.xml.XmlText;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.intellij.plugins.relaxNG.ProjectLoader;
|
||||
import org.intellij.plugins.relaxNG.ApplicationLoader;
|
||||
import org.intellij.plugins.relaxNG.xml.dom.RngGrammar;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -98,7 +98,7 @@ class CreatePatternFix implements IntentionAction, LocalQuickFix {
|
||||
private void doFix() throws IncorrectOperationException {
|
||||
final XmlTag tag = PsiTreeUtil.getParentOfType(myReference.getElement(), XmlTag.class);
|
||||
assert tag != null;
|
||||
final XmlTag defineTag = tag.createChildTag("define", ProjectLoader.RNG_NAMESPACE, "\n \n", false);
|
||||
final XmlTag defineTag = tag.createChildTag("define", ApplicationLoader.RNG_NAMESPACE, "\n \n", false);
|
||||
defineTag.setAttribute("name", myReference.getCanonicalText());
|
||||
|
||||
final RngGrammar grammar = ((DefinitionReference)myReference).getScope();
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.intellij.psi.PsiReference;
|
||||
import com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReferenceSet;
|
||||
import com.intellij.psi.xml.XmlFile;
|
||||
import com.intellij.util.xml.*;
|
||||
import org.intellij.plugins.relaxNG.ProjectLoader;
|
||||
import org.intellij.plugins.relaxNG.ApplicationLoader;
|
||||
import org.intellij.plugins.relaxNG.references.FileReferenceUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -59,7 +59,7 @@ public class RngHrefConverter extends Converter<XmlFile> implements CustomRefere
|
||||
}
|
||||
final FileReferenceSet set = FileReferenceSet.createSet(element, false, false, false);
|
||||
if (set != null) {
|
||||
return FileReferenceUtil.restrict(set, FileReferenceUtil.byNamespace(ProjectLoader.RNG_NAMESPACE), true);
|
||||
return FileReferenceUtil.restrict(set, FileReferenceUtil.byNamespace(ApplicationLoader.RNG_NAMESPACE), true);
|
||||
} else {
|
||||
return PsiReference.EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@ public abstract class AbstractParsingTest extends ParsingTestCase {
|
||||
new WriteAction() {
|
||||
protected void run(Result result) throws Throwable {
|
||||
new ApplicationLoader().initComponent();
|
||||
new ProjectLoader(getProject()).initComponent();
|
||||
ExternalResourceManagerEx.getInstanceEx().addIgnoredResource("urn:test:undefined");
|
||||
}
|
||||
}.execute();
|
||||
|
||||
Reference in New Issue
Block a user