From bcce895706c7342d4b50bc50f7e69f1a37160f08 Mon Sep 17 00:00:00 2001 From: rhcher Date: Tue, 14 Dec 2021 00:46:31 +0800 Subject: fix(ccls): delete invalid root directory pattern (#1565) ccls does not support compile_flags.txt see: https://github.com/MaskRay/ccls/wiki/FAQ#does-ccls-support-compile_flagstxt --- lua/lspconfig/server_configurations/ccls.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lua') diff --git a/lua/lspconfig/server_configurations/ccls.lua b/lua/lspconfig/server_configurations/ccls.lua index 2bf0e17e..09707980 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', 'compile_flags.txt', '.git'), + root_dir = util.root_pattern('compile_commands.json', '.ccls', '.git'), -- ccls does not support sending a null root directory single_file_support = false, }, @@ -13,7 +13,7 @@ return { https://github.com/MaskRay/ccls/wiki ccls relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) specified -as compile_commands.json or, for simpler projects, a compile_flags.txt. +as compile_commands.json or, for simpler projects, a .ccls. For details on how to automatically generate one using CMake look [here](https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html). Alternatively, you can use [Bear](https://github.com/rizsotto/Bear). Customization options are passed to ccls at initialization time via init_options, a list of available options can be found [here](https://github.com/MaskRay/ccls/wiki/Customization#initialization-options). For example: @@ -36,7 +36,7 @@ lspconfig.ccls.setup { ]], default_config = { - root_dir = [[root_pattern("compile_commands.json", ".ccls", "compile_flags.txt", ".git") or dirname]], + root_dir = [[root_pattern("compile_commands.json", ".ccls", ".git")]], }, }, } -- cgit v1.2.3-70-g09d2