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

Rename (remaining cases) #319

Merged
merged 12 commits into from
Oct 29, 2024
Merged

Rename (remaining cases) #319

merged 12 commits into from
Oct 29, 2024

Conversation

simerplaha
Copy link
Member

@simerplaha simerplaha commented Oct 23, 2024

  • Resolves Renaming should apply to all occurrences, not just the current member's scope #318
  • Resolves Renaming an inherited function should also rename its implementations #315
  • Renaming still uses go-to-references for search. So renaming should work on all node types that have go-to-reference implemented.
  • Handles cases that are specific to renaming. These cases can be found in test-cases within the rename package. In short, they ensure that renaming does not change the state of the program, i.e., renaming should not result in additional errors. For example, in the following case, renaming an abstract function should also rename its implementation and not result in an unimplemented function error.
    Abstract Contract Parent() {
      fn >>function@@<<() -> ()
    }
    
    Contract Child() extends Parent() {
      fn >>function<<() -> () { }
    }

@simerplaha simerplaha requested a review from tdroxler October 23, 2024 02:31
@simerplaha simerplaha changed the title Rename Rename (other cases) Oct 23, 2024
@simerplaha simerplaha changed the title Rename (other cases) Rename (remaining cases) Oct 23, 2024
Copy link
Member

@tdroxler tdroxler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job, renaming seems very complicated 😅

Base automatically changed from rename to master October 29, 2024 00:07
@simerplaha simerplaha merged commit 4997024 into master Oct 29, 2024
3 checks passed
@simerplaha simerplaha deleted the rename_other_cases branch October 29, 2024 00:15
@simerplaha
Copy link
Member Author

simerplaha commented Oct 29, 2024

I will try to simplify it and will add more documentation. Rename is the smallest of all CodeProviders. It recursively calls go-to-references on all references, which results in the nodes to rename.

@tdroxler
Copy link
Member

I will try to simplify it and will add more documentation. Rename is the smallest of all CodeProviders. It recursively calls go-to-references on all references, which results in the nodes to rename.

I was more thinking of the complexity of thinking to every edge cases, code wise it's indeed smaller and quite clear

@simerplaha
Copy link
Member Author

simerplaha commented Oct 29, 2024

Oh yes! Complicated for sure. Initially the thought was that it would be as simple as calling go-to-references. These edge cases popped up in my head at random hours through the day.

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