LSP rename incorrectly replaces characters with pyrefly #13902
-
SummaryWhen renaming a Python function parameter using LSP rename functionality, with pyrefly configured, the operation incorrectly replaces characters within function calls instead of properly renaming only the variable references. Note: I'm not entirely sure if this is a Helix issue or a pyrefly issue. The problem only occurs with pyrefly and not with pylsp. Even when using both pyrefly and pylsp together, the issue persists, suggesting that pyrefly's rename may be taking precedence. Is it possible to disable rename for pyrefly, and use pylsp for that? Tested on Reproduction StepsInstall Configure pyrefly as the only LSP for python in [language-server.pyrefly]
command = "pyrefly"
args = ["lsp"]
[[language]]
name = "python"
language-servers = [
"pyrefly",
] Create a python file with the following contents def some(A):
if bar(A):
pass Place cursor on the Trigger rename operation (default: Type new name Confirm the rename Expected BehaviorThe parameter
Final result should be: def some(a):
if bar(a):
pass Actual BehaviorThe rename operation incorrectly replaces characters, resulting in: def some(a):
ifaa:
pass Notice that output.mp4Helix logNo verbose flag~/.cache/helix/helix.log
Single verbose flag (
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is probably a bug in pirefly rather than Helix. You can configure Helix to not use pyrefly for the |
Beta Was this translation helpful? Give feedback.
This is probably a bug in pirefly rather than Helix. You can configure Helix to not use pyrefly for the
rename-symbol
feature https://docs.helix-editor.com/master/languages.html#configuring-language-servers-for-a-language