You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refresh.template.py: changed the _convert_compile_commands to return a list of SimpleNamespace objects instead of yielding a dictionary & Removal type cast
"""Converts from Bazel's aquery format to de-Bazeled compile_commands.json entries.
811
811
812
812
Input: jsonproto output from aquery, pre-filtered to (Objective-)C(++) compile actions for a given build.
813
-
Yields: Corresponding entries for a compile_commands.json, with commas after each entry, describing all ways every file is being compiled.
813
+
Returns: Corresponding entries for a compile_commands.json, with commas after each entry, describing all ways every file is being compiled.
814
814
Also includes one entry per header, describing one way it is compiled (to work around https://github.com/clangd/clangd/issues/123).
815
815
816
816
Crucially, this de-Bazels the compile commands it takes as input, leaving something clangd can understand. The result is a command that could be run from the workspace root directly, with no bazel-specific environment variables, etc.
iffile=='external/bazel_tools/src/tools/launcher/dummy.cc': continue# Suppress Bazel internal files leaking through. Hopefully will prevent issues like https://github.com/hedronvision/bazel-compile-commands-extractor/issues/77
874
-
yield { # TODO for consistency, let's have this return a list if its parent is returning a list. That'd also let us strip the list() cast in the found = True block, below
875
-
# Docs about compile_commands.json format: https://clang.llvm.org/docs/JSONCompilationDatabase.html#format
876
-
'file': file,
877
-
# Using `arguments' instead of 'command' because it's now preferred by clangd. Heads also that shlex.join doesn't work for windows cmd, so you'd need to use windows_list2cmdline if we ever switched back. For more, see https://github.com/hedronvision/bazel-compile-commands-extractor/issues/8#issuecomment-1090262263
878
-
'arguments': compile_command_args,
879
-
# Bazel gotcha warning: If you were tempted to use `bazel info execution_root` as the build working directory for compile_commands...search ImplementationReadme.md to learn why that breaks.
0 commit comments