so... jai :D
This commit is contained in:
41
editors/vscode/src/extension.ts
Normal file
41
editors/vscode/src/extension.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import {
|
||||
workspace,
|
||||
ExtensionContext,
|
||||
} from "vscode";
|
||||
import {
|
||||
LanguageClient,
|
||||
LanguageClientOptions,
|
||||
ServerOptions,
|
||||
} from "vscode-languageclient/node";
|
||||
|
||||
let client: LanguageClient;
|
||||
|
||||
export function activate(context: ExtensionContext) {
|
||||
const config = workspace.getConfiguration("sx");
|
||||
const lspPath = config.get<string>("lspPath", "sx-lsp");
|
||||
|
||||
const serverOptions: ServerOptions = {
|
||||
command: lspPath,
|
||||
args: ["lsp"],
|
||||
};
|
||||
|
||||
const clientOptions: LanguageClientOptions = {
|
||||
documentSelector: [{ scheme: "file", language: "sx" }],
|
||||
};
|
||||
|
||||
client = new LanguageClient(
|
||||
"sx-lsp",
|
||||
"sx Language Server",
|
||||
serverOptions,
|
||||
clientOptions
|
||||
);
|
||||
|
||||
client.start();
|
||||
}
|
||||
|
||||
export function deactivate(): Thenable<void> | undefined {
|
||||
if (!client) {
|
||||
return undefined;
|
||||
}
|
||||
return client.stop();
|
||||
}
|
||||
Reference in New Issue
Block a user