Skip to content
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

'yaml.schemas' configuration doesn't work on windows with full path #347

Closed
evidolob opened this issue Aug 19, 2020 · 4 comments · Fixed by redhat-developer/yaml-language-server#313
Labels

Comments

@evidolob
Copy link
Collaborator

When I provide json scheme with yaml.schemas and put full path to scheme, like:

C:\Users\yevhen\Documents\GitHub\test\basic_completion_schema.json

This scheme doesn't pick up, and there are no completion items provided.

But when i replace path with:

basic_completion_schema.json

It works as expected.

Related test is https://github.com/redhat-developer/vscode-yaml/blob/master/test/completion.test.ts#L19

That test pass on linux and mac, but fail on windows.

@evidolob evidolob added the bug label Aug 19, 2020
@evidolob
Copy link
Collaborator Author

The problem in https://github.com/redhat-developer/yaml-language-server/blob/master/src/languageservice/services/schemaRequestHandler.ts#L24 as path on windows has kind of scheme c:\ that symbols transforms in to 'scheme' for URI.

@JPinkney WDYT?

@JPinkney
Copy link
Contributor

Yeah that looks to be the case. I think you might be able to to do:

if (scheme === 'file' || scheme === "c") {

here: https://github.com/redhat-developer/yaml-language-server/blob/master/src/languageservice/services/schemaRequestHandler.ts#L27

@evidolob
Copy link
Collaborator Author

Yes, but if path will be d:\something? I think we need to solve this in general, I'm thinking to add check if OS is windows then we may use vscode.Uri.file() method to parse path, and then check uri scheme.

@JPinkney
Copy link
Contributor

That's true, I think

I'm thinking to add check if OS is windows then we may use vscode.Uri.file() method to parse path, and then check uri scheme.

I think that would work better, I just don't know that much about windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants