-
Notifications
You must be signed in to change notification settings - Fork 57
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
Rename Symbol is inconsistent #124
Comments
Thanks for the report! I suspect this is a bug, likely due to the fairly complicated nature of that source line. Can you add a couple of source code examples here (not screenshots) where this does not work? |
Alright, I narrowed it down! And it's weird ;-) Apparently, renaming the symbol does not work of the following two conditions apply:
Example: Originial State, prior to "rename symbol": character(len=255) :: ORIGINAL_NAME
! << "rename-symbol" works
ORIGINAL_NAME = "Testing"
! << "rename-symbol" works
write(*,*) ORIGINAL_NAME
! << "rename-symbol" works
write(*,'(A)') "This is a test with NO quotation mark in this string: ",trim(adjustl(ORIGINAL_NAME))
! << "rename-symbol" does not work
write(*,'(A)') "This is also a test, but with a quotation mark BEFORE the variable call: ' ", trim(adjustl(ORIGINAL_NAME))
! << "rename-symbol" works
write(*,'(A)') "This is also a test, but with a quotation mark BEFORE the variable call: ' ","a second quotation mark: ' ", trim(adjustl(ORIGINAL_NAME))
! << "rename-symbol" works
write(*,'(A)') trim(adjustl(ORIGINAL_NAME)), "This is also a test, but with a quotation mark ' after the variable call" Changed State, after using "rename symbol": character(len=255) :: RENAMED_VARIABLE_NAME
! << "rename-symbol" works
RENAMED_VARIABLE_NAME = "Testing"
! << "rename-symbol" works
write(*,*) RENAMED_VARIABLE_NAME
! << "rename-symbol" works
write(*,'(A)') "This is a test with NO quotation mark in this string: ",trim(adjustl(RENAMED_VARIABLE_NAME ))
! << "rename-symbol" does not work
write(*,'(A)') "This is also a test, but with a quotation mark BEFORE the variable call: ' ", trim(adjustl(ORIGINAL_NAME))
! << "rename-symbol" works
write(*,'(A)') "This is also a test, but with a quotation mark BEFORE the variable call: ' ","a second quotation mark: ' ", trim(adjustl(RENAMED_VARIABLE_NAME ))
! << "rename-symbol" works
write(*,'(A)') trim(adjustl(RENAMED_VARIABLE_NAME )), "This is also a test, but with a quotation mark ' after the variable call" I hope you can work with that? If not, please let me know how I can help! |
Another example: Originial State, prior to "rename symbol": character(len=255) :: ORIGINAL_NAME
call do_someting("test ' ",0,file_id,cbuf,ORIGINAL_NAME)
call do_someting("test ' ' ",0,file_id,cbuf,ORIGINAL_NAME)
call do_someting("test",0,file_id,cbuf,ORIGINAL_NAME," ' ") Changed State, after using "rename symbol": character(len=255) :: RENAMED_VARIABLE_NAME
call do_someting("test ' ",0,file_id,cbuf,ORIGINAL_NAME)
call do_someting("test ' ' ",0,file_id,cbuf,RENAMED_VARIABLE_NAME )
call do_someting("test",0,file_id,cbuf,RENAMED_VARIABLE_NAME ," ' ") |
Thanks for all the great test cases! I will look into it the next time I get a chance. |
Awesome! |
Hello!
I just tried "Rename Symbol" to change a variable name across the project.
(Just to clarify, this is essentially a refactoring process, correct?)
Anyway, sometimes it renames the symbol, but sometimes not and then not even in the same file. Unfortunately, I could not find a pattern so far, sorry.
Steps:
Pressing F2 (or right-click "Rename Symbol") in order to rename
MAIN_PLUGIN_ROOT_FOLDER to test_MAIN_PLUGIN_ROOT_FOLDER
The variable which I selected gets renamed accordingly:
However, further down the same source file, it sometimes apply the change, and sometimes not:
Am I doing something wrong or is this a bug?
Hope to hear from you soon!
The text was updated successfully, but these errors were encountered: