languages/rust: move rustaceanvim to extensions submodule#1624
languages/rust: move rustaceanvim to extensions submodule#1624sjcobb2022 wants to merge 45 commits into
Conversation
|
@NotAShelf @snoweuph I did have a quick question that I think is quite interesting. The current block of nvim-lspconfig settings purely is to get it working with cargo workspaces. rustaceanvim has all of the cargo workspace stuff built in. Perhaps we could go a different approach, and use rust-analyzer without any of the cargo workspace funk in our preset, and then rely on rustaceanvim for workspace + all its other stuff. In that way, we could keep the rust-analyzer preset super minimal, and rely on rustaceanvim to do the rest of the cool stuff. I would appreciate any comments. |
I dont like the Idea of relying only partial on the LSP.
Basically add t hat as a comment and im fine. |
Gotcha |
|
I have updated and added codelldb as an alternative. I couldn't get it to work with the descriminant type so I updated to using inline lua at 98b0371. Another note is that perhasp we should have enableDAP on the maximal config by default? Also here aresome screenshots of it working for prosterity: raw rust:
|
|
Sorry tagged wrong person earlier oops |
|
ready for re-review btw, sorry should have said something sooner |
|
could you please rebase this onto the latest main branch? we finally merged the big formatter rework :3 |
|
I gotchu |
snoweuph
left a comment
There was a problem hiding this comment.
Mostly LGTM, please rebase on the latest main. Also, after you think something is finished please close the threads as resolved, im losing the overview xD
Also, I would prefer on this one, @horriblename giving the final go, as he did the DAP re:vamp
Thanks for your contribution and time :3



Hi all,
Quick PR to migrate the rust away from a rustaceanvim-first config, and move it to be extension based. Related to #1195.
There are a few of caveats with this approach which I would appreciate comments on. Those being:
For some reason rustaceanvim is unable to pick up
vim.lsp.config.["rust-analyzer"].cmdeven though from my reading of the source code it should be able to do so. Therefore it is set manually for now. See https://github.com/mrcjkb/rustaceanvim/blob/8727e34809a7448b10ebc660c1425c3e808a0004/lua/rustaceanvim/lsp/init.lua#L166-L173.rust-analyzer is inherently, and by design, dependent on rustc and cargo. The nvim-lspconfig settings use them, and rust-analyzer itself is dependent on these tools for its own operation. If they are not in PATH, rust-analyzer is quite limited in its capabilities. My question is whether we should include them in
vim.extraPackagesperhaps? (or place a warning message if they are not present and a rust file is loaded).I have used mkForce in 1 area to ensure that we let rustaceanvim do root_dir and on_attach functions. I do not think that this is the most idiomatic. Perhaps setting the default
lsp.servers.rust-analyzer.root_dirto a very low mkOverride priority, and then making rustaceanvim override it? I feel like we would then need a warning or assertion because of the wacky priorities.Should we add a warning that is present on build saying that we no longer use rustaceanvim by default, or is the changelog enough?
Made with love and without AI.
Sanity Checking
nix fmt).#nix(default package).#maximal.#docs-html(manual, must build).#docs-linkcheck(optional, please build if adding links)x86_64-linuxaarch64-linuxx86_64-darwinaarch64-darwinAdd a 👍 reaction to pull requests you find important.