Skip to content

Commit 616a578

Browse files
committed
Apply patch from hedronvision#199.
1 parent a14ad3a commit 616a578

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

refresh.template.py

+4
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,10 @@ def _get_files(compile_action):
614614
"""Gets the ({source files}, {header files}) clangd should be told the command applies to."""
615615

616616
# Getting the source file is a little trickier than it might seem.
617+
is_precompiled_header = any([arg == "-xc++-header" for arg in compile_action.arguments])
618+
if is_precompiled_header:
619+
header_files = [arg for arg in compile_action.arguments if not arg.startswith('-') and arg.endswith(".h")]
620+
return set(), set(header_files)
617621

618622
# First, we do the obvious thing: Filter args to those that look like source files.
619623
source_file_candidates = [arg for arg in compile_action.arguments if not arg.startswith('-') and arg.endswith(_get_files.source_extensions)]

0 commit comments

Comments
 (0)