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

Support textDocument/selectionRange request #817

Closed
matklad opened this issue May 4, 2019 · 3 comments
Closed

Support textDocument/selectionRange request #817

matklad opened this issue May 4, 2019 · 3 comments
Assignees

Comments

@matklad
Copy link
Contributor

matklad commented May 4, 2019

There's a new provisional API in the protocol: textDocument/selectionRange.

spec
types

This API allows one to extend current selection to an encompassing syntactic construct, and is imo quite useful for many editing tasks. So, it's expand-region which actually knows about the source syntax.

It might be a good idea to give this API a shot before it is stabilized in the protocol, in case something is missing.

@matklad
Copy link
Contributor Author

matklad commented May 4, 2019

Before this was an official proposal, we've implemented an ad-hoc extension for this in rust-analyzer, together with Emacs integration. This code might be a useful starting point: https://github.com/rust-analyzer/rust-analyzer/blob/aa7bdfd37f999607806cf47c0108d33a5b44b3e5/editors/emacs/ra-emacs-lsp.el#L104-L137

@vibhavp vibhavp self-assigned this May 5, 2019
@yyoncho
Copy link
Member

yyoncho commented May 5, 2019

@matklad thanks for the heads up. As a side note, I am excited for the rest of the stuff you have mentioned in the original issue report especially point 3 - microsoft/language-server-protocol#613

vibhavp you may take a look at expand-region package. It allows plugging custom expand method function via er/try-expand-list so we can reuse pretty much everything

@yyoncho
Copy link
Member

yyoncho commented Jul 31, 2019

Fixed with dc86bbb . I will update the readme with guide how to use it with expand-region as part of the release notes.

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

No branches or pull requests

3 participants