LspRuntime class
In-process façade over the ApolloVM Language Server (LspService) used by
the MCP apollovm.lsp.* tools, so an AI agent can inspect code the way an
editor does: diagnostics, outline, hover, go-to-definition, references,
completion and workspace-wide symbol search.
Web-safe and stateless: each call spins up an in-process server (no socket,
no dart:io), answers the query against the given source, and disposes. The
parser is selected from the source language (via a matching document URI),
so results never depend on ambient state.
Constructors
- LspRuntime({McpLimits limits = const McpLimits()})
Properties
Methods
-
completion(
String language, String source, int line, int character, {String? uri}) → Future< Map< String, Object?> > -
Completion proposals at
line:character. -
definition(
String language, String source, int line, int character, {String? uri}) → Future< Map< String, Object?> > -
The declaration location for the symbol at
line:character. -
diagnostics(
String language, String source, {String? uri}) → Future< Map< String, Object?> > -
Diagnostics (errors/warnings) for
source, with precise LSP ranges. -
documentSymbols(
String language, String source, {String? uri}) → Future< Map< String, Object?> > - The document outline: hierarchical symbols with their source ranges.
-
hover(
String language, String source, int line, int character, {String? uri}) → Future< Map< String, Object?> > -
Hover information (signature + documentation) at
line:character. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
references(
String language, String source, int line, int character, {bool includeDeclaration = true, String? uri}) → Future< Map< String, Object?> > -
All references to the symbol at
line:character. -
toString(
) → String -
A string representation of this object.
inherited
-
workspaceSymbols(
String query, List< Object?> files) → Future<Map< String, Object?> > -
Searches declarations matching
queryacross a set of in-memoryfiles({uri, source, language?}), enabling codebase-wide symbol lookup.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
supportedLanguages
→ List<
String> -
The languages the LSP tools can analyze (all supported languages except
wasm, which is a compile target rather than a parsed source language).no setter