File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -614,6 +614,10 @@ def _get_files(compile_action):
614
614
"""Gets the ({source files}, {header files}) clangd should be told the command applies to."""
615
615
616
616
# 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 )
617
621
618
622
# First, we do the obvious thing: Filter args to those that look like source files.
619
623
source_file_candidates = [arg for arg in compile_action .arguments if not arg .startswith ('-' ) and arg .endswith (_get_files .source_extensions )]
You can’t perform that action at this time.
0 commit comments