redhat-developer / redhat-developer/yaml-language-server
Do not apply schema to child directories
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 352
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 11
Description
Is your enhancement related to a problem? Please describe.
I have a directory that has the following structure:
- parent
- child_folder
- client1_folder
- theme.yaml
- client2_folder
- theme.yaml
- client1_folder
- client1.yaml
- client2.yaml
- child_folder
I have defined 2 schema files: the first should be applied to all yaml files directly in the parent directory (there is not a naming convention for the files), while the second should be applied to all files in parent's child directories, that are named theme.yaml. However the way the glob string is applied to the document paths, there doesn't seem to be a way to avoid application of a schema recursively.
Describe the solution you would like
I would like the server to either:
- Only apply schemas recursively in a directory if a double * is used (e.g.
foo/**/*.yamlorfoo/**.yaml) - Be able to set a flag to disable recursive application of schemas for a directory
The first option is preferred, since it is more in line with the way glob strings are generally used.
Describe alternatives you have considered
I know I could use the inline schema technique to specify which schema to use for the file. In my case, I have many files in the parent folder, so this is not ideal.
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.
Research direction
Start by tracing how schema glob strings are matched against document paths in the YAML language server. Compare the current recursive behavior with the requested single-directory and double-star cases; the work is done when schemas using a single * do not apply to child directories while ** patterns retain recursive matching.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, yaml
- Domain
- devtools, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100