From 5752f38c131d1afe335b5edcbe8cbb58e04ecee7 Mon Sep 17 00:00:00 2001 From: Bigo <1781140+crisidev@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:49:12 +0000 Subject: [PATCH] Fix codelldb configuration for linux / mac --- lua/lazyvim/plugins/extras/lang/rust.lua | 27 ++++++------------------ 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index 9770d5ee..b01a61ff 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -97,13 +97,15 @@ return { }, }, config = function(_, opts) - -- Configure dap with codelldb local package_path = require("mason-registry").get_package("codelldb"):get_install_path() + local codelldb = package_path .. "/extension/adapter/codelldb" + local library_path = package_path .. "/extension/lldb/lib/liblldb.dylib" + local uname = io.popen("uname"):read("*l") + if uname == "Linux" then + library_path = package_path .. "/extension/lldb/lib/liblldb.so" + end opts.dap = { - adapter = require("rustaceanvim.config").get_codelldb_adapter( - package_path .. "/codelldb", - package_path .. "/extension/lldb/lib/liblldb.dylib" - ), + adapter = require("rustaceanvim.config").get_codelldb_adapter(codelldb, library_path), } vim.g.rustaceanvim = vim.tbl_deep_extend("keep", vim.g.rustaceanvim or {}, opts or {}) if vim.fn.executable("rust-analyzer") == 0 then @@ -123,21 +125,6 @@ return { bacon_ls = { enabled = diagnostics == "bacon-ls", }, - taplo = { - keys = { - { - "K", - function() - if vim.fn.expand("%:t") == "Cargo.toml" and require("crates").popup_available() then - require("crates").show_popup() - else - vim.lsp.buf.hover() - end - end, - desc = "Show Crate Documentation", - }, - }, - }, rust_analyzer = { enabled = false }, }, },