Skip to content

Fix for cases when aquery environment results do not contain a value key. #254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion refresh.template.py
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ def _get_cpp_command_for_files(compile_action):
Undo Bazel-isms and figures out which files clangd should apply the command to.
"""
# Condense aquery's environment variables into a dictionary, the format you might expect.
compile_action.environmentVariables = {pair.key: pair.value for pair in getattr(compile_action, 'environmentVariables', [])}
compile_action.environmentVariables = {pair.key: pair.value if hasattr(pair,'value') else "" for pair in getattr(compile_action, 'environmentVariables', [])}
if 'PATH' not in compile_action.environmentVariables: # Bazel only adds if --incompatible_strict_action_env is passed--and otherwise inherits.
compile_action.environmentVariables['PATH'] = os.environ['PATH']

Expand Down