-
Notifications
You must be signed in to change notification settings - Fork 274
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
Add schema info to diagnostics #310
Comments
@gorkem @JPinkney @joshuawilson WDYT? |
That looks good to me |
Are you sending it as part of the message filed on |
I not sure that understand the question, I add URL/path to Diagnostic#source field |
That is exactly what I was asking. |
OK this is half bad :) Can we have a format such as |
We can, but what is the value of |
|
Signed-off-by: Yevhen Vydolob <[email protected]>
* #310 Add schema info to diagnostics Signed-off-by: Yevhen Vydolob <[email protected]> * Show schema url if file has multiple schemas Signed-off-by: Yevhen Vydolob <[email protected]> * Fix k8s url Signed-off-by: Yevhen Vydolob <[email protected]> * Update test/schemaValidation.test.ts Co-authored-by: Josh Pinkney <[email protected]> * Remove commented code Signed-off-by: Yevhen Vydolob <[email protected]> * Set schema url and title to child schemas Signed-off-by: Yevhen Vydolob <[email protected]> Co-authored-by: Josh Pinkney <[email protected]>
Thanks, nice addition! |
I looked for the entire morning on how to expose this information and I still do not know how to enable the diagnosticst. Was this fixed only in an unreleased version? -- I am currently using the latest YAML 0.15.0 extension, which was released two weeks ago, so I expect to be able to see the diagnostics. Is there a hidden option to enable these? |
@ssbarnea this works since |
@evidolob So why do I see only this: |
I discuss that there #310 (comment) |
And you can use |
The string that is displayed is not really the schema name but is the title of the schema property that generated the error, which does not give any hint about which schema was effectively used. Take a look at one file like https://github.com/ansible-community/ansible-lint/blob/schemas/src/ansiblelint/data/ansible-playbook-schema.json and you will see lots of titles around. So yet, we do display information from within the schema but not the schema information itself. Combined with the fact that user can enable the schemaStore, you endup with a plethora of possible sources for schemas, some configured by local patterns and some determined by the schemastore. Still, as a user I have no clue from which file this came. I am not sure where is the "Jump to schema location" available from, as by pressing F1 (CommandPallete) I am unable to find it and I neither see the light-bulb contextual action available on the error, as documented on https://code.visualstudio.com/docs/editor/refactoring#_code-actions-quick-fixes-and-refactorings -- (i did not disable it in settings). My yaml related settings look like:
|
Oh, my bad As for
Can you create an issue for it? We can fix that pretty fast. |
when validation against a schema fails also add the schema information to the published diagnostics. This way users can identify the schemas that is affecting their YAML files.
The text was updated successfully, but these errors were encountered: