Skip to content
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

Use the do_ci.sh script for refreshing the compilation database #37668

Merged
merged 3 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
{
"label": "Refresh Compilation Database",
"type": "shell",
"command": "tools/vscode/refresh_compdb.sh",
"command": "ENVOY_GEN_COMPDB_OPTIONS=\"--vscode\" ./ci/do_ci.sh refresh_compdb",
"problemMatcher": []
},
{
"label": "Refresh Compilation Database Exclude Contrib",
"type": "shell",
"command": "EXCLUDE_CONTRIB=true tools/vscode/refresh_compdb.sh",
"command": "ENVOY_GEN_COMPDB_OPTIONS=\"--vscode --exclude_contrib\" ./ci/do_ci.sh refresh_compdb",
"problemMatcher": []
},
{
Expand Down
3 changes: 2 additions & 1 deletion support/hooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ do
# directory, independent of whether we're in a submodule, so no need to use
# our `relpath` helper.
SCRIPT_DIR="$(dirname "$(realpath "$0")")/../../tools"
CI_DIR="$(dirname "$(realpath "$0")")/../../ci"

_CHANGES=$(git diff --name-only "$RANGE" --diff-filter=ACMR --ignore-submodules=all 2>&1 | tr '\n' ' ')
IFS=' ' read -ra CHANGES <<< "$_CHANGES"
Expand All @@ -77,7 +78,7 @@ do
# "$SCRIPT_DIR"/spelling/check_spelling_pedantic.py check "${CHANGES[@]}" || exit 1

# TODO(mattklein123): Optimally we would be able to do this on a per-file basis.
"$SCRIPT_DIR"/proto_format/proto_format.sh check || exit 1
"$CI_DIR"/do_ci.sh check_proto_format || exit 1

bazel run //tools/code:check -- \
-s main \
Expand Down
5 changes: 2 additions & 3 deletions tools/vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ environment. Recommended extensions and settings are listed in

## Refresh compilation database

`tools/vscode/refresh_compdb.sh` is a script to refresh compilation database, it may take a while
`ci/do_ci.sh refresh_compdb` is a script to refresh compilation database, it may take a while
to generate all dependencies for code completion, such as protobuf generated codes, external dependencies.
If you changed proto definition, or changed any bazel structure, rerun this to get code completion
correctly.
If you changed proto definition, or changed any bazel structure, rerun this using the VSCode tasks to get code completion correctly.

Note that it is recommended to disable VSCode Microsoft C/C++ extension and use `vscode-clangd` instead for
C/C++ code completion.
Expand Down
14 changes: 0 additions & 14 deletions tools/vscode/refresh_compdb.sh

This file was deleted.