mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
project dsl — support reading of List<Object>
GitOrigin-RevId: bcc12557ea621f243dc0aeff250f5796d82b33af
This commit is contained in:
committed by
intellij-monorepo-bot
parent
9948c4dc2c
commit
3560e0a4f4
1
.idea/modules.xml
generated
1
.idea/modules.xml
generated
@@ -466,6 +466,7 @@
|
|||||||
<module fileurl="file://$PROJECT_DIR$/plugins/ant/jps-plugin/intellij.ant.jps.iml" filepath="$PROJECT_DIR$/plugins/ant/jps-plugin/intellij.ant.jps.iml" />
|
<module fileurl="file://$PROJECT_DIR$/plugins/ant/jps-plugin/intellij.ant.jps.iml" filepath="$PROJECT_DIR$/plugins/ant/jps-plugin/intellij.ant.jps.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/plugins/commander/intellij.commander.iml" filepath="$PROJECT_DIR$/plugins/commander/intellij.commander.iml" />
|
<module fileurl="file://$PROJECT_DIR$/plugins/commander/intellij.commander.iml" filepath="$PROJECT_DIR$/plugins/commander/intellij.commander.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/plugins/configuration-script/intellij.configurationScript.iml" filepath="$PROJECT_DIR$/plugins/configuration-script/intellij.configurationScript.iml" />
|
<module fileurl="file://$PROJECT_DIR$/plugins/configuration-script/intellij.configurationScript.iml" filepath="$PROJECT_DIR$/plugins/configuration-script/intellij.configurationScript.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/plugins/configuration-script/intellij.configurationScript.test.java.iml" filepath="$PROJECT_DIR$/plugins/configuration-script/intellij.configurationScript.test.java.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/plugins/copyright/intellij.copyright.iml" filepath="$PROJECT_DIR$/plugins/copyright/intellij.copyright.iml" />
|
<module fileurl="file://$PROJECT_DIR$/plugins/copyright/intellij.copyright.iml" filepath="$PROJECT_DIR$/plugins/copyright/intellij.copyright.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/plugins/cucumber-jvm-formatter/intellij.cucumber.jvmFormatter.iml" filepath="$PROJECT_DIR$/plugins/cucumber-jvm-formatter/intellij.cucumber.jvmFormatter.iml" />
|
<module fileurl="file://$PROJECT_DIR$/plugins/cucumber-jvm-formatter/intellij.cucumber.jvmFormatter.iml" filepath="$PROJECT_DIR$/plugins/cucumber-jvm-formatter/intellij.cucumber.jvmFormatter.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/plugins/cucumber-jvm-formatter3/intellij.cucumber.jvmFormatter3.iml" filepath="$PROJECT_DIR$/plugins/cucumber-jvm-formatter3/intellij.cucumber.jvmFormatter3.iml" />
|
<module fileurl="file://$PROJECT_DIR$/plugins/cucumber-jvm-formatter3/intellij.cucumber.jvmFormatter3.iml" filepath="$PROJECT_DIR$/plugins/cucumber-jvm-formatter3/intellij.cucumber.jvmFormatter3.iml" />
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||||
package com.intellij.configurationStore;
|
package com.intellij.configurationStore;
|
||||||
|
|
||||||
import com.intellij.openapi.components.PersistentStateComponent;
|
import com.intellij.openapi.components.PersistentStateComponent;
|
||||||
@@ -11,7 +11,7 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.lang.reflect.TypeVariable;
|
import java.lang.reflect.TypeVariable;
|
||||||
|
|
||||||
public class ComponentSerializationUtil {
|
public final class ComponentSerializationUtil {
|
||||||
@NotNull
|
@NotNull
|
||||||
public static <S> Class<S> getStateClass(@NotNull Class<? extends PersistentStateComponent> aClass) {
|
public static <S> Class<S> getStateClass(@NotNull Class<? extends PersistentStateComponent> aClass) {
|
||||||
TypeVariable<Class<PersistentStateComponent>> variable = PersistentStateComponent.class.getTypeParameters()[0];
|
TypeVariable<Class<PersistentStateComponent>> variable = PersistentStateComponent.class.getTypeParameters()[0];
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$/testJava">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/testJava" isTestSource="true" packagePrefix="com.intellij.configurationScript" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="module" module-name="intellij.configurationScript" scope="TEST" />
|
||||||
|
<orderEntry type="module" module-name="intellij.java.execution.impl" scope="TEST" />
|
||||||
|
<orderEntry type="library" scope="TEST" name="kotlin-stdlib-jdk8" level="project" />
|
||||||
|
<orderEntry type="module" module-name="intellij.platform.testFramework" scope="TEST" />
|
||||||
|
<orderEntry type="library" scope="TEST" name="assertJ" level="project" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
@@ -2,10 +2,9 @@
|
|||||||
package com.intellij.configurationScript
|
package com.intellij.configurationScript
|
||||||
|
|
||||||
import com.intellij.configurationScript.inspection.InspectionJsonSchemaGenerator
|
import com.intellij.configurationScript.inspection.InspectionJsonSchemaGenerator
|
||||||
import com.intellij.configurationScript.providers.PluginsConfiguration
|
|
||||||
import com.intellij.configurationScript.schemaGenerators.ComponentStateJsonSchemaGenerator
|
import com.intellij.configurationScript.schemaGenerators.ComponentStateJsonSchemaGenerator
|
||||||
|
import com.intellij.configurationScript.schemaGenerators.PluginJsonSchemaGenerator
|
||||||
import com.intellij.configurationScript.schemaGenerators.RunConfigurationJsonSchemaGenerator
|
import com.intellij.configurationScript.schemaGenerators.RunConfigurationJsonSchemaGenerator
|
||||||
import com.intellij.configurationScript.schemaGenerators.buildJsonSchema
|
|
||||||
import com.intellij.json.JsonFileType
|
import com.intellij.json.JsonFileType
|
||||||
import com.intellij.openapi.diagnostic.logger
|
import com.intellij.openapi.diagnostic.logger
|
||||||
import com.intellij.openapi.project.DumbAware
|
import com.intellij.openapi.project.DumbAware
|
||||||
@@ -85,6 +84,7 @@ internal class IntellijConfigurationJsonSchemaProviderFactory : JsonSchemaProvid
|
|||||||
|
|
||||||
private fun generateConfigurationSchema(): CharSequence {
|
private fun generateConfigurationSchema(): CharSequence {
|
||||||
return doGenerateConfigurationSchema(listOf(
|
return doGenerateConfigurationSchema(listOf(
|
||||||
|
PluginJsonSchemaGenerator(),
|
||||||
RunConfigurationJsonSchemaGenerator(),
|
RunConfigurationJsonSchemaGenerator(),
|
||||||
ComponentStateJsonSchemaGenerator(),
|
ComponentStateJsonSchemaGenerator(),
|
||||||
InspectionJsonSchemaGenerator())
|
InspectionJsonSchemaGenerator())
|
||||||
@@ -111,14 +111,6 @@ internal fun doGenerateConfigurationSchema(generators: List<SchemaGenerator>): C
|
|||||||
"type" to "object"
|
"type" to "object"
|
||||||
|
|
||||||
map("properties") {
|
map("properties") {
|
||||||
map(Keys.plugins) {
|
|
||||||
"type" to "object"
|
|
||||||
"description" to "The plugins"
|
|
||||||
map("properties") {
|
|
||||||
buildJsonSchema(PluginsConfiguration(), this, subObjectSchemaGenerator = null)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (generator in generators) {
|
for (generator in generators) {
|
||||||
generator.generate(this)
|
generator.generate(this)
|
||||||
}
|
}
|
||||||
@@ -144,6 +136,4 @@ internal fun doGenerateConfigurationSchema(generators: List<SchemaGenerator>): C
|
|||||||
internal object Keys {
|
internal object Keys {
|
||||||
const val runConfigurations = "runConfigurations"
|
const val runConfigurations = "runConfigurations"
|
||||||
const val templates = "templates"
|
const val templates = "templates"
|
||||||
|
|
||||||
const val plugins = "plugins"
|
|
||||||
}
|
}
|
||||||
30
plugins/configuration-script/src/ItemTypeInfoProvider.kt
Normal file
30
plugins/configuration-script/src/ItemTypeInfoProvider.kt
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
package com.intellij.configurationScript
|
||||||
|
|
||||||
|
import com.intellij.openapi.components.BaseState
|
||||||
|
import com.intellij.util.xmlb.BeanBinding
|
||||||
|
import java.lang.reflect.ParameterizedType
|
||||||
|
|
||||||
|
internal class ItemTypeInfoProvider(private val hostClass: Class<out BaseState>) {
|
||||||
|
private val accessors by lazy(LazyThreadSafetyMode.NONE) {
|
||||||
|
BeanBinding.getAccessors(hostClass)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getListItemType(propertyName: String): Class<out BaseState>? {
|
||||||
|
val accessor = accessors.find { it.name == propertyName }
|
||||||
|
if (accessor == null) {
|
||||||
|
LOG.warn("Property not found (name=$propertyName, hostClass=${hostClass.name})")
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
val type = accessor.genericType
|
||||||
|
if (type !is ParameterizedType) {
|
||||||
|
LOG.error("$type not supported (name=$propertyName, hostClass=${hostClass.name})")
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
val actualTypeArguments = type.actualTypeArguments
|
||||||
|
LOG.assertTrue(actualTypeArguments.size == 1)
|
||||||
|
@Suppress("UNCHECKED_CAST")
|
||||||
|
return actualTypeArguments[0] as Class<out BaseState>
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import com.intellij.openapi.components.ScalarProperty
|
|||||||
import com.intellij.openapi.components.StoredProperty
|
import com.intellij.openapi.components.StoredProperty
|
||||||
import com.intellij.serialization.stateProperties.CollectionStoredProperty
|
import com.intellij.serialization.stateProperties.CollectionStoredProperty
|
||||||
import com.intellij.serialization.stateProperties.MapStoredProperty
|
import com.intellij.serialization.stateProperties.MapStoredProperty
|
||||||
|
import com.intellij.util.ReflectionUtil
|
||||||
import org.snakeyaml.engine.v2.nodes.MappingNode
|
import org.snakeyaml.engine.v2.nodes.MappingNode
|
||||||
import org.snakeyaml.engine.v2.nodes.NodeTuple
|
import org.snakeyaml.engine.v2.nodes.NodeTuple
|
||||||
import org.snakeyaml.engine.v2.nodes.ScalarNode
|
import org.snakeyaml.engine.v2.nodes.ScalarNode
|
||||||
@@ -16,6 +17,7 @@ internal fun <T : BaseState> readIntoObject(instance: T, node: MappingNode, affe
|
|||||||
|
|
||||||
internal fun <T : BaseState> readIntoObject(instance: T, nodes: List<NodeTuple>, affectedPropertyConsumer: ((StoredProperty<Any>) -> Unit)? = null): T {
|
internal fun <T : BaseState> readIntoObject(instance: T, nodes: List<NodeTuple>, affectedPropertyConsumer: ((StoredProperty<Any>) -> Unit)? = null): T {
|
||||||
val properties = instance.__getProperties()
|
val properties = instance.__getProperties()
|
||||||
|
val itemTypeInfoProvider = ItemTypeInfoProvider(instance.javaClass)
|
||||||
for (tuple in nodes) {
|
for (tuple in nodes) {
|
||||||
val valueNode = tuple.valueNode
|
val valueNode = tuple.valueNode
|
||||||
val key = (tuple.keyNode as ScalarNode).value
|
val key = (tuple.keyNode as ScalarNode).value
|
||||||
@@ -40,7 +42,7 @@ internal fun <T : BaseState> readIntoObject(instance: T, nodes: List<NodeTuple>,
|
|||||||
else if (valueNode is SequenceNode) {
|
else if (valueNode is SequenceNode) {
|
||||||
for (property in properties) {
|
for (property in properties) {
|
||||||
if (property is CollectionStoredProperty<*, *> && key == property.name) {
|
if (property is CollectionStoredProperty<*, *> && key == property.name) {
|
||||||
readCollection(property, valueNode)
|
readCollection(property, itemTypeInfoProvider, valueNode)
|
||||||
affectedPropertyConsumer?.invoke(property)
|
affectedPropertyConsumer?.invoke(property)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -50,14 +52,25 @@ internal fun <T : BaseState> readIntoObject(instance: T, nodes: List<NodeTuple>,
|
|||||||
return instance
|
return instance
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun readCollection(property: CollectionStoredProperty<*, *>, valueNode: SequenceNode) {
|
private fun readCollection(property: CollectionStoredProperty<*, *>, itemTypeInfoProvider: ItemTypeInfoProvider, valueNode: SequenceNode) {
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
val collection = (property as CollectionStoredProperty<String, MutableList<String>>).__getValue()
|
val collection = (property as CollectionStoredProperty<Any, MutableList<Any>>).__getValue()
|
||||||
collection.clear()
|
collection.clear()
|
||||||
if (!valueNode.value.isEmpty()) {
|
if (valueNode.value.isEmpty()) {
|
||||||
for (itemNode in valueNode.value) {
|
return
|
||||||
val itemValue = (itemNode as? ScalarNode)?.value ?: continue
|
}
|
||||||
collection.add(itemValue)
|
|
||||||
|
val itemType by lazy { itemTypeInfoProvider.getListItemType(property.name!!) }
|
||||||
|
|
||||||
|
for (itemNode in valueNode.value) {
|
||||||
|
if (itemNode is ScalarNode) {
|
||||||
|
collection.add(itemNode.value ?: continue)
|
||||||
|
}
|
||||||
|
else if (itemNode is MappingNode) {
|
||||||
|
// object
|
||||||
|
val itemInstance = ReflectionUtil.newInstance(itemType ?: continue, false)
|
||||||
|
readIntoObject(itemInstance, itemNode.value)
|
||||||
|
collection.add(itemInstance)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -66,7 +79,7 @@ private fun readMap(property: MapStoredProperty<*, *>, valueNode: MappingNode) {
|
|||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
val map = (property as MapStoredProperty<String, String>).__getValue()
|
val map = (property as MapStoredProperty<String, String>).__getValue()
|
||||||
map.clear()
|
map.clear()
|
||||||
if (!valueNode.value.isEmpty()) {
|
if (valueNode.value.isNotEmpty()) {
|
||||||
for (tuple in valueNode.value) {
|
for (tuple in valueNode.value) {
|
||||||
val key = (tuple.keyNode as? ScalarNode)?.value ?: continue
|
val key = (tuple.keyNode as? ScalarNode)?.value ?: continue
|
||||||
val value = (tuple.valueNode as? ScalarNode)?.value ?: continue
|
val value = (tuple.valueNode as? ScalarNode)?.value ?: continue
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ internal class InspectionJsonSchemaGenerator : SchemaGenerator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
"additionalProperties" to false
|
||||||
}
|
}
|
||||||
"additionalProperties" to false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.intellij.configurationScript.providers
|
package com.intellij.configurationScript.providers
|
||||||
|
|
||||||
import com.intellij.configurationScript.ConfigurationFileManager
|
import com.intellij.configurationScript.ConfigurationFileManager
|
||||||
import com.intellij.configurationScript.Keys
|
|
||||||
import com.intellij.configurationScript.readIntoObject
|
import com.intellij.configurationScript.readIntoObject
|
||||||
|
import com.intellij.configurationScript.schemaGenerators.PluginJsonSchemaGenerator
|
||||||
import com.intellij.openapi.components.BaseState
|
import com.intellij.openapi.components.BaseState
|
||||||
import com.intellij.openapi.project.Project
|
import com.intellij.openapi.project.Project
|
||||||
import com.intellij.openapi.project.processOpenedProjects
|
import com.intellij.openapi.project.processOpenedProjects
|
||||||
@@ -10,10 +10,11 @@ import com.intellij.openapi.updateSettings.impl.UpdateSettingsProvider
|
|||||||
import com.intellij.openapi.util.NotNullLazyKey
|
import com.intellij.openapi.util.NotNullLazyKey
|
||||||
import com.intellij.util.SmartList
|
import com.intellij.util.SmartList
|
||||||
import com.intellij.util.concurrency.SynchronizedClearableLazy
|
import com.intellij.util.concurrency.SynchronizedClearableLazy
|
||||||
|
import com.intellij.util.xmlb.annotations.XCollection
|
||||||
|
|
||||||
private val dataKey = NotNullLazyKey.create<SynchronizedClearableLazy<PluginsConfiguration?>, Project>("MyUpdateSettingsProvider") { project ->
|
private val dataKey = NotNullLazyKey.create<SynchronizedClearableLazy<PluginsConfiguration?>, Project>("MyUpdateSettingsProvider") { project ->
|
||||||
val data = SynchronizedClearableLazy {
|
val data = SynchronizedClearableLazy {
|
||||||
val node = ConfigurationFileManager.getInstance(project).findValueNode(Keys.plugins) ?: return@SynchronizedClearableLazy null
|
val node = ConfigurationFileManager.getInstance(project).findValueNode(PluginJsonSchemaGenerator.plugins) ?: return@SynchronizedClearableLazy null
|
||||||
readIntoObject(PluginsConfiguration(), node)
|
readIntoObject(PluginsConfiguration(), node)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,5 +35,6 @@ private class MyUpdateSettingsProvider : UpdateSettingsProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal class PluginsConfiguration : BaseState() {
|
internal class PluginsConfiguration : BaseState() {
|
||||||
|
@get:XCollection
|
||||||
val repositories by list<String>()
|
val repositories by list<String>()
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.intellij.configurationScript.schemaGenerators
|
package com.intellij.configurationScript.schemaGenerators
|
||||||
|
|
||||||
|
import com.intellij.configurationScript.ItemTypeInfoProvider
|
||||||
import com.intellij.configurationScript.LOG
|
import com.intellij.configurationScript.LOG
|
||||||
import com.intellij.configurationStore.Property
|
import com.intellij.configurationStore.Property
|
||||||
import com.intellij.openapi.components.BaseState
|
import com.intellij.openapi.components.BaseState
|
||||||
@@ -9,10 +10,8 @@ import com.intellij.serialization.stateProperties.MapStoredProperty
|
|||||||
import com.intellij.util.ReflectionUtil
|
import com.intellij.util.ReflectionUtil
|
||||||
import gnu.trove.THashMap
|
import gnu.trove.THashMap
|
||||||
import org.jetbrains.io.JsonObjectBuilder
|
import org.jetbrains.io.JsonObjectBuilder
|
||||||
import java.lang.reflect.ParameterizedType
|
|
||||||
import kotlin.reflect.full.findAnnotation
|
import kotlin.reflect.full.findAnnotation
|
||||||
import kotlin.reflect.full.memberProperties
|
import kotlin.reflect.full.memberProperties
|
||||||
import kotlin.reflect.jvm.javaType
|
|
||||||
|
|
||||||
internal class OptionClassJsonSchemaGenerator(val definitionNodeKey: String) {
|
internal class OptionClassJsonSchemaGenerator(val definitionNodeKey: String) {
|
||||||
val definitionPointerPrefix = "#/$definitionNodeKey/"
|
val definitionPointerPrefix = "#/$definitionNodeKey/"
|
||||||
@@ -71,6 +70,8 @@ internal fun buildJsonSchema(state: BaseState,
|
|||||||
propertyToAnnotation.put(property.name, annotation)
|
propertyToAnnotation.put(property.name, annotation)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val itemTypeInfoProvider = ItemTypeInfoProvider(state.javaClass)
|
||||||
|
|
||||||
for (property in properties) {
|
for (property in properties) {
|
||||||
val name = property.name!!
|
val name = property.name!!
|
||||||
val annotation = propertyToAnnotation?.get(name)
|
val annotation = propertyToAnnotation?.get(name)
|
||||||
@@ -99,31 +100,21 @@ internal fun buildJsonSchema(state: BaseState,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
is CollectionStoredProperty<*, *> -> {
|
is CollectionStoredProperty<*, *> -> {
|
||||||
val propertyInfo = state.javaClass.kotlin.members.first { it.name == property.name }
|
val listType = itemTypeInfoProvider.getListItemType(name) ?: return@map
|
||||||
val type = propertyInfo.returnType.javaType
|
when {
|
||||||
if (type !is ParameterizedType) {
|
listType === java.lang.String::class.java -> {
|
||||||
LOG.error("$type not supported for collection property $propertyInfo")
|
map("items") {
|
||||||
}
|
"type" to "string"
|
||||||
else {
|
|
||||||
val actualTypeArguments = type.actualTypeArguments
|
|
||||||
LOG.assertTrue(actualTypeArguments.size == 1)
|
|
||||||
val listType = actualTypeArguments[0]
|
|
||||||
|
|
||||||
when {
|
|
||||||
listType === java.lang.String::class.java -> {
|
|
||||||
map("items") {
|
|
||||||
"type" to "string"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
subObjectSchemaGenerator == null -> {
|
}
|
||||||
LOG.error("$type not supported for collection property $propertyInfo because subObjectSchemaGenerator is not specified")
|
subObjectSchemaGenerator == null -> {
|
||||||
}
|
LOG.error("$listType not supported for collection property $name because subObjectSchemaGenerator is not specified")
|
||||||
else -> {
|
}
|
||||||
map("items") {
|
else -> {
|
||||||
@Suppress("UNCHECKED_CAST")
|
map("items") {
|
||||||
definitionReference(subObjectSchemaGenerator.definitionPointerPrefix,
|
@Suppress("UNCHECKED_CAST")
|
||||||
subObjectSchemaGenerator.addClass(listType as Class<out BaseState>))
|
definitionReference(subObjectSchemaGenerator.definitionPointerPrefix,
|
||||||
}
|
subObjectSchemaGenerator.addClass(listType))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.intellij.configurationScript.schemaGenerators
|
||||||
|
|
||||||
|
import com.intellij.configurationScript.SchemaGenerator
|
||||||
|
import com.intellij.configurationScript.providers.PluginsConfiguration
|
||||||
|
import org.jetbrains.io.JsonObjectBuilder
|
||||||
|
|
||||||
|
internal class PluginJsonSchemaGenerator : SchemaGenerator {
|
||||||
|
companion object {
|
||||||
|
const val plugins = "plugins"
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun generate(rootBuilder: JsonObjectBuilder) {
|
||||||
|
rootBuilder.map(plugins) {
|
||||||
|
"type" to "object"
|
||||||
|
"description" to "The plugins"
|
||||||
|
map("properties") {
|
||||||
|
buildJsonSchema(
|
||||||
|
PluginsConfiguration(), this, subObjectSchemaGenerator = null)
|
||||||
|
}
|
||||||
|
"additionalProperties" to false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
package com.intellij.configurationScript
|
package com.intellij.configurationScript
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonFactory
|
import com.fasterxml.jackson.core.JsonFactory
|
||||||
|
import com.intellij.configurationScript.providers.readRunConfigurations
|
||||||
import com.intellij.configurationScript.schemaGenerators.rcTypeIdToPropertyName
|
import com.intellij.configurationScript.schemaGenerators.rcTypeIdToPropertyName
|
||||||
//import com.intellij.execution.application.JvmMainMethodRunConfigurationOptions
|
//import com.intellij.execution.application.JvmMainMethodRunConfigurationOptions
|
||||||
import com.intellij.execution.configurations.ConfigurationTypeBase
|
import com.intellij.execution.configurations.ConfigurationTypeBase
|
||||||
@@ -59,7 +60,7 @@ class ConfigurationFileTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun empty() {
|
fun empty() {
|
||||||
val result = readRunConfigurations("""
|
val result = collectRunConfigurations("""
|
||||||
runConfigurations:
|
runConfigurations:
|
||||||
""")
|
""")
|
||||||
assertThat(result).isEmpty()
|
assertThat(result).isEmpty()
|
||||||
@@ -67,7 +68,7 @@ class ConfigurationFileTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `empty rc type group`() {
|
fun `empty rc type group`() {
|
||||||
val result = readRunConfigurations("""
|
val result = collectRunConfigurations("""
|
||||||
runConfigurations:
|
runConfigurations:
|
||||||
java:
|
java:
|
||||||
""")
|
""")
|
||||||
@@ -76,7 +77,7 @@ class ConfigurationFileTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `empty rc`() {
|
fun `empty rc`() {
|
||||||
val result = readRunConfigurations("""
|
val result = collectRunConfigurations("""
|
||||||
runConfigurations:
|
runConfigurations:
|
||||||
java:
|
java:
|
||||||
-
|
-
|
||||||
@@ -84,46 +85,9 @@ class ConfigurationFileTest {
|
|||||||
assertThat(result).isEmpty()
|
assertThat(result).isEmpty()
|
||||||
}
|
}
|
||||||
|
|
||||||
//@Test
|
|
||||||
//fun `one java`() {
|
|
||||||
// val result = readRunConfigurations("""
|
|
||||||
// runConfigurations:
|
|
||||||
// java:
|
|
||||||
// isAlternativeJrePathEnabled: true
|
|
||||||
// """)
|
|
||||||
// val options = JvmMainMethodRunConfigurationOptions()
|
|
||||||
// options.isAlternativeJrePathEnabled = true
|
|
||||||
// assertThat(result).containsExactly(options)
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//@Test
|
|
||||||
//fun `one java as list`() {
|
|
||||||
// val result = readRunConfigurations("""
|
|
||||||
// runConfigurations:
|
|
||||||
// java:
|
|
||||||
// - isAlternativeJrePathEnabled: true
|
|
||||||
// """)
|
|
||||||
// val options = JvmMainMethodRunConfigurationOptions()
|
|
||||||
// options.isAlternativeJrePathEnabled = true
|
|
||||||
// assertThat(result).containsExactly(options)
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//@Test
|
|
||||||
//fun `one v as list - template`() {
|
|
||||||
// val result = readRunConfigurations("""
|
|
||||||
// runConfigurations:
|
|
||||||
// templates:
|
|
||||||
// java:
|
|
||||||
// - isAlternativeJrePathEnabled: true
|
|
||||||
// """, isTemplatesOnly = true)
|
|
||||||
// val options = JvmMainMethodRunConfigurationOptions()
|
|
||||||
// options.isAlternativeJrePathEnabled = true
|
|
||||||
// assertThat(result).containsExactly(options)
|
|
||||||
//}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `templates as invalid node type`() {
|
fun `templates as invalid node type`() {
|
||||||
val result = readRunConfigurations("""
|
val result = collectRunConfigurations("""
|
||||||
runConfigurations:
|
runConfigurations:
|
||||||
templates: foo
|
templates: foo
|
||||||
""", isTemplatesOnly = true)
|
""", isTemplatesOnly = true)
|
||||||
@@ -131,9 +95,9 @@ class ConfigurationFileTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun readRunConfigurations(@Language("YAML") data: String, isTemplatesOnly: Boolean = false): List<Any> {
|
fun collectRunConfigurations(@Language("YAML") data: String, isTemplatesOnly: Boolean = false): List<Any> {
|
||||||
val list = SmartList<Any>()
|
val list = SmartList<Any>()
|
||||||
com.intellij.configurationScript.providers.readRunConfigurations(doRead(data.trimIndent().reader())!!, isTemplatesOnly) { _, state ->
|
readRunConfigurations(doRead(data.trimIndent().reader())!!, isTemplatesOnly) { _, state ->
|
||||||
list.add(state)
|
list.add(state)
|
||||||
}
|
}
|
||||||
return list
|
return list
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.intellij.configurationScript
|
|||||||
|
|
||||||
import com.intellij.codeInsight.lookup.LookupElement
|
import com.intellij.codeInsight.lookup.LookupElement
|
||||||
import com.intellij.codeInsight.lookup.LookupElementPresentation
|
import com.intellij.codeInsight.lookup.LookupElementPresentation
|
||||||
|
import com.intellij.configurationScript.providers.PluginsConfiguration
|
||||||
import com.intellij.configurationScript.schemaGenerators.ComponentStateJsonSchemaGenerator
|
import com.intellij.configurationScript.schemaGenerators.ComponentStateJsonSchemaGenerator
|
||||||
import com.intellij.configurationScript.schemaGenerators.RunConfigurationJsonSchemaGenerator
|
import com.intellij.configurationScript.schemaGenerators.RunConfigurationJsonSchemaGenerator
|
||||||
import com.intellij.json.JsonFileType
|
import com.intellij.json.JsonFileType
|
||||||
@@ -26,7 +27,7 @@ internal class ConfigurationSchemaTest : BasePlatformTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun `test map and description`() {
|
fun `test map and description`() {
|
||||||
val variants = test("""
|
val variants = testRunConfigurations("""
|
||||||
runConfigurations:
|
runConfigurations:
|
||||||
java:
|
java:
|
||||||
<caret>
|
<caret>
|
||||||
@@ -39,7 +40,7 @@ internal class ConfigurationSchemaTest : BasePlatformTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun `test array or object`() {
|
fun `test array or object`() {
|
||||||
val variants = test("""
|
val variants = testRunConfigurations("""
|
||||||
runConfigurations:
|
runConfigurations:
|
||||||
java: <caret>
|
java: <caret>
|
||||||
""".trimIndent())
|
""".trimIndent())
|
||||||
@@ -53,7 +54,7 @@ internal class ConfigurationSchemaTest : BasePlatformTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun `test no isAllowRunningInParallel if singleton policy not configurable`() {
|
fun `test no isAllowRunningInParallel if singleton policy not configurable`() {
|
||||||
val variants = test("""
|
val variants = testRunConfigurations("""
|
||||||
runConfigurations:
|
runConfigurations:
|
||||||
compound:
|
compound:
|
||||||
<caret>
|
<caret>
|
||||||
@@ -84,17 +85,6 @@ internal class ConfigurationSchemaTest : BasePlatformTestCase() {
|
|||||||
""")
|
""")
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("unused")
|
|
||||||
private class JdkAutoHint: BaseState() {
|
|
||||||
var sdkName by string()
|
|
||||||
var sdkPath by string()
|
|
||||||
}
|
|
||||||
|
|
||||||
private class JdkAutoHints : BaseState() {
|
|
||||||
@get:XCollection
|
|
||||||
val sdks by list<JdkAutoHint>()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun `test list of objects`() {
|
fun `test list of objects`() {
|
||||||
testComponentState("sdks", """
|
testComponentState("sdks", """
|
||||||
sdks:
|
sdks:
|
||||||
@@ -102,11 +92,18 @@ internal class ConfigurationSchemaTest : BasePlatformTestCase() {
|
|||||||
""", beanClass = JdkAutoHints::class.java, expectedVariants = """sdks (array)""")
|
""", beanClass = JdkAutoHints::class.java, expectedVariants = """sdks (array)""")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun `test list of strings`() {
|
||||||
|
testComponentState("plugins", """
|
||||||
|
plugins:
|
||||||
|
<caret>
|
||||||
|
""", beanClass = PluginsConfiguration::class.java, expectedVariants = """repositories (array)""")
|
||||||
|
}
|
||||||
|
|
||||||
private fun testFooComponentState(path: String, fileContent: String) {
|
private fun testFooComponentState(path: String, fileContent: String) {
|
||||||
testComponentState(path, fileContent, Foo::class.java, expectedVariants = "a (string)")
|
testComponentState(path, fileContent, Foo::class.java, expectedVariants = "a (string)")
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun testComponentState(path: String, fileContent: String, beanClass: Class<out BaseState>, expectedVariants: String) {
|
private fun testComponentState(path: String, @Language("YAML") fileContent: String, beanClass: Class<out BaseState>, expectedVariants: String) {
|
||||||
val variants = test(fileContent.trimIndent(), listOf(object : SchemaGenerator {
|
val variants = test(fileContent.trimIndent(), listOf(object : SchemaGenerator {
|
||||||
private val componentStateJsonSchemaGenerator = ComponentStateJsonSchemaGenerator()
|
private val componentStateJsonSchemaGenerator = ComponentStateJsonSchemaGenerator()
|
||||||
|
|
||||||
@@ -133,7 +130,11 @@ internal class ConfigurationSchemaTest : BasePlatformTestCase() {
|
|||||||
assertThat(presentation.typeText).isEqualTo(expectedDescription)
|
assertThat(presentation.typeText).isEqualTo(expectedDescription)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun test(@Language("YAML") text: String, generators: List<SchemaGenerator> = listOf(RunConfigurationJsonSchemaGenerator()), schemaValidator: ((CharSequence) -> Unit)? = null): List<LookupElement> {
|
private fun testRunConfigurations(@Language("YAML") text: String, schemaValidator: ((CharSequence) -> Unit)? = null): List<LookupElement> {
|
||||||
|
return test(text, listOf(RunConfigurationJsonSchemaGenerator()), schemaValidator)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun test(@Language("YAML") text: String, generators: List<SchemaGenerator>, schemaValidator: ((CharSequence) -> Unit)? = null): List<LookupElement> {
|
||||||
val position = EditorTestUtil.getCaretPosition(text)
|
val position = EditorTestUtil.getCaretPosition(text)
|
||||||
assertThat(position).isGreaterThan(0)
|
assertThat(position).isGreaterThan(0)
|
||||||
|
|
||||||
@@ -165,3 +166,14 @@ private fun getTypeTest(variant: LookupElement): String {
|
|||||||
variant.renderElement(presentation)
|
variant.renderElement(presentation)
|
||||||
return presentation.typeText!!
|
return presentation.typeText!!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
|
internal class JdkAutoHint: BaseState() {
|
||||||
|
var sdkName by string()
|
||||||
|
var sdkPath by string()
|
||||||
|
}
|
||||||
|
|
||||||
|
internal class JdkAutoHints : BaseState() {
|
||||||
|
@get:XCollection
|
||||||
|
val sdks by list<JdkAutoHint>()
|
||||||
|
}
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
package com.intellij.configurationScript
|
package com.intellij.configurationScript
|
||||||
|
|
||||||
//import com.intellij.execution.application.JvmMainMethodRunConfigurationOptions
|
|
||||||
import com.intellij.configurationScript.providers.PluginsConfiguration
|
import com.intellij.configurationScript.providers.PluginsConfiguration
|
||||||
|
import com.intellij.configurationScript.schemaGenerators.PluginJsonSchemaGenerator
|
||||||
import com.intellij.testFramework.ProjectRule
|
import com.intellij.testFramework.ProjectRule
|
||||||
import com.intellij.testFramework.assertions.Assertions.assertThat
|
import com.intellij.testFramework.assertions.Assertions.assertThat
|
||||||
import org.intellij.lang.annotations.Language
|
import org.intellij.lang.annotations.Language
|
||||||
import org.junit.ClassRule
|
import org.junit.ClassRule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
import org.snakeyaml.engine.v2.nodes.MappingNode
|
||||||
|
|
||||||
class PropertyValueReaderTest {
|
class PropertyValueReaderTest {
|
||||||
companion object {
|
companion object {
|
||||||
@@ -15,32 +16,6 @@ class PropertyValueReaderTest {
|
|||||||
val projectRule = ProjectRule()
|
val projectRule = ProjectRule()
|
||||||
}
|
}
|
||||||
|
|
||||||
//@Test
|
|
||||||
//fun `enum`() {
|
|
||||||
// val result = readRunConfigurations("""
|
|
||||||
// runConfigurations:
|
|
||||||
// java:
|
|
||||||
// shortenClasspath: MANIFEST
|
|
||||||
// """)
|
|
||||||
// val options = JvmMainMethodRunConfigurationOptions()
|
|
||||||
// options.shortenClasspath = ShortenCommandLine.MANIFEST
|
|
||||||
// assertThat(result).containsExactly(options)
|
|
||||||
//}
|
|
||||||
|
|
||||||
//@Test
|
|
||||||
//fun map() {
|
|
||||||
// val result = readRunConfigurations("""
|
|
||||||
// runConfigurations:
|
|
||||||
// java:
|
|
||||||
// env:
|
|
||||||
// foo: bar
|
|
||||||
// answer: 42
|
|
||||||
// """)
|
|
||||||
// val options = JvmMainMethodRunConfigurationOptions()
|
|
||||||
// options.env = linkedMapOf("foo" to "bar", "answer" to "42")
|
|
||||||
// assertThat(result).containsExactly(options)
|
|
||||||
//}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun collection() {
|
fun collection() {
|
||||||
val result = doReadPluginsConfiguration("""
|
val result = doReadPluginsConfiguration("""
|
||||||
@@ -54,8 +29,26 @@ class PropertyValueReaderTest {
|
|||||||
options.repositories.addAll(listOf("foo", "bar", "http://example.com"))
|
options.repositories.addAll(listOf("foo", "bar", "http://example.com"))
|
||||||
assertThat(result).isEqualTo(options)
|
assertThat(result).isEqualTo(options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `list of objects`() {
|
||||||
|
val result = JdkAutoHints()
|
||||||
|
readIntoObject(result, readYaml("""
|
||||||
|
sdks:
|
||||||
|
- sdkName: foo
|
||||||
|
sdkPath: /home/foo
|
||||||
|
"""))
|
||||||
|
|
||||||
|
assertThat(result.sdks).hasSize(1)
|
||||||
|
val sdks = result.sdks
|
||||||
|
assertThat(sdks).hasSize(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun doReadPluginsConfiguration(@Language("YAML") data: String): PluginsConfiguration? {
|
private fun readYaml(@Language("YAML") data: String): MappingNode {
|
||||||
return readIntoObject(PluginsConfiguration(), findValueNodeByPath(Keys.plugins, doRead(data.trimIndent().reader())!!.value)!!)
|
return doRead(data.trimIndent().reader())!!
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun doReadPluginsConfiguration(@Suppress("SameParameterValue") @Language("YAML") data: String): PluginsConfiguration? {
|
||||||
|
return readIntoObject(PluginsConfiguration(), findValueNodeByPath(PluginJsonSchemaGenerator.plugins, readYaml(data).value)!!)
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
@file:Suppress("UsePropertyAccessSyntax")
|
||||||
|
package com.intellij.configurationScript
|
||||||
|
|
||||||
|
import com.intellij.execution.application.JvmMainMethodRunConfigurationOptions
|
||||||
|
import com.intellij.testFramework.ProjectRule
|
||||||
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
|
import org.junit.ClassRule
|
||||||
|
import org.junit.Test
|
||||||
|
|
||||||
|
class JavaConfigurationFileTest {
|
||||||
|
companion object {
|
||||||
|
@JvmField
|
||||||
|
@ClassRule
|
||||||
|
val projectRule = ProjectRule()
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `one java`() {
|
||||||
|
val result = collectRunConfigurations("""
|
||||||
|
runConfigurations:
|
||||||
|
java:
|
||||||
|
isAlternativeJrePathEnabled: true
|
||||||
|
""")
|
||||||
|
val options = JvmMainMethodRunConfigurationOptions()
|
||||||
|
options.isAlternativeJrePathEnabled = true
|
||||||
|
assertThat(result).containsExactly(options)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `one java as list`() {
|
||||||
|
val result = collectRunConfigurations("""
|
||||||
|
runConfigurations:
|
||||||
|
java:
|
||||||
|
- isAlternativeJrePathEnabled: true
|
||||||
|
""")
|
||||||
|
val options = JvmMainMethodRunConfigurationOptions()
|
||||||
|
options.isAlternativeJrePathEnabled = true
|
||||||
|
assertThat(result).containsExactly(options)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `one v as list - template`() {
|
||||||
|
val result = collectRunConfigurations("""
|
||||||
|
runConfigurations:
|
||||||
|
templates:
|
||||||
|
java:
|
||||||
|
- isAlternativeJrePathEnabled: true
|
||||||
|
""", isTemplatesOnly = true)
|
||||||
|
val options = JvmMainMethodRunConfigurationOptions()
|
||||||
|
options.isAlternativeJrePathEnabled = true
|
||||||
|
assertThat(result).containsExactly(options)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.intellij.configurationScript
|
||||||
|
|
||||||
|
import com.intellij.execution.ShortenCommandLine
|
||||||
|
import com.intellij.execution.application.JvmMainMethodRunConfigurationOptions
|
||||||
|
import com.intellij.testFramework.ProjectRule
|
||||||
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
|
import org.junit.ClassRule
|
||||||
|
import org.junit.Test
|
||||||
|
|
||||||
|
class JavaPropertyValueReaderTest {
|
||||||
|
companion object {
|
||||||
|
@JvmField
|
||||||
|
@ClassRule
|
||||||
|
val projectRule = ProjectRule()
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `enum`() {
|
||||||
|
val result = collectRunConfigurations("""
|
||||||
|
runConfigurations:
|
||||||
|
java:
|
||||||
|
shortenClasspath: MANIFEST
|
||||||
|
""")
|
||||||
|
val options = JvmMainMethodRunConfigurationOptions()
|
||||||
|
options.shortenClasspath = ShortenCommandLine.MANIFEST
|
||||||
|
assertThat(result).containsExactly(options)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun map() {
|
||||||
|
val result = collectRunConfigurations("""
|
||||||
|
runConfigurations:
|
||||||
|
java:
|
||||||
|
env:
|
||||||
|
foo: bar
|
||||||
|
answer: 42
|
||||||
|
""")
|
||||||
|
val options = JvmMainMethodRunConfigurationOptions()
|
||||||
|
options.env = linkedMapOf("foo" to "bar", "answer" to "42")
|
||||||
|
assertThat(result).containsExactly(options)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,17 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#","$id": "https://jetbrains.com/intellij-configuration.schema.json","title": "IntelliJ Configuration","description": "IntelliJ Configuration to configure IDE behavior, run configurations and so on","type": "object",
|
"$schema": "http://json-schema.org/draft-07/schema#","$id": "https://jetbrains.com/intellij-configuration.schema.json","title": "IntelliJ Configuration","description": "IntelliJ Configuration to configure IDE behavior, run configurations and so on","type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"plugins": {
|
|
||||||
"type": "object","description": "The plugins",
|
|
||||||
"properties": {
|
|
||||||
"repositories": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"foo": {
|
"foo": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|||||||
@@ -1,17 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#","$id": "https://jetbrains.com/intellij-configuration.schema.json","title": "IntelliJ Configuration","description": "IntelliJ Configuration to configure IDE behavior, run configurations and so on","type": "object",
|
"$schema": "http://json-schema.org/draft-07/schema#","$id": "https://jetbrains.com/intellij-configuration.schema.json","title": "IntelliJ Configuration","description": "IntelliJ Configuration to configure IDE behavior, run configurations and so on","type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"plugins": {
|
|
||||||
"type": "object","description": "The plugins",
|
|
||||||
"properties": {
|
|
||||||
"repositories": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"foo": {
|
"foo": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|||||||
@@ -1,31 +1,20 @@
|
|||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#","$id": "https://jetbrains.com/intellij-configuration.schema.json","title": "IntelliJ Configuration","description": "IntelliJ Configuration to configure IDE behavior, run configurations and so on","type": "object",
|
"$schema": "http://json-schema.org/draft-07/schema#","$id": "https://jetbrains.com/intellij-configuration.schema.json","title": "IntelliJ Configuration","description": "IntelliJ Configuration to configure IDE behavior, run configurations and so on","type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"plugins": {
|
|
||||||
"type": "object","description": "The plugins",
|
|
||||||
"properties": {
|
|
||||||
"repositories": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sdks": {
|
"sdks": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"sdks": {
|
"sdks": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"$ref": "#/classDefinitions/com_intellij_configurationScript_ConfigurationSchemaTest$JdkAutoHint"
|
"$ref": "#/classDefinitions/com_intellij_configurationScript_JdkAutoHint"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},"additionalProperties": false
|
},"additionalProperties": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"classDefinitions": {
|
"classDefinitions": {
|
||||||
"com_intellij_configurationScript_ConfigurationSchemaTest$JdkAutoHint": {
|
"com_intellij_configurationScript_JdkAutoHint": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"sdkName": {
|
"sdkName": {
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"$schema": "http://json-schema.org/draft-07/schema#","$id": "https://jetbrains.com/intellij-configuration.schema.json","title": "IntelliJ Configuration","description": "IntelliJ Configuration to configure IDE behavior, run configurations and so on","type": "object",
|
||||||
|
"properties": {
|
||||||
|
"plugins": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"repositories": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},"additionalProperties": false
|
||||||
|
}
|
||||||
|
},"additionalProperties": false
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user