python-lsp/python-lsp-ruff

fixall should consider range

Shane-XB-Qian opened this issue · 4 comments

'fix all' of code action should consider the range,
the statement in def pylsp_code_actions( :

    range : Dict
        Range argument given by pylsp. Not used here.

should be not true, this range i guess should be used later in checks_with_fixes to filter fixes only in this range.
otherwise 'fix all' probably in the action list all the time, but that actually maybe would get action nothing from it.

I'm not sure what kind of range the 'Fix all' action should take, wouldn't you expect it to explicitly go through the whole document instead of only a range?

You mentioned that other language servers also include ranges in fix all actions, but I couldn't find any that check in the range only (i.e. ruff-lsp).
Otherwise I would be opposed to this, since the "Fix all" action is supposed to just go through the document and apply any easy applicable fixes without any user input required.