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 Lsp Symbol Rename Bug #1046

Merged
merged 2 commits into from
Apr 5, 2022
Merged

Fix Lsp Symbol Rename Bug #1046

merged 2 commits into from
Apr 5, 2022

Conversation

JoshuaBatty
Copy link
Member

closes #1042

Copy link
Contributor

@adlerjohn adlerjohn left a comment

Choose a reason for hiding this comment

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

Revert changes to lockfile pls, update in separate PR

Copy link
Contributor

@mitchmindtree mitchmindtree left a comment

Choose a reason for hiding this comment

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

LGTM, but I might give @leviathanbeak the chance to give this a tick in case there was some reason for make_range_end_inclusive I'm overlooking.

Also it looks like the lock file update isn't necessary to land this right? If that's the case, are we able to remove that commit? I think the general approach for maintaining the lock file is to only update if it is strictly necessary for the PR to work (e.g. new dependencies were introduced or some critical bug was patched) or the PR itself is for a dedicated update of all dependencies. Otherwise it's a bit too easy to run into lots of unrelated conflicts between PRs.

@JoshuaBatty JoshuaBatty force-pushed the josh/lsp_rename_bug branch from 0ef4ef9 to c7a42ce Compare March 28, 2022 03:10
@JoshuaBatty
Copy link
Member Author

Ok cool, make sense. I'll omit the lock file in future PR's unless it is necessary for the PR to work.

@leviathanbeak not sure why this function was once needed?

Copy link
Contributor

@adlerjohn adlerjohn left a comment

Choose a reason for hiding this comment

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

utACK, would like @leviathanbeak to weigh in too

@leviathanbeak
Copy link
Contributor

@JoshuaBatty I don't remember exactly for renaming, but I know for example when hovering over symbols there was a "off by 1" bug, where you would hover over the last character and you would not get anything so I added +1.

So I probably added +1 to the rename range when I shouldn't, if this fix passes all the possible scenarios:

  • requesting "rename" while hovering over the last character
  • requesting "rename" while hovering over the next whitespace after the last character (and not getting anything back)

then I guess it's fine :)

@sezna
Copy link
Contributor

sezna commented Apr 4, 2022

Is this good to go? Seems like everybody is happy with it and it has been 7 days since last activity. cc @JoshuaBatty @adlerjohn @mitchmindtree

mitchmindtree
mitchmindtree previously approved these changes Apr 4, 2022
@JoshuaBatty
Copy link
Member Author

Is this good to go? Seems like everybody is happy with it and it has been 7 days since last activity. cc @JoshuaBatty @adlerjohn @mitchmindtree

Sorry, have been sick so haven't had a chance to double-check what Elvis recommended, going to do that now and finish this PR off.

@JoshuaBatty
Copy link
Member Author

This should be good to go now, have double-checked it passes the scenarios that Elvis brought up.

@JoshuaBatty JoshuaBatty merged commit 2485b5d into master Apr 5, 2022
@JoshuaBatty JoshuaBatty deleted the josh/lsp_rename_bug branch April 5, 2022 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Rename symbol in sway-lsp overwrites the ( char of a function
5 participants