From 85ee398810cb06e033724a3ee2ad75966882ae71 Mon Sep 17 00:00:00 2001 From: dlond Date: Wed, 3 Sep 2025 09:56:24 +1200 Subject: [PATCH] =?UTF-8?q?fix:=20last=20fix=20=F0=9F=A4=B7=F0=9F=8F=BE?= =?UTF-8?q?=E2=80=8D=E2=99=82=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/compile-commands-picker.lua | 1 - lua/plugins/config/lsp/servers.lua | 22 +------------------ 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/lua/plugins/config/compile-commands-picker.lua b/lua/plugins/config/compile-commands-picker.lua index 527c436e..ecd095d3 100644 --- a/lua/plugins/config/compile-commands-picker.lua +++ b/lua/plugins/config/compile-commands-picker.lua @@ -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) diff --git a/lua/plugins/config/lsp/servers.lua b/lua/plugins/config/lsp/servers.lua index f416dc02..4d8fb69c 100644 --- a/lua/plugins/config/lsp/servers.lua +++ b/lua/plugins/config/lsp/servers.lua @@ -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',