--- a/etc/build.props Wed Mar 09 16:52:32 2022 +0100
+++ b/etc/build.props Wed Mar 09 16:58:26 2022 +0100
@@ -211,7 +211,7 @@
src/Tools/Graphview/popups.scala \
src/Tools/Graphview/shapes.scala \
src/Tools/Graphview/tree_panel.scala \
- src/Tools/VSCode/src/build_vscode.scala \
+ src/Tools/VSCode/src/build_vscode_extension.scala \
src/Tools/VSCode/src/build_vscodium.scala \
src/Tools/VSCode/src/channel.scala \
src/Tools/VSCode/src/dynamic_output.scala \
--- a/src/Tools/VSCode/README.md Wed Mar 09 16:52:32 2022 +0100
+++ b/src/Tools/VSCode/README.md Wed Mar 09 16:58:26 2022 +0100
@@ -19,7 +19,7 @@
* Shell commands within $ISABELLE_HOME directory:
- isabelle build_vscode -U
+ isabelle build_vscode_extension -U
isabelle vscode src/Tools/VSCode/extension
* VSCode commands:
@@ -29,4 +29,4 @@
## Build and install ##
- isabelle build_vscode -I
+ isabelle build_vscode_extension -I
--- a/src/Tools/VSCode/src/build_vscode.scala Wed Mar 09 16:52:32 2022 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-/* Title: Tools/VSCode/src/build_vscode.scala
- Author: Makarius
-
-Build the Isabelle/VSCode extension.
-*/
-
-package isabelle.vscode
-
-
-import isabelle._
-
-
-object Build_VSCode
-{
- val extension_dir = Path.explode("$ISABELLE_VSCODE_HOME/extension")
-
-
- /* grammar */
-
- def build_grammar(options: Options, progress: Progress = new Progress): Unit =
- {
- val logic = TextMate_Grammar.default_logic
- val keywords = Sessions.base_info(options, logic).check.base.overall_syntax.keywords
-
- val output_path = extension_dir + Path.explode(TextMate_Grammar.default_output(logic))
- progress.echo(output_path.expand.implode)
- File.write_backup(output_path, TextMate_Grammar.generate(keywords))
- }
-
-
- /* extension */
-
- def uninstall_extension(progress: Progress = new Progress): Unit =
- progress.bash("isabelle vscode --uninstall-extension Isabelle.isabelle").check
-
- def install_extension(vsix_path: Path, progress: Progress = new Progress): Unit =
- progress.bash("isabelle vscode --install-extension " +
- File.bash_platform_path(vsix_path))
-
- def build_extension(progress: Progress = new Progress): Path =
- {
- val output_path = extension_dir + Path.explode("out")
- Isabelle_System.rm_tree(output_path)
- Isabelle_System.make_directory(output_path)
- progress.echo(output_path.expand.implode)
-
- val result =
- progress.bash("npm install && npm update --dev && vsce package",
- cwd = extension_dir.file, echo = true).check
-
- val Pattern = """.*Packaged:.*(isabelle-.*\.vsix).*""".r
- result.out_lines.collectFirst(
- { case Pattern(vsix_name) => extension_dir + Path.basic(vsix_name) })
- .getOrElse(error("Failed to guess resulting .vsix file name"))
- }
-
-
- /* Isabelle tool wrapper */
-
- val isabelle_tool =
- Isabelle_Tool("build_vscode", "build Isabelle/VSCode extension module",
- Scala_Project.here, args =>
- {
- var install = false
- var uninstall = false
-
- val getopts = Getopts("""
-Usage: isabelle build_vscode
-
- Options are:
- -I install resulting extension
- -U uninstall extension (no build)
-
-Build Isabelle/VSCode extension module in directory
-""" + extension_dir.expand + """
-
-This requires node.js/npm and the vsce build tool.
-""",
- "I" -> (_ => install = true),
- "U" -> (_ => uninstall = true))
-
- val more_args = getopts(args)
- if (more_args.nonEmpty) getopts.usage()
-
- val options = Options.init()
- val progress = new Console_Progress()
-
- if (uninstall) {
- uninstall_extension(progress = progress)
- }
- else {
- build_grammar(options, progress = progress)
- val path = build_extension(progress = progress)
- if (install) install_extension(path, progress = progress)
- }
- })
-}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Tools/VSCode/src/build_vscode_extension.scala Wed Mar 09 16:58:26 2022 +0100
@@ -0,0 +1,97 @@
+/* Title: Tools/VSCode/src/build_vscode_extension.scala
+ Author: Makarius
+
+Build the Isabelle/VSCode extension.
+*/
+
+package isabelle.vscode
+
+
+import isabelle._
+
+
+object Build_VSCode
+{
+ val extension_dir = Path.explode("$ISABELLE_VSCODE_HOME/extension")
+
+
+ /* grammar */
+
+ def build_grammar(options: Options, progress: Progress = new Progress): Unit =
+ {
+ val logic = TextMate_Grammar.default_logic
+ val keywords = Sessions.base_info(options, logic).check.base.overall_syntax.keywords
+
+ val output_path = extension_dir + Path.explode(TextMate_Grammar.default_output(logic))
+ progress.echo(output_path.expand.implode)
+ File.write_backup(output_path, TextMate_Grammar.generate(keywords))
+ }
+
+
+ /* extension */
+
+ def uninstall_extension(progress: Progress = new Progress): Unit =
+ progress.bash("isabelle vscode --uninstall-extension Isabelle.isabelle").check
+
+ def install_extension(vsix_path: Path, progress: Progress = new Progress): Unit =
+ progress.bash("isabelle vscode --install-extension " +
+ File.bash_platform_path(vsix_path))
+
+ def build_extension(progress: Progress = new Progress): Path =
+ {
+ val output_path = extension_dir + Path.explode("out")
+ Isabelle_System.rm_tree(output_path)
+ Isabelle_System.make_directory(output_path)
+ progress.echo(output_path.expand.implode)
+
+ val result =
+ progress.bash("npm install && npm update --dev && vsce package",
+ cwd = extension_dir.file, echo = true).check
+
+ val Pattern = """.*Packaged:.*(isabelle-.*\.vsix).*""".r
+ result.out_lines.collectFirst(
+ { case Pattern(vsix_name) => extension_dir + Path.basic(vsix_name) })
+ .getOrElse(error("Failed to guess resulting .vsix file name"))
+ }
+
+
+ /* Isabelle tool wrapper */
+
+ val isabelle_tool =
+ Isabelle_Tool("build_vscode_extension", "build Isabelle/VSCode extension module",
+ Scala_Project.here, args =>
+ {
+ var install = false
+ var uninstall = false
+
+ val getopts = Getopts("""
+Usage: isabelle build_vscode_extension
+
+ Options are:
+ -I install resulting extension
+ -U uninstall extension (no build)
+
+Build Isabelle/VSCode extension module in directory
+""" + extension_dir.expand + """
+
+This requires node.js/npm and the vsce build tool.
+""",
+ "I" -> (_ => install = true),
+ "U" -> (_ => uninstall = true))
+
+ val more_args = getopts(args)
+ if (more_args.nonEmpty) getopts.usage()
+
+ val options = Options.init()
+ val progress = new Console_Progress()
+
+ if (uninstall) {
+ uninstall_extension(progress = progress)
+ }
+ else {
+ build_grammar(options, progress = progress)
+ val path = build_extension(progress = progress)
+ if (install) install_extension(path, progress = progress)
+ }
+ })
+}