![Tobe O](/assets/img/avatar_default.png)
git-subtree-dir: packages/vscode git-subtree-mainline:0aca1c51de
git-subtree-split:58c04d96c2
40 lines
940 B
TypeScript
40 lines
940 B
TypeScript
"use strict";
|
|
|
|
import * as vscode from "vscode";
|
|
import { workspace } from "vscode";
|
|
import {
|
|
LanguageClient,
|
|
LanguageClientOptions,
|
|
ServerOptions,
|
|
TransportKind,
|
|
Executable
|
|
} from "vscode-languageclient";
|
|
|
|
export function activate(context: vscode.ExtensionContext) {
|
|
const runOpts: Executable = {
|
|
command: "pub",
|
|
args: ["global", "run", "jael_language_server"]
|
|
};
|
|
const serverOptions: ServerOptions = {
|
|
run: runOpts,
|
|
debug: runOpts,
|
|
transport: TransportKind.stdio
|
|
};
|
|
const clientOptions: LanguageClientOptions = {
|
|
documentSelector: [
|
|
{
|
|
scheme: "file",
|
|
language: "jael"
|
|
}
|
|
],
|
|
synchronize: {
|
|
configurationSection: "jael",
|
|
fileEvents: workspace.createFileSystemWatcher("**/.jael")
|
|
}
|
|
};
|
|
|
|
const lsp = new LanguageClient("jael", "Jael", serverOptions, clientOptions);
|
|
context.subscriptions.push(lsp.start());
|
|
}
|
|
|
|
export function deactivate() {}
|