@semanticintent/recall-lsp
v0.1.0
Published
RECALL Language Server — LSP server for .rcl files
Readme
@semanticintent/recall-lsp
RECALL Language Server — LSP server for .rcl files.
Provides diagnostics, autocomplete, hover, go-to-definition, and rename for the RECALL language. Used by the RECALL VS Code extension and any LSP-capable editor.
Features
| Feature | Description | |---|---| | Diagnostics | All 33 RCL error and warning codes surfaced inline as you type — no compile step required | | Autocomplete | Element names, PIC types, clause keywords, DATA DIVISION field references — context-aware | | Hover | PIC type, VALUE, and COMMENT clause for any field reference; element descriptions | | Go-to-definition | F12 from a PROCEDURE DIVISION field reference jumps to its DATA DIVISION declaration | | Rename | Rename a DATA field — all references update simultaneously |
The server calls compileFromSource() on every document change. Because Copilot and Cursor both consume LSP data, RECALL fields, types, and diagnostics are visible to AI coding assistants — not just to humans.
Install
npm install @semanticintent/recall-lspThe server entry point is dist/server.js. It communicates over stdio or IPC — the transport is determined by the client.
Usage with the VS Code extension
The recall-vscode extension manages the server automatically. Install the extension and the LSP activates on any .rcl file.
Usage with other editors
Any LSP-capable editor can connect to this server. Point your client at node /path/to/node_modules/@semanticintent/recall-lsp/dist/server.js --stdio.
Neovim (nvim-lspconfig):
local lspconfig = require('lspconfig')
local configs = require('lspconfig.configs')
if not configs.recall then
configs.recall = {
default_config = {
cmd = { 'node', vim.fn.stdpath('data') .. '/recall-lsp/dist/server.js', '--stdio' },
filetypes = { 'rcl' },
root_dir = lspconfig.util.root_pattern('package.json', '.git'),
settings = {},
},
}
end
lspconfig.recall.setup {}Diagnostic coverage
All 33 RCL diagnostic codes map directly to LSP DiagnosticSeverity:
'error' → DiagnosticSeverity.Error
'warning' → DiagnosticSeverity.WarningCodes RCL-W01 – RCL-W11 are warnings. Everything else is an error. Run recall explain --list from the compiler CLI for the full code reference.
Architecture
recall-lsp/src/
├── server.ts LSP entry point — stdio/IPC transport, capability registration
├── documents.ts TextDocuments store + parse cache (warm AST for providers)
├── diagnostics.ts compileFromSource() → LSP Diagnostic[] on every change
├── completion.ts Context-aware completions: elements, PIC types, field refs
├── hover.ts Hover info for field names and element names
├── definition.ts Go-to-definition via DataField.loc from the parser AST
└── rename.ts Whole-word rename across the documentThe compiler's parse() function produces location-annotated AST nodes (NodeLocation with line, col, length). The LSP providers read directly from the cached AST — no re-parsing for hover, definition, or rename.
Full reparse on every change is acceptable for v1 — the RECALL compiler targets < 50ms on large files. Incremental AST will be introduced if profiling shows reparse latency is a problem.
Dependencies
| Package | Role |
|---|---|
| @semanticintent/recall-compiler | Parser, type-checker, compileFromSource() |
| vscode-languageserver | LSP protocol implementation |
| vscode-languageserver-textdocument | Document management |
Contributing
git clone https://github.com/semanticintent/recall-lsp
cd recall-lsp
npm install
npm run buildThe server has no test suite of its own — provider logic is thin wrappers around the compiler's tested AST. Integration testing is done via the VS Code extension's test harness.
License
MIT © semanticintent
