Bazel LSP
This is a LSP for bazel, forked from starlark-rust.
Features
- Go to definition for identifiers & labels
- Autocomplete for identifiers & labels
- Auto-import (currently only for open files)
Usage
Installation
Download a release from github releases and move it to somewhere on your $PATH
.
Alternatively, it can be installed from source by cloning this repo and building with Bazel:
bazel build //:bazel-lsp -c opt
VSCode
Note: This requires a currently-unreleased version > 0.8.1 (with bazelbuild/vscode-bazel#317 in it) to work.
Ensure you have the Bazel extension installed, and add the following config to your user settings.json
:
{
"bazel.lsp.enabled": true,
"bazel.lsp.command": "bazel-lsp",
"bazel.lsp.args": []
}
Restart vscode for this to take effect.