feat(editor): Listen to config file changes and trigger a didChangeConfiguration update (#6964)

Watch eslint and oxlint config files for changes. When these files
change, a `didChangeConfiguration` event will be sent to the language
server.

Ref https://github.com/oxc-project/backlog/issues/132.
This commit is contained in:
Nicholas Rayburn 2024-10-27 19:39:24 -05:00 committed by GitHub
parent ebf37539c0
commit 6b619da23a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -150,8 +150,12 @@ export async function activate(context: ExtensionContext) {
scheme: 'file',
})),
synchronize: {
// Notify the server about file changes to '.clientrc files contained in the workspace
fileEvents: workspace.createFileSystemWatcher('**/.clientrc'),
// Notify the server about file config changes in the workspace
fileEvents: [
workspace.createFileSystemWatcher('**/.eslintr{c,c.json}'),
workspace.createFileSystemWatcher('**/.oxlint{.json,rc.json,rc}'),
workspace.createFileSystemWatcher('**/oxlint{.json,rc.json}'),
],
},
initializationOptions: {
settings: config.toLanguageServerConfig(),