languages/rust: move rustaceanvim to extensions submodule - #1624
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 had to do some doohickies with to get the option to work nicely. Now using a raw mkOption Main issues were:
If there are any other suggestions for a nicer implementation please do say. |
|
Formatted |
snoweuph
left a comment
There was a problem hiding this comment.
Some minor stuff.
generaly looks good to me.
Still needs a final review of @NotAShelf though.
|
could you do one final rebase and solve the conflicts? |
|
oops merged not rebased. |
Don't worry will need to squash this anyways |
snoweuph
left a comment
There was a problem hiding this comment.
LGTM, just a few small docs nicks left.
also because of his nick, requires a final review of @NotAShelf
|
you forgot to run |
|
Gootta doa squash rebase on this and merge as soon as CI passes |
62c16c7 to
46bb459
Compare
Co-authored-by: sjcobb <68509699+sjcobb2022@users.noreply.github.com>
Co-authored-by: sjcobb <68509699+sjcobb2022@users.noreply.github.com>
Co-authored-by: sjcobb <68509699+sjcobb2022@users.noreply.github.com>
NotAShelf
left a comment
There was a problem hiding this comment.
I've got some nitpicks, but they're mostly because we don't have established conventions yet. We'll discuss this on Matrix and establish some conventions first, then I can address my nitpicks myself.
Thank you for your good work (and patience)
46bb459 to
479fd9c
Compare
|
rebased |
|
I'm getting This is without the rustaceanvim extension enabled (codelldb is the default debugger), will test with it enabled. |
|
With it enabled (and nvf/modules/plugins/languages/rust.nix Line 10 in c55a3a7 getExe is from lib.meta).
Reading the source seems to imply that if there were no other eval errors, then with |
|
Also, not sure if this is out of the ordinary, but the rustaceanvim setupOpts options that are explicitly defined don't show up in the docs. Might just be a result of the eval error though? |
|
please don't comment in MRs after they closed, please doc it in an issue, stuff inside MRs will get lost and forgotten. |
Thats a ndg bug I reported to @NotAShelf |
That makes sense, sorry about that (I'm used to just putting it in a fix pr). When I have the ability I'll make an issue/pr depending on the situation, will be the next couple days. |

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.