src/Tools/VSCode/extension/src/extension.ts
changeset 64605 9c1173a7e4cb
child 64734 12558536d977
equal deleted inserted replaced
64604:2bf8cfc98c4d 64605:9c1173a7e4cb
       
     1 'use strict';
       
     2 
       
     3 import * as vscode from 'vscode';
       
     4 import * as path from 'path';
       
     5 
       
     6 import { LanguageClient, LanguageClientOptions, SettingMonitor, ServerOptions, TransportKind }
       
     7   from 'vscode-languageclient';
       
     8 
       
     9 
       
    10 export function activate(context: vscode.ExtensionContext)
       
    11 {
       
    12   let isabelle_home = vscode.workspace.getConfiguration("isabelle").get("home");
       
    13 
       
    14   let run = {
       
    15     command: path.join(isabelle_home, "bin", "isabelle"),
       
    16     args: ["vscode_server"]
       
    17   };
       
    18   let server_options: ServerOptions =
       
    19   {
       
    20     run: run,
       
    21     debug: {
       
    22       command: run.command,
       
    23       args: run.args.concat(["-L", path.join(context.extensionPath, "protocol.log")]) }
       
    24   };
       
    25   let client_options: LanguageClientOptions = { documentSelector: "isabelle" };
       
    26 
       
    27   let disposable =
       
    28     new LanguageClient("Isabelle Language Service", server_options, client_options, false).start();
       
    29   context.subscriptions.push(disposable);
       
    30 }
       
    31 
       
    32 export function deactivate() { }