Skip to content

Commit 3f2a973

Browse files
committed
fix(custom-schema-provider): correct class name and resource file reference
The commit corrects an inconsistency in the class name and the associated resource file reference in the `CustomAgentJsonSchemaProviderFactory` class, ensuring that the correct `JsonSchemaFileProvider` is instantiated and the correct schema file is loaded. This change ensures that the custom agent schema is properly resolved and applied, which is essential for correct validation and behavior.
1 parent 4905248 commit 3f2a973

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/233/main/resources/META-INF/autodev-core.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
</extensions>
188188

189189
<extensions defaultExtensionNs="JavaScript.JsonSchema">
190-
<ProviderFactory implementation="cc.unitmesh.devti.custom.schema.AutoDevJsonJsonSchemaProviderFactory"/>
190+
<ProviderFactory implementation="cc.unitmesh.devti.custom.schema.AutoDevJsonSchemaProviderFactory"/>
191191
</extensions>
192192

193193
<actions>

src/main/kotlin/cc/unitmesh/devti/custom/schema/CustomAgentJsonSchemaProviderFactory.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import com.intellij.openapi.project.Project
44
import com.jetbrains.jsonSchema.extension.JsonSchemaFileProvider
55
import com.jetbrains.jsonSchema.extension.JsonSchemaProviderFactory
66

7-
internal class AutoDevJsonJsonSchemaProviderFactory: JsonSchemaProviderFactory {
7+
class AutoDevJsonSchemaProviderFactory: JsonSchemaProviderFactory {
88
override fun getProviders(project: Project): MutableList<JsonSchemaFileProvider> {
99
return mutableListOf(CustomAgentSchemaFileProvider(project))
1010
}

src/main/kotlin/cc/unitmesh/devti/custom/schema/CustomAgentSchemaFileProvider.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ class CustomAgentSchemaFileProvider(val project: Project): JsonSchemaFileProvide
2525
override fun getName(): String = "AutoDevCustomAgentFile"
2626

2727
override fun getSchemaFile(): VirtualFile? {
28-
return JsonSchemaProviderFactory.getResourceFile(this::class.java, schemaFileName)
28+
return JsonSchemaProviderFactory.getResourceFile(this::class.java, customAgentSchemaFile)
2929
}
3030

3131
override fun getSchemaType(): SchemaType {
3232
return SchemaType.schema
3333
}
3434

3535
companion object {
36-
private const val schemaFileName = "autodev-custom-agent.json"
36+
private const val customAgentSchemaFile = "autodev-custom-agent.json"
3737
}
3838
}

0 commit comments

Comments
 (0)