From 38f5240332fb94c7428ff9404ef7bd5bf344557d Mon Sep 17 00:00:00 2001 From: Boyang Du Date: Tue, 14 Feb 2023 14:25:40 +0000 Subject: [PATCH] ignore compile_commands.json which is unreasonably small in size --- ycmd/completers/cpp/clangd_completer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ycmd/completers/cpp/clangd_completer.py b/ycmd/completers/cpp/clangd_completer.py index 2cfc3c33d9..34e1729f6b 100644 --- a/ycmd/completers/cpp/clangd_completer.py +++ b/ycmd/completers/cpp/clangd_completer.py @@ -427,6 +427,9 @@ def ExtraDebugItems( self, request_data ): def CompilationDatabaseExists( file_dir ): for folder in PathsToAllParentFolders( file_dir ): if os.path.exists( os.path.join( folder, 'compile_commands.json' ) ): - return True + if os.path.getsize( os.path.join( folder, 'compile_commands.json' ) ) < 32: + return False + else: + return True return False