Skip to content

Commit 4948b1e

Browse files
committed
lsp: limit source.fixAll matching to pyrefly subtree
When a client requests source.fixAll.*, we should not run pyrefly fix-all for sibling providers. Restrict matching to either the generic source.fixAll ancestor or source.fixAll.pyrefly descendants.
1 parent c7e6cc2 commit 4948b1e

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

pyrefly/lib/lsp/non_wasm/server.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4174,9 +4174,7 @@ impl Server {
41744174
let allow_fix_all = only_kinds.is_none_or(|kinds| {
41754175
kinds.iter().any(|kind| {
41764176
kind == &CodeActionKind::SOURCE_FIX_ALL
4177-
|| kind
4178-
.as_str()
4179-
.starts_with(CodeActionKind::SOURCE_FIX_ALL.as_str())
4177+
|| kind.as_str().starts_with(SOURCE_FIX_ALL_PYREFLY)
41804178
})
41814179
});
41824180
let allow_refactor = only_kinds.is_none_or(|kinds| {

0 commit comments

Comments
 (0)