Skip to content

Commit e429750

Browse files
committed
Fix filesystem watcher glob
The current glob for watching workspace file changes uses `?(e)` and `?(a)` to try and mean greadily accept `e` or `a` in the extension. Unfortuately, VS Code doesn't support this syntax, so changes in `.yaml` files in the workspace aren't reported to yaml-language-server. As a result of this, if you have a JSON schema written in YAML, then any files that reference it won't be properly revalidated when you change it, and the cached version of the schema won't be invalidated properly, leading to incorrect completion results. See redhat-developer/yaml-language-server#1134 (comment) Signed-off-by: David Thompson <davthomp@redhat.com>
1 parent 51a7796 commit e429750

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export function startClient(
132132
],
133133
synchronize: {
134134
// Notify the server about file changes to YAML and JSON files contained in the workspace
135-
fileEvents: [workspace.createFileSystemWatcher('**/*.?(e)y?(a)ml'), workspace.createFileSystemWatcher('**/*.json')],
135+
fileEvents: [workspace.createFileSystemWatcher('{**/*.json,**/*.yaml,**/*.eyaml,**/*.yml}')],
136136
},
137137
revealOutputChannelOn: RevealOutputChannelOn.Never,
138138
errorHandler: telemetryErrorHandler,

0 commit comments

Comments
 (0)