-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Renaming a variable changes all instances except those made on read
#1183
Comments
Hi, I'm the one who implemented the rename symbol capability. This is a known limitation as the parser we use (tree-sitter-bash) doesn't type As for arithmetic expansions, renaming should work as expected since it was raised in #1134 and fixed in #1148. |
Got it thanks. Should I open an issue with tree-sitter? |
You can try, but I'm not sure if they'd be willing to change the current behavior since a fix would require treating read answer Everything after read -p prompt answer Now the parser needs to be aware that We might be able to handle this as a special case from the language server since it's a common enough use case, but I'm not sure if I'll have the time to look into it any time soon. |
The way you explain it, it makes more sense to handle it at the LSP level. |
Hi, so I made a PR (#1221) to address this. I'd appreciate it if you can give the changes a try and see if they work for your use case. |
Thanks. Will test soon and let you know. |
Code editor
Neovim
Platform
Linux
Version
5.4.0
What steps will reproduce the bug?
Any code where a variable is set and then potentially reset by the
read
command. For example, on this snippet:Renaming
CASE
will change it everywhere except for the instance onread -rp "Enter case number (must be 8-10 numerals): " CASE
.How often does it reproduce? Is there a required condition?
Can be reproduced all the time.
What is the expected behavior?
The variable should be renamed everywhere.
What do you see instead?
Rename skips instances of the variable used with the
read
command.Additional information
There are other instances of variables being used without the usual
$
. For example, you can omit the$
inside arithmetic$((...))
. I have not tested if these instances are also skipped by the rename.The text was updated successfully, but these errors were encountered: