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

Editor: Schema link does not work when schema is a local file #513

Closed
1 of 4 tasks
Ark-kun opened this issue May 20, 2021 · 2 comments · Fixed by redhat-developer/yaml-language-server#479
Closed
1 of 4 tasks
Labels
Milestone

Comments

@Ark-kun
Copy link

Ark-kun commented May 20, 2021

Describe the bug

There is a schema link above the editor window. When the schema is a local file, clicking on the link leads to error: Cannot Load content for: A:\<some path>\components.json_schema.json. Unknown schema: 'A'

Expected Behavior

I expect that the schema link works fine when the schema is a local file.

Current Behavior

Cannot Load content for: A:\<some path>\components.json_schema.json. Unknown schema: 'A'

Steps to Reproduce

  1. Add schema from a local file:
    "yaml.schemas": {
        "A:\\<some path>\\components.json_schema.json": "component.yaml"
    }
  1. Create file called component.yaml
  2. In the editor click on the components.json_schema.json line above the first line.

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)
@evidolob evidolob added the bug label May 20, 2021
@alkuzad
Copy link

alkuzad commented May 28, 2021

Using file URI is workaround, some examples:

file:///C:\\Users\\dawid.goslawski\\schema.json
file://localhost/c$/Users/dawid.goslawski/schema.json

@evidolob I've seen you are quite strictly bound to XHR and http/https api, maybe just change documentation ?

@evidolob
Copy link
Collaborator

Hm, I think it would be better to improve schema mappings to support windows paths.

@evidolob evidolob added this to the 0.20.0 milestone Jun 1, 2021
bleach31 pushed a commit to bleach31/vscode-yaml that referenced this issue Jan 25, 2022
* redhat-developer#513 fix opening local schema on windows

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>

* fix test

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>

* Fix opening local schema file on windows

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>

* fix test

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>

* fix test

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
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.

3 participants