-
-
Notifications
You must be signed in to change notification settings - Fork 904
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
Add 2 rust analyzer LSP extensions #2776
Add 2 rust analyzer LSP extensions #2776
Conversation
@brotzeit should I add any documentation on these 2 functions or is documentation auto-generated from the code? |
Yes, only documentation of defcustom are auto generated, otherwise you should edit |
Thanks for clarifying. Since there were no comments about function names or UX, I think I can record the gifs, while changing the implementation |
c8613db
to
919c531
Compare
Not sure if this belongs here, maybe doom? I realised that one of those lsp extensions can replace a function defined in rustic-mode. (if (and (fboundp #'rustic-open-dependency-file)
(fboundp #'lsp-rust-analyzer-open-cargo-toml))
(advice-add 'rustic-open-dependency-file :override #'lsp-rust-analyzer-open-cargo-toml)) thoughts? |
@petr-tik rustic has lsp module, right? |
Indeed - thanks for pointing out this basic omission of mine. I can contribute my humble patch there, should you decide that this PR is worthy of merging and they deem my little piece of advise a deserving addition. In the meantime, i shall await your review and verdict on this attempt at extending the already glorious lsp-mode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good: few minor nits.
It should be in lsp-mode since there is rust-mode as well. |
I can leave it at the bottom of the file then? I am just not sure if people want a behind-the-scenes change in interactive functions |
Takes a universal arg to open in another window similar to lsp-clangd-find-other-file Implement the related tests ra extension Extract the common code to run a given runnable in cargo-process-mode and use it in ~lsp-rust-analyzer-run~ as well as =lsp-rust-analyzer-related-tests=
It should not be part of lsp-mode. It should be part of rustic and it should run either OOTB or it should be behind a config option. |
Can you fix the conflicts? |
919c531
to
d3d00fc
Compare
Have addressed your careful review to the best of my limited ability and resolved the conflict in the changelog. Only the ivy-specific comment left - I think the rest of the PR is ready. |
extend the rust-analyzer protocol with relevant entries add a review comment about the preview function Add manual documentation and gifs for both interactive functions
d3d00fc
to
f2ac5e4
Compare
Implement OpenCargoToml - takes a universal arg to open in another window similar to lsp-clangd-find-other-file.
Still has some outstanding comments for code review.
Add the Related Tests interactive function - for some reason this rust-analyzer endpoint doesn't return
Runnable[]
but instead a list of key value mappings, where key is always "runnable" and value is theRunnable
, hence I couldn't find many opportunities for code reuse with otherlsp-rust-analyzer-*-runnable
methodsExtract the common code to run a given runnable in cargo-process-mode and use it in
lsp-rust-analyzer-run
as well aslsp-rust-analyzer-related-tests
. Tested manually in a local checkout of rust-analyzer (of course), didn't add any tests, as there isn't a sample rust project.Misc code tidy-up to pacify flycheck