src/Tools/VSCode/extension/media/sledgehammer.js
author wenzelm
Sun, 26 Oct 2025 19:38:38 +0100
changeset 83405 6ac2c6c2e549
parent 83401 1d9b1ca7977e
child 83407 a51835dd6a64
permissions -rw-r--r--
more direct treatment of "purpose"; clarified message names;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
     1
(function () {
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
     2
  const vscode = acquireVsCodeApi();
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
     3
  let was_cancelled = false;
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
     4
  let can_be_cancelled = false;
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
     5
83396
1cc5bab55049 tuned whitespace;
wenzelm
parents: 83395
diff changeset
     6
  let history = [];
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
     7
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
     8
  const container = document.createElement("div");
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
     9
  container.id = "sledgehammer-container";
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    10
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    11
  const top_row = document.createElement("div");
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    12
  top_row.classList.add("top-row");
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    13
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    14
  const provers_label = document.createElement("label");
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    15
  provers_label.textContent = "Provers: ";
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    16
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    17
  const provers_input_wrapper = document.createElement("div");
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    18
  provers_input_wrapper.className = "provers-input-wrapper";
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    19
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    20
  const provers_input = document.createElement("input");
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    21
  provers_input.type = "text";
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    22
  provers_input.id = "provers";
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    23
  provers_input.size = 30;
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    24
  provers_input.value = "";
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    25
  provers_input.autocomplete = "off";
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    26
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    27
  provers_input_wrapper.appendChild(provers_input);
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    28
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    29
  const chevron_button = document.createElement("button");
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    30
  chevron_button.type = "button";
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    31
  chevron_button.className = "provers-dropdown-toggle";
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    32
  chevron_button.setAttribute("aria-label", "Show provers history");
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    33
  chevron_button.tabIndex = -1;
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    34
  chevron_button.innerHTML = "\u25bc";
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    35
  provers_input_wrapper.appendChild(chevron_button);
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    36
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    37
  provers_label.appendChild(provers_input_wrapper);
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    38
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    39
  const dropdown = document.createElement("div");
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    40
  dropdown.className = "provers-dropdown";
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    41
  provers_input_wrapper.appendChild(dropdown);
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    42
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    43
  function show_dropdown() {
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    44
    dropdown.classList.add("visible");
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    45
  }
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    46
  function hide_dropdown() {
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    47
    dropdown.classList.remove("visible");
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    48
  }
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    49
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    50
  function render_dropdown(open = false) {
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    51
    dropdown.innerHTML = "";
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    52
    const header = document.createElement("div");
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    53
    header.textContent = "Previously entered strings:";
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    54
    header.className = "history-header";
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    55
    dropdown.appendChild(header);
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    56
    if (history.length === 0) {
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    57
      const no_entry = document.createElement("div");
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    58
      no_entry.className = "history-header";
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    59
    }
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    60
    else {
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    61
      history.forEach(item => {
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    62
        const row = document.createElement("div");
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    63
        row.tabIndex = 0;
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    64
        row.textContent = item;
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    65
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    66
        const delete_button = document.createElement("span");
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    67
        delete_button.textContent = "\u2716";
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    68
        delete_button.className = "delete-btn";
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    69
        delete_button.title = "Delete entry";
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    70
        delete_button.addEventListener("mousedown", function (ev) {
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    71
          ev.preventDefault();
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    72
          ev.stopPropagation();
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    73
          history = history.filter(h => h !== item);
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    74
          render_dropdown(false);
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    75
          show_dropdown();
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    76
        });
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    77
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    78
        row.appendChild(delete_button);
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    79
        row.addEventListener("mousedown", function (e) {
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    80
          e.preventDefault();
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    81
          provers_input.value = item;
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    82
          hide_dropdown();
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    83
          provers_input.focus();
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    84
        });
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    85
        dropdown.appendChild(row);
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    86
      });
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    87
    }
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    88
    if (open) show_dropdown(); else hide_dropdown();
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    89
  }
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    90
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    91
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    92
  chevron_button.addEventListener("mousedown", function (e) {
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
    93
    e.preventDefault();
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
    94
    if (dropdown.classList.contains("visible")) {
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    95
      hide_dropdown();
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    96
    }
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    97
    else {
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    98
      render_dropdown(true);
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
    99
      show_dropdown();
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   100
      provers_input.focus();
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   101
    }
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   102
  });
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   103
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   104
  provers_input.addEventListener("input", () => { });
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   105
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   106
  provers_input.addEventListener("focus", function () {
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   107
    render_dropdown(true);
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   108
    show_dropdown();
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   109
  });
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   110
  provers_input.addEventListener("blur", () => {
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   111
    setTimeout(() => {
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   112
      if (!dropdown.contains(document.activeElement)) hide_dropdown();
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   113
    }, 150);
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   114
  });
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   115
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   116
  provers_input.addEventListener("keydown", (e) => {
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   117
    if (e.key === "ArrowDown" && dropdown.childNodes.length) {
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   118
      dropdown.firstChild && dropdown.firstChild.focus && dropdown.firstChild.focus();
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   119
    }
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   120
  });
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   121
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   122
  function save_state() {
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   123
    vscode.setState({
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   124
      history,
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   125
      provers: provers_input.value,
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   126
      isar: isar_checkbox.checked,
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   127
      try0: try0_checkbox.checked
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   128
    });
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   129
  }
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   130
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   131
  function add_to_history(entry) {
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   132
    if (!entry.trim()) return;
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   133
    history = [entry, ...history.filter((h) => h !== entry)].slice(0, 10);
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   134
    save_state();
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   135
    render_dropdown();
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   136
  }
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   137
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   138
  const isar_label = document.createElement("label");
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   139
  const isar_checkbox = document.createElement("input");
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   140
  isar_checkbox.type = "checkbox";
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   141
  isar_checkbox.id = "isar";
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   142
  isar_label.appendChild(isar_checkbox);
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   143
  isar_label.appendChild(document.createTextNode(" Isar proofs"));
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   144
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   145
  const try0_label = document.createElement("label");
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   146
  const try0_checkbox = document.createElement("input");
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   147
  try0_checkbox.type = "checkbox";
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   148
  try0_checkbox.id = "try0";
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   149
  try0_checkbox.checked = true;
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   150
  try0_label.appendChild(try0_checkbox);
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   151
  try0_label.appendChild(document.createTextNode(" Try methods"));
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   152
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   153
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   154
  provers_input.addEventListener("input", save_state);
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   155
  isar_checkbox.addEventListener("change", save_state);
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   156
  try0_checkbox.addEventListener("change", save_state);
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   157
  const spinner = document.createElement("div");
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   158
  spinner.id = "sledgehammer-spinner";
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   159
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   160
  const apply_button = document.createElement("button");
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   161
  apply_button.textContent = "Apply";
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   162
  apply_button.id = "apply-btn";
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   163
  apply_button.addEventListener("click", () => {
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   164
    was_cancelled = false;
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   165
    can_be_cancelled = true;
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   166
    result.innerHTML = "";
83396
1cc5bab55049 tuned whitespace;
wenzelm
parents: 83395
diff changeset
   167
    add_to_history(provers_input.value);
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   168
    hide_dropdown();
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   169
    vscode.postMessage({
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   170
      command: "apply",
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   171
      provers: provers_input.value,
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   172
      isar: isar_checkbox.checked,
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   173
      try0: try0_checkbox.checked
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   174
    });
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   175
  });
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   176
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   177
  const cancel_button = document.createElement("button");
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   178
  cancel_button.textContent = "Cancel";
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   179
  cancel_button.addEventListener("click", () => {
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   180
    vscode.postMessage({ command: "cancel" });
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   181
    if (was_cancelled) return;
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   182
    if (!can_be_cancelled) return;
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   183
    was_cancelled = true;
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   184
    spinner.classList.remove("loading");
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   185
    const div = document.createElement("div");
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   186
    div.classList.add("interrupt");
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   187
    div.textContent = "Interrupt";
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   188
    result.appendChild(div);
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   189
  });
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   190
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   191
  const locate_button = document.createElement("button");
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   192
  locate_button.textContent = "Locate";
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   193
  locate_button.addEventListener("click", () => {
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   194
    vscode.postMessage({
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   195
      command: "locate",
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   196
      provers: provers_input.value,
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   197
      isar: isar_checkbox.checked,
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   198
      try0: try0_checkbox.checked
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   199
    });
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   200
  });
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   201
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   202
  top_row.appendChild(provers_label);
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   203
  top_row.appendChild(isar_label);
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   204
  top_row.appendChild(try0_label);
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   205
  top_row.appendChild(spinner);
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   206
  top_row.appendChild(apply_button);
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   207
  top_row.appendChild(cancel_button);
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   208
  top_row.appendChild(locate_button);
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   209
  container.appendChild(top_row);
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   210
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   211
  const result = document.createElement("div");
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   212
  result.id = "result";
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   213
  container.appendChild(result);
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   214
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   215
  document.body.appendChild(container);
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   216
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   217
  render_dropdown();
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   218
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   219
  window.addEventListener("message", event => {
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   220
    const message = event.data;
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   221
    if (message.command === "status") {
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   222
      spinner.classList.toggle("loading", message.message !== "Finished");
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   223
    }
83401
1d9b1ca7977e dismantle redundant sledgehammer history in Isabelle/Scala, which does not quite work --- and is already done via vscode.setState / vscode.getState;
wenzelm
parents: 83400
diff changeset
   224
    else if (message.command === "provers" && message.provers) {
1d9b1ca7977e dismantle redundant sledgehammer history in Isabelle/Scala, which does not quite work --- and is already done via vscode.setState / vscode.getState;
wenzelm
parents: 83400
diff changeset
   225
      provers_input.value = message.provers;
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   226
    }
83405
6ac2c6c2e549 more direct treatment of "purpose";
wenzelm
parents: 83401
diff changeset
   227
    else if (message.command === "no_proof") {
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   228
      const div = document.createElement("div");
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   229
      div.classList.add("interrupt");
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   230
      div.textContent = "Unknown proof context";
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   231
      result.appendChild(div);
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   232
    }
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   233
    else if (message.command === "no_provers") {
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   234
      const div = document.createElement("div");
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   235
      div.classList.add("interrupt");
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   236
      div.textContent = "No such provers";
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   237
      result.appendChild(div);
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   238
    }
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   239
    else if (message.command === "result") {
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   240
      if (was_cancelled) return;
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   241
      result.innerHTML = "";
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   242
      const parser = new DOMParser();
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   243
      const xml_doc = parser.parseFromString(`<root>${message.content}</root>`, "application/xml");
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   244
      const messages = xml_doc.getElementsByTagName("writeln_message");
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   245
      for (const msg of messages) {
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   246
        const div = document.createElement("div");
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   247
        const inner = msg.innerHTML;
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   248
        if (inner.includes("<sendback")) {
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   249
          const temp_container = document.createElement("div");
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   250
          temp_container.innerHTML = inner;
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   251
          temp_container.childNodes.forEach(node => {
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   252
            if (node.nodeType === Node.TEXT_NODE) {
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   253
              const text = node.textContent.trim();
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   254
              if (text) {
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   255
                const span = document.createElement("span");
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   256
                span.textContent = text;
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   257
                div.appendChild(span);
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   258
              }
83396
1cc5bab55049 tuned whitespace;
wenzelm
parents: 83395
diff changeset
   259
            }
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   260
            else if (node.nodeName.toLowerCase() === "sendback") {
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   261
              const button = document.createElement("button");
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   262
              button.textContent = node.textContent.trim();
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   263
              button.addEventListener("click", () => {
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   264
                vscode.postMessage({
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   265
                  command: "insert_text",
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   266
                  provers: provers_input.value,
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   267
                  isar: isar_checkbox.checked,
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   268
                  try0: try0_checkbox.checked,
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   269
                  text: node.textContent.trim()
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   270
                });
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   271
              });
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   272
              div.appendChild(button);
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   273
            }
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   274
            else {
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   275
              const span = document.createElement("span");
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   276
              span.textContent = node.textContent.trim();
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   277
              div.appendChild(span);
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   278
            }
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   279
          });
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   280
        }
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   281
        else {
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   282
          div.textContent = msg.textContent.trim();
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   283
        }
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   284
        result.appendChild(div);
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   285
      }
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   286
      if (/Unknown proof context/i.test(message.content)) {
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   287
        result.classList.add("error");
83396
1cc5bab55049 tuned whitespace;
wenzelm
parents: 83395
diff changeset
   288
      }
1cc5bab55049 tuned whitespace;
wenzelm
parents: 83395
diff changeset
   289
      else {
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   290
        result.classList.remove("error");
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   291
      }
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   292
      can_be_cancelled = false;
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   293
    }
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   294
  });
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   295
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   296
  window.onload = function () {
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   297
    const saved = vscode.getState();
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   298
    if (saved) {
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   299
      history = Array.isArray(saved.history) ? saved.history : [];
83399
f32e9720b31d tuned quotes: follow Isabelle majority style, instead of JS/TS;
wenzelm
parents: 83398
diff changeset
   300
      provers_input.value = saved.provers || "";
83395
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   301
      isar_checkbox.checked = !!saved.isar;
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   302
      try0_checkbox.checked = saved.try0 !== undefined ? saved.try0 : true;
d2a9248792cf tuned names: avoid camel-case;
wenzelm
parents: 83394
diff changeset
   303
      render_dropdown(false);
83363
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   304
    }
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   305
  };
486e094b676c various improvements of Isabelle/VSCode: original changeset by Diana Korchmar, LMU München;
wenzelm
parents:
diff changeset
   306
})();