1

My issue in short:

I have built an extension, that does additional json validation, completion, definitions. So far - the extension relyed on json schemas in client's settings.json for the main validation. Now I have to make that part dynamic - when client installs a specific npm package, I have to find in it's node modules that definition, and provide it for specific files. So far - have made that part - gathering schemas, and fileMatch them. I have them in a format of ISchemaAssociation (Ref). I was thinking - if only I could send This notification to json language server - it could provide those schemas to the client.

I was even looking by requiring this extension as a dependency, but looks like - it has no exports (Ref to extenions... So I have no way to get any piece of it.

// If it had exported a function like notifySchemaAssociations(associations: IAssociation[]), and I would call it - it would work, since it would notify jsonServer > vscode-json-languageservice, right?

One way - I did make this work - was to build my language server as a pretty much copy-paste from jsonServer.ts, which uses vscode-json-languageservice that does all of the standard json stuff. But this does not feel right...

By looking further into json-language-features - found - that it's inputs are either settings.json / global settings, and other extension contributes.jsonValidation. So I think, I will make my extension update client's settings.json... This is not targeted for public use, just for internal and for some users.

Wish
  • 1,594
  • 1
  • 18
  • 36

0 Answers0