Skip to content

Commit

Permalink
Bug 1654557 - add clangd to the clang-tidy package. r=froydnj
Browse files Browse the repository at this point in the history
  • Loading branch information
abpostelnicu committed Jul 22, 2020
1 parent 3b087ff commit f89a833
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions build/build-clang/build-clang.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,8 @@ def get_tool(config, key):
# This function is intended to be called on the final build directory when
# building clang-tidy. Also clang-format binaries are included that can be used
# in conjunction with clang-tidy.
# As a separate binary we also ship clangd for the language server protocol that
# can be used as a plugin in `vscode`.
# Its job is to remove all of the files which won't be used for clang-tidy or
# clang-format to reduce the download size. Currently when this function
# finishes its job, it will leave final_dir with a layout like this:
Expand All @@ -495,6 +497,7 @@ def get_tool(config, key):
# clang-apply-replacements
# clang-format
# clang-tidy
# clangd
# include/
# * (nothing will be deleted here)
# lib/
Expand All @@ -518,10 +521,8 @@ def prune_final_dir_for_clang_tidy(final_dir, osx_cross_compile):
if not os.path.isdir(f):
raise Exception("Expected %s to be a directory" % f)

# In bin/, only keep clang-tidy and clang-apply-replacements. The last one
# is used to auto-fix some of the issues detected by clang-tidy.
re_clang_tidy = re.compile(
r"^clang-(apply-replacements|format|tidy)(\.exe)?$", re.I)
kept_binaries = ['clang-apply-replacements', 'clang-format', 'clang-tidy', 'clangd']
re_clang_tidy = re.compile(r"^(" + "|".join(kept_binaries) + r")(\.exe)?$", re.I)
for f in glob.glob("%s/bin/*" % final_dir):
if re_clang_tidy.search(os.path.basename(f)) is None:
delete(f)
Expand Down

0 comments on commit f89a833

Please sign in to comment.