From 810dad81f9958cbe3a104e73e55cd3b4098e2ef2 Mon Sep 17 00:00:00 2001 From: Alex Gegechkori Date: Sun, 23 Jun 2024 18:15:15 -0700 Subject: [PATCH] Applied patch from hedronvision#199. --- refresh.template.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/refresh.template.py b/refresh.template.py index 3b33701..ecdfdac 100644 --- a/refresh.template.py +++ b/refresh.template.py @@ -614,6 +614,10 @@ def _get_files(compile_action): """Gets the ({source files}, {header files}) clangd should be told the command applies to.""" # Getting the source file is a little trickier than it might seem. + is_precompiled_header = any([arg == "-xc++-header" for arg in compile_action.arguments]) + if is_precompiled_header: + header_files = [arg for arg in compile_action.arguments if not arg.startswith('-') and arg.endswith(".h")] + return set(), set(header_files) # First, we do the obvious thing: Filter args to those that look like source files. source_file_candidates = [arg for arg in compile_action.arguments if not arg.startswith('-') and arg.endswith(_get_files.source_extensions)]