-
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
There should be a way to specify Schema file that is part of the project #123
Comments
If i'm not mistaken you can do something like:
So that "./schemas/my-schema.json is applied to my.schema.yaml. Relative paths should work. |
@JPinkney Your example indeed works, but only in single-folder workspace (at least we couldn't make it work in muulti-root workpsace). Is there any trick on how to make it work in multi-folder workspace? If feels like it be better to support standard VSCode reference variables as in https://code.visualstudio.com/docs/editor/variables-reference Could you please clarify what do you mean by relative paths? Relative to what? Also, we need a way to specify that schema location is relative to the YAML file. The simplified folder structure of our data is like this:
So, we would like to specify something like this in
Currently, |
I'd like to use
where some schemas are shared between multiple projects. |
I was trying to get something like: # yaml-language-server: ${workspaceFolder}/my-schema.json But it didn't seem to work. Would this be possible? |
Yes please, setting schema sets an absolute path that works on just that system not any system. |
this appears to have been removed in favor of the rather frustratingly unhelpful error message "unable to load schema from '/<whatever path you specified>': No Content."
or have the extension updated to use a more user-friendly path resolution method? EDIT: It turns out I was incorrect on this. I just encountered a bit of a footgun created by a mismatch between the marketplace description and the README. Reading the README here gives the correct information, while the information in the vscode marketplace appears to be outdated. Definitely would be happy to see an update to the marketplace page to bring it in line with the README here. |
During active development, especially for a small or local or private project there is no justification to post schema to some hosted location, like Schema store.
yaml.schemas
settings should allow specifying${workspaceFolder}
placeholder infile:///local-path
or, ideally, just recognize relative path notationFor example:
/schemas/my-schema.json
should mean that schema file is located infile:///${workspaceFolder}/schemas/my-schema.json
The only way it works right now is if we specify absolute path of the schema file on local file system in Worspace settings file, but it doesn't work in generall, because different developers / dev boxes have different folder names/structure.
VSCode-yaml extension v0.0.16
VSCode: (windows portable install)
Version: 1.27.2
Commit: f46c4c469d6e6d8c46f268d1553c5dc4b475840f
Date: 2018-09-12T16:17:45.060Z
Electron: 2.0.7
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64
The text was updated successfully, but these errors were encountered: