Skip to content

seibert-media/bundlewrap-lsp

Repository files navigation

bundlewrap-lsp

A Language Server Protocol (LSP) implementation for BundleWrap, providing intelligent editor support for BundleWrap repositories.

Features

  • Context-aware completions for bundle items, metadata, nodes, groups, and templates
    • Item attributes (e.g. owner, mode, content_type) with type-specific suggestions
    • Metadata keys from both static analysis and live repo metadata
    • Bundle, node, and group names in method calls like node.has_bundle()
    • Item references in needs, triggers, and preceded_by
    • Injected symbols (node, repo, metadata, etc.) per file type
    • Node/repo properties and repo.libs.* modules
  • Diagnostics — undefined name detection aware of BundleWrap's injected symbols
  • Two-tier metadata indexing — instant AST-based schema extraction plus background full-repo metadata resolution

Installation

Requires Python 3.10+.

pip install .
# or with uv
uv pip install .

This installs the bw-lsp command.

Usage

The server communicates over stdio by default:

bw-lsp

TCP mode is also available:

bw-lsp --tcp --host 127.0.0.1 --port 2087

VS Code

A minimal VS Code extension is included (vscode-extension.js + vscode-package.json). It launches bw-lsp via stdio and activates on Python and TOML files. The server path is configurable via the bwLsp.serverPath setting.

PyCharm (LSP4IJ)

  1. Install the LSP4IJ plugin.
  2. Go to Settings → Languages & Frameworks → Language Servers.
  3. Add a new server definition:
    • Name: BundleWrap LSP
    • Command: bw-lsp
    • File mappings: *.py (or scope it to your BundleWrap repo)

Other editors

Any editor with LSP support can use bw-lsp. Point your editor's LSP client at the bw-lsp command using stdio transport.

Development

uv pip install -e ".[dev]"
python -m pytest

About

LSP Server for Bundlewrap Config Management Software

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors