Technical deep-dive on the poly-bench Language Server Protocol implementation
Loading...
Docs in progress. Some content or features may be missing or not covered in detail.
The poly-bench-lsp-v2 crate implements the Language Server Protocol. It provides syntax highlighting, diagnostics, hover, formatting, and embedded language support for .bench files. This page covers the server architecture, Tree-sitter integration, and embedded code handling.
The LSP uses poly-bench-syntax (Tree-sitter-based) for parsing:
Error-tolerant — Always returns a tree; parse errors become diagnostics
Incremental — Reuses unchanged subtrees on edit
Queries — queries/highlights.scm for semantic tokens
This differs from poly-bench-dsl (used by CLI), which uses a different parser. The LSP prioritizes responsiveness and partial results over strict correctness.