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

fix(pack): make codelldb point to the right path in windows #169

Merged
merged 2 commits into from
Apr 28, 2023
Merged
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
12 changes: 11 additions & 1 deletion lua/astrocommunity/pack/rust/rust.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,23 @@ return {
local package_path = require("mason-registry").get_package("codelldb"):get_install_path()
local codelldb_path = package_path .. "/codelldb"
local liblldb_path = package_path .. "/extension/lldb/lib/liblldb"
local this_os = vim.loop.os_uname().sysname;

-- The path in windows is different
if this_os:find 'Windows' then
codelldb_path = package_path .. "\\extension\\adapter\\codelldb.exe"
liblldb_path = package_path .. "\\extension\\lldb\\bin\\liblldb.dll"
else
-- The liblldb extension is .so for linux and .dylib for macOS
liblldb_path = liblldb_path .. (this_os == "Linux" and ".so" or ".dylib")
end

return {
server = require("astronvim.utils.lsp").config "rust_analyzer",
dap = {
adapter = require("rust-tools.dap").get_codelldb_adapter(
codelldb_path,
liblldb_path .. (vim.loop.os_uname().sysname == "Linux" and ".so" or ".dylib")
liblldb_path
),
},
}
Expand Down