Skip to content

Commit 6dddf3f

Browse files
authored
Bazelrc featureset: launch.bazelrc, hover, flaginfo (#20)
1 parent 03e5bc3 commit 6dddf3f

22 files changed

Lines changed: 1842 additions & 166 deletions

README.md

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,32 @@ Bazel Support for Visual Studio Code.
1212
<td style="text-align: center">VSCode</td>
1313
</tr></table>
1414

15+
## Features:
16+
17+
- `bazel` and `starlark` files (`BUILD`, `.bazel`, `WORKSPACE`, `*.bzl`, `.star`, `*.sky`):
18+
- syntax highlighting
19+
- formatting & linting diagnostics (via `buildifier`)
20+
- hover to get links to bazel documentation
21+
- hover to get bazel rule & starlark function reference (via experimental Starlark Language
22+
Server)
23+
24+
- `bazelrc` files (`*.bazelrc`):
25+
- syntax highlighting
26+
- hover to get flag reference & links to bazel docs / bazel codesearch
27+
- completion for all 834 available flags by command (includes undocumented flags).
28+
- `launch.bazelrc` file (a file where you can stash frequently executed commands):
29+
- syntax highlighting
30+
- hover over command name to get a "codelens" (click to run the command)
31+
- repeat previous command for iterative development (`shift+ctrl+space`)
32+
- custom problem matcher for rules_go output
33+
1534

1635
<table border-collapse="collapse" style="margin: 1rem 0">
1736
<tr><td style="border: 1px solid rgba(255,255,255,0.16)">
1837

1938
## Syntax Highlighting
2039

21-
This extension contributes a language grammar for:
40+
This extension contributes language grammars for syntax highlighting of:
2241

2342
1. **bazel** files (`WORKSPACE`, `BUILD`, `*.bazel`, `*.bzl`)
2443
2. plain **starlark** files (`.sky` and `.star`)
@@ -84,7 +103,7 @@ This extension contributes a HoverProvider that looks for built-in symbols in st
84103

85104
This extension contributes a language server for bazel & starlark files.
86105

87-
> NOTE: currently this feature is **Disabled** by default. To enable it, visit the extension settings and set `feature.starlark.lsp.enabled: true`.
106+
> NOTE: currently this feature is **Disabled** by default. To enable it, visit the [extension settings](command://workbench.action.openSettings)) and set `feature.starlark.lsp.enabled: true`.
88107
89108
The Starlark Language Server implements a hoverProvider for builtin starlark
90109
language functions (e.g. `len`, `print`, etc), builtin bazel functions (e.g.
@@ -96,6 +115,45 @@ language functions (e.g. `len`, `print`, etc), builtin bazel functions (e.g.
96115
</table>
97116

98117

118+
119+
<table border-collapse="collapse" style="margin: 1rem 0">
120+
<tr><td style="border: 1px solid rgba(255,255,255,0.16)">
121+
122+
## Bazelrc Features
123+
124+
This extension provides the following features to assist with `*.bazelrc` files:
125+
126+
1. A language grammar (syntax highlighting)
127+
2. Hover provider: hover over a flag name for documentation & links to additional support.
128+
3. Completion: suggestions for flag names when you type dash-dash sequence (`--`).
129+
130+
![hover-flag](https://user-images.githubusercontent.com/50580/87987703-4c2dcb80-ca9c-11ea-95f0-430b1d8856e7.gif)
131+
132+
</tr></tr>
133+
</table>
134+
135+
136+
<table border-collapse="collapse" style="margin: 1rem 0">
137+
<tr><td style="border: 1px solid rgba(255,255,255,0.16)">
138+
139+
## Launch.Bazelrc Feature
140+
141+
This extension has special support for files named `launch.bazelrc`. A
142+
`launch.bazelrc` is a text file where you can store common commands & flag combinations. It has the same
143+
144+
1. Be syntax highlighted
145+
146+
2. A language grammar (syntax highlighting)
147+
3. Hover provider: hover over a flag name for documentation & links to additional support.
148+
4. Completion: suggestions for flag names when you type dash-dash sequence (`--`).
149+
150+
![hover-flag](https://user-images.githubusercontent.com/50580/87987703-4c2dcb80-ca9c-11ea-95f0-430b1d8856e7.gif)
151+
152+
</tr></tr>
153+
</table>
154+
155+
156+
99157
## Requirements
100158

101159
Portions of this plugin may rely on the [bzl tool](https://build.bzl.io). You

flaginfo/bazel.flaginfo

230 KB
Binary file not shown.

0 commit comments

Comments
 (0)