{"id":15676451,"url":"https://github.com/bazel-contrib/vscode-bazel","last_synced_at":"2026-04-06T00:03:14.146Z","repository":{"id":34569282,"uuid":"148143775","full_name":"bazel-contrib/vscode-bazel","owner":"bazel-contrib","description":"Bazel support for Visual Studio Code","archived":false,"fork":false,"pushed_at":"2025-09-07T14:51:36.000Z","size":1096,"stargazers_count":276,"open_issues_count":108,"forks_count":91,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-09-26T04:32:08.513Z","etag":null,"topics":["bazel","visual-studio-code"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=BazelBuild.vscode-bazel","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bazel-contrib.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"open_collective":"bazel-rules-authors-sig"}},"created_at":"2018-09-10T11:17:02.000Z","updated_at":"2025-09-19T20:20:31.000Z","dependencies_parsed_at":"2023-12-01T20:35:14.299Z","dependency_job_id":"4b0fba99-48ce-4b81-9670-e4091a6a5282","html_url":"https://github.com/bazel-contrib/vscode-bazel","commit_stats":null,"previous_names":["bazel-contrib/vscode-bazel"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/bazel-contrib/vscode-bazel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazel-contrib%2Fvscode-bazel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazel-contrib%2Fvscode-bazel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazel-contrib%2Fvscode-bazel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazel-contrib%2Fvscode-bazel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bazel-contrib","download_url":"https://codeload.github.com/bazel-contrib/vscode-bazel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazel-contrib%2Fvscode-bazel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018312,"owners_count":26086342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bazel","visual-studio-code"],"created_at":"2024-10-03T16:01:59.638Z","updated_at":"2026-04-06T00:03:14.137Z","avatar_url":"https://github.com/bazel-contrib.png","language":"TypeScript","funding_links":["https://opencollective.com/bazel-rules-authors-sig"],"categories":["TypeScript"],"sub_categories":[],"readme":"# Bazel plugin for Visual Studio Code\n\n[![Build Status](https://github.com/bazel-contrib/vscode-bazel/actions/workflows/build-release.yml/badge.svg)](https://github.com/bazel-contrib/vscode-bazel/actions/workflows/build-release.yml)\n\nThis extension provides support for Bazel in Visual Studio.\n\n## Features\n\n- **Syntax highlighting**\n- **Bazel Targets** tree displays the build packages/targets in your\n  workspace\n- **CodeLens** links in BUILD files to directly launch a build or test by simply\n  clicking on the targets\n- **Buildifier** integration to lint and format your Bazel files (requires that\n  [Buildifier](https://github.com/bazelbuild/buildtools/releases) be installed)\n- **Bazel Task** definitions for `tasks.json`\n- **Coverage Support** showing coverage results from `bazel coverage` directly\n  in VS Code.\n- **Code Navigation** to go to BUILD files or labels\n- **Starlark Debugger** to debug Starlark code in your `.bzl` files during analysis phase (set breakpoints, step\n  through code, inspect variables, etc.)\n- **URI handler** to go to targets from outside of VSCode. (Example: vscode://bazelbuild.vscode-bazel//path/to/tests:target)\n\n## Configuring the Extension\n\nThis extension adds a **Bazel** section to the extension settings in Visual\nStudio Code. If you have Bazel installed in a location that is not on your\nsystem path or if you wish to use a different version in the IDE, you should\nset the **Bazel: Executable** setting to the location of the Bazel executable.\n\nSimilarly, the **Bazel: Buildifier Executable** setting can be configured if\nyou install Buildifier in a location that is not on your system path.\n\nWhen Buildifier is installed, the **Format Document** command in Visual Studio\ncode will reformat `BUILD`, `WORKSPACE`, `.bzl`, and `.sky` files using the\ntool and will display lint warnings from those files as you type. By default,\nthis extension does not automatically _fix_ lint warnings during formatting,\nbut you can opt into this by enabling the **Bazel: Buildifier Fix on Format**\nsetting.\n\n### Using a separate output base\n\nBy default this extension will use the default output base for running queries. This will cause builds to block queries, potentially causing degraded performance. In Bazel versions since 7.1 it is safe to disable this by changing the `bazel.queriesShareServer` setting to `false`. In earlier versions it can be safely disabled after adding the convenience symlinks to `.bazelignore`, for example:\n\n```\nbazel-myreponame\nbazel-bin\nbazel-testlogs\n```\n\nSee [#216](https://github.com/bazelbuild/vscode-bazel/issues/216) and [bazelbuild/bazel#106539](https://github.com/bazelbuild/bazel/issues/10653).\n\n## Using the Starlark Debugger\n\nThe Starlark Debugger is designed to help you understand and debug Starlark code execution during Bazel's analysis phase.\nIt's particularly useful when working with macros, rule implementations, or aspects - giving you insight into how your build configuration is processed.\n\nTo start debugging, simply right-click any build target in the **Bazel Targets** section in the Explorer View and select \"Build Target with Starlark Debugger\".\nOr use the command palette and search for \"Bazel: Build Target with Starlark Debugger\".\nThis launches the Bazel build within Visual Studio Code's debugger, redirecting output to the Debug Console pane and automatically pausing at any breakpoints you've set.\n\n**Helpful tips for effective debugging:**\n\n- The debugger activates when Bazel evaluates Starlark code. With the flags automatically applied by the extension, your Starlark code will be reanalyzed each debugging session, ensuring breakpoints are consistently hit.\n- Set breakpoints directly in `*.bzl` files next to line numbers where your Starlark functions are implemented.\n- For builds requiring specific configuration arguments, use the `bazel.commandLine.commandArgs` setting to add them.\n\nOnce debugging is active and Bazel pauses, you can step through your Starlark code, add watch expressions in VSCode's Debug pane to monitor variables, and execute statements directly in the Debug Console input area.\n\nTo stop the debugging session, click the \"Stop\" button in the debugger.\nThis terminates the current Bazel process while keeping the Bazel server running for future builds.\n\n## Using a language server (experimental)\n\nThis extension can use a language server for various features, such as go to definition and completions. There are currently two compatible language servers:\n\n- [bazel-lsp](https://github.com/cameron-martin/bazel-lsp) is based on Facebook's Starlark language server and extends it with additional, Bazel-specific functionality.\n- [starpls](https://github.com/withered-magic/starpls) is an implementation based on rust-analyzer which also provides Bazel-specific functionality.\n\nIn general, you need to install the language server binary and then set the `bazel.lsp.command` setting. See the README of the corresponding repo for more specific setup instructions.\n\nWe can't currently make any recommendation between these two. Both are under active development and are rapidly gaining more functionality.\n\n## Bazel tasks\n\nBazel tasks can be configured from the `tasks.json` using the following structure:\n\n```jsonc\n{\n  // See https://go.microsoft.com/fwlink/?LinkId=733558\n  // for the documentation about the tasks.json format\n  \"version\": \"2.0.0\",\n  \"tasks\": [\n    {\n      \"label\": \"Check for flakyness\",\n      \"type\": \"bazel\",\n      \"command\": \"test\",\n      \"targets\": [\"${input:pickFlakyTest}\"],\n      \"options\": [\"--runs_per_test=9\"],\n    },\n  ],\n  \"inputs\": [\n    {\n      \"id\": \"pickFlakyTest\",\n      \"type\": \"command\",\n      \"command\": \"bazel.pickTarget\",\n      \"args\": {\n        \"query\": \"kind('.*_test', //...:*)\",\n        \"placeHolder\": \"Which test to check for flakyness?\",\n      },\n    },\n  ],\n}\n```\n\n## Coverage support (Experimental)\n\nFor all `coverage` tasks, the coverage results are automatically loaded into VS\nCode upon completion of the task. E.g., you could define your own task to\ndisplay the coverage provided by your integration tests using the following task\ndefinition:\n\n```jsonc\n{\n  \"label\": \"Show test coverage from integration test\",\n  \"type\": \"bazel\",\n  \"command\": \"coverage\",\n  \"targets\": [\"//test/integration/...\", \"//cpp/test/integration/...\"],\n  \"options\": [\"--instrumentation_filter=.*\"],\n}\n```\n\nYou might need additional Bazel `options` to get the intended coverage results.\nIn particular if are using remote builds, you might need to use the\n`--experimental_split_coverage_postprocessing` and `--experimental_fetch_all_coverage_outputs`\noptions. See the documentation on [Code Coverage with Bazel](https://bazel.build/configure/coverage)\nfor more details.\n\nCode coverage support in this extension is still rather fresh and might still\nhave rough edges. It was tested with the Java, C++, Go and Rust rules.\nIn case you are using the code coverage integration with any other language\n(Python, Swift, Kotlin, Scala, ...), please let us know how things are going in\nbazelbuild/vscode-bazel#367. Please share both positive and negative experiences\nyou might have.\n\nFor C++ and Rust, make sure to have `c++filt` / `rustfilt` installed and\navailable through the `$PATH`. Otherwise, only mangled, hard-to-decipher\nfunction names will be displayed. For Java, no additional steps are required.\n\n## Contributing\n\nIf you would like to contribute to the Bazel Visual Studio extension, please\nrefer to the [contribution guidelines](CONTRIBUTING.md) for information about\nour patch acceptance process and setting up your development environment.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbazel-contrib%2Fvscode-bazel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbazel-contrib%2Fvscode-bazel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbazel-contrib%2Fvscode-bazel/lists"}