mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Extract ArbitraryPlaceUrlReferenceProvider into platform (fixes WEB-17031)
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* 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 com.intellij.psi.impl.source.resolve.reference;
|
||||
|
||||
import com.intellij.patterns.PlatformPatterns;
|
||||
import com.intellij.psi.PsiComment;
|
||||
import com.intellij.psi.PsiReferenceContributor;
|
||||
import com.intellij.psi.PsiReferenceRegistrar;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class ArbitraryPlaceUrlReferenceContributor extends PsiReferenceContributor {
|
||||
@Override
|
||||
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
|
||||
registrar.registerReferenceProvider(PlatformPatterns.psiElement(PsiComment.class), ArbitraryPlaceUrlReferenceProvider.INSTANCE);
|
||||
}
|
||||
}
|
||||
+2
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.codeInsight.documentation;
|
||||
package com.intellij.psi.impl.source.resolve.reference;
|
||||
|
||||
import com.intellij.execution.filters.UrlFilter;
|
||||
import com.intellij.openapi.paths.GlobalPathReferenceProvider;
|
||||
@@ -73,7 +73,6 @@ public class ArbitraryPlaceUrlReferenceProvider extends PsiReferenceProvider {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiReference[] getReferencesByElement(@NotNull final PsiElement element, @NotNull ProcessingContext context) {
|
||||
@@ -765,6 +765,7 @@
|
||||
<psi.fileReferenceHelper implementation="com.intellij.psi.impl.source.resolve.reference.impl.providers.JarFileReferenceHelper"/>
|
||||
<psi.fileReferenceHelper implementation="com.intellij.psi.impl.source.resolve.reference.impl.providers.HttpFileReferenceHelper"/>
|
||||
<psi.fileReferenceHelper implementation="com.intellij.psi.impl.source.resolve.reference.impl.providers.NullFileReferenceHelper" order="last"/>
|
||||
<psi.referenceContributor implementation="com.intellij.psi.impl.source.resolve.reference.ArbitraryPlaceUrlReferenceContributor"/>
|
||||
|
||||
<projectConfigurable groupId="editor"
|
||||
groupWeight="140"
|
||||
@@ -841,6 +842,7 @@
|
||||
|
||||
<inspectionsReportConverter implementation="com.intellij.codeInspection.ex.PlainTextFormatter"/>
|
||||
|
||||
<documentationProvider implementation="com.intellij.openapi.paths.WebReferenceDocumentationProvider"/>
|
||||
<documentationProvider implementation="com.intellij.openapi.paths.WebReferenceDocumentationProvider"/>
|
||||
|
||||
<refactoring.moveDirectoryWithClassesHelper
|
||||
|
||||
+2
-5
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,12 +16,12 @@
|
||||
package com.intellij.psi.impl.source.resolve.reference.impl.providers;
|
||||
|
||||
import com.intellij.codeInsight.AnnotationUtil;
|
||||
import com.intellij.codeInsight.documentation.ArbitraryPlaceUrlReferenceProvider;
|
||||
import com.intellij.codeInspection.i18n.JavaI18nUtil;
|
||||
import com.intellij.patterns.PlatformPatterns;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.filters.ElementFilter;
|
||||
import com.intellij.psi.filters.position.FilterPattern;
|
||||
import com.intellij.psi.impl.source.resolve.reference.ArbitraryPlaceUrlReferenceProvider;
|
||||
import com.intellij.psi.javadoc.PsiDocToken;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -55,8 +55,5 @@ public class JavaReferenceContributor extends PsiReferenceContributor{
|
||||
}
|
||||
})), filePathReferenceProvider);
|
||||
registrar.registerReferenceProvider(PlatformPatterns.psiElement(PsiDocToken.class), ArbitraryPlaceUrlReferenceProvider.INSTANCE);
|
||||
// todo register for all ?
|
||||
registrar.registerReferenceProvider(PlatformPatterns.psiElement(PsiComment.class), ArbitraryPlaceUrlReferenceProvider.INSTANCE);
|
||||
registrar.registerReferenceProvider(xmlAttributeValue(), ArbitraryPlaceUrlReferenceProvider.INSTANCE, PsiReferenceRegistrar.LOWER_PRIORITY);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,6 +24,7 @@ import com.intellij.psi.*;
|
||||
import com.intellij.psi.filters.*;
|
||||
import com.intellij.psi.filters.position.NamespaceFilter;
|
||||
import com.intellij.psi.filters.position.ParentElementFilter;
|
||||
import com.intellij.psi.impl.source.resolve.reference.ArbitraryPlaceUrlReferenceProvider;
|
||||
import com.intellij.psi.impl.source.resolve.reference.impl.providers.*;
|
||||
import com.intellij.psi.xml.*;
|
||||
import com.intellij.util.ProcessingContext;
|
||||
@@ -52,6 +53,8 @@ public class XmlReferenceContributor extends PsiReferenceContributor {
|
||||
registrar.registerReferenceProvider(PlatformPatterns.psiElement(XmlAttlistDecl.class), dtdReferencesProvider);
|
||||
registrar.registerReferenceProvider(PlatformPatterns.psiElement(XmlElementContentSpec.class), dtdReferencesProvider);
|
||||
registrar.registerReferenceProvider(PlatformPatterns.psiElement(XmlToken.class), dtdReferencesProvider);
|
||||
registrar.registerReferenceProvider(xmlAttributeValue(), ArbitraryPlaceUrlReferenceProvider.INSTANCE, PsiReferenceRegistrar.LOWER_PRIORITY);
|
||||
|
||||
|
||||
URIReferenceProvider uriProvider = new URIReferenceProvider();
|
||||
XmlUtil.registerXmlAttributeValueReferenceProvider(registrar, null, dtdReferencesProvider.getSystemReferenceFilter(), uriProvider);
|
||||
|
||||
Reference in New Issue
Block a user