src/Tools/VSCode/extension/src/extension.ts
author wenzelm
Sun, 01 Jan 2017 13:38:20 +0100
changeset 64734 12558536d977
parent 64605 9c1173a7e4cb
child 64735 4ad6d21545bd
permissions -rw-r--r--
more configuration;

'use strict';

import * as vscode from 'vscode';
import * as path from 'path';

import { LanguageClient, LanguageClientOptions, SettingMonitor, ServerOptions, TransportKind }
  from 'vscode-languageclient';


export function activate(context: vscode.ExtensionContext)
{
  let isabelle_home = vscode.workspace.getConfiguration("isabelle").get<string>("home");
  let isabelle_arguments =
    vscode.workspace.getConfiguration("isabelle").get<Array<string>>("arguments");

  let run = {
    command: path.join(isabelle_home, "bin", "isabelle"),
    args: ["vscode_server"].concat(isabelle_arguments)
  };
  let server_options: ServerOptions =
  {
    run: run,
    debug: {
      command: run.command,
      args: run.args.concat(["-L", path.join(context.extensionPath, "protocol.log")]) }
  };
  let client_options: LanguageClientOptions = { documentSelector: "isabelle" };

  let disposable =
    new LanguageClient("Isabelle Language Service", server_options, client_options, false).start();
  context.subscriptions.push(disposable);
}

export function deactivate() { }