facebook / facebook/pyrefly

Renaming dataclass property renames class name instead

Open
#2,496 2 comments 0 reactions 1 assignee Assigned to @shobhitmehro View on GitHub
help wanted language-server
Dominant language
Rust
Stars
7k
Forks
519
PR merge metrics
No merged PRs in 30d

Description

### Describe the Bug

When renaming a property of a dataclass (or Pydantic Schema / ...) pyrefly renames the class name instead:

```python
@dataclass
class Foo:
a: int
b: str

Foo(
a=123,
b='abc', # <- press F2 or "Rename Symbol" here, enter 'c'
)
```

After renaming:

```python
@dataclass
class c:
a: int
b: str

c(
a=123,
b='abc',
)
```

### Sandbox Link

_No response_

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

VSCode with pyrefly v0.53.0

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.