Repository navigation
Add Rust support with rustaceanvim - #16
Merged
Merged
Conversation
- rustaceanvim v9 runs the toolchain's rust-analyzer (not Mason's) with clippy as the checker, and finds Mason's codelldb for debugging. mason-nvim-dap installs codelldb but leaves its setup to rustaceanvim. - rust and toml treesitter parsers; neotest gets rustaceanvim's adapter; dap-virtual-text covers Rust. - after/ftplugin/rust.lua: :make runs cargo build into quickfix, and <leader>rr / <leader>rd / <leader>re open runnables, debuggables and the error explanation. - Smoke test checks Rust buffers get treesitter highlighting and that rust_analyzer isn't also enabled through lspconfig. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 90315f97-7c82-4bc1-9bf1-2f8460782554
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Rust support, built on the 0.12 upgrade in #15.
lazy/rust.lua: rustaceanvim v9 (needs Neovim 0.12). It runs rust-analyzer from the toolchain on PATH, not Mason's, so it matches the compiler; clippy is its default checker.codelldb, which rustaceanvim finds on its own. Its mason-nvim-dap handler is a no-op so rustaceanvim owns the Rust adapter and configurations.rustaceanvim.neotestadded to neotest (<leader>T…maps work for Rust).rustandtomlparsers. dap-virtual-text also covers Rust.after/ftplugin/rust.lua:<leader>b(:make!) runscargo buildinto quickfix;<leader>rrrunnables,<leader>rddebuggables,<leader>reexplain error. All three were unused.rust_analyzeris also enabled through lspconfig (two clients would duplicate every result).rustup component add rust-analyzer(with msrustup:msrustup component add rust-analyzer).Tested locally on 0.12.6 with a throwaway
cargo newproject:test tests::adds,cargo test …)main