Description
I would like to request to expose the jsonSchemaRegistry
in the public API for extensions.
The interface IJSONContributionRegistry
is defined here:
vscode/src/vs/platform/jsonschemas/common/jsonContributionRegistry.ts
Lines 19 to 55 in b68fa59
I would like to be able to do the same as the internal LanguageModelToolsService
is doing here but within an extension
:
vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.ts
Lines 126 to 127 in b68fa59
- first register a new schema
- associate that schema with a specific file in the workspace/editor
I cannot use the contributes.jsonValidation
(in package.json
) for this, since I need to construct a JSON schema on-the-fly depending on the content of the to-be-analyzed JSON file and the JSON file itself doesn't have a specific filename
pattern that could be used with the contributes.jsonValidation
mechanism.
If the internal jsonSchemaRegistry
as defined here:
would be exposed I could register and unregister the JSON schemas with the different files dynamically/on-the-fly. This would also solve this feature request over here: #230136
Pseudo code would look like this:
const jsonSchemaRegistry: IJSONContributionRegistry = vscode....getJsonSchemaRegistry();
...
const unregisterAssocCb = jsonSchemaRegistry.registerSchemaAssociation(schemaUri, fileUri);
...
unregisterAssocCb();