llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clangd Author: SR_team (sr-tream) <details> <summary>Changes</summary> Currently, impossible to remove irrelevant files from CDB via LSP notification `workspace/didChangeConfiguration`. This PR change clangd behavior to remove file from CDB, when LSP pass empty parameters for them. --- Full diff: https://github.com/llvm/llvm-project/pull/72635.diff 1 Files Affected: - (modified) clang-tools-extra/clangd/ClangdLSPServer.cpp (+4-1) ``````````diff diff --git a/clang-tools-extra/clangd/ClangdLSPServer.cpp b/clang-tools-extra/clangd/ClangdLSPServer.cpp index a87da252b7a7e9b..0a228df4f0b5f4c 100644 --- a/clang-tools-extra/clangd/ClangdLSPServer.cpp +++ b/clang-tools-extra/clangd/ClangdLSPServer.cpp @@ -1385,7 +1385,10 @@ void ClangdLSPServer::applyConfiguration( std::move(Entry.second.compilationCommand), /*Output=*/""); if (Old != New) { - CDB->setCompileCommand(File, std::move(New)); + if (New.CommandLine.empty() && New.Directory.empty()) + CDB->setCompileCommand(File, std::nullopt); + else + CDB->setCompileCommand(File, std::move(New)); ModifiedFiles.insert(File); } } `````````` </details> https://github.com/llvm/llvm-project/pull/72635 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits