ballerina-platform / ballerina-lang

The Ballerina Programming Language
https://ballerina.io/
Apache License 2.0
3.68k stars 752 forks source link

[New Feature]: Support for renaming methods coming from type inclusions #38481

Open pubudu91 opened 2 years ago

pubudu91 commented 2 years ago

Description

This is more of a suggestion. Need to consider and see if what I'm proposing is feasible/makes sense from a language semantics POV. Consider the following:

type Foo object {
    function foo(); // <1>
};

class Bar {
    *Foo;

    function foo() {} // <2>
}

Currently when we rename foo() method at either <1> or <2>, it only renames that particular case (along with its usages I presume). Suppose we rename foo to bar at <1>. Then this breaks all the places in the code where we have used Foo as a type inclusion. So can we consider or rather is it correct to consider foo() at <2> a reference of foo() at <1> and rename foo to bar at <2> as well? The inverse shouldn't happen though: renaming foo() at <2> to bar() shouldn't change foo() at <1>.

Describe your problem(s)

No response

Describe your solution(s)

No response

Related area

-> Editor

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

sanjana commented 1 year ago

Awaiting changes from #34319