src/Tools/VSCode/extension/src/library.ts
author wenzelm
Tue, 30 May 2017 11:50:12 +0200
changeset 65968 44e703278dfd
parent 65967 5d9da2f8fd3f
child 65970 05e317e291a8
permissions -rw-r--r--
clarified modules;

'use strict';

import { ViewColumn, TextEditor, workspace } from 'vscode'


/* Isabelle configuration */

export function get_configuration<T>(name: string): T
{
  return workspace.getConfiguration("isabelle").get<T>(name)
}

export function get_color(color: string, light: boolean): string
{
  const config = color + (light ? "_light" : "_dark") + "_color"
  return get_configuration<string>(config)
}


/* text editor column */

export function other_column(active_editor: TextEditor | null): ViewColumn
{
  if (!active_editor || active_editor.viewColumn === ViewColumn.Three) return ViewColumn.One
  else if (active_editor.viewColumn === ViewColumn.One) return ViewColumn.Two
  else return ViewColumn.Three
}