platform/packages/vscode/angel_vscode/src/extension.ts
Tobe O 24d8c0515d Add 'packages/vscode/' from commit '58c04d96c28dc5750e87520b36d526cd692ed2bc'
git-subtree-dir: packages/vscode
git-subtree-mainline: 0aca1c51de
git-subtree-split: 58c04d96c2
2020-02-15 18:28:59 -05:00

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() {}