-
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 #326
Add schema info to diagnostics #326
Conversation
Signed-off-by: Yevhen Vydolob <[email protected]>
I think this is a really cool feature. I've been playing around with it and it seems like it works perfectly when theres one schema associated to the file but it has a bit of trouble when there's multiple schemas associated to a file. E.g.
and then with content
you'll get Also if you did:
with content
you'll get |
@JPinkney Thx, I miss that file may have multiple schemas, going to fix that |
Signed-off-by: Yevhen Vydolob <[email protected]>
@JPinkney |
Signed-off-by: Yevhen Vydolob <[email protected]>
@gorkem @JPinkney @joshuawilson |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, it looks good to me. I tried it out locally and everything seems to be working almost perfectly. I only issue I ran into was in a test scenario with a .drone.yml
file where I had yaml.settings as:
"yaml.schemas": {
"kubernetes": ".drone.yml"
},
with the content:
apiVersion: v1
kind: Deployment
where I was getting error message Property apiVersion is not allowed.YAML
when hovering apiVersion and when hovering deployment I got
Value is not accepted. Valid values: "pipeline".: YAML
maybe in this case the validator matches a little bit of the drone ci and the kubernetes schema and cannot decide which one it is matching? I'm not sure
if (uriString) { | ||
const url = URI.parse(uriString); | ||
if (url.scheme === 'file') { | ||
label = url.fsPath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case won't label always just end up being whatever url.toString() is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is done for local files, I assume the path /home/user/folder/schema.json
will be more informative than file:///home/user/folder/schema.json
. If URI has different schema than it used as is.
Co-authored-by: Josh Pinkney <[email protected]>
Signed-off-by: Yevhen Vydolob <[email protected]>
Signed-off-by: Yevhen Vydolob <[email protected]>
@JPinkney I fix that, can you check again? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested again and now everything seems to be working as expected!
Fix: #310
Also fix: redhat-developer/vscode-yaml#373 partially, as I add
YAML
for YAML syntax errorsDemo:
Schema with
title
:Local schema:
Yaml error:
Problems:
Kubernetos schema: