IntelliJ supports a way to configure Json Schema from settings.
I want to achieve the same thing using IntelliJ plugin where I will keep schemas in the plugin code and apply them to the project which uses it.
I tried to use JsonSchemaProviderFactory but it doesn’t seem to work. when I am running the plugin in sandbox, it doesn’t seem to load these json mappings hence autocompletion is not working.
what’s the preferred way to support YAML completion based on schema?
Schema Provider:
<code>public class SchemaProviderFactory implements JsonSchemaProviderFactory {
@Override
public @NotNull List<JsonSchemaFileProvider> getProviders(@NotNull Project project) {
return List.of(new MyCustomSchemaProvider());
}
}
</code>
<code>public class SchemaProviderFactory implements JsonSchemaProviderFactory {
@Override
public @NotNull List<JsonSchemaFileProvider> getProviders(@NotNull Project project) {
return List.of(new MyCustomSchemaProvider());
}
}
</code>
public class SchemaProviderFactory implements JsonSchemaProviderFactory {
@Override
public @NotNull List<JsonSchemaFileProvider> getProviders(@NotNull Project project) {
return List.of(new MyCustomSchemaProvider());
}
}
Plugin config:
<code><extensions defaultExtensionNs="JavaScript">
<JsonSchema.ProviderFactory implementation="com.myproject.completion.SchemaProviderFactory" />
</extensions>
</code>
<code><extensions defaultExtensionNs="JavaScript">
<JsonSchema.ProviderFactory implementation="com.myproject.completion.SchemaProviderFactory" />
</extensions>
</code>
<extensions defaultExtensionNs="JavaScript">
<JsonSchema.ProviderFactory implementation="com.myproject.completion.SchemaProviderFactory" />
</extensions>