Skip to content

Commit 7f8393c

Browse files
authored
Update documentation (#21)
1 parent 6dddf3f commit 7f8393c

1 file changed

Lines changed: 29 additions & 117 deletions

File tree

README.md

Lines changed: 29 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -16,141 +16,63 @@ Bazel Support for Visual Studio Code.
1616

1717
- `bazel` and `starlark` files (`BUILD`, `.bazel`, `WORKSPACE`, `*.bzl`, `.star`, `*.sky`):
1818
- 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)
19+
- [formatting](#Build-File-Formatting) & [linting diagnostics](#Build-File-Linting-Diagnostics) (via `buildifier`)
20+
- hover to get [links to bazel documentation](#Hover-Symbols-to-Get-Documentation-Links)
21+
- hover to get [bazel rule & starlark function
22+
reference](#Hover-Symbols-to-Get-Inline-Documentation) (via Starlark
23+
Language Server)
2324

2425
- `bazelrc` files (`*.bazelrc`):
2526
- syntax highlighting
26-
- hover to get flag reference & links to bazel docs / bazel codesearch
27+
- hover to get [flag reference](#Hover-Flags-to-Get-Inline-Documentation) & links to bazel docs / bazel codesearch
2728
- completion for all 834 available flags by command (includes undocumented flags).
2829
- `launch.bazelrc` file (a file where you can stash frequently executed commands):
2930
- syntax highlighting
30-
- hover over command name to get a "codelens" (click to run the command)
31+
- [hover over command name](#Launch-File-Codelens) to get a "codelens" (click to run the command)
3132
- repeat previous command for iterative development (`shift+ctrl+space`)
3233
- custom problem matcher for rules_go output
3334

35+
### Build File Formatting
3436

35-
<table border-collapse="collapse" style="margin: 1rem 0">
36-
<tr><td style="border: 1px solid rgba(255,255,255,0.16)">
37+
![1-format](https://user-images.githubusercontent.com/50580/89370237-7cc95400-d69d-11ea-8d6c-949fd099cf21.gif)
3738

38-
## Syntax Highlighting
39+
### Build File Linting Diagnostics
3940

40-
This extension contributes language grammars for syntax highlighting of:
41+
![1-lint](https://user-images.githubusercontent.com/50580/89370514-227cc300-d69e-11ea-8784-266e9756e8ec.gif)
4142

42-
1. **bazel** files (`WORKSPACE`, `BUILD`, `*.bazel`, `*.bzl`)
43-
2. plain **starlark** files (`.sky` and `.star`)
44-
3. **bazelrc** files (`bazelrc`, `*.bazelrc`)
43+
### Hover Symbols to Get Inline Documentation
4544

46-
![starlark-grammar](https://user-images.githubusercontent.com/50580/87883685-38b03100-c9c6-11ea-88ac-04202a45abaf.png)
45+
![1-rulehover](https://user-images.githubusercontent.com/50580/89370355-c31eb300-d69d-11ea-8fc6-eeff04641dd0.gif)
4746

48-
![bazelrc-grammar](https://user-images.githubusercontent.com/50580/88016408-8caf3880-cae0-11ea-8afa-a2898f136d2f.png)
47+
### Hover Symbols to Get Documentation Links
4948

50-
</tr></tr>
51-
</table>
49+
![1-bazeldoc](https://user-images.githubusercontent.com/50580/89370432-efd2ca80-d69d-11ea-97e3-cdc52925acf9.gif)
5250

51+
### Hover Flags to Get Inline Documentation
5352

54-
## Buildifier Linting/Formatting
53+
![1-flaghover](https://user-images.githubusercontent.com/50580/89370676-8f905880-d69e-11ea-958b-5b7574abd067.gif)
5554

56-
This extension contributes:
55+
> Includes all 834 flags (including undocumented options)
5756
58-
1. Linting diagnostics for starlark/bazel files
59-
2. Document formatting for starlark/bazel
57+
### Flag Autocomplete
6058

61-
![buildifier-lint](https://user-images.githubusercontent.com/50580/88228725-ce4cfa00-cc2c-11ea-82a6-3d9a7975d148.gif)
59+
![1-flag-completion](https://user-images.githubusercontent.com/50580/89370594-5ce66000-d69e-11ea-8838-7520efd6531a.gif)
6260

63-
![buildifier-format](https://user-images.githubusercontent.com/50580/88228704-cab97300-cc2c-11ea-9920-54e981c1e8ae.gif)
61+
> Use the `' '` (space) or `'='` (equals) to commit choice and continue typing
6462
65-
> By default this extension will automatically download a copy of `buildifier`
66-
for you. Use the `bzl.buildifier.executable` setting to explicitly configure a
67-
path to a pre-installed buildifier binary.
63+
### Launch File Codelens
6864

69-
</tr></tr>
70-
</table>
65+
![1-launch](https://user-images.githubusercontent.com/50580/89370737-b64e8f00-d69e-11ea-970d-d139fbaab06f.gif)
7166

67+
Keep a `launch.bazelrc` file for common (or uncommonly used) commands. Click
68+
the "codelens" to
69+
run it.
7270

73-
<table border-collapse="collapse" style="margin: 1rem 0">
74-
<tr><td style="border: 1px solid rgba(255,255,255,0.16)">
71+
> Repeat the last command with `shift+ctrl+space`.
7572
76-
## Snippets
73+
> NOTE: the directory where the `launch.bazelrc` file determines the working
74+
> directory for the shell. Typically you'll put this next to your `WORKSPACE` file.
7775
78-
This extension contributes a set of snippets for assorted bazel/starlark
79-
idioms:
80-
81-
![feature-snippets](https://user-images.githubusercontent.com/50580/87883832-60ec5f80-c9c7-11ea-87a8-ec78e7214670.png)
82-
</tr></tr>
83-
</table>
84-
85-
<table border-collapse="collapse" style="margin: 1rem 0">
86-
<tr><td style="border: 1px solid rgba(255,255,255,0.16)">
87-
88-
## Links to Bazel Documentation
89-
90-
This extension contributes a HoverProvider that looks for built-in symbols in starlark files and provides links to documentation:
91-
92-
![hover-doc-links](https://user-images.githubusercontent.com/50580/87987703-4c2dcb80-ca9c-11ea-95f0-430b1d8856e7.gif)
93-
94-
</tr></tr>
95-
</table>
96-
97-
98-
99-
<table border-collapse="collapse" style="margin: 1rem 0">
100-
<tr><td style="border: 1px solid rgba(255,255,255,0.16)">
101-
102-
## Starlark Language Server (Experimental)
103-
104-
This extension contributes a language server for bazel & starlark files.
105-
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`.
107-
108-
The Starlark Language Server implements a hoverProvider for builtin starlark
109-
language functions (e.g. `len`, `print`, etc), builtin bazel functions (e.g.
110-
`select`, `attr.string`, ...) in addition to builtin rules like `java_library`.
111-
112-
![starlark-ls-hover](https://user-images.githubusercontent.com/50580/89113148-551e8580-d42a-11ea-990e-04be3a90b77c.gif)
113-
114-
</tr></tr>
115-
</table>
116-
117-
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>
15476

15577

15678

@@ -168,15 +90,5 @@ you experience errors due to rate limits, `export
16890
GITHUB_TOKEN={MY_PERSONAL_TOKEN}` and relaunch vscode to get higher rate
16991
limits.
17092

171-
**Language Server Spawn Error on Windows** If you observe this error on windows upon initial download of the executable, please reload the vscode window (`> Developer: Reload Window`).
172-
173-
```
174-
[Error - 2:38:35 AM] Starting client failed
175-
Error: spawn EBUSY
176-
at ChildProcess.spawn (internal/child_process.js:394:11)
177-
at Object.spawn (child_process.js:553:9)
178-
at c:\Users\develop\.vscode\extensions\stackbuild.bazel-stack-vscode-0.4.0\node_modules\vscode-languageclient\lib\main.js:376:40
179-
```
180-
18193
> NOTE: portions of this extension were adapted from
18294
> https://github.com/bazelbuild/vscode-bazel (Apache 2.0).

0 commit comments

Comments
 (0)