Files
openide/json/src/com/jetbrains/jsonSchema/extension/JsonSchemaCompletionHandlerProvider.java
Anton Lobov d2d2a80c11 [amper] provide a custom insert handler for enum item for a json schema
this is needed to handle cases when the value is "expandable" - there are two different options to write the same (product = lib or product {type = lib}), but in some cases one of them requires expanding by default (lib requires a set of platforms)

instead of introducing the notion of "expandable" into the schema, we just provide an ability to provide a custom completion insert handler to handle tricky cases like that

GitOrigin-RevId: 5e54f19326891d7d02061b338efb392fc0ae2634
2024-04-11 19:19:15 +00:00

17 lines
796 B
Java

// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.jetbrains.jsonSchema.extension;
import com.intellij.codeInsight.completion.InsertHandler;
import com.intellij.codeInsight.lookup.LookupElement;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.jetbrains.jsonSchema.impl.JsonSchemaObject;
import org.jetbrains.annotations.Nullable;
public interface JsonSchemaCompletionHandlerProvider {
ExtensionPointName<JsonSchemaCompletionHandlerProvider> EXTENSION_POINT_NAME = ExtensionPointName.create("com.intellij.json.jsonSchemaCompletionHandlerProvider");
default @Nullable InsertHandler<LookupElement> createHandlerForEnumValue(JsonSchemaObject schema, String value) {
return null;
}
}