-
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
JSON Schema (still) not applied for custom file extension #790
Comments
Is this the case when the |
I'm puzzled by the behavior here. If I've opened a file and:
...then why isn't that enough to use that schema? Apart from the specific issues about globs etc, this scheme seems like it won't work when:
|
Unfortunately, we are not staffed to test/implement the LSP on editors other than VSCode, so such oversights happen. |
Is there any update on this issue? I see it was part of the 1.12 milestone but seems to have been a little lost. I'd argue that it's quite a useful issue to fix, not only for our own use case but also for all the other uses of custom file extensions, most notably dotfiles. |
Describe the bug
This has been reported previously, in issues:
And was fixed in PR #714
However, I'm still experiencing the issue.
I believe I can spot the error:
When it adds the custom file extensions to the
yamlSettings.fileExtensions
array, it pushes the entire pattern. This pattern most often has an asterisk in it, like*.bu
. It then checks to see if the extension is present in thefileMatch
property of the schema. The problem is that it does anindexOf
of the pattern on thefileMatch
string, which means it includes the asterisk when looking at the file.So, I think a solution would be to remove the asterisk before searching for it in the
fileMatch
properties.However, I'm a bit confused as to why the test passes...
Expected Behavior
YAML schemas are applied on files with custom extensions if they are configured in the
files.associations
array to be associated with YAML.Current Behavior
YAML schemas are not applied on files with custom extensions.
Steps to Reproduce
See referenced issues.
Environment
The text was updated successfully, but these errors were encountered: