redhat-developer / vscode-yaml

YAML support for VS Code with built-in kubernetes syntax support
MIT License
652 stars 221 forks source link

Nested glob patterns match paths above them that they shouldn't #1054

Open lord0gnome opened 3 weeks ago

lord0gnome commented 3 weeks ago

Describe the bug

I am trying to match files that have the same names, using folder depth to determine which schema to use.

Expected Behavior

I should be able to use glob patterns to determine the depth of a file, ex : foo/*/*/*/*.bar and match only files at that folder depth

Current Behavior

It matches the depth I want, but also the one directly above it.

Steps to Reproduce

  1. go in settings.json of workspace and configure these settings: { "yaml.schemas":{ "./.lsp/thing1.properties.schema.json": "rootDir/*/filewithsamename.yaml", "./.lsp/thing2.properties.schema.json": "rootDir/*/*/filewithsamename.yaml", "./.lsp/thing3.properties.schema.json": "rootDir/*/*/*/filewithsamename.yaml", "./.lsp/thing4.properties.schema.json": "rootDir/*/*/*/*/filewithsamename.yaml", "./.lsp/thing5.properties.schema.json": "rootDir/*/*/*/*/*/filewithsamename.yaml"} }

  2. Look at some example file matches, they will match the correct file to the correct schema, but also the one above it.

Environment