Skip to content

stormlightlabs/beacon

Repository files navigation

Beacon

codecov License Status - CI/CD

Beacon is a Rust implementation of the language server protocol & a hindley-milner type system for Python, inspired by languages like F# & OCaml and the work of Astral & BASED pyright.

Features

Beacon provides advanced type inference and static analysis for Python:

  • Hindley-Milner type inference with generics and constraints
  • Type narrowing through pattern matching and control flow
  • Real-time diagnostics for syntax, semantic, and type errors
  • Code intelligence: hover, completions, navigation, symbol search
  • Code actions and refactoring: quick fixes, renaming, protocol implementations
  • Semantic highlighting and inlay hints
  • Code formatting and static analysis

Full documentation

Editor Support

Beacon works with any LSP-compatible editor:

Usage Modes

Stdio (Default)

For editor integration, Beacon uses stdio mode by default:

# Invoke the lsp binary directly or use the cli
beacon-lsp # or beacon lsp

TCP

For debugging, testing, or remote connections, use TCP mode:

beacon lsp --tcp --host 127.0.0.1 --port 9350

Quick Start

See the Development Quick Start Guide for more detailed installation, usage, and editor setup instructions

Build & Run from Source

Install the prerequisites listed in CONTRIBUTING.md, then clone the repo and bootstrap:

git clone https://github.com/stormlightlabs/beacon
pnpm install && cargo fetch

Use cargo or the just recipes to build (just build), then run directly

# CLI
cargo run -p beacon-cli -- typecheck samples/basic.py
# Language server (stdio mode)
cargo run -p beacon-lsp -- --stdio

Made with ⚡️ by Stormlight Labs.

Stormlight Labs is just me, Owais. Sponsor my work here on github

Sponsor this project

  •  

Languages