src/Tools/VSCode/extension/src/extension.ts
author wenzelm
Fri, 11 Aug 2017 18:08:46 +0200
changeset 66395 14146fb264d8
parent 66216 d4949bae0bad
child 69322 ce6d43af5bcb
permissions -rw-r--r--
proper state_panel exit;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
64605
9c1173a7e4cb basic support for VSCode Language Server protocol;
wenzelm
parents:
diff changeset
     1
'use strict';
9c1173a7e4cb basic support for VSCode Language Server protocol;
wenzelm
parents:
diff changeset
     2
9c1173a7e4cb basic support for VSCode Language Server protocol;
wenzelm
parents:
diff changeset
     3
import * as path from 'path';
65172
365e97f009ed default cygwin_root from Isabelle distribution;
wenzelm
parents: 65171
diff changeset
     4
import * as fs from 'fs';
65968
44e703278dfd clarified modules;
wenzelm
parents: 65958
diff changeset
     5
import * as library from './library'
65094
386d9d487f62 support for decorations;
wenzelm
parents: 64874
diff changeset
     6
import * as decorations from './decorations';
66098
5aa9cb83e70e clarified modules;
wenzelm
parents: 66097
diff changeset
     7
import * as preview_panel from './preview_panel';
65201
2d01b30e6ac6 clarified modules;
wenzelm
parents: 65200
diff changeset
     8
import * as protocol from './protocol';
66098
5aa9cb83e70e clarified modules;
wenzelm
parents: 66097
diff changeset
     9
import * as state_panel from './state_panel';
66052
39eb61b1fa51 provide information about Isabelle symbols within VSCode;
wenzelm
parents: 65987
diff changeset
    10
import * as symbol from './symbol';
66060
b2bfbefd354f symbol completion that bypasses the LS protocol, and thus observes the range properly;
wenzelm
parents: 66052
diff changeset
    11
import * as completion from './completion';
66216
d4949bae0bad clarified editor focus;
wenzelm
parents: 66215
diff changeset
    12
import { Uri, TextEditor, ViewColumn, Selection, Position, ExtensionContext, workspace, window,
d4949bae0bad clarified editor focus;
wenzelm
parents: 66215
diff changeset
    13
  commands, languages } from 'vscode';
66215
9a8b6b86350c proper hyperlink_command, notably for locate_query;
wenzelm
parents: 66211
diff changeset
    14
import { LanguageClient, LanguageClientOptions, SettingMonitor, ServerOptions, TransportKind,
9a8b6b86350c proper hyperlink_command, notably for locate_query;
wenzelm
parents: 66211
diff changeset
    15
  NotificationType } from 'vscode-languageclient';
64605
9c1173a7e4cb basic support for VSCode Language Server protocol;
wenzelm
parents:
diff changeset
    16
9c1173a7e4cb basic support for VSCode Language Server protocol;
wenzelm
parents:
diff changeset
    17
65201
2d01b30e6ac6 clarified modules;
wenzelm
parents: 65200
diff changeset
    18
let last_caret_update: protocol.Caret_Update = {}
65180
b5a8f27a4980 tuned signature;
wenzelm
parents: 65172
diff changeset
    19
65969
1f93eb5c3d77 tuned imports;
wenzelm
parents: 65968
diff changeset
    20
export function activate(context: ExtensionContext)
64605
9c1173a7e4cb basic support for VSCode Language Server protocol;
wenzelm
parents:
diff changeset
    21
{
65968
44e703278dfd clarified modules;
wenzelm
parents: 65958
diff changeset
    22
  const isabelle_home = library.get_configuration<string>("home")
44e703278dfd clarified modules;
wenzelm
parents: 65958
diff changeset
    23
  const isabelle_args = library.get_configuration<Array<string>>("args")
44e703278dfd clarified modules;
wenzelm
parents: 65958
diff changeset
    24
  const cygwin_root = library.get_configuration<string>("cygwin_root")
64605
9c1173a7e4cb basic support for VSCode Language Server protocol;
wenzelm
parents:
diff changeset
    25
65182
973b7669e7d9 proper Map operations;
wenzelm
parents: 65180
diff changeset
    26
973b7669e7d9 proper Map operations;
wenzelm
parents: 65180
diff changeset
    27
  /* server */
973b7669e7d9 proper Map operations;
wenzelm
parents: 65180
diff changeset
    28
65172
365e97f009ed default cygwin_root from Isabelle distribution;
wenzelm
parents: 65171
diff changeset
    29
  if (isabelle_home === "")
65969
1f93eb5c3d77 tuned imports;
wenzelm
parents: 65968
diff changeset
    30
    window.showErrorMessage("Missing user settings: isabelle.home")
64753
79ed396709e4 more robust startup;
wenzelm
parents: 64750
diff changeset
    31
  else {
65168
9eabc312a2a2 prefer immutable bindings;
wenzelm
parents: 65167
diff changeset
    32
    const isabelle_tool = isabelle_home + "/bin/isabelle"
9eabc312a2a2 prefer immutable bindings;
wenzelm
parents: 65167
diff changeset
    33
    const standard_args = ["-o", "vscode_unicode_symbols", "-o", "vscode_pide_extensions"]
65167
wenzelm
parents: 65165
diff changeset
    34
65168
9eabc312a2a2 prefer immutable bindings;
wenzelm
parents: 65167
diff changeset
    35
    const server_options: ServerOptions =
65970
05e317e291a8 clarified modules;
wenzelm
parents: 65969
diff changeset
    36
      library.platform_is_windows() ?
65172
365e97f009ed default cygwin_root from Isabelle distribution;
wenzelm
parents: 65171
diff changeset
    37
        { command:
365e97f009ed default cygwin_root from Isabelle distribution;
wenzelm
parents: 65171
diff changeset
    38
            (cygwin_root === "" ? path.join(isabelle_home, "contrib", "cygwin") : cygwin_root) +
365e97f009ed default cygwin_root from Isabelle distribution;
wenzelm
parents: 65171
diff changeset
    39
            "/bin/bash",
64874
e13ff666af96 enable vscode_unicode_symbols by default, despite asymmetry of input and output;
wenzelm
parents: 64833
diff changeset
    40
          args: ["-l", isabelle_tool, "vscode_server"].concat(standard_args, isabelle_args) } :
64755
ceb81f4928ea support for Windows;
wenzelm
parents: 64753
diff changeset
    41
        { command: isabelle_tool,
64874
e13ff666af96 enable vscode_unicode_symbols by default, despite asymmetry of input and output;
wenzelm
parents: 64833
diff changeset
    42
          args: ["vscode_server"].concat(standard_args, isabelle_args) };
65983
d8c5603c1732 explicit preview request/response;
wenzelm
parents: 65979
diff changeset
    43
    const language_client_options: LanguageClientOptions = {
64833
0f410e3b1d20 support for bibtex entries;
wenzelm
parents: 64756
diff changeset
    44
      documentSelector: ["isabelle", "isabelle-ml", "bibtex"]
64753
79ed396709e4 more robust startup;
wenzelm
parents: 64750
diff changeset
    45
    };
64605
9c1173a7e4cb basic support for VSCode Language Server protocol;
wenzelm
parents:
diff changeset
    46
65983
d8c5603c1732 explicit preview request/response;
wenzelm
parents: 65979
diff changeset
    47
    const language_client =
d8c5603c1732 explicit preview request/response;
wenzelm
parents: 65979
diff changeset
    48
      new LanguageClient("Isabelle", server_options, language_client_options, false)
65094
386d9d487f62 support for decorations;
wenzelm
parents: 64874
diff changeset
    49
65182
973b7669e7d9 proper Map operations;
wenzelm
parents: 65180
diff changeset
    50
65201
2d01b30e6ac6 clarified modules;
wenzelm
parents: 65200
diff changeset
    51
    /* decorations */
2d01b30e6ac6 clarified modules;
wenzelm
parents: 65200
diff changeset
    52
66097
ee4c2d5b650e tuned signature;
wenzelm
parents: 66096
diff changeset
    53
    decorations.setup(context)
65975
f20739a63a44 more careful treatment of context.subscriptions;
wenzelm
parents: 65974
diff changeset
    54
    context.subscriptions.push(
66097
ee4c2d5b650e tuned signature;
wenzelm
parents: 66096
diff changeset
    55
      workspace.onDidChangeConfiguration(() => decorations.setup(context)),
65975
f20739a63a44 more careful treatment of context.subscriptions;
wenzelm
parents: 65974
diff changeset
    56
      workspace.onDidChangeTextDocument(event => decorations.touch_document(event.document)),
f20739a63a44 more careful treatment of context.subscriptions;
wenzelm
parents: 65974
diff changeset
    57
      window.onDidChangeActiveTextEditor(decorations.update_editor),
f20739a63a44 more careful treatment of context.subscriptions;
wenzelm
parents: 65974
diff changeset
    58
      workspace.onDidCloseTextDocument(decorations.close_document))
65201
2d01b30e6ac6 clarified modules;
wenzelm
parents: 65200
diff changeset
    59
65983
d8c5603c1732 explicit preview request/response;
wenzelm
parents: 65979
diff changeset
    60
    language_client.onReady().then(() =>
d8c5603c1732 explicit preview request/response;
wenzelm
parents: 65979
diff changeset
    61
      language_client.onNotification(protocol.decoration_type, decorations.apply_decoration))
65201
2d01b30e6ac6 clarified modules;
wenzelm
parents: 65200
diff changeset
    62
2d01b30e6ac6 clarified modules;
wenzelm
parents: 65200
diff changeset
    63
65978
wenzelm
parents: 65977
diff changeset
    64
    /* caret handling */
65191
4c9c83311cad dynamic output, depending on caret focus (see also Tools/jEdit/src/output_dockable.scala);
wenzelm
parents: 65189
diff changeset
    65
65189
41d2452845fc support for caret handling and dynamic output;
wenzelm
parents: 65186
diff changeset
    66
    function update_caret()
41d2452845fc support for caret handling and dynamic output;
wenzelm
parents: 65186
diff changeset
    67
    {
65969
1f93eb5c3d77 tuned imports;
wenzelm
parents: 65968
diff changeset
    68
      const editor = window.activeTextEditor
65201
2d01b30e6ac6 clarified modules;
wenzelm
parents: 65200
diff changeset
    69
      let caret_update: protocol.Caret_Update = {}
65189
41d2452845fc support for caret handling and dynamic output;
wenzelm
parents: 65186
diff changeset
    70
      if (editor) {
41d2452845fc support for caret handling and dynamic output;
wenzelm
parents: 65186
diff changeset
    71
        const uri = editor.document.uri
41d2452845fc support for caret handling and dynamic output;
wenzelm
parents: 65186
diff changeset
    72
        const cursor = editor.selection.active
65972
9f6a154c6ca0 clarified modules;
wenzelm
parents: 65970
diff changeset
    73
        if (library.is_file(uri) && cursor)
65189
41d2452845fc support for caret handling and dynamic output;
wenzelm
parents: 65186
diff changeset
    74
          caret_update = { uri: uri.toString(), line: cursor.line, character: cursor.character }
41d2452845fc support for caret handling and dynamic output;
wenzelm
parents: 65186
diff changeset
    75
      }
41d2452845fc support for caret handling and dynamic output;
wenzelm
parents: 65186
diff changeset
    76
      if (last_caret_update !== caret_update) {
65202
187277b77d50 suppress vacuous messages;
wenzelm
parents: 65201
diff changeset
    77
        if (caret_update.uri)
65983
d8c5603c1732 explicit preview request/response;
wenzelm
parents: 65979
diff changeset
    78
          language_client.sendNotification(protocol.caret_update_type, caret_update)
65189
41d2452845fc support for caret handling and dynamic output;
wenzelm
parents: 65186
diff changeset
    79
        last_caret_update = caret_update
41d2452845fc support for caret handling and dynamic output;
wenzelm
parents: 65186
diff changeset
    80
      }
41d2452845fc support for caret handling and dynamic output;
wenzelm
parents: 65186
diff changeset
    81
    }
41d2452845fc support for caret handling and dynamic output;
wenzelm
parents: 65186
diff changeset
    82
66215
9a8b6b86350c proper hyperlink_command, notably for locate_query;
wenzelm
parents: 66211
diff changeset
    83
    function goto_file(caret_update: protocol.Caret_Update)
9a8b6b86350c proper hyperlink_command, notably for locate_query;
wenzelm
parents: 66211
diff changeset
    84
    {
66216
d4949bae0bad clarified editor focus;
wenzelm
parents: 66215
diff changeset
    85
      function move_cursor(editor: TextEditor)
d4949bae0bad clarified editor focus;
wenzelm
parents: 66215
diff changeset
    86
      {
d4949bae0bad clarified editor focus;
wenzelm
parents: 66215
diff changeset
    87
        const pos = new Position(caret_update.line || 0, caret_update.character || 0)
d4949bae0bad clarified editor focus;
wenzelm
parents: 66215
diff changeset
    88
        editor.selections = [new Selection(pos, pos)]
d4949bae0bad clarified editor focus;
wenzelm
parents: 66215
diff changeset
    89
      }
d4949bae0bad clarified editor focus;
wenzelm
parents: 66215
diff changeset
    90
66215
9a8b6b86350c proper hyperlink_command, notably for locate_query;
wenzelm
parents: 66211
diff changeset
    91
      if (caret_update.uri) {
9a8b6b86350c proper hyperlink_command, notably for locate_query;
wenzelm
parents: 66211
diff changeset
    92
        workspace.openTextDocument(Uri.parse(caret_update.uri)).then(document =>
9a8b6b86350c proper hyperlink_command, notably for locate_query;
wenzelm
parents: 66211
diff changeset
    93
        {
9a8b6b86350c proper hyperlink_command, notably for locate_query;
wenzelm
parents: 66211
diff changeset
    94
          const editor = library.find_file_editor(document.uri)
66216
d4949bae0bad clarified editor focus;
wenzelm
parents: 66215
diff changeset
    95
          const column = editor ? editor.viewColumn : ViewColumn.One
d4949bae0bad clarified editor focus;
wenzelm
parents: 66215
diff changeset
    96
          window.showTextDocument(document, column, !caret_update.focus).then(move_cursor)
66215
9a8b6b86350c proper hyperlink_command, notably for locate_query;
wenzelm
parents: 66211
diff changeset
    97
        })
9a8b6b86350c proper hyperlink_command, notably for locate_query;
wenzelm
parents: 66211
diff changeset
    98
      }
9a8b6b86350c proper hyperlink_command, notably for locate_query;
wenzelm
parents: 66211
diff changeset
    99
    }
9a8b6b86350c proper hyperlink_command, notably for locate_query;
wenzelm
parents: 66211
diff changeset
   100
65983
d8c5603c1732 explicit preview request/response;
wenzelm
parents: 65979
diff changeset
   101
    language_client.onReady().then(() =>
65189
41d2452845fc support for caret handling and dynamic output;
wenzelm
parents: 65186
diff changeset
   102
    {
65975
f20739a63a44 more careful treatment of context.subscriptions;
wenzelm
parents: 65974
diff changeset
   103
      context.subscriptions.push(
f20739a63a44 more careful treatment of context.subscriptions;
wenzelm
parents: 65974
diff changeset
   104
        window.onDidChangeActiveTextEditor(_ => update_caret()),
f20739a63a44 more careful treatment of context.subscriptions;
wenzelm
parents: 65974
diff changeset
   105
        window.onDidChangeTextEditorSelection(_ => update_caret()))
65189
41d2452845fc support for caret handling and dynamic output;
wenzelm
parents: 65186
diff changeset
   106
      update_caret()
66215
9a8b6b86350c proper hyperlink_command, notably for locate_query;
wenzelm
parents: 66211
diff changeset
   107
9a8b6b86350c proper hyperlink_command, notably for locate_query;
wenzelm
parents: 66211
diff changeset
   108
      language_client.onNotification(protocol.caret_update_type, goto_file)
65189
41d2452845fc support for caret handling and dynamic output;
wenzelm
parents: 65186
diff changeset
   109
    })
41d2452845fc support for caret handling and dynamic output;
wenzelm
parents: 65186
diff changeset
   110
41d2452845fc support for caret handling and dynamic output;
wenzelm
parents: 65186
diff changeset
   111
65978
wenzelm
parents: 65977
diff changeset
   112
    /* dynamic output */
wenzelm
parents: 65977
diff changeset
   113
wenzelm
parents: 65977
diff changeset
   114
    const dynamic_output = window.createOutputChannel("Isabelle Output")
wenzelm
parents: 65977
diff changeset
   115
    context.subscriptions.push(dynamic_output)
wenzelm
parents: 65977
diff changeset
   116
    dynamic_output.show(true)
wenzelm
parents: 65977
diff changeset
   117
    dynamic_output.hide()
wenzelm
parents: 65977
diff changeset
   118
65983
d8c5603c1732 explicit preview request/response;
wenzelm
parents: 65979
diff changeset
   119
    language_client.onReady().then(() =>
65978
wenzelm
parents: 65977
diff changeset
   120
    {
65983
d8c5603c1732 explicit preview request/response;
wenzelm
parents: 65979
diff changeset
   121
      language_client.onNotification(protocol.dynamic_output_type,
65979
c208fcf369b7 tuned -- like Dynamic_Preview;
wenzelm
parents: 65978
diff changeset
   122
        params => { dynamic_output.clear(); dynamic_output.appendLine(params.content) })
65978
wenzelm
parents: 65977
diff changeset
   123
    })
wenzelm
parents: 65977
diff changeset
   124
wenzelm
parents: 65977
diff changeset
   125
66098
5aa9cb83e70e clarified modules;
wenzelm
parents: 66097
diff changeset
   126
    /* state panel */
66096
6187612e83c1 support for separate proof state output;
wenzelm
parents: 66072
diff changeset
   127
6187612e83c1 support for separate proof state output;
wenzelm
parents: 66072
diff changeset
   128
    context.subscriptions.push(
66098
5aa9cb83e70e clarified modules;
wenzelm
parents: 66097
diff changeset
   129
      commands.registerCommand("isabelle.state", uri => state_panel.init(uri)),
5aa9cb83e70e clarified modules;
wenzelm
parents: 66097
diff changeset
   130
      commands.registerCommand("_isabelle.state-locate", state_panel.locate),
66211
100c9c997e2b HTML GUI actions via JavaScript;
wenzelm
parents: 66138
diff changeset
   131
      commands.registerCommand("_isabelle.state-update", state_panel.update),
66395
14146fb264d8 proper state_panel exit;
wenzelm
parents: 66216
diff changeset
   132
      commands.registerCommand("_isabelle.state-auto-update", state_panel.auto_update),
14146fb264d8 proper state_panel exit;
wenzelm
parents: 66216
diff changeset
   133
      workspace.onDidCloseTextDocument(document => state_panel.exit_uri(document.uri)))
66096
6187612e83c1 support for separate proof state output;
wenzelm
parents: 66072
diff changeset
   134
66098
5aa9cb83e70e clarified modules;
wenzelm
parents: 66097
diff changeset
   135
    language_client.onReady().then(() => state_panel.setup(context, language_client))
66096
6187612e83c1 support for separate proof state output;
wenzelm
parents: 66072
diff changeset
   136
6187612e83c1 support for separate proof state output;
wenzelm
parents: 66072
diff changeset
   137
66098
5aa9cb83e70e clarified modules;
wenzelm
parents: 66097
diff changeset
   138
    /* preview panel */
65958
6338355b2a88 basic setup for document preview;
wenzelm
parents: 65233
diff changeset
   139
65984
8e6a833da7db register commands earlier, before prover startup;
wenzelm
parents: 65983
diff changeset
   140
    context.subscriptions.push(
66098
5aa9cb83e70e clarified modules;
wenzelm
parents: 66097
diff changeset
   141
      commands.registerCommand("isabelle.preview", uri => preview_panel.request(uri, false)),
5aa9cb83e70e clarified modules;
wenzelm
parents: 66097
diff changeset
   142
      commands.registerCommand("isabelle.preview-split", uri => preview_panel.request(uri, true)),
5aa9cb83e70e clarified modules;
wenzelm
parents: 66097
diff changeset
   143
      commands.registerCommand("isabelle.preview-source", preview_panel.source),
5aa9cb83e70e clarified modules;
wenzelm
parents: 66097
diff changeset
   144
      commands.registerCommand("isabelle.preview-update", preview_panel.update))
65984
8e6a833da7db register commands earlier, before prover startup;
wenzelm
parents: 65983
diff changeset
   145
66098
5aa9cb83e70e clarified modules;
wenzelm
parents: 66097
diff changeset
   146
    language_client.onReady().then(() => preview_panel.setup(context, language_client))
65958
6338355b2a88 basic setup for document preview;
wenzelm
parents: 65233
diff changeset
   147
6338355b2a88 basic setup for document preview;
wenzelm
parents: 65233
diff changeset
   148
66052
39eb61b1fa51 provide information about Isabelle symbols within VSCode;
wenzelm
parents: 65987
diff changeset
   149
    /* Isabelle symbols */
39eb61b1fa51 provide information about Isabelle symbols within VSCode;
wenzelm
parents: 65987
diff changeset
   150
39eb61b1fa51 provide information about Isabelle symbols within VSCode;
wenzelm
parents: 65987
diff changeset
   151
    language_client.onReady().then(() =>
39eb61b1fa51 provide information about Isabelle symbols within VSCode;
wenzelm
parents: 65987
diff changeset
   152
    {
39eb61b1fa51 provide information about Isabelle symbols within VSCode;
wenzelm
parents: 65987
diff changeset
   153
      language_client.onNotification(protocol.symbols_type,
66097
ee4c2d5b650e tuned signature;
wenzelm
parents: 66096
diff changeset
   154
        params => symbol.setup(context, params.entries))
66052
39eb61b1fa51 provide information about Isabelle symbols within VSCode;
wenzelm
parents: 65987
diff changeset
   155
      language_client.sendNotification(protocol.symbols_request_type)
39eb61b1fa51 provide information about Isabelle symbols within VSCode;
wenzelm
parents: 65987
diff changeset
   156
    })
39eb61b1fa51 provide information about Isabelle symbols within VSCode;
wenzelm
parents: 65987
diff changeset
   157
39eb61b1fa51 provide information about Isabelle symbols within VSCode;
wenzelm
parents: 65987
diff changeset
   158
66060
b2bfbefd354f symbol completion that bypasses the LS protocol, and thus observes the range properly;
wenzelm
parents: 66052
diff changeset
   159
    /* completion */
b2bfbefd354f symbol completion that bypasses the LS protocol, and thus observes the range properly;
wenzelm
parents: 66052
diff changeset
   160
b2bfbefd354f symbol completion that bypasses the LS protocol, and thus observes the range properly;
wenzelm
parents: 66052
diff changeset
   161
    const completion_provider = new completion.Completion_Provider
b2bfbefd354f symbol completion that bypasses the LS protocol, and thus observes the range properly;
wenzelm
parents: 66052
diff changeset
   162
    for (const mode of ["isabelle", "isabelle-ml"]) {
b2bfbefd354f symbol completion that bypasses the LS protocol, and thus observes the range properly;
wenzelm
parents: 66052
diff changeset
   163
      context.subscriptions.push(
b2bfbefd354f symbol completion that bypasses the LS protocol, and thus observes the range properly;
wenzelm
parents: 66052
diff changeset
   164
        languages.registerCompletionItemProvider(mode, completion_provider))
b2bfbefd354f symbol completion that bypasses the LS protocol, and thus observes the range properly;
wenzelm
parents: 66052
diff changeset
   165
    }
b2bfbefd354f symbol completion that bypasses the LS protocol, and thus observes the range properly;
wenzelm
parents: 66052
diff changeset
   166
66138
f7ef4c50b747 added commands for spell-checker dictionary;
wenzelm
parents: 66098
diff changeset
   167
f7ef4c50b747 added commands for spell-checker dictionary;
wenzelm
parents: 66098
diff changeset
   168
    /* spell checker */
f7ef4c50b747 added commands for spell-checker dictionary;
wenzelm
parents: 66098
diff changeset
   169
f7ef4c50b747 added commands for spell-checker dictionary;
wenzelm
parents: 66098
diff changeset
   170
    language_client.onReady().then(() =>
f7ef4c50b747 added commands for spell-checker dictionary;
wenzelm
parents: 66098
diff changeset
   171
    {
f7ef4c50b747 added commands for spell-checker dictionary;
wenzelm
parents: 66098
diff changeset
   172
      context.subscriptions.push(
f7ef4c50b747 added commands for spell-checker dictionary;
wenzelm
parents: 66098
diff changeset
   173
        commands.registerCommand("isabelle.include-word", uri =>
f7ef4c50b747 added commands for spell-checker dictionary;
wenzelm
parents: 66098
diff changeset
   174
          language_client.sendNotification(protocol.include_word_type)),
f7ef4c50b747 added commands for spell-checker dictionary;
wenzelm
parents: 66098
diff changeset
   175
        commands.registerCommand("isabelle.include-word-permanently", uri =>
f7ef4c50b747 added commands for spell-checker dictionary;
wenzelm
parents: 66098
diff changeset
   176
          language_client.sendNotification(protocol.include_word_permanently_type)),
f7ef4c50b747 added commands for spell-checker dictionary;
wenzelm
parents: 66098
diff changeset
   177
        commands.registerCommand("isabelle.exclude-word", uri =>
f7ef4c50b747 added commands for spell-checker dictionary;
wenzelm
parents: 66098
diff changeset
   178
          language_client.sendNotification(protocol.exclude_word_type)),
f7ef4c50b747 added commands for spell-checker dictionary;
wenzelm
parents: 66098
diff changeset
   179
        commands.registerCommand("isabelle.exclude-word-permanently", uri =>
f7ef4c50b747 added commands for spell-checker dictionary;
wenzelm
parents: 66098
diff changeset
   180
          language_client.sendNotification(protocol.exclude_word_permanently_type)),
f7ef4c50b747 added commands for spell-checker dictionary;
wenzelm
parents: 66098
diff changeset
   181
        commands.registerCommand("isabelle.reset-words", uri =>
f7ef4c50b747 added commands for spell-checker dictionary;
wenzelm
parents: 66098
diff changeset
   182
          language_client.sendNotification(protocol.reset_words_type)))
f7ef4c50b747 added commands for spell-checker dictionary;
wenzelm
parents: 66098
diff changeset
   183
    })
f7ef4c50b747 added commands for spell-checker dictionary;
wenzelm
parents: 66098
diff changeset
   184
f7ef4c50b747 added commands for spell-checker dictionary;
wenzelm
parents: 66098
diff changeset
   185
65182
973b7669e7d9 proper Map operations;
wenzelm
parents: 65180
diff changeset
   186
    /* start server */
973b7669e7d9 proper Map operations;
wenzelm
parents: 65180
diff changeset
   187
65986
d2b2f08533c5 added update operation;
wenzelm
parents: 65985
diff changeset
   188
    context.subscriptions.push(language_client.start())
65094
386d9d487f62 support for decorations;
wenzelm
parents: 64874
diff changeset
   189
  }
64605
9c1173a7e4cb basic support for VSCode Language Server protocol;
wenzelm
parents:
diff changeset
   190
}
9c1173a7e4cb basic support for VSCode Language Server protocol;
wenzelm
parents:
diff changeset
   191
9c1173a7e4cb basic support for VSCode Language Server protocol;
wenzelm
parents:
diff changeset
   192
export function deactivate() { }