More buildins and vscode exstention <CO-AUthored, ai>

This commit is contained in:
allexanderbergmns
2026-08-25 16:20:11 +02:00
parent 5daadce7a9
commit 7ed774089e
27 changed files with 2080 additions and 122 deletions
+53
View File
@@ -0,0 +1,53 @@
// extension.js — VS Code client for the VuurRaaf language server.
//
// Spawns `vr lsp` (the toolchain's built-in language server) and wires up
// diagnostics, go-to-definition, and hover for .vr / .vrmm files.
// The toolchain binary defaults to `vr` on PATH; override it with the
// `vuurraaf.toolchainPath` setting.
const vscode = require('vscode');
const {
LanguageClient,
TransportKind,
} = require('vscode-languageclient/node');
let client;
function activate(context) {
const config = () => vscode.workspace.getConfiguration('vuurraaf');
const toolchain = () => config().get('toolchainPath', 'vr');
const serverOptions = {
command: toolchain(),
args: ['lsp'],
transport: TransportKind.stdio,
};
const clientOptions = {
documentSelector: [{ scheme: 'file', language: 'vuurraaf' }],
synchronize: {
// re-publish diagnostics when a settings change or a file is saved
fileEvents: vscode.workspace.createFileSystemWatcher('**/*.{vr,vrmm}'),
},
};
client = new LanguageClient('vuurraaf', 'VuurRaaf', serverOptions, clientOptions);
client.start();
context.subscriptions.push(
vscode.commands.registerCommand('vuurraaf.restartServer', async () => {
await client.stop();
client = new LanguageClient('vuurraaf', 'VuurRaaf', serverOptions, clientOptions);
client.start();
vscode.window.showInformationMessage('VuurRaaf language server restarted.');
})
);
}
function deactivate() {
if (client) {
return client.stop();
}
}
module.exports = { activate, deactivate };
+23
View File
@@ -0,0 +1,23 @@
{
"comments": {
"lineComment": "//"
},
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
"autoClosingPairs": [
{ "open": "{", "close": "}" },
{ "open": "[", "close": "]" },
{ "open": "(", "close": ")" },
{ "open": "\"", "close": "\"", "notIn": ["string"] },
{ "open": "'", "close": "'", "notIn": ["string", "comment"] }
],
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""]
]
}
+61
View File
@@ -0,0 +1,61 @@
{
"name": "vuurraaf",
"displayName": "VuurRaaf",
"description": "Language support for VuurRaaf: syntax highlighting, diagnostics, and go-to-definition via the vr language server.",
"version": "0.1.0",
"publisher": "vuurraaf",
"license": "MIT",
"engines": {
"vscode": "^1.75.0"
},
"categories": [
"Programming Languages",
"Linters"
],
"activationEvents": [
"onLanguage:vuurraaf"
],
"main": "./client/extension.js",
"contributes": {
"languages": [
{
"id": "vuurraaf",
"aliases": [
"VuurRaaf",
"vr"
],
"extensions": [
".vr",
".vrmm"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "vuurraaf",
"scopeName": "source.vuurraaf",
"path": "./syntaxes/vuurraaf.tmLanguage.json"
}
],
"configuration": {
"title": "VuurRaaf",
"properties": {
"vuurraaf.toolchainPath": {
"type": "string",
"default": "vr",
"description": "Path to the vr toolchain binary (defaults to `vr` on PATH)."
}
}
}
},
"scripts": {
"vscode:prepublish": "npm install"
},
"dependencies": {
"vscode-languageclient": "^8.1.0"
},
"devDependencies": {
"@types/vscode": "^1.75.0"
}
}
+160
View File
@@ -0,0 +1,160 @@
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "VuurRaaf",
"scopeName": "source.vuurraaf",
"patterns": [
{
"include": "#comments"
},
{
"include": "#strings"
},
{
"include": "#numbers"
},
{
"include": "#keywords"
},
{
"include": "#function-declaration"
},
{
"include": "#function-call"
},
{
"include": "#identifiers"
},
{
"include": "#operators"
}
],
"repository": {
"comments": {
"patterns": [
{
"name": "comment.line.double-slash.vuurraaf",
"match": "//.*$"
}
]
},
"strings": {
"patterns": [
{
"name": "string.quoted.raw.vuurraaf",
"begin": "r\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape.vuurraaf",
"match": "\\\\(\\\\|n|t|r|\"|$)"
}
]
},
{
"name": "string.quoted.double.vuurraaf",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape.vuurraaf",
"match": "\\\\(\\\\|n|t|r|\"|$)"
},
{
"name": "string.interpolated.vuurraaf",
"begin": "\\$\\{",
"end": "\\}",
"patterns": [
{
"include": "#identifiers"
}
]
}
]
}
]
},
"numbers": {
"patterns": [
{
"name": "constant.numeric.vuurraaf",
"match": "\\b(0x[0-9a-fA-F]+|\\d+(\\.\\d+)?([eE][+-]?\\d+)?)\\b"
}
]
},
"keywords": {
"patterns": [
{
"name": "keyword.control.vuurraaf",
"match": "\\b(fn|struct|enum|interface|import|const|let|if|else|while|for|in|match|break|continue|return|assert|try|catch|throw|and|or|not|true|false|none)\\b"
}
]
},
"function-declaration": {
"patterns": [
{
"name": "meta.function.vuurraaf",
"begin": "\\b(fn)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*\\(",
"beginCaptures": {
"1": {
"name": "keyword.control.vuurraaf"
},
"2": {
"name": "entity.name.function.vuurraaf"
}
},
"end": "\\)",
"patterns": [
{
"include": "#identifiers"
}
]
}
]
},
"function-call": {
"patterns": [
{
"name": "meta.function-call.vuurraaf",
"begin": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*\\(",
"beginCaptures": {
"1": {
"name": "entity.name.function.vuurraaf"
}
},
"end": "\\)",
"patterns": [
{
"include": "#identifiers"
},
{
"include": "#numbers"
},
{
"include": "#strings"
}
]
}
]
},
"identifiers": {
"patterns": [
{
"name": "entity.name.type.vuurraaf",
"match": "\\b[A-Z][a-zA-Z0-9_]*\\b"
},
{
"name": "variable.other.vuurraaf",
"match": "\\b[a-z_][a-zA-Z0-9_]*\\b"
}
]
},
"operators": {
"patterns": [
{
"name": "keyword.operator.vuurraaf",
"match": "==|!=|<=|>=|<<|>>|\\+|\\-|\\*|/|%|&|\\||\\^|~|=|<|>"
}
]
}
}
}