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

feat(pack): switch to codelldb for rust debugging #106

Merged
merged 4 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lua/astrocommunity/pack/rust/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Rust Language Pack

Requires `lldb-vscode` in your `PATH`

This plugin pack does the following:

- Adds `rust` Treesitter parsers
Expand Down
17 changes: 16 additions & 1 deletion lua/astrocommunity/pack/rust/rust.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,22 @@ return {
"simrat39/rust-tools.nvim",
ft = { "rust" },
init = function() utils.list_insert_unique(astronvim.lsp.skip_setup, "rust_analyzer") end,
opts = function() return { server = require("astronvim.utils.lsp").config "rust_analyzer" } end,
opts = function()
local extension_path = vim.fn.stdpath "data" .. "/mason/packages/codelldb/extension/"
mehalter marked this conversation as resolved.
Show resolved Hide resolved
local codelldb_path = extension_path .. "adapter/codelldb"
local liblldb_path = extension_path .. "lldb/lib/liblldb"

if vim.loop.os_uname().sysname == "Linux" then
liblldb_path = liblldb_path .. ".so"
else
liblldb_path = liblldb_path .. ".dylib"
end
mehalter marked this conversation as resolved.
Show resolved Hide resolved

return {
server = require("astronvim.utils.lsp").config "rust_analyzer",
dap = { adapter = require("rust-tools.dap").get_codelldb_adapter(codelldb_path, liblldb_path) },
}
end,
dependencies = {
{
"jay-babu/mason-nvim-dap.nvim",
Expand Down