redhat-developer / redhat-developer/yaml-language-server

JSON Schema (still) not applied for custom file extension

Open
#790 4 comments 0 reactions 1 assignee View on GitHub

@msivasubramaniaan is already working on this.

Since Nov 28, 2022.

  • #805 by @msivasubramaniaan — open
bug
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:

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.