ruff server: Support setting to prioritize project configuration over editor configuration#11086
Conversation
9637979 to
86ff807
Compare
86ff807 to
51b5c51
Compare
|
38b3b60 to
afbfabe
Compare
charliermarsh
left a comment
There was a problem hiding this comment.
I wonder if this should be an enum, rather than a bool? That way, we can associate documentation with each variant too, which seems like it would be helpful.
@MichaReiser made a similar comment here. I think that's what I plan to go with :) |
|
Oops, I swear I didn't see that! |
|
No worries 😄 |
51b5c51 to
a71e3ed
Compare
2a2997f to
f4ad8e8
Compare
charliermarsh
left a comment
There was a problem hiding this comment.
The code looks good, I'm just not sold on the names...
|
I think @MichaReiser will have good advice on the naming and documentation. |
Lol no 😆 I commented in the other PR that I don't have good naming suggestions haha |
…ce', rename variants, and introduce a third, editor-only variant.
c8b6b56 to
e58c8b6
Compare
) ## Summary Fixes #425 (though only in the pre-release version, since this is a feature for the new LSP server) This is a follow-up to #456. A new setting has been introduced, `Prioritize File Configuration`, which tells the extension to prioritize settings from discovered TOML files over extension settings. Extension settings will still be used when a set field in the extension is not set in the file configuration. ## Test Plan Refer to astral-sh/ruff#11086 for a test plan.
) ## Summary Fixes #425 (though only in the pre-release version, since this is a feature for the new LSP server) This is a follow-up to #456. A new setting has been introduced, `Prioritize File Configuration`, which tells the extension to prioritize settings from discovered TOML files over extension settings. Extension settings will still be used when a set field in the extension is not set in the file configuration. ## Test Plan Refer to astral-sh/ruff#11086 for a test plan.
Summary
This is intended to address astral-sh/ruff-vscode#425, and is a follow-up to #11062.
A new client setting is now supported by the server,
prioritizeFileConfiguration. This is a boolean setting (default:false) that, if set totrue, will instruct the configuration resolver to prioritize file configuration (aka discovered TOML files) over configuration passed in by the editor.A corresponding extension PR has been opened, which makes this setting available for VS Code: astral-sh/ruff-vscode#457.
Test Plan
To test this with VS Code, you'll need to check out the VS Code PR that adds this setting.
The test process is similar to #11062, but in scenarios where the editor configuration would take priority over file configuration, file configuration should take priority.