redhat-developer / redhat-developer/yaml-language-server
JSON Schema (still) not applied for custom file extension
@msivasubramaniaan is already working on this.
Since Nov 28, 2022.
- #805 by @msivasubramaniaan — open
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 352
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 11
Description
Describe the bug
This has been reported previously, in issues:
- https://github.com/redhat-developer/vscode-yaml/issues/747
- https://github.com/redhat-developer/vscode-yaml/issues/701
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 the fileMatch property of the schema. The problem is that it does an indexOf of the pattern on the fileMatch 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
- Windows
- Mac
- Linux
- other (please specify)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.