For a research project, I am trying to understand if I could use yaml-language-server to support external lookup scenarios? Given the following yaml document:
object:
propertyA: ValueA
What I want to accomplish is to have the language server suggest allowed values based on the /object/propertyA path. The problem with this is that these values change frequently. So coding them into the schema as an enum is probably not the best solution.
My idea would be to call an external service for a given path and get a list of allowed values in response.
Alternatively, I could regenerate the JSON schemas on central changes and let the language server reload them periodically via HTTP?
It is possible to modify and reload schemas. I do not have an example that uses yaml-language-server directly, but we expose this API on vscode-yaml. This file should hint what yaml-language-server requests the API corresponds with
Summary
For a research project, I am trying to understand if I could use yaml-language-server to support external lookup scenarios? Given the following yaml document:
What I want to accomplish is to have the language server suggest allowed values based on the /object/propertyA path. The problem with this is that these values change frequently. So coding them into the schema as an enum is probably not the best solution. My idea would be to call an external service for a given path and get a list of allowed values in response.
Alternatively, I could regenerate the JSON schemas on central changes and let the language server reload them periodically via HTTP?
Any hint very appreciated!