From ff39dd1df2cadaffb5ebec091add11357f5910dc Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Sat, 17 Jan 2026 19:50:05 +0100 Subject: [PATCH] Modules/Neovim: Rewrite clangd root_dir expression for neovim v0.11 --- home/modules/neovim/default.nix | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/home/modules/neovim/default.nix b/home/modules/neovim/default.nix index 75a224c8..9e59bb7d 100644 --- a/home/modules/neovim/default.nix +++ b/home/modules/neovim/default.nix @@ -842,21 +842,15 @@ in { { name = "clangd"; extraOptions = { - root_dir.__raw = '' - function(fname) - -- return require("lspconfig.util").root_pattern( - return vim.lsp.config.util.root_pattern( - "Makefile", - "CMakeLists.txt", - ".clang-format", - ".clang-tidy" - -- )(fname) or require("lspconfig.util").root_pattern( - )(fname) or vim.lsp.config.util.root_pattern( - "compile_commands.json" - -- )(fname) or require("lspconfig.util").find_git_ancestor(fname) - )(fname) or vim.lsp.config.util.find_git_ancestor(fname) - end - ''; + root_markers = [ + "Makefile" + "CMakeLists.txt" + ".clang-format" + ".clang-tidy" + "compile_commands.json" + ]; + + workspace_required = true; cmd = [ "clangd"