# HG changeset patch # User wenzelm # Date 1489151805 -3600 # Node ID 365e97f009ed905c480496775a6f7d07525903a0 # Parent 63655086649f6424d25f0c3d9097e81c3f811799 default cygwin_root from Isabelle distribution; diff -r 63655086649f -r 365e97f009ed src/Tools/VSCode/extension/README.md --- a/src/Tools/VSCode/extension/README.md Fri Mar 10 11:03:46 2017 +0100 +++ b/src/Tools/VSCode/extension/README.md Fri Mar 10 14:16:45 2017 +0100 @@ -16,11 +16,6 @@ * On Windows: `isabelle.home` as above, but in Windows path notation with drive-letter and backslashes. - Moreover, `isabelle.cygwin_root` needs to point to a suitable Cygwin - installation, e.g. `$ISABELLE_HOME\contrib\cygwin` for a regular Isabelle - application bundle, or `C:\cygwin` for a stand-alone installation used - with Isabelle repository snapshot. - ## Isabelle symbols ## diff -r 63655086649f -r 365e97f009ed src/Tools/VSCode/extension/package.json --- a/src/Tools/VSCode/extension/package.json Fri Mar 10 11:03:46 2017 +0100 +++ b/src/Tools/VSCode/extension/package.json Fri Mar 10 14:16:45 2017 +0100 @@ -52,11 +52,6 @@ "configuration": { "title": "Isabelle", "properties": { - "isabelle.cygwin_root": { - "type": "string", - "default": "", - "description": "Root of Cygwin installation on Windows (e.g. ISABELLE_HOME/cygwin)." - }, "isabelle.home": { "type": "string", "default": "", @@ -68,6 +63,11 @@ "default": [], "description": "Command-line arguments for isabelle vscode_server process." }, + "isabelle.cygwin_root": { + "type": "string", + "default": "", + "description": "Cygwin installation on Windows (only relevant when running directly from the Isabelle repository)." + }, "isabelle.unprocessed1_light_color": { "type": "string", "default": "rgba(255, 160, 160, 0.20)" }, "isabelle.unprocessed1_dark_color": { "type": "string", "default": "rgba(255, 160, 160, 0.20)" }, "isabelle.running1_light_color": { "type": "string", "default": "rgba(97, 0, 97, 0.39)" }, diff -r 63655086649f -r 365e97f009ed src/Tools/VSCode/extension/src/extension.ts --- a/src/Tools/VSCode/extension/src/extension.ts Fri Mar 10 11:03:46 2017 +0100 +++ b/src/Tools/VSCode/extension/src/extension.ts Fri Mar 10 14:16:45 2017 +0100 @@ -2,6 +2,7 @@ import * as vscode from 'vscode'; import * as path from 'path'; +import * as fs from 'fs'; import * as os from 'os'; import * as decorations from './decorations'; import { Decoration } from './decorations' @@ -13,13 +14,11 @@ { const is_windows = os.type().startsWith("Windows") - const cygwin_root = vscode.workspace.getConfiguration("isabelle").get("cygwin_root"); - const isabelle_home = vscode.workspace.getConfiguration("isabelle").get("home"); - const isabelle_args = vscode.workspace.getConfiguration("isabelle").get>("args"); + const isabelle_home = vscode.workspace.getConfiguration("isabelle").get("home") + const isabelle_args = vscode.workspace.getConfiguration("isabelle").get>("args") + const cygwin_root = vscode.workspace.getConfiguration("isabelle").get("cygwin_root") - if (is_windows && cygwin_root === "") - vscode.window.showErrorMessage("Missing user settings: isabelle.cygwin_root") - else if (isabelle_home === "") + if (isabelle_home === "") vscode.window.showErrorMessage("Missing user settings: isabelle.home") else { const isabelle_tool = isabelle_home + "/bin/isabelle" @@ -27,7 +26,9 @@ const server_options: ServerOptions = is_windows ? - { command: cygwin_root + "/bin/bash", + { command: + (cygwin_root === "" ? path.join(isabelle_home, "contrib", "cygwin") : cygwin_root) + + "/bin/bash", args: ["-l", isabelle_tool, "vscode_server"].concat(standard_args, isabelle_args) } : { command: isabelle_tool, args: ["vscode_server"].concat(standard_args, isabelle_args) };