Skip to content

v1.4.0 — In-process LSP API + MCP code-inspection tools

Choose a tag to compare

@gmpassos gmpassos released this 05 Jul 22:17
· 220 commits to master since this release
d6fa861

ApolloVM 1.4.0 brings its Language Server features to two new audiences — web/agent embedders and MCP AI agents — with no socket or transport wiring required.

Highlights

  • 🧩 LspService — in-process LSP API (no socket). Embed ApolloVM's language features as plain typed Dart calls: analyze, hover, definition, documentSymbols, completion, references, rename, workspaceSymbols, and a diagnostics stream. No transport, no initialize/initialized handshake; dart:io-free, so it runs unchanged in the browser (compiled to JS).
  • 🤖 MCP code-inspection tools (apollovm.lsp.*). The MCP server now lets an AI agent inspect a codebase the way an editor does — diagnostics, outline, hover, definition, references, completion and workspace-wide symbol search — with precise LSP line/character ranges.

MCP — code-inspection tools (LSP)

  • The MCP server now exposes ApolloVM's LSP features as apollovm.lsp.* tools, so an AI agent can inspect code the way an editor does. Results carry precise LSP line/character ranges.
    • apollovm.lsp.diagnostics — errors/warnings with ranges.
    • apollovm.lsp.symbols — document outline (nested symbols + ranges).
    • apollovm.lsp.hover — signature, type and documentation at a position.
    • apollovm.lsp.definition — declaration location at a position.
    • apollovm.lsp.references — all references at a position.
    • apollovm.lsp.completion — completion proposals at a position.
    • apollovm.lsp.workspaceSymbols — symbol search across multiple in-memory files (codebase-wide lookup).
  • Each tool is stateless and web-safe (backed by the in-process LspService; no socket, no dart:io), runs in-process or inside an isolate like the other bounded tools, and honors the existing maxSourceChars limit. The parser is selected from the language argument, so a mismatched URI cannot change it.
  • New public API in package:apollovm/apollovm_mcp.dart: LspRuntime, buildLspTools, computeLspTool, isLspTool, lspToolNames. The CLI apollovm mcp call gained --line, --character and --query flags.
  • New example example/apollovm_example_mcp_lsp.dart.

Language Server Protocol — in-process API (no socket)

  • New LspService in package:apollovm/apollovm_lsp.dart: a document-oriented facade that embeds an in-process LspServer and exposes the language features as plain typed Dart calls — no transport, no socket and no initialize/initialized handshake to run by hand. Being dart:io-free it runs unchanged in a browser (compiled to JS) or an AI agent.
    • One-shot analyze(uri, text) returns the buffer's diagnostics directly; open/change/close manage documents (versions tracked automatically); every query resolves against the current buffer.
    • Typed helpers: hover, definition, documentSymbols, completion, references, documentHighlight, prepareRename, rename, workspaceSymbols, plus a diagnostics stream and a ready (InitializeResult) future.
    • LspService.wrap(client) layers the same convenience over an existing LspClient (e.g. one connected to a remote server).
  • New example example/apollovm_example_lsp_api.dart.

Full changelog: v1.3.0...v1.4.0