mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
WEB-25752 webpack.conf.js: recognize exporting multiple configurations
This commit is contained in:
@@ -44,7 +44,7 @@ public class JsonBySchemaDocumentationProvider implements DocumentationProvider
|
||||
@Nullable
|
||||
@Override
|
||||
public String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
|
||||
final JsonLikePsiWalker walker = JsonSchemaWalker.getWalker(element);
|
||||
final JsonLikePsiWalker walker = JsonSchemaWalker.getWalker(element, myRootSchema);
|
||||
if (walker == null) return null;
|
||||
|
||||
if (JsonSchemaFileType.INSTANCE.equals(element.getContainingFile().getFileType())) {
|
||||
|
||||
@@ -52,7 +52,7 @@ public class JsonBySchemaObjectAnnotator implements Annotator {
|
||||
|
||||
@Override
|
||||
public void annotate(@NotNull PsiElement element, @NotNull AnnotationHolder holder) {
|
||||
final JsonLikePsiWalker walker = JsonSchemaWalker.getWalker(element);
|
||||
final JsonLikePsiWalker walker = JsonSchemaWalker.getWalker(element, myRootSchema);
|
||||
if (walker == null) return;
|
||||
|
||||
final JsonPropertyAdapter firstProp = walker.getParentPropertyAdapter(element);
|
||||
@@ -66,7 +66,7 @@ public class JsonBySchemaObjectAnnotator implements Annotator {
|
||||
if (checkIfAlreadyProcessed(holder, firstProp.getDelegate())) return;
|
||||
|
||||
final List<BySchemaChecker> checkers = new ArrayList<>();
|
||||
JsonSchemaWalker.findSchemasForAnnotation(firstProp.getDelegate(), JsonSchemaWalker.getWalker(element), new JsonSchemaWalker.CompletionSchemesConsumer() {
|
||||
JsonSchemaWalker.findSchemasForAnnotation(firstProp.getDelegate(), JsonSchemaWalker.getWalker(element, myRootSchema), new JsonSchemaWalker.CompletionSchemesConsumer() {
|
||||
@Override
|
||||
public void consume(boolean isName,
|
||||
@NotNull JsonSchemaObject schema,
|
||||
|
||||
@@ -98,7 +98,7 @@ class JsonBySchemaObjectCompletionContributor extends CompletionContributor {
|
||||
myOriginalPosition = originalPosition;
|
||||
myResultConsumer = resultConsumer;
|
||||
myVariants = new ArrayList<>();
|
||||
myWalker = JsonSchemaWalker.getWalker(myPosition);
|
||||
myWalker = JsonSchemaWalker.getWalker(myPosition, myRootSchema);
|
||||
myWrapInQuotes = myWalker.isNameQuoted() && !(position.getParent() instanceof JsonStringLiteral);
|
||||
myInsideStringLiteral = position.getParent() instanceof JsonStringLiteral;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.jetbrains.jsonSchema.impl;
|
||||
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -27,7 +26,6 @@ import java.util.Set;
|
||||
* @author Irina.Chernushina on 2/15/2017.
|
||||
*/
|
||||
public interface JsonLikePsiWalker {
|
||||
ExtensionPointName<JsonLikePsiWalker> EXTENSION_POINT_NAME = ExtensionPointName.create("Json.Like.Psi.Walker");
|
||||
boolean handles(@NotNull PsiElement element);
|
||||
boolean isName(PsiElement checkable);
|
||||
boolean isPropertyWithValue(@NotNull PsiElement element);
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright 2000-2017 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.jetbrains.jsonSchema.impl;
|
||||
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author Irina.Chernushina on 3/7/2017.
|
||||
*/
|
||||
public interface JsonLikePsiWalkerFactory {
|
||||
ExtensionPointName<JsonLikePsiWalkerFactory> EXTENSION_POINT_NAME = ExtensionPointName.create("Json.Like.Psi.Walker.Factory");
|
||||
|
||||
JsonLikePsiWalker create(@NotNull JsonSchemaObject schemaObject);
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package com.jetbrains.jsonSchema.impl;
|
||||
/**
|
||||
* @author Irina.Chernushina on 7/15/2015.
|
||||
*/
|
||||
enum JsonSchemaType {
|
||||
public enum JsonSchemaType {
|
||||
_string, _number, _integer, _object, _array, _boolean, _null, _any;
|
||||
|
||||
public String getName() {
|
||||
|
||||
@@ -285,17 +285,18 @@ public class JsonSchemaWalker {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static JsonLikePsiWalker getWalker(@NotNull final PsiElement element) {
|
||||
return getJsonLikeThing(element, walker -> walker);
|
||||
public static JsonLikePsiWalker getWalker(@NotNull final PsiElement element, JsonSchemaObject schemaObject) {
|
||||
return getJsonLikeThing(element, walker -> walker, schemaObject);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static <T> T getJsonLikeThing(@NotNull final PsiElement element,
|
||||
@NotNull Convertor<JsonLikePsiWalker, T> convertor) {
|
||||
@NotNull Convertor<JsonLikePsiWalker, T> convertor,
|
||||
JsonSchemaObject schemaObject) {
|
||||
final List<JsonLikePsiWalker> list = new ArrayList<>();
|
||||
list.add(JSON_ORIGINAL_PSI_WALKER);
|
||||
final JsonLikePsiWalker[] extensions = Extensions.getExtensions(JsonLikePsiWalker.EXTENSION_POINT_NAME);
|
||||
list.addAll(Arrays.asList(extensions));
|
||||
final JsonLikePsiWalkerFactory[] extensions = Extensions.getExtensions(JsonLikePsiWalkerFactory.EXTENSION_POINT_NAME);
|
||||
list.addAll(Arrays.stream(extensions).map(extension -> extension.create(schemaObject)).collect(Collectors.toList()));
|
||||
for (JsonLikePsiWalker walker : list) {
|
||||
if (walker.handles(element)) return convertor.convert(walker);
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
<extensionPoint qualifiedName="com.intellij.json.jsonStandardComplianceProvider"
|
||||
interface="com.intellij.json.codeinsight.JsonStandardComplianceProvider"/>
|
||||
<extensionPoint qualifiedName="JavaScript.JsonSchema.ProviderFactory" interface="com.jetbrains.jsonSchema.extension.JsonSchemaProviderFactory"/>
|
||||
<extensionPoint qualifiedName="Json.Like.Psi.Walker" interface="com.jetbrains.jsonSchema.impl.JsonLikePsiWalker"/>
|
||||
<extensionPoint qualifiedName="Json.Like.Psi.Walker.Factory" interface="com.jetbrains.jsonSchema.impl.JsonLikePsiWalkerFactory"/>
|
||||
</extensionPoints>
|
||||
|
||||
</idea-plugin>
|
||||
Reference in New Issue
Block a user