facebook / facebook/pyrefly

Rename/semantic tokens on redefined variables doesn't work

Open
#1,033 6 comments 2 reactions 1 assignee Claimed by @grievejia View on GitHub
language-server
Dominant language
Rust
Stars
7k
Forks
519
PR merge metrics
No merged PRs in 30d

Description

### Describe the Bug

Consider the following:

```
i = 0
while i < 10:
i = i + 1
```

For me, when I ask pyrefly to rename the first occurrence of `i` to `j` (via a textDocument/rename), it produces:

```
j = 0
while j < 10:
i = j + 1
```

i.e., it does not rename the redefined `i` variable.

Note that, for me (using Emacs `lsp-mode`), when I hover over the first occurrence of `i` in the first snippet, pyrefly does not highlight the redefined `i` variable, although I cannot reproduce that in the Sandbox.

### Sandbox Link

_No response_

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

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.