fix: last fix 🤷🏾‍♂️

This commit is contained in:
dlond 2025-09-03 09:56:24 +12:00 committed by Daniel Lond
parent d8b586a55a
commit 85ee398810
2 changed files with 1 additions and 22 deletions

View File

@ -48,7 +48,6 @@ function M.pick_compile_commands()
prompt_title = 'Select compile_commands.json',
cwd = vim.fn.getcwd(),
find_command = { 'find', '.', '-name', 'compile_commands.json', '-type', 'f' },
previewer = require('telescope.config').values.file_previewer,
attach_mappings = function(prompt_bufnr, map)
actions.select_default:replace(function()
actions.close(prompt_bufnr)

View File

@ -3,35 +3,15 @@ local M = {}
local util = require 'lspconfig.util'
-- Query driver for clangd to find compilers in various locations
local function get_clangd_query_driver()
return table.concat({
'/nix/store/*/bin/clang*',
'/opt/homebrew/opt/llvm/bin/clang*',
'/usr/bin/clang*',
}, ':')
end
-- Get clang resource directory
local function get_clang_resource_dir()
local ok, result = pcall(vim.fn.systemlist, { 'clang++', '--print-resource-dir' })
if ok and result and result[1] then
return result[1]
else
return '/usr/lib/clang/19/include' -- fallback
end
end
function M.get_servers()
return {
-- C/C++ Language Server
-- The clangd from dev-shells is already wrapped with --query-driver and --enable-config
clangd = {
cmd = {
'clangd',
'--query-driver=' .. get_clangd_query_driver(),
'--background-index',
'--clang-tidy',
'--enable-config',
'--fallback-style=llvm',
'--function-arg-placeholders',
'--header-insertion-decorators',