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

feat: use current range for type_of_range() #564

Merged
merged 2 commits into from
May 10, 2023
Merged

Conversation

bloznelis
Copy link
Contributor

Adds better support for scalameta/metals#3060.

Context:


Currently, vim.lsp.util.make_given_range_params() defaults to previous selection as it's using '< and '> registers underneath (code) which are only updated after leaving visual mode. While it might be useful in some cases, using it for type_of_range() leads to unresponsive experience.

In the new implementation we use getpos() and getcurpos() which returns position that is updated live as selection changes.

Showcase:

hovertype2.mp4

Copy link
Member

@ckipp01 ckipp01 left a comment

Choose a reason for hiding this comment

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

Thanks a lot of sending this in @bloznelis! This looks good to me. Looks like you just need to run a make format and then you should be good to go.

@bloznelis bloznelis requested a review from ckipp01 May 10, 2023 12:45
Copy link
Member

@ckipp01 ckipp01 left a comment

Choose a reason for hiding this comment

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

Perfect. Thanks @bloznelis!

Copy link
Member

@ckipp01 ckipp01 left a comment

Choose a reason for hiding this comment

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

Perfect. Thanks @bloznelis!

@ckipp01 ckipp01 merged commit 9326571 into scalameta:main May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants