tuned signature;
authorwenzelm
Sat Mar 11 12:12:55 2017 +0100 (2017-03-11)
changeset 65180b5a8f27a4980
parent 65179 883acfccb265
child 65181 b4105202751c
tuned signature;
src/Tools/VSCode/extension/src/decorations.ts
src/Tools/VSCode/extension/src/extension.ts
     1.1 --- a/src/Tools/VSCode/extension/src/decorations.ts	Fri Mar 10 23:09:53 2017 +0100
     1.2 +++ b/src/Tools/VSCode/extension/src/decorations.ts	Sat Mar 11 12:12:55 2017 +0100
     1.3 @@ -3,6 +3,7 @@
     1.4  import * as vscode from 'vscode'
     1.5  import { Position, Range, MarkedString, DecorationOptions, DecorationRenderOptions,
     1.6    TextDocument, TextEditor, TextEditorDecorationType, ExtensionContext, Uri } from 'vscode'
     1.7 +import { get_color } from './extension'
     1.8  
     1.9  
    1.10  /* known decoration types */
    1.11 @@ -55,12 +56,6 @@
    1.12    "antiquote"
    1.13  ]
    1.14  
    1.15 -function get_color(color: string, light: boolean): string
    1.16 -{
    1.17 -  const config = color + (light ? "_light" : "_dark") + "_color"
    1.18 -  return vscode.workspace.getConfiguration("isabelle").get<string>(config)
    1.19 -}
    1.20 -
    1.21  export function init(context: ExtensionContext)
    1.22  {
    1.23    function decoration(options: DecorationRenderOptions): TextEditorDecorationType
     2.1 --- a/src/Tools/VSCode/extension/src/extension.ts	Fri Mar 10 23:09:53 2017 +0100
     2.2 +++ b/src/Tools/VSCode/extension/src/extension.ts	Sat Mar 11 12:12:55 2017 +0100
     2.3 @@ -6,17 +6,34 @@
     2.4  import * as os from 'os';
     2.5  import * as decorations from './decorations';
     2.6  import { Decoration } from './decorations'
     2.7 +import { WorkspaceConfiguration} from 'vscode'
     2.8  import { LanguageClient, LanguageClientOptions, SettingMonitor, ServerOptions, TransportKind, NotificationType }
     2.9    from 'vscode-languageclient';
    2.10  
    2.11  
    2.12 +/* Isabelle configuration */
    2.13 +
    2.14 +export function get_configuration(): WorkspaceConfiguration
    2.15 +{
    2.16 +  return vscode.workspace.getConfiguration("isabelle")
    2.17 +}
    2.18 +
    2.19 +export function get_color(color: string, light: boolean): string
    2.20 +{
    2.21 +  const config = color + (light ? "_light" : "_dark") + "_color"
    2.22 +  return get_configuration().get<string>(config)
    2.23 +}
    2.24 +
    2.25 +
    2.26 +/* activate extension */
    2.27 +
    2.28  export function activate(context: vscode.ExtensionContext)
    2.29  {
    2.30    const is_windows = os.type().startsWith("Windows")
    2.31  
    2.32 -  const isabelle_home = vscode.workspace.getConfiguration("isabelle").get<string>("home")
    2.33 -  const isabelle_args = vscode.workspace.getConfiguration("isabelle").get<Array<string>>("args")
    2.34 -  const cygwin_root = vscode.workspace.getConfiguration("isabelle").get<string>("cygwin_root")
    2.35 +  const isabelle_home = get_configuration().get<string>("home")
    2.36 +  const isabelle_args = get_configuration().get<Array<string>>("args")
    2.37 +  const cygwin_root = get_configuration().get<string>("cygwin_root")
    2.38  
    2.39    if (isabelle_home === "")
    2.40      vscode.window.showErrorMessage("Missing user settings: isabelle.home")