src/Tools/VSCode/extension/src/extension.ts
author wenzelm
Mon, 02 Jan 2017 09:39:00 +0100
changeset 64743 ebaf9d01a964
parent 64735 4ad6d21545bd
child 64750 1f855e03455f
permissions -rw-r--r--
tuned;

'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_args = vscode.workspace.getConfiguration("isabelle").get<Array<string>>("args");

  let run = {
    command: path.join(isabelle_home, "bin", "isabelle"),
    args: ["vscode_server"].concat(isabelle_args)
  };
  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", server_options, client_options, false).start();
  context.subscriptions.push(disposable);
}

export function deactivate() { }