Modifications to config files that are used through `extend` in another config file don't trigger ruff-vscode to reload the config
If we have a Ruff config file (e.g. .ruff.toml) that uses extend to build on another Ruff file (e.g. .ruff-base.toml), and use this in VSCode, changes to the extend files don't trigger VSCode to reload the config. The extending files needs to be save to trigger (or alter ruff settings, or reload VSCode).
My guess is that ruff-vscode doesn't currently watch the extended files.
Example files attached, and demo video showing the bug case as described step by step:
- Load the three files in VSCode, show them side-by-side for clarity
- Make sure ruff-vscode is configured to use
.ruff.toml - observe that nothing is highlighted in
some_file.py - uncomment line 6 (about
dummy-variable-rgx) in.ruff-base.toml(any change here that would effect the warnings would be fine) and save - observe that nothing has changed in highlighting in
some_file.py - do a null-op change to
.ruff.tomland save (or just hit save, but that's not very visible on video) - observe that now the highlighting in
some_file.pyhas changed - recomment line 6 in
.ruff-base.tomland save - observe highlighting doesn't change
- null-op change to
.ruff.tomland save - observe highlighting now changes
some_file.py .ruff.toml.txt .ruff-base.toml.txt
https://github.com/user-attachments/assets/adee34f3-8094-4ce3-9374-4d7c6ab25426
Thanks for the report! This certainly sounds plausible to me, but @dhruvmanila might know more about how this works/is intended to work.
My guess is that ruff-vscode doesn't currently watch the extended files.
Yes, this is correct. The server doesn't watch for the config files specified in extend. If that config file is part of the project itself, then the server should be watching for those files but if it's outside the project then it won't be.
Currently, this is a limitation of the way the server code is structured because the server doesn't have access to the resolved settings at the point of registering the file watcher. This is different in the ty server and we could port the same code changes to Ruff in order to support this.