MCPcopy Index your code
hub / github.com/cameron-martin/bazel-lsp

github.com/cameron-martin/bazel-lsp @v0.6.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.6.4 ↗ · + Follow
107 symbols 230 edges 11 files 6 documented · 6%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Bazel LSP

This is a LSP for bazel, based on 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

Ensure you have the Bazel extension installed, and add the following config to your user settings.json:

{
  "bazel.lsp.command": "bazel-lsp"
}

Restart vscode for this to take effect.

Extension points exported contracts — how you extend this code

BazelClient (Interface)
A client for interacting with the build system. This is used for testing, where we don't want to actually invoke Bazel s [3 …
src/client.rs

Core symbols most depended-on inside this repo

get_environment
called by 6
src/bazel.rs
resolve_load
called by 5
src/bazel.rs
get_string_completion_options
called by 5
src/bazel.rs
validate_doc_string
called by 5
src/bazel.rs
get_function_doc
called by 4
src/bazel.rs
workspace
called by 3
src/bazel.rs
create_docstring
called by 3
src/builtin.rs
execute_bazel_get_stdout
called by 3
src/client.rs

Shape

Method 46
Function 40
Class 14
Enum 6
Interface 1

Languages

Rust100%

Modules by API surface

src/bazel.rs51 symbols
src/client.rs13 symbols
src/test_fixture.rs12 symbols
src/label.rs12 symbols
src/workspace.rs7 symbols
src/builtin.rs6 symbols
src/file_type.rs3 symbols
src/main.rs2 symbols
fixtures/bzlmod/root/main.rs1 symbols

For agents

$ claude mcp add bazel-lsp \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page