Skip to content
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

Using Rename Symbol (F2) in VSCode renames also part after dot. #5613

Open
PawelWozniak opened this issue May 28, 2024 · 2 comments
Open

Using Rename Symbol (F2) in VSCode renames also part after dot. #5613

PawelWozniak opened this issue May 28, 2024 · 2 comments

Comments

@PawelWozniak
Copy link
Contributor

Summary

This is the same area as in #5585
When I use Rename Symbol (F2) in VSCode, with Apex class open, then also part after dot is replaced. See example below.

Steps To Reproduce:

  1. Open apex class and paste this code:
Contract oneChildContract = parentContract.Renewal_Contracts__r.get(0);
renewalContract.StartDate = oneChildContract.EndDate.addDays(1);
renewalContract.StartDate = oneChildContract.EndDate;
  1. Use Rename Symbol (F2) on "oneChildContract" and type "firstChildContract". Code will be renamed but too much is renamed.
Contract firstChildContract = parentContract.Renewal_Contracts__r.get(0);
renewalContract.StartDate = firstChildContract.firstChildContract.addDays(1);
renewalContract.StartDate = firstChildContract.EndDate;

oneChildContract.EndDate.addDays(1); become firstChildContract.firstChildContract.addDays(1);

Word EndDate was replaced by firstChildContract.

In the line below where there is no .addDays() replacement is correct.

Expected result

Word EndDate is not replaced by firstChildContract.

Actual result

Word EndDate was replaced by firstChildContract.

Additional information

Feel free to attach a screenshot.

Salesforce Extension Version in VS Code: 60.13

Salesforce CLI Version: @salesforce/cli/2.42.6 win32-x64 node-v20.12.2

OS and version: Windows 11

VS Code version: 1.89.1

Most recent version of the extensions where this was working:

@PawelWozniak PawelWozniak changed the title Using Rename variable in VSCode renames also part after dot. Using Rename Symbol (F2) in VSCode renames also part after dot. May 28, 2024
Copy link

git2gus bot commented May 28, 2024

This issue has been linked to a new work item: W-15873777

@daphne-sfdc
Copy link
Contributor

Hi @PawelWozniak, Thank you for filing this issue. Yes, I'm able to replicate it using the code snippet that you provided. I have created a bug in my team's backlog, and we will prioritize it during our grooming session next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants