facebook / facebook/pyrefly

Symbol rename doesn't rename all occurences

Open
#4,284 0 comments 0 reactions 0 assignees View on GitHub
language-server
Dominant language
Rust
Stars
7k
Forks
516
PR merge metrics
No merged PRs in 30d

Description

### Describe the Bug

In VSCode and neovim, when renaming symbol, if variable is reassigned (or was assigned before), it will be treated as a different symbol

Example:

```python
val = 1
val = val + 1
```
If we rename val at line 1:

```python
val1 = 1
val = val1 + 1
```

If we rename val at line 2:

```python
val = 1
val1 = val + 1
```

### Sandbox Link

_No response_

### (Only applicable for extension issues) IDE Information

pyrefly==1.1.1
VSCode extension version 1.1.1
Version in mason 1.1.1

Contributor guide

Open the contributing guide

Research direction

No source file, test, or entry point is named. Reproduce the example in VSCode or neovim with pyrefly 1.1.1, then trace the symbol-rename request and its handling of reassigned variables. Done means renaming either occurrence consistently renames all occurrences of the same symbol.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.