Skip to main content

Generate VSCode configuration for selected Bazel C++ targets

Project description

configure-vscode-for-bazel

PyPI PyPI - Python Version PyPI - License

If you want to work with C++ Bazel targets in VS Code, you can use configure-vscode-for-bazel to generate a VS Code configuration. This tool supports generating:

  • .vscode/launch.json and tasks.json files that contain selected targets for debugging and compiling in VS Code and
  • a compile_commands.json file using bazel-compile-commands-extractor for selected targets.

To generate these for a defined set of targets, run

uvx configure-vscode-for-bazel //path/to/your/target/...

This will be forwarded to a bazel query listing all cc_binary and cc_test targets. Then, when you go to VSCode -> Run and Debug (Ctrl+Shift+D) you'll be able to select an executable. By pressing ▶ Start Debugging (F5), you'll trigger a bazel build command and start debugging the executable. The latter is provided by C/C++ Microsoft extension.

Make sure you compile with debug symbols (--compilation_mode=dbg) enabled. You can pass your Bazel flags to this tool with --additional-debug-arg.

In addition, a .vscode/BUILD.bazel file will be created and bazel-compile-commands-**extractor** run to create a compile_commands.json in the workspace root. See the usage documentation for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

configure_vscode_for_bazel-0.3.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

configure_vscode_for_bazel-0.3.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file configure_vscode_for_bazel-0.3.0.tar.gz.

File metadata

File hashes

Hashes for configure_vscode_for_bazel-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f2bfaba5ea00d5bfe4a70bcc791685492b1bda9d5fe9fa848dcc4298136fc4c2
MD5 8ba31eaa6a68307b275e85a24424c2f9
BLAKE2b-256 a8f4fb65746220571a71ffbe8d9158f8ee248ab1fcb2dfe4e43ec180291fd577

See more details on using hashes here.

Provenance

The following attestation bundles were made for configure_vscode_for_bazel-0.3.0.tar.gz:

Publisher: publish-configure-vscode-for-bazel.yml on hofbi/dev-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file configure_vscode_for_bazel-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for configure_vscode_for_bazel-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e50e6460dcfe9054e3c8f74f7975b7d8ad5837f76506d278d7743e87c1b2754c
MD5 28e04c5a46016dbdb3594495e71921ed
BLAKE2b-256 861aff32567fcd9d8d42a32fc41b7e2ab7df5387c926f19998b490dd6a4f26c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for configure_vscode_for_bazel-0.3.0-py3-none-any.whl:

Publisher: publish-configure-vscode-for-bazel.yml on hofbi/dev-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page