{"id":13450857,"url":"https://github.com/stackb/bazel-stack-vscode","last_synced_at":"2025-10-06T00:51:48.004Z","repository":{"id":38818045,"uuid":"280938635","full_name":"stackb/bazel-stack-vscode","owner":"stackb","description":"VSCode Extension for Bazel","archived":false,"fork":false,"pushed_at":"2023-08-07T01:19:54.000Z","size":4644,"stargazers_count":68,"open_issues_count":20,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-06T10:34:48.112Z","etag":null,"topics":["bazel","build-events","debugger","visual-studio-code","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":"https://docs.stack.build","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-07-19T19:45:49.000Z","updated_at":"2025-07-07T09:32:34.000Z","dependencies_parsed_at":"2024-04-06T03:42:20.105Z","dependency_job_id":null,"html_url":"https://github.com/stackb/bazel-stack-vscode","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/stackb/bazel-stack-vscode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackb%2Fbazel-stack-vscode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackb%2Fbazel-stack-vscode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackb%2Fbazel-stack-vscode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackb%2Fbazel-stack-vscode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackb","download_url":"https://codeload.github.com/stackb/bazel-stack-vscode/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackb%2Fbazel-stack-vscode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278542676,"owners_count":26004061,"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-05T02:00:06.059Z","response_time":54,"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","build-events","debugger","visual-studio-code","vscode","vscode-extension"],"created_at":"2024-07-31T07:00:39.419Z","updated_at":"2025-10-06T00:51:47.977Z","avatar_url":"https://github.com/stackb.png","language":"TypeScript","readme":"# bazel-stack-vscode\n\n[Bazel](https://bazel.build) Support for Visual Studio Code.\n\n\u003ctable\u003e\u003ctr\u003e\n\u003ctd style=\"width: 120px; text-align: center\"\u003e\u003cimg src=\"https://upload.wikimedia.org/wikipedia/en/thumb/7/7d/Bazel_logo.svg/240px-Bazel_logo.svg.png\" height=\"120\"/\u003e\u003c/td\u003e\n\u003ctd style=\"width: 120px; text-align: center\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/50580/78734740-486ba400-7906-11ea-89fa-f207544de185.png\" height=\"100\"/\u003e\u003c/td\u003e\n\u003ctd style=\"width: 120px; text-align: center\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/29654835/27530004-e789a11e-5a13-11e7-8a34-870da7e678ac.PNG\" height=\"100\"/\u003e\u003c/td\u003e\n\u003c/tr\u003e\u003ctr\u003e\n\u003ctd style=\"text-align: center\"\u003eBazel\u003c/td\u003e\n\u003ctd style=\"text-align: center\"\u003eStack\u003c/td\u003e\n\u003ctd style=\"text-align: center\"\u003eVSCode\u003c/td\u003e\n\u003c/tr\u003e\u003c/table\u003e\n\n## Documentation\n\n\u003chttps://docs.stack.build/docs/vscode/installation\u003e\n\n## Marketplace\n\n\u003chttps://marketplace.visualstudio.com/items?itemName=StackBuild.bazel-stack-vscode\u003e\n\nThis extension provides editor support for the starlark language and the bazel\ndialect of starlark.\n\nThe following operating systems are supported:\n\n- linux\n- mac\n- windows\n\n\u003e NOTE: while the list above is sorted alphabetically, windows is not an\n\u003e afterthought; one of the main supporters of bazel-stack-vscode is a\n\u003e windows-only shop).\n\n## Contributions\n\nThe major contribution points include:\n\n### Language\n\n- `starlark` language (matches `.sky`, `.star` files).\n- `bazel` language (matches `BUILD`, `BUILD.bazel`, `.bzl` and related files).\n- `bazelrc` language (matches `.bazelrc` and related files).\n\n### Grammar\n\n- `starlark` grammar (syntax highlighting for `starlark` language).\n- `bazel` grammar (syntax highlighting for `bazel` language).\n- `bazelrc` grammar (syntax highlighting for `bazelrc` language).\n\n### Commands\n\nSee [Keybindings](#keybindings) for description of commands bound to keyboard\nshortcuts.  Other commands included are typically meant to be activated by menus\nor buttons (see [Tools](#tools)).\n\n### Keybindings\n\n- `shift+cmd+space` runs the `bsv.bzl.redo` command; to use this, click on a\n  build/test *code action* to run it the first time; then slap the space bar\n  while holding down the command key to quickly rebuild/retest it.\n- `ctrl+shift+cmd+b` runs the `bsv.bzl.copyLabel` command.  To use this, place\n  your cursor in the `name` of a build rule (e.g. `name = \"my_f|oo_library\"`)\n  and stroke the keybinding; the full label `//pkg/app:my_foo_library` will be\n  copied to the clipboard.\n- `cmd+;` runs the `bsv.bzl.goToLabel` command.  To use this, stroke the\n  keybinding (designed to be ergonomically similar to the builtin `cmd+p` menu);\n  this will open an input box where you can type/paste in a bazel label; press\n  `ENTER` to move to the rule/file implied by the label.\n- `shift+cmd+t` runs the `workbench.view.extension.bazel-explorer` command. This\n  will show the [Tools](#tools).\n- `ctrl+shift+cmd+p` runs the `bsv.buildozer.wizard` command.  To use this,\n  stroke the keybinding; a sequence of input boxes / picks will guide you\n  through formulating a buildozer command.\n\n### View\n\n- The `bazel-explorer` contains a number of so-called **Tools**.  Each tool has\n  a similar look-and-feel for enablement, configuration, documentation/help, and\n  possible launch/execution of the tool.  See [Tools](#tools) for reference.\n\n### Debugger\n\n- Support for `bazel` language debugging via the debug adapter protocol.  See\n  description of the [Starlark Debugger Tool](#starlark-debugger-tool) for\n  details.\n\n### Breakpoint\n\n- Support for setting breakpoints for the `bazel` language. See\n  [Debugger](#debugger).\n\n### Snippet\n\nAssorted `bazel` language snippets for templating out rule, provider\nimplementations, etc.\n\n## Tools\n\nThe *activity view* contains a list of tree items; each top-level item\nrepresents a \"tool\".  The tool may be something like `buildifier`, which\nactually downloads and runs an executable; or something like a *service* that\nshows information (e.g. `bazel info`).\n\nEach \"tool\" component has a set of configurable elements; to configure them\neither expand the **Settings** tree item and click on it, or go directly to your\nuser/workspace settings and hunt for the corresponding configuration item (e.g.\n`bsv.bzl.lsp.enableCodelenses`).\n\n\n### Buildifier Tool\n\nBuildifier provides linting and formatting support for the `bazel` language.  It\nis highly recommended to always format on save: to do this, add the following to\nyour `settings.json`:\n\n```json\n\"[bazel]\": {\n    \"editor.formatOnSave\": true\n}\n```\n\n### Buildozer Tool\n\nBuildozer performs bulk editing of BUILD files and can be very useful for\nvarious refactoring activities.  If you are buildozer expert, you may not need\nthis.  For the rest of us who use buildozer relatively infrequently, you can use\nthe `bsv.buildozer.wizard` to help step through the various possibilities and\nconstruct a buildozer command.  See [Keybindings](#keybindings).\n\n### Starlark Debugger Tool\n\nThe starlark debugger tool launches the debug adapter tool when a `bazel`\nlanguage debug session is starting.  You can customize the settings used for the\nadapter or the bazel server.\n\nSee the [Debugging](https://docs.stack.build/docs/vscode/debugger)\nsection of the docs for more details.\n\n### Starlark Language Server Tool\n\nThe starlark language server provides LSP support for the `bazel` and `starlark`\nlanguages.  Supported features include:\n\n- **code actions**: code action links for `[LABEL]`, `build`, `test`, `run`, `debug`,\n  `codesearch`, and `ui`.\n  - `[LABEL]`: clicking on this code action will copy the label to the clipboard.\n  - `build`: clicking on this code action will run `bazel build [LABEL]` in an\n    integrated terminal.\n  - `test`: clicking on this code action will run `bazel test [LABEL]` in an\n    integrated terminal.\n  - `run`: clicking on this code action will run `bazel run [LABEL]` in an\n    integrated terminal.\n  - `debug`: clicking on this code action will run `bazel build [LABEL]\n    --experimental_skylark_debug` and start a starlark debugging session.\n  - `codesearch`: clicking on this code action will show the [Codesearch\n    UI](#code-search-tool) for that label.  This allows you to \"livegrep\"\n    withing the transitive set of source files required to build `[LABEL]`.\n  - `ui`: clicking on this code action will open an external link to the\n    `[LABEL]` in the [Bzl UI](#bzl-ui-tool).\n- **hover**:\n  - hover over a rule/provider/aspect to get documentation about the it (e.g. `ge*nrule`).\n  - hover over a rule attribute to get documentation about the attribute (e.g.\n    `s*rcs = [\"...]`).\n  - hover over a function to get documentation about the function (e.g.\n    `ran*ge(1, 1, 1)`).\n- **completion**:\n  - completion for core starlark functions (e.g. type `rev` -\u003e\n    `reversed(sequence)`).\n  - completion for bazel builtin function/rules/providers/attributes (e.g. `jav`\n    -\u003e `java_binary(...)`).\n  - completion for third-party and custom starlark rules is available on a\n    subscription basis.\n- **jump-to-definition**:\n  - `F12` on any string literal; if it looks like a relative or canonical bazel\n    label, will open the corresponding BUILD or source file (works with default and\n    external workspaces).\n\n### Remote Cache Tool\n\nThe `bzl` tool contains a lightweight and fast LRU [remote\ncache](https://docs.bazel.build/versions/main/remote-caching.html)\nimplementation.\n\nThis \"locally-running\" remote cache is actually 30% faster than using the\n`--disk_cache` option (and manages disk usage better).  If you have multiple\nbazel repositories on your workstation (or are frequently switching git\nbranches) it is highly recommended to run this remote cache locally, at all\ntimes.\n\nThe cache implementation also provides nice progress notifications for uploads\nwith a terminal-based progress bar.\n\nGiven that you may or may not have a vscode window running at all times, the\nrecommended strategy is to keep a terminal running (or system service) with\n`/path/to/bzl cache --progress` and put the following in your `$HOME/.bazelrc`\nfile:\n\n```bazelrc\nbuild --remote_cache=grpc://localhost:2020\n```\n\nThis will give a nice speedup for many actions that you'd otherwise be waiting\nto unnecessarily rebuild.\n\n### Bazel Tool\n\nThe bazel tool provides a view of the `bazel info` for a workspace.  It is also\nused to configure default build/test flags used on conjuction with the language\nserver (see [Starlark Language Server](#starlark-language-server-tool)).\n\n### Stack.Build Account Tool\n\nThe account tool is used to view account settings and/or signup for a pro\nsubscription.  If you and your team members are using the `bazel-stack-vscode`\nextension at work, please encourage your product owner / manager / corp-entity\nto get your team signed up.\n\nBenefits of `pro` subscriptions include:\n\n1. Autocompletion, hover documentation, and jump-to-definition for\n   third-party/custom rulesets.  For example, this will automagically produce\n   autocompletion for a `go_binary` rule from `@io_bazel_rules_go//go:def.bzl`,\n   or for a `my_custom_rule` from `//bazel/internal/corp.bzl`. [COMING SOON].\n2. Invocation details and build events within VSCode.\n3. Execution log diff tool.\n4. Running the `bzl` tool as a service within your organization to share\n   invocation details (as a developer support tool).\n5. Using the `bzl cache` tool in CI.\n6. User support via slack.\n\n### Bzl UI Tool\n\nThe `bzl` tool runs a webserver by default at `http://localhost:8080`.  The UI\nprovides a navigable display of core bazel concepts such as:\n\n1. Show bazel workspaces on current machine.\n2. Show packages within a workspace.\n3. Show rules within a workspace (by type).\n4. Show attributes of a rule.\n5. Show external workspaces.\n6. Codesearch UI.\n7. Clickable dependency graph.\n\nThe UI is intended to be used as a form of documentation for the workspace to\nassist with code presentations, code review, and onboarding of new team members.\n\n### Code Search Tool\n\nThe code search tool implements a fast search code search engine.  If you are\nfamiliar with [livegrep](https://github.com/livegrep/livegrep), this is like\nlivegrep for bazel queries.  The backend is not actually livegrep, but a custom\nregexp implementation similar to\n[google/codesearch](github.com/google/codesearch) with an API similar to\nlivegrep.\n\nBzl codesearch is unlike any other codesearch tool as it naturally includes all\nsource file dependencies in the query.\n\nUsing codesearch is a two-step process:\n\n1. Build a search file index.\n2. Run queries against the index.\n\nThe codesearch UI will guide you through that process.  See the docs for\n[Codesearch](https://docs.stack.build/docs/vscode/codesearch) for more details.\n\n### Build Events Service Tool\n\nThe build event service configured the display of build events within VSCode.\n\n### Invocations Service Tool\n\nThe invocation service tool allows you to view and/or replay invocations.\n\n### Event Stream Tool\n\nThe event stream service tool provide a realtime view of build events for build\ninvocations.\n\n\n## Bazelrc Language\n\n- syntax highlighting\n- hover to get [flag reference](#Hover-Flags-to-Get-Inline-Documentation) \u0026 links to bazel docs / bazel codesearch\n","funding_links":[],"categories":["Tooling"],"sub_categories":["Editors"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackb%2Fbazel-stack-vscode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackb%2Fbazel-stack-vscode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackb%2Fbazel-stack-vscode/lists"}