Skip to content

Commit

Permalink
Apply patch from hedronvision#199.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidzchen committed Jun 16, 2024
1 parent a14ad3a commit 616a578
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions refresh.template.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit 616a578

Please sign in to comment.