...
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
dotnet publish -c Release ../compiler/NubLang.LSP/NubLang.LSP.csproj
|
||||
cp ../compiler/NubLang.LSP/bin/Release/net9.0/linux-x64/publish/nublsp src/server/
|
||||
cp ../compiler/NubLang.LSP/bin/Release/net9.0/linux-x64/publish/nublsp server/
|
||||
@@ -31,7 +31,23 @@
|
||||
"scopeName": "source.nub",
|
||||
"path": "./syntaxes/nub.tmLanguage.json"
|
||||
}
|
||||
]
|
||||
],
|
||||
"commands": [
|
||||
{
|
||||
"command": "nub.openOutput",
|
||||
"title": "Nub: Show Output",
|
||||
"icon": "$(open-preview)"
|
||||
}
|
||||
],
|
||||
"menus": {
|
||||
"editor/title": [
|
||||
{
|
||||
"command": "nub.openOutput",
|
||||
"when": "editorLangId == nub || resourceExtname == .nub",
|
||||
"group": "navigation"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc -p ./",
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import path from 'path';
|
||||
import { workspace, ExtensionContext, window, Uri, commands, StatusBarAlignment, ViewColumn } from 'vscode';
|
||||
import vscode from 'vscode';
|
||||
import { LanguageClient, TransportKind } from 'vscode-languageclient/node';
|
||||
|
||||
let client: LanguageClient;
|
||||
|
||||
export function activate(context: ExtensionContext) {
|
||||
export function activate(context: vscode.ExtensionContext) {
|
||||
const serverExecutable = path.join(context.asAbsolutePath('server'), "nublsp");
|
||||
|
||||
client = new LanguageClient(
|
||||
@@ -27,16 +27,17 @@ export function activate(context: ExtensionContext) {
|
||||
{ scheme: 'file', pattern: '**/*.nub' }
|
||||
],
|
||||
synchronize: {
|
||||
fileEvents: workspace.createFileSystemWatcher('**/.clientrc')
|
||||
fileEvents: vscode.workspace.createFileSystemWatcher('**/.clientrc')
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
let outputMap: Map<string, string> = new Map();
|
||||
client.onNotification("nub/output", (params: { path: string, content: string }) => {
|
||||
|
||||
});
|
||||
|
||||
vscode.commands.registerCommand('nub.openOutput', async () => {
|
||||
|
||||
client.onNotification("nub/output", (params) => {
|
||||
const virtualUri = Uri.parse(`nub://${params.uri}`);
|
||||
outputMap.set(virtualUri.toString(), params.content);
|
||||
});
|
||||
|
||||
client.start();
|
||||
@@ -46,5 +47,6 @@ export function deactivate(): Thenable<void> | undefined {
|
||||
if (!client) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return client.stop();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user