Skip to content
Merged
Changes from all commits
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
17 changes: 2 additions & 15 deletions lua/modules/configs/completion/servers/clangd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,11 @@ local function switch_source_header_splitcmd(bufnr, splitcmd)
end
end

local function get_binary_path(binary)
local path = nil
if global.is_mac or global.is_linux then
path = vim.fn.trim(vim.fn.system("which " .. binary))
elseif global.is_windows then
path = vim.fn.trim(vim.fn.system("where " .. binary))
end
if vim.v.shell_error ~= 0 then
path = nil
end
return path
end

local function get_binary_path_list(binaries)
local path_list = {}
for _, binary in ipairs(binaries) do
local path = get_binary_path(binary)
if path then
local path = vim.fn.exepath(binary)
if path ~= "" then
table.insert(path_list, path)
end
end
Expand Down