From 6045a52d82ba4b0dcd0b050688302a22c2fc3991 Mon Sep 17 00:00:00 2001 From: GrigoreAlexandru-Arch <93489863+GrigoreAlexandru-Arch@users.noreply.github.com> Date: Tue, 5 Sep 2023 00:07:55 +0300 Subject: [PATCH] fix: #1305 rust debugging not working on windows due to missing liblldb path (#1390) --- lua/lazyvim/plugins/extras/lang/rust.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index 4e827270..699ad563 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -51,8 +51,14 @@ return { local codelldb = mason_registry.get_package("codelldb") local extension_path = codelldb:get_install_path() .. "/extension/" local codelldb_path = extension_path .. "adapter/codelldb" - local liblldb_path = vim.fn.has("mac") == 1 and extension_path .. "lldb/lib/liblldb.dylib" - or extension_path .. "lldb/lib/liblldb.so" + local liblldb_path = "" + if vim.loop.os_uname().sysname:find("Windows") then + liblldb_path = extension_path .. "lldb\\bin\\liblldb.dll" + elseif vim.fn.has("mac") == 1 then + liblldb_path = extension_path .. "lldb/lib/liblldb.dylib" + else + liblldb_path = extension_path .. "lldb/lib/liblldb.so" + end adapter = require("rust-tools.dap").get_codelldb_adapter(codelldb_path, liblldb_path) end return {