Official Language Server and Syntax Highlighting for the LOVE Metalang compiler.
Features
- Triadic Syntax Highlighting: Follows the ROYGBIV color philosophy. String boundaries (
<...>,"...") are colored normally, while embedded ornaments like::tagspop independently. - Full Extension Support: Natively registers highlighting for
.love, .skill, .job, .template, .rule, .model, .main, .language, .secret, .command, .error, .log, .prompt, .programme, .test, .persona, .fact, .context, .lang. - Active Language Server (LSP): Evaluates deterministic natural language ASTs. Rejects esoteric dialects (e.g.
SATOR,caveman) and enforces strict Triadic Logic (Firstness, Secondness, Thirdness).
Next Steps: Tree-Sitter & Autocompletion
To enhance the LSP with real-time autocompletion, a Tree-sitter grammar should be integrated into the server.
- Compile the Grammar:
Write your
tree-sitter-lovegrammar (defining nodes forFirstness,#INVARIANT, etc.) and compile it viatree-sitter generate. - Bind to Node.js LSP:
In
server/src/server.ts, importweb-tree-sitter:import Parser from 'web-tree-sitter'; await Parser.init(); const parser = new Parser(); const Lang = await Parser.Language.load('path/to/tree-sitter-love.wasm'); parser.setLanguage(Lang); - Parse and Provide Completions:
On every document change (
documents.onDidChangeContent), pass the text throughparser.parse(text). Inconnection.onCompletion(), traverse the Tree-sitter AST to determine if the cursor is inside a string or global scope, and return the relevant@::tagsor keywords!
Uploading to the VS Code Marketplace
Once the Tree-sitter LSP is finalized, you can officially publish this to the Microsoft Marketplace:
- Get a Personal Access Token (PAT)
- Go to Azure DevOps.
- Create a PAT with the scope
Marketplace (Publish).
- Create a Publisher
- Go to the VS Code Marketplace Publisher Management page.
- Create a publisher matching
"love-lang-foundation"from yourpackage.json.
- Login via VSCE
- Run
npx @vscode/vsce login love-lang-foundation - Paste your PAT when prompted.
- Run
- Publish!
- Run
npx @vscode/vsce publish - Within 5 minutes,
LOVE Metalangwill be live in the extension tab for anyone in the world to download!
- Run