pyrefly icon indicating copy to clipboard operation
pyrefly copied to clipboard

Symbol Renaming (F2) does not work anymore when using VS Code Extension

Open jfthuong opened this issue 7 months ago • 1 comments

Describe the Bug

When the VS Code extension (as of 0.17.0) is installed and enabled, the renaming of symbols with F2 in Python stopped working.

Image

Might be related to #364

Example of code to reproduce:

number = 5

result1 = number + 10
result2 = number * 3
result3 = number ** 2

print("Addition:", result1)
print("Multiplication:", result2)
print("Square:", result3)

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

jfthuong avatar May 27 '25 10:05 jfthuong

Hi @jfthuong thanks for reaching out. We don't yet support this feature but it's on our roadmap and we are tracking it here: https://github.com/facebook/pyrefly/issues/344. I'll make this a sub feature of that one.

lolpack avatar May 27 '25 12:05 lolpack

This should be marked as a bug.

The issue is that when Pyrefly is enabled, the built in function for the "Rename Symbol" feature has been removed (or hidden?).

Before enabling the Pyrefly extension

Command palette:

Image

The right-click menu:

Image

After enabling the Pyrefly extension

The command palette:

Image

The right-click menu:

Image

The existing refactoring tools should not be affected by an extension being installed - especially one that is providing type-checking services.

Version info

VS Code

Version: 1.101.1
Commit: 18e3a1ec544e6907be1e944a94c496e302073435
Date: 2025-06-18T13:35:12.605Z (4 days ago)
Electron: 35.5.1
ElectronBuildId: 11727614
Chromium: 134.0.6998.205
Node.js: 22.15.1
V8: 13.4.114.21-electron.0
OS: Darwin arm64 23.6.0

Pyrefly

Identifier
meta.pyrefly
Version
0.20.2
Last Updated
2025-06-18, 09:26:34

sivynava avatar Jun 22 '25 16:06 sivynava

I've filed a separate issue for this: https://github.com/facebook/pyrefly/issues/544

sivynava avatar Jun 22 '25 16:06 sivynava

hi @sivynava, basic rename support was just added in 0.22.0, please try it out and let us know your thoughts!

kinto0 avatar Jul 01 '25 15:07 kinto0

Hi,

It seems there is still an issue when trying to rename: The element can't be renamed

Image

I just tried to do a "rename symbol" today after re-enabling the Pyrefly extension and I could rename. Shortly after, I have done an update of VS Code (version 1.103.2) and it stopped working (FYI: I have Firefly 0.31.0)

Note that unlike before, we CAN see the Rename Symbol command

Image

Disabling PyreFly allows to rename the variable correctly.

Anybody can reproduce?

Full VS Code version:

Version: 1.103.2 (system setup) Commit: 6f17636121051a53c88d3e605c491d22af2ba755 Date: 2025-08-20T16:45:34.255Z Electron: 37.2.3 ElectronBuildId: 12035395 Chromium: 138.0.7204.100 Node.js: 22.17.0 V8: 13.8.500258-electron.0 OS: Windows_NT x64 10.0.22631

jfthuong avatar Sep 04 '25 01:09 jfthuong

... coming back on my comment, I just noticed that I had disabled Language Services for Pyrefly

Image

After unchecking the box, it works

Image Image

It's all good! 👍

jfthuong avatar Sep 04 '25 01:09 jfthuong