• Stars
    star
    241
  • Rank 167,643 (Top 4 %)
  • Language
    TypeScript
  • License
    Apache License 2.0
  • Created about 6 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Bazel support for Visual Studio Code

Bazel plugin for Visual Studio Code

Build Status

This extension provides support for Bazel in Visual Studio.

Features

  • Syntax highlighting
  • Bazel Build Targets tree displays the build packages/targets in your workspace
  • CodeLens links in BUILD files to directly launch a build or test by simply clicking on the targets
  • Buildifier integration to lint and format your Bazel files (requires that Buildifier be installed)
  • Debug Starlark code in your .bzl files during a build (set breakpoints, step through code, inspect variables, etc.)

Configuring the Extension

This extension adds a Bazel section to the extension settings in Visual Studio Code. If you have Bazel installed in a location that is not on your system path or if you wish to use a different version in the IDE, you should set the Bazel: Executable setting to the location of the Bazel executable.

Similarly, the Bazel: Buildifier Executable setting can be configured if you install Buildifier in a location that is not on your system path.

When Buildifier is installed, the Format Document command in Visual Studio code will reformat BUILD, WORKSPACE, .bzl, and .sky files using the tool and will display lint warnings from those files as you type. By default, this extension does not automatically fix lint warnings during formatting, but you can opt into this by enabling the Bazel: Buildifier Fix on Format setting.

Using the Starlark Debugger

Currently, the Starlark Debugger can be used by right-clicking a build target in the Bazel Build Targets view and selecting "Build Target with Starlark Debugger". This will start the build inside the Visual Studio Code debugger (output will be redirected to the Debug Console pane) and it will pause on any breakpoints hit during execution.

When a Bazel thread is paused, you can step through Starlark code, add watch expressions, and execute arbitrary statements by typing them in the input area of the Debug Console.

Clicking the "Stop" button in the debugger will kill the Bazel process being debugger, allowing you to halt the current build. The Bazel server, however, will continue running.

Contributing

If you would like to contribute to the Bazel Visual Studio extension, please refer to the contribution guidelines for information about our patch acceptance process and setting up your development environment.

More Repositories

1

rules_nodejs

NodeJS toolchain for Bazel.
Starlark
727
star
2

rules_foreign_cc

Build rules for interfacing with "foreign" (non-Bazel) build systems (CMake, configure-make, GNU Make, boost, ninja, Meson)
Starlark
662
star
3

rules_jvm_external

Bazel rules to resolve, fetch and export Maven artifacts
Starlark
324
star
4

toolchains_llvm

LLVM toolchain for bazel
Starlark
294
star
5

rules_oci

Bazel rules for building OCI containers
Starlark
265
star
6

rules_dotnet

.NET rules for Bazel
Starlark
190
star
7

bazel-lib

Common useful functions for writing BUILD files and Starlark macros/rules
Starlark
137
star
8

target-determinator

Determines which Bazel targets were affected between two git commits.
Go
131
star
9

bazel-mypy-integration

πŸπŸŒΏπŸ’š Integrate MyPy type-checking into your Python Bazel builds
Starlark
119
star
10

rules_fuzzing

Bazel Starlark extensions for defining fuzz tests in Bazel projects
Starlark
87
star
11

rules_cuda

Starlark implementation of bazel rules for CUDA.
Starlark
83
star
12

rules_jsonnet

Jsonnet rules for Bazel
Starlark
69
star
13

rules_jvm

Contributed Bazel rules that make working with java projects more pleasant
Java
46
star
14

rules-template

A template for creating a new Bazel ruleset
Starlark
45
star
15

rules_bazel_integration_test

Rules and macros for executing integration tests that use Bazel. Supports running integration tests with multiple versions of Bazel.
Starlark
40
star
16

rules_debian_packages

Rules for installing debian-packages into Docker-Images with bazel
Starlark
23
star
17

SIG-rules-authors

Governance and admin for the rules authors Special Interest Group
Shell
22
star
18

publish-to-bcr

A GitHub app that mirrors releases of your Bazel ruleset to the Central Registry
TypeScript
21
star
19

Bazel-learning-paths

Bazel training materials and codelabs focused on beginner, advanced and contributor learning paths
Java
19
star
20

bazel_features

Support Bazel "feature detection" from starlark
Starlark
17
star
21

musl-toolchain

Python
14
star
22

unused-jvm-deps

Tool to remove unused deps entries for Java
Java
14
star
23

bcr-ui

Website for the Bazel Central Registry
TypeScript
10
star
24

bazel-catalog

Catalog of Bazel rules. http://awesomebazel.com meets https://bazel.build/rules plus live stats.
Shell
3
star
25

target-determinator-testdata

Sample commits used to test implementations of target determinators.
1
star
26

.github

GitHub metadata for the org
1
star