AdaCore/ada_language_server

Renaming rarely works

Joebeazelman opened this issue · 3 comments

When I try to rename an identifier (the name of a function, procedure, variable, or type) using VS Code's Rename Symbol menu option, it complains that it can't rename it without providing a reason. On other occasions, it lets me go through the process of renaming it but nothing happens. There has only been a few times when it successfully renamed an identifier.

We have an improvement that shows more information of failed refactoring in the problem windows. This will be in the next release. We are interested in fixing renaming issue. Please send us any reproducer for this issue.

I would have to send you my project which is confidential.

Please send us any reproducer for this issue.

In my experience, just about any Ada code at all will reproduce it. I used VS Code extensively during the 2023 Advent of Code, and the Rename feature didn't rename anything except the text I had clicked on. It wasn't able even to rename the label after an end keyword.

For example, the following steps reproduce the issue for me:

  1. alr init --bin test_rename
  2. cd test_rename
  3. codium .
  4. open src/test_rename.adb
  5. click on Test_Rename in line 1
  6. press f2
  7. rename Test_Rename to anything at all
  8. observe that line 4 still has end Test_Rename