rewrite icon indicating copy to clipboard operation
rewrite copied to clipboard

Enhance `VariableNameScopeVisitor` to track variable declarations in each scope

Open traceyyoshima opened this issue 3 years ago • 0 comments

Track variable declarations in name scopes to enable similar renaming functionality as IntelliJ when there are namespace conflicts.

Currently, all names are included as a set of strings. So, using the set to detect conflicts may result in a new name that isn't necessary. I.E. name is detected as a conflict and name1 is generated to prevent a change in-app behavior. I.E.

class SomeClass {
    int name = 0;
    void someMethod() {
        int isRenamed = 1;  // if isRenamed is changed to `name`, the reference to SomeClass.name may be changed to this.name.
        name += 1;
    }
}

traceyyoshima avatar Jun 30 '22 20:06 traceyyoshima