-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatic linking of Camel K schema based on Camel K modeline #279
Comments
Personally I'm against having specific code for any extension inside of the language server, and instead, want everything to be an API if possible. The only reason why there is kubernetes specific code was that when I was assigned the project ~3 years ago it was originally just a language server for kubernetes files. Eventually, we enhanced everything to include YAML but also kept kubernetes for compatibility. @gorkem WDYT? |
I agree. I would rather have APIs. I am not sure even kubernetes is making a lot of sense anymore, there are extensions out there nowadays that are using the APIs to set k8s schemas better than the fixed setting. It is something that is left over from the early days of the extension. |
me too personally.
the problem with this approach is that it requires a specific implementation in each client.
would be an API to provide a custom "SchemaResolver" written in javascript/TypeScript? How to pass it when the client is not a typescript project? a npm module and the class name? |
the
yaml-language-server/src/languageservice/services/yamlSchemaService.ts Lines 244 to 269 in 3cdc18b
|
If we re-used the custom schema provider I think what we could do is modify it so that if something like:
appears in the YAML file then instead of passing in the resource to the customSchemaProvider pass in the modeline. That way any extensions that handle the modeline would pass the schema back. For example, |
I started work to register a customSchemaProvider camel-tooling/vscode-camelk#483 Sometimes the schema is correctly found and the completion is provided but most of the time not. Currently searching why. |
rejected to avoid having Camel K specific code inside Yaml language Server. |
Camel K has a specific modeline which allows to identify that a yaml file is a Camel K one.
They would like to avoid forcing a specific filename (such *.camelk.yaml).
Given that schema cannot be specified inside the file directly. Would it be possible to associate the Camel K schema with files using the modeline
# camel-k
?technically, it would be a "simple" matter of modifying
yaml-language-server/src/languageservice/services/yamlSchemaService.ts
Line 217 in 3cdc18b
From a conceptual point of view, are we ready to have specific code to Camel K in Yaml language server? (there is already specific code for Kubernetes)
this would be last priority for schema resolution #250 (comment)
The text was updated successfully, but these errors were encountered: