Add ErgoScript LSP with real SigmaParser integration (Closes #1097)#1108
Open
sameezy667 wants to merge 3 commits intoergoplatform:masterfrom
Open
Add ErgoScript LSP with real SigmaParser integration (Closes #1097)#1108sameezy667 wants to merge 3 commits intoergoplatform:masterfrom
sameezy667 wants to merge 3 commits intoergoplatform:masterfrom
Conversation
…ics, hover, symbols
- Add ParserCLI.scala: Scala wrapper that invokes SigmaParser and outputs JSON diagnostics - Update server.js: Auto-detect parser JAR and call Scala CLI, fallback to regex if unavailable - Add architecture diagram showing LSP -> ParserCLI -> SigmaParser flow - Add example.es: Sample ErgoScript file for testing - Add test_parser.sh: Helper script to test parser CLI directly - Document build steps: sbt parsers/publishLocal to enable real parser - Async validation to avoid blocking on parser invocation
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.
Closes #1097
Overview
Adds a minimal, production-ready Language Server Protocol (LSP) for ErgoScript with real parser integration. Automatically uses
SigmaParserwhen available, falls back to regex-based validation otherwise. Provides diagnostics, hover, and document symbols for IDE/AI agent support.What I added
lsp/server.js— LSP server (Node.js, stdio) with auto-detection of Scala parserlsp/ParserCLI.scala— Scala CLI wrapper that invokesSigmaParserand outputs JSON diagnosticslsp/package.json— Node dependencies (vscode-languageserver)lsp/README.md— Setup, architecture diagram, usage instructionslsp/example.es— Sample ErgoScript file for testinglsp/test_parser.sh— Test script for parser CLIHow it works
Real parser mode (recommended):
sbt "parsers/publishLocal"to build parser JARscalaCLI to invokeParserCLI.scalaSigmaParserFallback mode (no build required):
TODOmarkersArchitecture
LSP Client → server.js → ParserCLI.scala → SigmaParser (fastparse)
↘ regex fallback (if no JAR)
How to test