lean4monaco 1.0.46 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -0
- package/dist/JuliaMono-Regular.ttf +0 -0
- package/dist/css/custom.css +7 -1
- package/dist/infowebview.d.ts +3 -4
- package/dist/infowebview.js +4 -4
- package/dist/lean4-infoview/codicon.ttf +0 -0
- package/dist/lean4-infoview/esm-shims/react-dom.d.ts +5 -0
- package/dist/lean4-infoview/esm-shims/react-jsx-runtime.d.ts +5 -0
- package/dist/lean4-infoview/esm-shims/react.d.ts +5 -0
- package/dist/lean4-infoview/index.css +4161 -0
- package/dist/lean4-infoview/index.d.ts +16 -0
- package/dist/lean4-infoview/index.development.js +37312 -0
- package/dist/lean4-infoview/index.production.min.js +1528 -0
- package/dist/lean4-infoview/infoview/collapsing.d.ts +12 -0
- package/dist/lean4-infoview/infoview/contexts.d.ts +10 -0
- package/dist/lean4-infoview/infoview/editorConnection.d.ts +22 -0
- package/dist/lean4-infoview/infoview/errors.d.ts +14 -0
- package/dist/lean4-infoview/infoview/event.d.ts +33 -0
- package/dist/lean4-infoview/infoview/goalLocation.d.ts +61 -0
- package/dist/lean4-infoview/infoview/goals.d.ts +46 -0
- package/dist/lean4-infoview/infoview/info.d.ts +18 -0
- package/dist/lean4-infoview/infoview/infos.d.ts +2 -0
- package/dist/lean4-infoview/infoview/interactiveCode.d.ts +19 -0
- package/dist/lean4-infoview/infoview/main.d.ts +13 -0
- package/dist/lean4-infoview/infoview/messages.d.ts +19 -0
- package/dist/lean4-infoview/infoview/rpcSessions.d.ts +11 -0
- package/dist/lean4-infoview/infoview/serverVersion.d.ts +10 -0
- package/dist/lean4-infoview/infoview/tooltips.d.ts +32 -0
- package/dist/lean4-infoview/infoview/traceExplorer.d.ts +11 -0
- package/dist/lean4-infoview/infoview/userWidget.d.ts +39 -0
- package/dist/lean4-infoview/infoview/util.d.ts +144 -0
- package/dist/lean4-infoview/loader.d.ts +20 -0
- package/dist/lean4-infoview/loader.development.js +1006 -0
- package/dist/lean4-infoview/loader.production.min.js +1 -0
- package/dist/lean4-infoview/react-dom.development.js +30537 -0
- package/dist/lean4-infoview/react-dom.production.min.js +21 -0
- package/dist/lean4-infoview/react-jsx-runtime.development.js +1362 -0
- package/dist/lean4-infoview/react-jsx-runtime.production.min.js +1 -0
- package/dist/lean4-infoview/react.development.js +2823 -0
- package/dist/lean4-infoview/react.production.min.js +1 -0
- package/dist/leanmonaco.js +5 -4
- package/dist/monaco-lean4/vscode-lean4/package.json +944 -0
- package/dist/monaco-lean4/vscode-lean4/src/abbreviation/AbbreviationFeature.d.ts +9 -0
- package/dist/monaco-lean4/vscode-lean4/src/abbreviation/AbbreviationFeature.js +20 -0
- package/dist/monaco-lean4/vscode-lean4/src/abbreviation/AbbreviationHoverProvider.d.ts +12 -0
- package/dist/monaco-lean4/vscode-lean4/src/abbreviation/AbbreviationHoverProvider.js +40 -0
- package/dist/monaco-lean4/vscode-lean4/src/abbreviation/AbbreviationRewriterFeature.d.ts +20 -0
- package/dist/monaco-lean4/vscode-lean4/src/abbreviation/AbbreviationRewriterFeature.js +79 -0
- package/dist/monaco-lean4/vscode-lean4/src/abbreviation/VSCodeAbbreviationConfig.d.ts +13 -0
- package/dist/monaco-lean4/vscode-lean4/src/abbreviation/VSCodeAbbreviationConfig.js +29 -0
- package/dist/monaco-lean4/vscode-lean4/src/abbreviation/VSCodeAbbreviationRewriter.d.ts +28 -0
- package/dist/monaco-lean4/vscode-lean4/src/abbreviation/VSCodeAbbreviationRewriter.js +124 -0
- package/dist/monaco-lean4/vscode-lean4/src/config.d.ts +33 -0
- package/dist/monaco-lean4/vscode-lean4/src/config.js +119 -0
- package/dist/monaco-lean4/vscode-lean4/src/diagnostics/setupNotifs.d.ts +27 -0
- package/dist/monaco-lean4/vscode-lean4/src/diagnostics/setupNotifs.js +133 -0
- package/dist/monaco-lean4/vscode-lean4/src/infoview.d.ts +69 -0
- package/dist/monaco-lean4/vscode-lean4/src/infoview.js +711 -0
- package/dist/monaco-lean4/vscode-lean4/src/leanclient.d.ts +67 -0
- package/dist/monaco-lean4/vscode-lean4/src/leanclient.js +443 -0
- package/dist/monaco-lean4/vscode-lean4/src/rpc.d.ts +16 -0
- package/dist/monaco-lean4/vscode-lean4/src/rpc.js +102 -0
- package/dist/monaco-lean4/vscode-lean4/src/taskgutter.d.ts +11 -0
- package/dist/monaco-lean4/vscode-lean4/src/taskgutter.js +130 -0
- package/dist/monaco-lean4/vscode-lean4/src/utils/batch.d.ts +37 -0
- package/dist/monaco-lean4/vscode-lean4/src/utils/batch.js +203 -0
- package/dist/monaco-lean4/vscode-lean4/src/utils/clientProvider.d.ts +41 -0
- package/dist/monaco-lean4/vscode-lean4/src/utils/clientProvider.js +205 -0
- package/dist/monaco-lean4/vscode-lean4/src/utils/converters.d.ts +16 -0
- package/dist/monaco-lean4/vscode-lean4/src/utils/converters.js +129 -0
- package/dist/monaco-lean4/vscode-lean4/src/utils/elan.d.ts +3 -0
- package/dist/monaco-lean4/vscode-lean4/src/utils/elan.js +4 -0
- package/dist/monaco-lean4/vscode-lean4/src/utils/envPath.d.ts +21 -0
- package/dist/monaco-lean4/vscode-lean4/src/utils/envPath.js +53 -0
- package/dist/monaco-lean4/vscode-lean4/src/utils/exturi.d.ts +35 -0
- package/dist/monaco-lean4/vscode-lean4/src/utils/exturi.js +136 -0
- package/dist/monaco-lean4/vscode-lean4/src/utils/fsHelper.d.ts +17 -0
- package/dist/monaco-lean4/vscode-lean4/src/utils/fsHelper.js +36 -0
- package/dist/monaco-lean4/vscode-lean4/src/utils/leanInstaller.d.ts +37 -0
- package/dist/monaco-lean4/vscode-lean4/src/utils/leanInstaller.js +210 -0
- package/dist/monaco-lean4/vscode-lean4/src/utils/logger.d.ts +7 -0
- package/dist/monaco-lean4/vscode-lean4/src/utils/logger.js +20 -0
- package/dist/monaco-lean4/vscode-lean4/src/utils/notifs.d.ts +24 -0
- package/dist/monaco-lean4/vscode-lean4/src/utils/notifs.js +110 -0
- package/dist/monaco-lean4/vscode-lean4/src/utils/projectInfo.d.ts +9 -0
- package/dist/monaco-lean4/vscode-lean4/src/utils/projectInfo.js +125 -0
- package/dist/monacoleanclient.d.ts +1 -2
- package/dist/monacoleanclient.js +3 -3
- package/dist/vscode-lean4/lean4-infoview/package.json +25 -23
- package/dist/vscode-lean4/lean4-infoview/src/infoview/highlightjs.css +210 -0
- package/dist/vscode-lean4/lean4-infoview/tsconfig.json +6 -2
- package/dist/vscode-lean4/lean4-infoview-api/package.json +1 -1
- package/dist/vscode-lean4/lean4-unicode-input/package.json +1 -1
- package/dist/vscode-lean4/lean4-unicode-input/src/abbreviations.json +12 -12
- package/dist/vscode-lean4/lean4-unicode-input-component/package.json +2 -2
- package/dist/vscode-lean4/package-lock.json +6129 -3245
- package/dist/vscode-lean4/vscode-lean4/language-configuration.json +1 -1
- package/dist/vscode-lean4/vscode-lean4/loogleview/static/index.css +19 -16
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-dark.svg +91 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-i-dark.svg +114 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-i-light.svg +114 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-i-passthrough-dark.svg +109 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-i-passthrough-light.svg +109 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-init-dark.svg +100 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-init-light.svg +100 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-l-dark.svg +123 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-l-light.svg +123 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-l-passthrough-dark.svg +109 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-l-passthrough-light.svg +109 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-light.svg +91 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-t-dark.svg +123 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-t-light.svg +123 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-t-passthrough-dark.svg +118 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-t-passthrough-light.svg +118 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-checkmark-dark.svg +138 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-checkmark-i-passthrough-dark.svg +160 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-checkmark-i-passthrough-light.svg +160 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-checkmark-l-passthrough-dark.svg +158 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-checkmark-l-passthrough-light.svg +158 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-checkmark-light.svg +138 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-checkmark-t-passthrough-dark.svg +169 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-checkmark-t-passthrough-light.svg +169 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-circled-checkmark-dark.svg +147 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-circled-checkmark-i-passthrough-dark.svg +170 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-circled-checkmark-i-passthrough-light.svg +170 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-circled-checkmark-l-passthrough-dark.svg +167 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-circled-checkmark-l-passthrough-light.svg +167 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-circled-checkmark-light.svg +147 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-circled-checkmark-t-passthrough-dark.svg +179 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-circled-checkmark-t-passthrough-light.svg +179 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-octopus-dark.svg +165 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-octopus-i-passthrough-dark.svg +187 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-octopus-i-passthrough-light.svg +187 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-octopus-l-passthrough-dark.svg +185 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-octopus-l-passthrough-light.svg +185 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-octopus-light.svg +165 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-octopus-t-passthrough-dark.svg +196 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-octopus-t-passthrough-light.svg +196 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-tada-dark.svg +184 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-tada-i-passthrough-dark.svg +206 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-tada-i-passthrough-light.svg +206 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-tada-l-passthrough-dark.svg +204 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-tada-l-passthrough-light.svg +204 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-tada-light.svg +184 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-tada-t-passthrough-dark.svg +215 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-tada-t-passthrough-light.svg +215 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/warning-dark.svg +132 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/warning-i-passthrough-dark.svg +154 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/warning-i-passthrough-light.svg +154 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/warning-l-passthrough-dark.svg +152 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/warning-l-passthrough-light.svg +152 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/warning-light.svg +132 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/warning-t-passthrough-dark.svg +163 -0
- package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/warning-t-passthrough-light.svg +163 -0
- package/dist/vscode-lean4/vscode-lean4/moogleview/static/index.css +198 -0
- package/dist/vscode-lean4/vscode-lean4/moogleview/tsconfig.json +10 -0
- package/dist/vscode-lean4/vscode-lean4/package.json +638 -18
- package/dist/vscode-lean4/vscode-lean4/src/abbreviation/AbbreviationFeature.d.ts +2 -2
- package/dist/vscode-lean4/vscode-lean4/src/abbreviation/AbbreviationFeature.js +2 -2
- package/dist/vscode-lean4/vscode-lean4/src/abbreviation/AbbreviationRewriterFeature.d.ts +2 -3
- package/dist/vscode-lean4/vscode-lean4/src/abbreviation/AbbreviationRewriterFeature.js +3 -5
- package/dist/vscode-lean4/vscode-lean4/src/abbreviation/VSCodeAbbreviationRewriter.d.ts +1 -2
- package/dist/vscode-lean4/vscode-lean4/src/abbreviation/VSCodeAbbreviationRewriter.js +4 -8
- package/dist/vscode-lean4/vscode-lean4/src/config.d.ts +14 -1
- package/dist/vscode-lean4/vscode-lean4/src/config.js +56 -5
- package/dist/vscode-lean4/vscode-lean4/src/diagnostics/setupDiagnoser.d.ts +36 -5
- package/dist/vscode-lean4/vscode-lean4/src/diagnostics/setupDiagnoser.js +59 -23
- package/dist/vscode-lean4/vscode-lean4/src/diagnostics/setupDiagnostics.d.ts +22 -17
- package/dist/vscode-lean4/vscode-lean4/src/diagnostics/setupDiagnostics.js +182 -119
- package/dist/vscode-lean4/vscode-lean4/src/diagnostics/setupNotifs.d.ts +33 -20
- package/dist/vscode-lean4/vscode-lean4/src/diagnostics/setupNotifs.js +235 -89
- package/dist/vscode-lean4/vscode-lean4/src/infoview.d.ts +7 -18
- package/dist/vscode-lean4/vscode-lean4/src/infoview.js +217 -102
- package/dist/vscode-lean4/vscode-lean4/src/leanclient.d.ts +12 -7
- package/dist/vscode-lean4/vscode-lean4/src/leanclient.js +187 -64
- package/dist/vscode-lean4/vscode-lean4/src/taskgutter.d.ts +35 -3
- package/dist/vscode-lean4/vscode-lean4/src/taskgutter.js +533 -93
- package/dist/vscode-lean4/vscode-lean4/src/utils/batch.d.ts +12 -4
- package/dist/vscode-lean4/vscode-lean4/src/utils/batch.js +78 -72
- package/dist/vscode-lean4/vscode-lean4/src/utils/clientProvider.d.ts +9 -9
- package/dist/vscode-lean4/vscode-lean4/src/utils/clientProvider.js +121 -77
- package/dist/vscode-lean4/vscode-lean4/src/utils/converters.d.ts +15 -0
- package/dist/vscode-lean4/vscode-lean4/src/utils/converters.js +9 -0
- package/dist/vscode-lean4/vscode-lean4/src/utils/elan.d.ts +179 -1
- package/dist/vscode-lean4/vscode-lean4/src/utils/elan.js +422 -3
- package/dist/vscode-lean4/vscode-lean4/src/utils/exturi.d.ts +3 -1
- package/dist/vscode-lean4/vscode-lean4/src/utils/exturi.js +11 -11
- package/dist/vscode-lean4/vscode-lean4/src/utils/groupBy.d.ts +2 -0
- package/dist/vscode-lean4/vscode-lean4/src/utils/groupBy.js +17 -0
- package/dist/vscode-lean4/vscode-lean4/src/utils/internalErrors.d.ts +2 -0
- package/dist/vscode-lean4/vscode-lean4/src/utils/internalErrors.js +35 -0
- package/dist/vscode-lean4/vscode-lean4/src/utils/leanCmdRunner.d.ts +34 -0
- package/dist/vscode-lean4/vscode-lean4/src/utils/leanCmdRunner.js +249 -0
- package/dist/vscode-lean4/vscode-lean4/src/utils/leanEditorProvider.d.ts +83 -0
- package/dist/vscode-lean4/vscode-lean4/src/utils/leanEditorProvider.js +323 -0
- package/dist/vscode-lean4/vscode-lean4/src/utils/leanInstaller.d.ts +41 -12
- package/dist/vscode-lean4/vscode-lean4/src/utils/leanInstaller.js +245 -128
- package/dist/vscode-lean4/vscode-lean4/src/utils/notifs.d.ts +27 -22
- package/dist/vscode-lean4/vscode-lean4/src/utils/notifs.js +177 -82
- package/dist/vscode-lean4/vscode-lean4/src/utils/projectInfo.d.ts +11 -4
- package/dist/vscode-lean4/vscode-lean4/src/utils/projectInfo.js +18 -16
- package/dist/vscode-lean4/vscode-lean4/src/utils/semverRegex.d.ts +1 -0
- package/dist/vscode-lean4/vscode-lean4/src/utils/semverRegex.js +2 -0
- package/dist/vscode-lean4/vscode-lean4/src/utils/viewColumn.d.ts +3 -0
- package/dist/vscode-lean4/vscode-lean4/src/utils/viewColumn.js +22 -0
- package/dist/vscode-lean4/vscode-lean4/tsconfig.json +2 -1
- package/dist/vscode-lean4/vscode-lean4/webview/tsconfig.json +3 -1
- package/dist/vscode.css +7 -0
- package/package.json +7 -5
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-redundant-type-constituents */
|
|
2
|
+
import { Disposable, commands, window } from 'vscode';
|
|
3
|
+
import { lean } from './leanEditorProvider';
|
|
2
4
|
function toNotif(severity) {
|
|
3
5
|
switch (severity) {
|
|
4
6
|
case 'Information':
|
|
@@ -9,6 +11,78 @@ function toNotif(severity) {
|
|
|
9
11
|
return window.showErrorMessage;
|
|
10
12
|
}
|
|
11
13
|
}
|
|
14
|
+
export async function setStickyNotificationActiveButHidden(isActiveButHidden) {
|
|
15
|
+
await commands.executeCommand('setContext', 'lean4.isStickyNotificationActiveButHidden', isActiveButHidden);
|
|
16
|
+
}
|
|
17
|
+
let activeStickyNotification;
|
|
18
|
+
let nextStickyNotification;
|
|
19
|
+
let activeDisplayFn;
|
|
20
|
+
function makeSticky(n) {
|
|
21
|
+
if (activeStickyNotification !== undefined) {
|
|
22
|
+
nextStickyNotification = n;
|
|
23
|
+
return Disposable.from();
|
|
24
|
+
}
|
|
25
|
+
activeStickyNotification = n;
|
|
26
|
+
let isDisplaying = false;
|
|
27
|
+
// eslint-disable-next-line prefer-const
|
|
28
|
+
let d;
|
|
29
|
+
const display = async () => {
|
|
30
|
+
if (isDisplaying) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
await setStickyNotificationActiveButHidden(false);
|
|
34
|
+
isDisplaying = true;
|
|
35
|
+
try {
|
|
36
|
+
await activeStickyNotification?.options.onDisplay();
|
|
37
|
+
let gotNewStickyNotification = false;
|
|
38
|
+
let r;
|
|
39
|
+
let continueDisplaying;
|
|
40
|
+
do {
|
|
41
|
+
gotNewStickyNotification = false;
|
|
42
|
+
r = await activeStickyNotification?.displayNotification();
|
|
43
|
+
continueDisplaying =
|
|
44
|
+
r === undefined || ((await activeStickyNotification?.options.onInput(r, true)) ?? false);
|
|
45
|
+
if (nextStickyNotification !== undefined) {
|
|
46
|
+
activeStickyNotification = nextStickyNotification;
|
|
47
|
+
nextStickyNotification = undefined;
|
|
48
|
+
gotNewStickyNotification = true;
|
|
49
|
+
}
|
|
50
|
+
} while ((r !== undefined && continueDisplaying) || gotNewStickyNotification);
|
|
51
|
+
if (!continueDisplaying) {
|
|
52
|
+
activeStickyNotification = undefined;
|
|
53
|
+
await setStickyNotificationActiveButHidden(false);
|
|
54
|
+
d?.dispose();
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
await setStickyNotificationActiveButHidden(true);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
catch (e) {
|
|
61
|
+
activeStickyNotification = undefined;
|
|
62
|
+
nextStickyNotification = undefined;
|
|
63
|
+
await setStickyNotificationActiveButHidden(false);
|
|
64
|
+
d?.dispose();
|
|
65
|
+
console.log(e);
|
|
66
|
+
}
|
|
67
|
+
finally {
|
|
68
|
+
isDisplaying = false;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
activeDisplayFn = display;
|
|
72
|
+
d = Disposable.from(lean.onDidRevealLeanEditor(async () => await display()), {
|
|
73
|
+
dispose: () => {
|
|
74
|
+
activeStickyNotification = undefined;
|
|
75
|
+
activeDisplayFn = undefined;
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
void display();
|
|
79
|
+
return d;
|
|
80
|
+
}
|
|
81
|
+
export function displayActiveStickyNotification() {
|
|
82
|
+
if (activeDisplayFn !== undefined) {
|
|
83
|
+
void activeDisplayFn();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
12
86
|
export function displayNotification(severity, message, finalizer) {
|
|
13
87
|
void (async () => {
|
|
14
88
|
await toNotif(severity)(message, {});
|
|
@@ -17,94 +91,115 @@ export function displayNotification(severity, message, finalizer) {
|
|
|
17
91
|
}
|
|
18
92
|
})();
|
|
19
93
|
}
|
|
20
|
-
export
|
|
21
|
-
return
|
|
22
|
-
}
|
|
23
|
-
|
|
94
|
+
export function displayStickyNotification(severity, message, options) {
|
|
95
|
+
return makeSticky({
|
|
96
|
+
displayNotification: async () => (await toNotif(severity)(message, {})),
|
|
97
|
+
options,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
export async function displayNotificationWithInput(severity, message, items, defaultItem) {
|
|
101
|
+
if (defaultItem === undefined) {
|
|
102
|
+
// VS Code renders buttons for modal notifications in the reverse order (which it doesn't do for non-modal notifications),
|
|
103
|
+
// so we reverse them for consistency.
|
|
104
|
+
// The close button is placed to the left of the primary button.
|
|
105
|
+
return await toNotif(severity)(message, { modal: true }, ...[...items].reverse());
|
|
106
|
+
}
|
|
107
|
+
let notif;
|
|
108
|
+
switch (severity) {
|
|
109
|
+
case 'Information':
|
|
110
|
+
notif = window.showInformationMessage;
|
|
111
|
+
break;
|
|
112
|
+
case 'Warning':
|
|
113
|
+
notif = window.showWarningMessage;
|
|
114
|
+
break;
|
|
115
|
+
case 'Error':
|
|
116
|
+
notif = window.showErrorMessage;
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
const messageItems = items.map(item => ({
|
|
120
|
+
title: item,
|
|
121
|
+
isCloseAffordance: false,
|
|
122
|
+
}));
|
|
123
|
+
// VS Code always moves the `isCloseAffordance: true` button to the left of the primary button.
|
|
124
|
+
messageItems.push({
|
|
125
|
+
title: defaultItem,
|
|
126
|
+
isCloseAffordance: true,
|
|
127
|
+
});
|
|
128
|
+
messageItems.reverse();
|
|
129
|
+
const choice = await notif(message, { modal: true }, ...messageItems);
|
|
130
|
+
return choice?.title;
|
|
131
|
+
}
|
|
132
|
+
export async function displayModalNotification(severity, message) {
|
|
133
|
+
await displayNotificationWithInput(severity, message, [], 'Close');
|
|
134
|
+
}
|
|
135
|
+
export function displayNotificationWithOptionalInput(severity, message, inputs, finalizer) {
|
|
24
136
|
void (async () => {
|
|
25
|
-
const choice = await toNotif(severity)(message, {}, input);
|
|
26
|
-
|
|
27
|
-
|
|
137
|
+
const choice = await toNotif(severity)(message, {}, ...inputs.map(i => i.input));
|
|
138
|
+
const chosenInput = inputs.find(i => i.input === choice);
|
|
139
|
+
if (chosenInput !== undefined) {
|
|
140
|
+
chosenInput.action();
|
|
28
141
|
}
|
|
29
142
|
if (finalizer) {
|
|
30
143
|
finalizer();
|
|
31
144
|
}
|
|
32
145
|
})();
|
|
33
146
|
}
|
|
34
|
-
export function
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
export async function displayWarningWithInput(message, ...items) {
|
|
63
|
-
return await displayNotificationWithInput('Warning', message, ...items);
|
|
64
|
-
}
|
|
65
|
-
export function displayWarningWithOptionalInput(message, input, action, finalizer) {
|
|
66
|
-
displayNotificationWithOptionalInput('Warning', message, input, action, finalizer);
|
|
67
|
-
}
|
|
68
|
-
export function displayWarningWithOutput(message, finalizer) {
|
|
69
|
-
displayNotificationWithOutput('Warning', message, finalizer);
|
|
70
|
-
}
|
|
71
|
-
export async function displayModalWarningWithOutput(message) {
|
|
72
|
-
const choice = await window.showWarningMessage(message, 'Show Output', 'Proceed Regardless');
|
|
73
|
-
if (choice === undefined) {
|
|
74
|
-
return 'Abort';
|
|
147
|
+
export function displayStickyNotificationWithOptionalInput(severity, message, options, inputs) {
|
|
148
|
+
const updatedOptions = {
|
|
149
|
+
...options,
|
|
150
|
+
onInput: async (lastChoice, continueDisplaying) => {
|
|
151
|
+
const chosenInput = inputs.find(i => i.input === lastChoice);
|
|
152
|
+
if (chosenInput !== undefined) {
|
|
153
|
+
await chosenInput.action();
|
|
154
|
+
continueDisplaying = chosenInput.continueDisplaying;
|
|
155
|
+
}
|
|
156
|
+
return options.onInput(lastChoice, continueDisplaying);
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
return makeSticky({
|
|
160
|
+
displayNotification: async () => await toNotif(severity)(message, {}, ...inputs.map(i => i.input)),
|
|
161
|
+
options: updatedOptions,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
export function displayNotificationWithOutput(severity, message, otherInputs = [], finalizer) {
|
|
165
|
+
displayNotificationWithOptionalInput(severity, message, [
|
|
166
|
+
{ input: 'Show Output', action: () => commands.executeCommand('lean4.troubleshooting.showOutput') },
|
|
167
|
+
...otherInputs,
|
|
168
|
+
], finalizer);
|
|
169
|
+
}
|
|
170
|
+
export async function displayModalNotificationWithOutput(severity, message, otherItems = [], defaultItem) {
|
|
171
|
+
const choice = await displayNotificationWithInput(severity, message, ['Show Output', ...otherItems], defaultItem);
|
|
172
|
+
if (choice === 'Show Output') {
|
|
173
|
+
await commands.executeCommand('lean4.troubleshooting.showOutput');
|
|
75
174
|
}
|
|
76
|
-
|
|
77
|
-
|
|
175
|
+
return choice;
|
|
176
|
+
}
|
|
177
|
+
export function displayStickyNotificationWithOutput(severity, message, options, otherInputs = []) {
|
|
178
|
+
const showOutputItem = {
|
|
179
|
+
input: 'Show Output',
|
|
180
|
+
continueDisplaying: true,
|
|
181
|
+
action: async () => await commands.executeCommand('lean4.troubleshooting.showOutput'),
|
|
182
|
+
};
|
|
183
|
+
return displayStickyNotificationWithOptionalInput(severity, message, options, [showOutputItem, ...otherInputs]);
|
|
184
|
+
}
|
|
185
|
+
export function displayNotificationWithSetupGuide(severity, message, otherInputs = [], finalizer) {
|
|
186
|
+
displayNotificationWithOptionalInput(severity, message, [
|
|
187
|
+
{ input: 'Open Setup Guide', action: () => commands.executeCommand('lean4.docs.showSetupGuide') },
|
|
188
|
+
...otherInputs,
|
|
189
|
+
], finalizer);
|
|
190
|
+
}
|
|
191
|
+
export function displayStickyNotificationWithSetupGuide(severity, message, options, otherInputs = []) {
|
|
192
|
+
const openSetupGuideItem = {
|
|
193
|
+
input: 'Open Setup Guide',
|
|
194
|
+
continueDisplaying: true,
|
|
195
|
+
action: async () => await commands.executeCommand('lean4.docs.showSetupGuide'),
|
|
196
|
+
};
|
|
197
|
+
return displayStickyNotificationWithOptionalInput(severity, message, options, [openSetupGuideItem, ...otherInputs]);
|
|
198
|
+
}
|
|
199
|
+
export async function displayModalNotificationWithSetupGuide(severity, message, otherItems = [], defaultItem) {
|
|
200
|
+
const choice = await displayNotificationWithInput(severity, message, ['Open Setup Guide', ...otherItems], defaultItem);
|
|
201
|
+
if (choice === 'Open Setup Guide') {
|
|
202
|
+
await commands.executeCommand('lean4.docs.showSetupGuide');
|
|
78
203
|
}
|
|
79
|
-
|
|
80
|
-
return 'Abort';
|
|
81
|
-
}
|
|
82
|
-
export function displayWarningWithSetupGuide(message, finalizer) {
|
|
83
|
-
displayNotificationWithSetupGuide('Warning', message, finalizer);
|
|
84
|
-
}
|
|
85
|
-
export async function displayModalWarningWithSetupGuide(message) {
|
|
86
|
-
const choice = await window.showWarningMessage(message, 'Open Setup Guide', 'Proceed Regardless');
|
|
87
|
-
if (choice === undefined) {
|
|
88
|
-
return 'Abort';
|
|
89
|
-
}
|
|
90
|
-
if (choice === 'Proceed Regardless') {
|
|
91
|
-
return 'Proceed';
|
|
92
|
-
}
|
|
93
|
-
await commands.executeCommand('lean4.docs.showSetupGuide');
|
|
94
|
-
return 'Abort';
|
|
95
|
-
}
|
|
96
|
-
export function displayInformation(message, finalizer) {
|
|
97
|
-
displayNotification('Information', message, finalizer);
|
|
98
|
-
}
|
|
99
|
-
export async function displayInformationWithInput(message, ...items) {
|
|
100
|
-
return await displayNotificationWithInput('Information', message, ...items);
|
|
101
|
-
}
|
|
102
|
-
export function displayInformationWithOptionalInput(message, input, action, finalizer) {
|
|
103
|
-
displayNotificationWithOptionalInput('Information', message, input, action, finalizer);
|
|
104
|
-
}
|
|
105
|
-
export function displayInformationWithOutput(message, finalizer) {
|
|
106
|
-
displayNotificationWithOutput('Information', message, finalizer);
|
|
107
|
-
}
|
|
108
|
-
export function displayInformationWithSetupGuide(message, finalizer) {
|
|
109
|
-
displayNotificationWithSetupGuide('Information', message, finalizer);
|
|
204
|
+
return choice;
|
|
110
205
|
}
|
|
@@ -2,10 +2,14 @@ import { ExtUri, FileUri } from './exturi';
|
|
|
2
2
|
export declare function isCoreLean4Directory(path: FileUri): Promise<boolean>;
|
|
3
3
|
type ProjectRootInfo = {
|
|
4
4
|
kind: 'Success';
|
|
5
|
-
projectRootUri:
|
|
5
|
+
projectRootUri: ExtUri;
|
|
6
6
|
toolchainUri: FileUri | undefined;
|
|
7
7
|
} | {
|
|
8
8
|
kind: 'FileNotFound';
|
|
9
|
+
} | {
|
|
10
|
+
kind: 'LakefileWithoutToolchain';
|
|
11
|
+
projectRootUri: FileUri;
|
|
12
|
+
lakefileUri: FileUri;
|
|
9
13
|
};
|
|
10
14
|
type ToolchainInfo = {
|
|
11
15
|
uri: FileUri;
|
|
@@ -13,13 +17,16 @@ type ToolchainInfo = {
|
|
|
13
17
|
};
|
|
14
18
|
type ProjectInfo = {
|
|
15
19
|
kind: 'Success';
|
|
16
|
-
projectRootUri:
|
|
20
|
+
projectRootUri: ExtUri;
|
|
17
21
|
toolchainInfo: ToolchainInfo | undefined;
|
|
18
22
|
} | {
|
|
19
23
|
kind: 'FileNotFound';
|
|
24
|
+
} | {
|
|
25
|
+
kind: 'LakefileWithoutToolchain';
|
|
26
|
+
projectRootUri: FileUri;
|
|
27
|
+
lakefileUri: FileUri;
|
|
20
28
|
};
|
|
21
|
-
export declare function findLeanProjectRootInfo(uri:
|
|
22
|
-
export declare function findLeanProjectRoot(uri: FileUri): Promise<FileUri | 'FileNotFound'>;
|
|
29
|
+
export declare function findLeanProjectRootInfo(uri: ExtUri): Promise<ProjectRootInfo>;
|
|
23
30
|
export declare function findLeanProjectInfo(uri: FileUri): Promise<ProjectInfo>;
|
|
24
31
|
export declare function isValidLeanProject(projectFolder: FileUri): Promise<boolean>;
|
|
25
32
|
export declare function checkParentFoldersForLeanProject(folder: FileUri): Promise<FileUri | undefined>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
|
-
import { FileUri, getWorkspaceFolderUri } from './exturi';
|
|
3
|
-
import { dirExists, fileExists } from './fsHelper';
|
|
4
2
|
import path from 'path';
|
|
3
|
+
import { FileUri, isWorkspaceFolder, UntitledUri } from './exturi';
|
|
4
|
+
import { dirExists, fileExists } from './fsHelper';
|
|
5
5
|
// Detect lean4 root directory (works for both lean4 repo and nightly distribution)
|
|
6
6
|
export async function isCoreLean4Directory(path) {
|
|
7
7
|
const licensePath = path.join('LICENSE').fsPath;
|
|
@@ -23,9 +23,10 @@ export async function isCoreLean4Directory(path) {
|
|
|
23
23
|
}
|
|
24
24
|
// Find the root of a Lean project and the Uri for the 'lean-toolchain' file found there.
|
|
25
25
|
export async function findLeanProjectRootInfo(uri) {
|
|
26
|
-
|
|
26
|
+
if (uri.scheme === 'untitled') {
|
|
27
|
+
return { kind: 'Success', projectRootUri: new UntitledUri(), toolchainUri: undefined };
|
|
28
|
+
}
|
|
27
29
|
let path = uri;
|
|
28
|
-
const containingWsFolderUri = getWorkspaceFolderUri(uri);
|
|
29
30
|
try {
|
|
30
31
|
if ((await fs.promises.stat(path.fsPath)).isFile()) {
|
|
31
32
|
path = uri.join('..');
|
|
@@ -37,7 +38,9 @@ export async function findLeanProjectRootInfo(uri) {
|
|
|
37
38
|
let bestFolder = path;
|
|
38
39
|
let bestLeanToolchain;
|
|
39
40
|
while (true) {
|
|
40
|
-
const leanToolchain = path.join(
|
|
41
|
+
const leanToolchain = path.join('lean-toolchain');
|
|
42
|
+
const lakefileLean = path.join('lakefile.lean');
|
|
43
|
+
const lakefileToml = path.join('lakefile.toml');
|
|
41
44
|
if (await fileExists(leanToolchain.fsPath)) {
|
|
42
45
|
bestFolder = path;
|
|
43
46
|
bestLeanToolchain = leanToolchain;
|
|
@@ -48,7 +51,13 @@ export async function findLeanProjectRootInfo(uri) {
|
|
|
48
51
|
// Stop searching in case users accidentally created a lean-toolchain file above the core directory
|
|
49
52
|
break;
|
|
50
53
|
}
|
|
51
|
-
if (
|
|
54
|
+
else if (await fileExists(lakefileLean.fsPath)) {
|
|
55
|
+
return { kind: 'LakefileWithoutToolchain', projectRootUri: path, lakefileUri: lakefileLean };
|
|
56
|
+
}
|
|
57
|
+
else if (await fileExists(lakefileToml.fsPath)) {
|
|
58
|
+
return { kind: 'LakefileWithoutToolchain', projectRootUri: path, lakefileUri: lakefileToml };
|
|
59
|
+
}
|
|
60
|
+
if (isWorkspaceFolder(path)) {
|
|
52
61
|
if (bestLeanToolchain === undefined) {
|
|
53
62
|
// If we haven't found a toolchain yet, prefer the workspace folder as the project scope for the file,
|
|
54
63
|
// but keep looking in case there is a lean-toolchain above the workspace folder
|
|
@@ -69,15 +78,6 @@ export async function findLeanProjectRootInfo(uri) {
|
|
|
69
78
|
}
|
|
70
79
|
return { kind: 'Success', projectRootUri: bestFolder, toolchainUri: bestLeanToolchain };
|
|
71
80
|
}
|
|
72
|
-
export async function findLeanProjectRoot(uri) {
|
|
73
|
-
const info = await findLeanProjectRootInfo(uri);
|
|
74
|
-
switch (info.kind) {
|
|
75
|
-
case 'Success':
|
|
76
|
-
return info.projectRootUri;
|
|
77
|
-
case 'FileNotFound':
|
|
78
|
-
return 'FileNotFound';
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
81
|
export async function findLeanProjectInfo(uri) {
|
|
82
82
|
const info = await findLeanProjectRootInfo(uri);
|
|
83
83
|
switch (info.kind) {
|
|
@@ -88,7 +88,9 @@ export async function findLeanProjectInfo(uri) {
|
|
|
88
88
|
}
|
|
89
89
|
return { kind: 'Success', projectRootUri: info.projectRootUri, toolchainInfo };
|
|
90
90
|
case 'FileNotFound':
|
|
91
|
-
return
|
|
91
|
+
return info;
|
|
92
|
+
case 'LakefileWithoutToolchain':
|
|
93
|
+
return info;
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
async function readLeanToolchainFile(toolchainFileUri) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const semVerRegex: RegExp;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Suggested at https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
|
|
2
|
+
export const semVerRegex = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TabInputWebview, ViewColumn, window } from 'vscode';
|
|
2
|
+
export function viewColumnOfInfoView() {
|
|
3
|
+
for (const tabGroup of window.tabGroups.all) {
|
|
4
|
+
const tab = tabGroup.tabs.find(tab => tab.input instanceof TabInputWebview && tab.input.viewType === 'mainThreadWebview-lean4_infoview');
|
|
5
|
+
if (tab !== undefined) {
|
|
6
|
+
return tabGroup.viewColumn;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
// We do not use `ViewColumn.Beside` here because `ViewColumn.Beside` will never
|
|
10
|
+
// add a tab to a locked tab group.
|
|
11
|
+
// This is especially problematic because locking the tab group of the InfoView
|
|
12
|
+
// is a workaround for https://github.com/microsoft/vscode/issues/212679
|
|
13
|
+
// and using `ViewColumn.Beside` will retain an empty locked tab group when restarting VS Code.
|
|
14
|
+
const activeColumn = window.activeTextEditor?.viewColumn;
|
|
15
|
+
if (activeColumn === undefined) {
|
|
16
|
+
return ViewColumn.Two;
|
|
17
|
+
}
|
|
18
|
+
return activeColumn + 1;
|
|
19
|
+
}
|
|
20
|
+
export function viewColumnOfActiveTextEditor() {
|
|
21
|
+
return window.activeTextEditor?.viewColumn ?? ViewColumn.One;
|
|
22
|
+
}
|
|
@@ -8,8 +8,9 @@
|
|
|
8
8
|
"lib": ["es6", "ES2021", "es2020.string"],
|
|
9
9
|
"sourceMap": true,
|
|
10
10
|
"alwaysStrict": true,
|
|
11
|
-
"rootDir": "
|
|
11
|
+
"rootDir": "../..",
|
|
12
12
|
"noImplicitAny": true,
|
|
13
|
+
"noFallthroughCasesInSwitch": true,
|
|
13
14
|
"strictNullChecks": true,
|
|
14
15
|
"esModuleInterop": true
|
|
15
16
|
},
|
package/dist/vscode.css
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lean4monaco",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Monaco Editor support for the Lean 4 theorem prover.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lean",
|
|
@@ -42,14 +42,16 @@
|
|
|
42
42
|
"test": "npm run demo:setup && concurrently --hide 0 --kill-others \"npm start\" \"wait-on http://localhost:5173 && cypress run\" -n server,cypress -s command-cypress"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@leanprover/infoview": "
|
|
46
|
-
"@leanprover/infoview-api": "
|
|
47
|
-
"@leanprover/unicode-input": "
|
|
45
|
+
"@leanprover/infoview": "~0.8.5",
|
|
46
|
+
"@leanprover/infoview-api": "~0.7.0",
|
|
47
|
+
"@leanprover/unicode-input": "~0.1.4",
|
|
48
|
+
"@leanprover/unicode-input-component": "~0.1.4",
|
|
48
49
|
"concurrently": "^8.2.2",
|
|
49
50
|
"import-meta-resolve": "^4.1.0",
|
|
50
51
|
"memfs": "^4.9.3",
|
|
51
52
|
"monaco-editor-wrapper": "^5.3.1",
|
|
52
|
-
"semver": "^7.6.2"
|
|
53
|
+
"semver": "^7.6.2",
|
|
54
|
+
"zod": "^3.22.4"
|
|
53
55
|
},
|
|
54
56
|
"devDependencies": {
|
|
55
57
|
"@types/node": "^22.1.0",
|