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

Fix rename for alias and function prefixes #5118

Merged
merged 4 commits into from Sep 14, 2023
Merged

Fix rename for alias and function prefixes #5118

merged 4 commits into from Sep 14, 2023

Conversation

sdankel
Copy link
Member

@sdankel sdankel commented Sep 13, 2023

Description

Closes #4982

There were actually two issues here.

  1. Type aliases were not getting renamed
  2. In any function call with a prefix, the prefix was not getting renamed, whether it was a type alias or not

I added a test that covers both. I also noticed that the other rename tests do not assert anything about the response. I think we should at least assert the number of changes is correct to prevent regressions. I can add that to this PR or open a follow up.

This changes the behavior of go to the definition of a function call prefix. Previously it would go to the impl of the prefix where the function was implemented. Now it takes you to the definition of the struct/enum, or the top of the module instead. The new behavior is more similar to rust-analyzer.

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@sdankel sdankel requested a review from a team September 13, 2023 02:05
@sdankel sdankel marked this pull request as ready for review September 13, 2023 02:06
@JoshuaBatty
Copy link
Member

looks like some go to tests are failing now.

Copy link
Member

@JoshuaBatty JoshuaBatty left a comment

Choose a reason for hiding this comment

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

LGTM

@JoshuaBatty JoshuaBatty requested a review from a team September 13, 2023 23:46
Copy link
Member

@kayagokalp kayagokalp left a comment

Choose a reason for hiding this comment

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

utACK

@sdankel sdankel merged commit af30647 into master Sep 14, 2023
32 checks passed
@sdankel sdankel deleted the sophie/4982 branch September 14, 2023 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename symbol for type aliases isn't working
3 participants