-
Notifications
You must be signed in to change notification settings - Fork 237
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
Ability to specify schema as a comment in the YAML file #401
Comments
@johnbillion yaml-language-server already supports this |
I think yes, it could. As for #397 we have draft PR to fix schema selection redhat-developer/yaml-language-server#362 Any PR is welcome. |
Any updates on this? At this moment I even have zero feedback regarding which schema is used, if any at all. This extensions needs to expose the current schema being used on the status bar, so we would know if any was loaded or not, or if wrong one was used. I even tried to see if there is any command exposed by YAML extension, that can be used to expose if something happened or not regarding validation but I was not able to find any. While using the inline schema specifier, I seen that putting wrong url does correctly reports a failure to load the schema but I seen no proof of success when it worked, which is very important for those that are writing schemas. |
Update: I was able to make the language server recognise a specific format, overriding the auto-association based on the filename. @evidolob, the impact that this issue is having is quite severe at the moment. Just disable the extension? I would, except that it's a dependency for the Visual Studio Code Kubernetes extension and has to be loaded. |
There doesn't seem to be a way to tell the language server that the YAML file it is dealing with is a Kubernetes manifest |
Could we also support something like ⬇️ ?
to solve for: |
Anything blocking this, considering there's an official representation of this? |
This seems to be still the case. |
@madmalkav Please assign yourself and work on this. Thanks for taking this up. |
Sorry, I’m not a native speaker and I think my comment was misleading, I have no knowledge to fix this myself. I have edited my comment to avoid further confusion. |
Is this still a target? If so, I can be the one taking this. |
@pedromvgomes are you still working on this issue ? Any update on that ? |
Is your enhancement related to a problem? Please describe.
A common problem with this extension is mis-detection of the correct schema. For example, a file named
deploy.yml
is assumed to be a PHPDeployer file because this is the only match on JSON Schema Store.Related issues:
The only way to override an incorrect schema is to set glob to schema mapping in the VS Code settings, but this means the settings can't easily be shared between developers or committed to version control.
Describe the solution you would like
It should be possible to insert a leading comment in a YAML file that declares its schema.
VS Code natively supports this for JSON files via a VS Code-specific
$schema
property (because JSON doesn't support comments):In a YAML file, a comment could be used:
When this comment is present, this extension should skip fetching schemas from Schema Store and fetch the linked schema directly, if necessary.
Describe alternatives you have considered
I have no considered whether any other editors or IDEs support such a syntax for YAML file schema declaration. If they do, it would be worth trying to be compatible.
The text was updated successfully, but these errors were encountered: