Fix resolution of percent-encoded schema paths in modelines - #1316
Merged
datho7561 merged 2 commits intoAug 6, 2026
Conversation
shin19991207
force-pushed
the
fix-encoded-modeline
branch
from
August 5, 2026 21:42
b077caa to
d2171a1
Compare
shin19991207
force-pushed
the
fix-encoded-modeline
branch
from
August 6, 2026 00:00
d2171a1 to
b077caa
Compare
Signed-off-by: Morgan Chang <shin19991207@gmail.com>
Signed-off-by: Morgan Chang <shin19991207@gmail.com>
shin19991207
force-pushed
the
fix-encoded-modeline
branch
from
August 6, 2026 00:04
ec34c15 to
9174b21
Compare
Contributor
|
Tried this out on Linux and it was working well; I'll also check it on Windows before approving... |
Contributor
|
Works on Windows too! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Prevents percent-encoded schema paths in modelines from being encoded a second time when converted to file URIs.
For example, this following percent-encoded modeline should resolve to a schema named
encoded:schema.json:# yaml-language-server: $schema=./encoded%3Aschema.jsonPreviously, the existing percent escape was encoded again:
Consequently, the schema request targeted a file literally named
encoded%3Aschema.jsoninstead of decoding%3Ato:.What issues does this PR fix or reference?
Related to redhat-developer/vscode-yaml#1274
This is a separate modeline path case discovered while investigating encoded schema URIs in
yaml.schemas.Is it tested? How?
encoded:schema.json(For Windows, useencoded schema.jsonbecause:is invalid in filenames on Windows)# yaml-language-server: $schema=./encoded%3Aschema.json(or# yaml-language-server: $schema=./encoded%20schema.jsonfor Windows)