@sf-agentscript/lsp-server
v2.2.25
Published
Node.js LSP server for AgentScript — thin wrapper over @sf-agentscript/lsp core
Readme
@agentscript/lsp-server
Node.js LSP server for AgentScript. Thin wrapper over @agentscript/lsp that provides the native tree-sitter parser and dialect registry.
How It Works
This package creates a Node.js LSP connection and calls setupServer() from @agentscript/lsp with:
- Native tree-sitter parser — uses
@agentscript/parser-tree-sitterfor fast, native parsing - Query executor — tree-sitter query API for semantic token highlighting
- Dialect registry — ships with
agentforceandagentscriptdialects
All LSP features (diagnostics, hover, completion, go-to-definition, references, rename, symbols, code actions, semantic tokens) are provided by @agentscript/lsp — this package only wires up the Node.js-specific bindings.
See @agentscript/lsp README for the full architecture and feature list.
Installation
pnpm add @agentscript/lsp-serverUsage
As a CLI
The package provides an agentscript-lsp binary that auto-detects IPC or stdio transport:
agentscript-lsp --stdioAs a library
import '@agentscript/lsp-server';
// The module self-starts: creates a connection, configures the parser, and listens.From VS Code
The @agentscript/vscode extension bundles this server and launches it via IPC — no manual setup needed.
Adding a Dialect
Register your dialect in packages/lsp/src/dialect-registry.ts (the shared registry in @agentscript/lsp):
import { mydialect } from '@agentscript/mydialect-dialect';
export const defaultDialects: DialectConfig[] = [
agentforceDialect,
agentscriptDialect,
mydialect, // add here
];See the Adding a New Dialect guide for full instructions.
Development
pnpm build # Build
pnpm dev # Watch mode
pnpm typecheck # Type-checkLicense
MIT
