leanprover / leanprover/vscode-lean4
The "Rename Symbol" code action fails to account for constructor/destructor tags
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 313
- Forks
- 104
- Avg merge
- 1h 56m
- Merged PRs (30d)
- 1
Description
The "Rename Symbol" code action in VS Code seems to have issues with inductive types.
inductive Meow where
| mrow
| hiss
def foo : Meow -> Unit
| .mrow => ()
| Meow.hiss => ()
def bar := Meow.mrow
Placing the cursor on Meow in inductive Meow and renaming the symbol will rename it in : Meow, but leave the original symbol name in all destructors and constructors (| Meow.hiss, := Meow.mrow).
Placing the cursor on | mrow in inductive Meow and renaming the symbol (ex. to baz) will incorrectly rename it to | baz (missing the . prefix) in def foo and := baz in def bar (missing the Meow. prefix).
Placing the cursor on .mrow or Meow.hiss in def foo and renaming the symbol will let you rename the whole symbol (i.e. .mrow, Meow.hiss), rather than just the intended mrow or hiss.
vscode-lean4: 0.0.239
lean-toolchain: leanprover/lean4:v4.34.0
Fedora 44
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the VS Code "Rename Symbol" code action and reproduce the issue with the Lean inductive-type snippet in the report. Trace how constructor and destructor references are selected and qualified; done means renaming the inductive type updates all references and renaming mrow or hiss preserves the appropriate . or Meow. qualification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100