apex-dev-tools / apex-dev-tools/apex-ls

Revise the use of Refresh in RenameProvider

Open
#249 0 comments 0 reactions 0 assignees View on GitHub
backlog
Dominant language
Scala
Stars
12
Forks
3
Avg merge
13h 43m
Merged PRs (30d)
19

Description

The rename provider currently calls `refresh` in `getClassBodyDeclaration` method. This is done to correctly resolve dependency holders. When this call is not in place, the list of dependency holders returned from calling getDependencyHolders on a declaration is incomplete.
For example: a function is defined and used in Class A but also used in Class B. If the user tries to rename the function from its **usage** (a callout) in class A - when getDependencyHolders is called on the declaration, it will not return the class body declaration from Class B as a dependency. As a result only instances in Class A are returned.
This is easiest to reproduce the first time you call rename after launching vscode. Subsequent attempts may behave correctly so it's important to make sure the first attempt works.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.