feat(language-server): standalone Malloy LSP with render-tag diagnostics#2816
Draft
jswir wants to merge 4 commits into
Draft
feat(language-server): standalone Malloy LSP with render-tag diagnostics#2816jswir wants to merge 4 commits into
jswir wants to merge 4 commits into
Conversation
New @malloydata/malloy-language-server package implementing LSP over stdio for .malloy, .malloysql, and .malloynb files. Provides: - Diagnostics (syntax + semantic, with notebook cell mapping) - Document symbols - Code lenses (Run / Show SQL / Preview) - Context-aware completions and hover docs - Go-to-definition for sources, fields, and imports - Code actions Ships a CLI binary (`malloy-language-server --stdio`) and a Claude Code plugin scaffold under `claude-code-plugin/` so LSP-capable editors can spawn the server directly. Signed-off-by: James Swirhun <james@credibledata.com>
…der-validator Validate renderer tag usage on every named and unnamed query in the model on each diagnostic pass. The render-validator runs the renderer's own validation against the compiled query result without executing the query or needing a DOM, so errors like '# currency on a string field' appear directly in the editor as the user types instead of only at preview time. Renderer log messages already carry source url+range via the tag's DocumentLocation; when absent the diagnostic falls back to the query's range. Diagnostics are tagged with code 'render-tag' so users can distinguish them from compile errors. Signed-off-by: James Swirhun <james@credibledata.com>
I, James Swirhun <james@credibledata.com>, hereby add my Signed-off-by to this commit: 9c3de00 Signed-off-by: James Swirhun <james@credibledata.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@malloydata/malloy-language-server— a standalone LSP-over-stdio implementation for.malloy,.malloysql, and.malloynbfiles. Provides diagnostics, document symbols, code lenses, completions, hover, go-to-definition, and code actions.malloy-language-server --stdio) and a Claude Code plugin scaffold underclaude-code-plugin/so LSP-capable editors (Neovim, Emacs, Helix, Claude Code, etc.) can spawn the server directly.@malloydata/render-validatorinto the diagnostic pipeline so renderer tag mistakes (e.g.# currencyon a string field) surface in the editor as the user types instead of only at preview time. Render-validator runs the renderer's own validation against the compiled result without executing the query or needing a DOM. Diagnostics carrycode: render-tagso they're distinguishable from compile errors.Test plan
npm run buildbuilds the new package cleanly against current mainnpx eslint 'packages/malloy-language-server/src/**/*.ts'passes (0 errors; pre-existingno-consolewarnings only)initialize→initialized→workspace/didChangeConfiguration→textDocument/didOpenround-trips with capabilities and emitspublishDiagnostics[sev=Error] code=render-tag Tag 'currency' on field 'val' requires a numeric field, but field is string