From daee5eeceb5d39c1ccb8a73ff62c62aaba92f362 Mon Sep 17 00:00:00 2001 From: Alexandru Geana Date: Sat, 23 Apr 2022 00:15:51 +0200 Subject: fix(ccls): remove .git from root_dir CCLS does not use .git to identify the root of a project. In addition, it causes issues with projects that are based on the repo tool (e.g. AOSP), which generates .git symlinks in many places in the source tree. In such cases, CCLS incorrectly identifies subdirectories as the root. --- lua/lspconfig/server_configurations/ccls.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lua') diff --git a/lua/lspconfig/server_configurations/ccls.lua b/lua/lspconfig/server_configurations/ccls.lua index dd642db2..70490aa4 100644 --- a/lua/lspconfig/server_configurations/ccls.lua +++ b/lua/lspconfig/server_configurations/ccls.lua @@ -4,7 +4,7 @@ return { default_config = { cmd = { 'ccls' }, filetypes = { 'c', 'cpp', 'objc', 'objcpp' }, - root_dir = util.root_pattern('compile_commands.json', '.ccls', '.git'), + root_dir = util.root_pattern('compile_commands.json', '.ccls'), offset_encoding = 'utf-32', -- ccls does not support sending a null root directory single_file_support = false, @@ -37,7 +37,7 @@ lspconfig.ccls.setup { ]], default_config = { - root_dir = [[root_pattern("compile_commands.json", ".ccls", ".git")]], + root_dir = [[root_pattern("compile_commands.json", ".ccls")]], }, }, } -- cgit v1.2.3-70-g09d2