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,19 +1,8 @@
|
|
|
1
1
|
import { commands } from 'vscode';
|
|
2
2
|
import { extUriToCwdUri } from '../utils/exturi';
|
|
3
|
-
import {
|
|
3
|
+
import { displayInternalError } from '../utils/internalErrors';
|
|
4
4
|
import { diagnose } from './setupDiagnoser';
|
|
5
|
-
import {
|
|
6
|
-
export async function checkAll(...checks) {
|
|
7
|
-
let worstViolation = 'Fulfilled';
|
|
8
|
-
for (const check of checks) {
|
|
9
|
-
const result = await check();
|
|
10
|
-
worstViolation = worstPreconditionViolation(worstViolation, result);
|
|
11
|
-
if (worstViolation === 'Fatal') {
|
|
12
|
-
return 'Fatal';
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return worstViolation;
|
|
16
|
-
}
|
|
5
|
+
import { SetupNotifier, worstPreconditionViolation, } from './setupNotifs';
|
|
17
6
|
const singleFileWarningMessage = `Lean 4 server is operating in restricted single file mode.
|
|
18
7
|
Please open a valid Lean 4 project containing a \'lean-toolchain\' file for full functionality.
|
|
19
8
|
Click the following link to learn how to set up or open Lean projects: [(Show Setup Guide)](command:lean4.docs.showSetupGuide)`;
|
|
@@ -27,124 +16,198 @@ const lean3ProjectErrorMessage = (origin, projectVersion) => `${origin} is using
|
|
|
27
16
|
If you want to use Lean 3, disable this extension ('Extensions' in the left sidebar > Cog icon on 'lean4' > 'Disable') and install the 'lean' extension for Lean 3 support.`;
|
|
28
17
|
const ancientLean4ProjectWarningMessage = (origin, projectVersion) => `${origin} is using a Lean 4 version (${projectVersion.toString()}) from before the first Lean 4 stable release (4.0.0).
|
|
29
18
|
Pre-stable Lean 4 versions are increasingly less supported, so please consider updating to a newer Lean 4 version.`;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
const oldServerFolderContainsNewServerFolderErrorMessage = (folderUri, fileUri, clientFolderUri) => `Error while starting language server: The project at '${folderUri.fsPath}' of the file '${fileUri.baseName()}' is contained inside of another project at '${clientFolderUri.fsPath}', for which a language server is already running.
|
|
20
|
+
The Lean 4 VS Code extension does not support nested Lean projects.`;
|
|
21
|
+
const newServerFolderContainsOldServerFolderErrorMessage = (folderUri, fileUri, clientFolderUri) => `Error while starting language server: The project at '${folderUri.fsPath}' of the file '${fileUri.baseName()}' contains another project at '${clientFolderUri.fsPath}', for which a language server is already running.
|
|
22
|
+
The Lean 4 VS Code extension does not support nested Lean projects.`;
|
|
23
|
+
export class SetupDiagnostics {
|
|
24
|
+
n;
|
|
25
|
+
constructor(o) {
|
|
26
|
+
this.n = new SetupNotifier(o);
|
|
34
27
|
}
|
|
35
|
-
|
|
36
|
-
missingDeps
|
|
28
|
+
async checkAreDependenciesInstalled(channel, cwdUri) {
|
|
29
|
+
const missingDeps = [];
|
|
30
|
+
if (!(await diagnose({ channel, cwdUri }).checkCurlAvailable())) {
|
|
31
|
+
missingDeps.push('curl');
|
|
32
|
+
}
|
|
33
|
+
if (!(await diagnose({ channel, cwdUri }).checkGitAvailable())) {
|
|
34
|
+
missingDeps.push('git');
|
|
35
|
+
}
|
|
36
|
+
if (missingDeps.length === 0) {
|
|
37
|
+
return 'Fulfilled';
|
|
38
|
+
}
|
|
39
|
+
let missingDepMessage;
|
|
40
|
+
if (missingDeps.length === 1) {
|
|
41
|
+
missingDepMessage = `One of Lean's dependencies ('${missingDeps.at(0)}') is missing`;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
missingDepMessage = `Multiple of Lean's dependencies (${missingDeps.map(dep => `'${dep}'`).join(', ')}) are missing`;
|
|
45
|
+
}
|
|
46
|
+
const errorMessage = `${missingDepMessage}. Please read the Setup Guide on how to install missing dependencies and set up Lean 4.`;
|
|
47
|
+
return await this.n.displaySetupErrorWithSetupGuide(errorMessage);
|
|
37
48
|
}
|
|
38
|
-
|
|
39
|
-
|
|
49
|
+
async checkIsLean4Installed(installer, context, cwdUri, toolchainUpdateMode) {
|
|
50
|
+
const leanVersionResult = await diagnose({
|
|
51
|
+
channel: installer.getOutputChannel(),
|
|
52
|
+
cwdUri,
|
|
53
|
+
context,
|
|
54
|
+
toolchainUpdateMode,
|
|
55
|
+
}).queryLeanVersion();
|
|
56
|
+
switch (leanVersionResult.kind) {
|
|
57
|
+
case 'Success':
|
|
58
|
+
return 'Fulfilled';
|
|
59
|
+
case 'CommandError':
|
|
60
|
+
return this.n.displaySetupErrorWithOutput(`Error while checking Lean version: ${leanVersionResult.message}`);
|
|
61
|
+
case 'Cancelled':
|
|
62
|
+
return this.n.displaySetupErrorWithOutput('Error while checking Lean version: Operation cancelled.');
|
|
63
|
+
case 'InvalidVersion':
|
|
64
|
+
return this.n.displaySetupErrorWithOutput(`Error while checking Lean version: 'lean --version' returned a version that could not be parsed: '${leanVersionResult.versionResult}'`);
|
|
65
|
+
case 'CommandNotFound':
|
|
66
|
+
return await this.n.displayElanSetupError(installer, 'Lean is not installed.');
|
|
67
|
+
}
|
|
40
68
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
69
|
+
async checkIsElanUpToDate(installer, cwdUri, options) {
|
|
70
|
+
const elanDiagnosis = await diagnose({ channel: installer.getOutputChannel(), cwdUri }).elanVersion();
|
|
71
|
+
switch (elanDiagnosis.kind) {
|
|
72
|
+
case 'NotInstalled':
|
|
73
|
+
if (options.elanMustBeInstalled) {
|
|
74
|
+
return await this.n.displayElanSetupError(installer, "Lean's version manager Elan is not installed.");
|
|
75
|
+
}
|
|
76
|
+
return await this.n.displayElanSetupWarning(installer, "Lean's version manager Elan is not installed. This means that the correct Lean 4 toolchain version of Lean 4 projects will not be selected or installed automatically.");
|
|
77
|
+
case 'ExecutionError':
|
|
78
|
+
return await this.n.displaySetupWarningWithOutput('Cannot determine Elan version: ' + elanDiagnosis.message);
|
|
79
|
+
case 'Outdated':
|
|
80
|
+
return await this.n.displayElanOutdatedSetupWarning(installer, elanDiagnosis.currentVersion, elanDiagnosis.recommendedVersion);
|
|
81
|
+
case 'UpToDate':
|
|
82
|
+
return 'Fulfilled';
|
|
83
|
+
}
|
|
55
84
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
85
|
+
async checkIsValidProjectFolder(channel, folderUri) {
|
|
86
|
+
const projectSetupDiagnosis = await diagnose({ channel, cwdUri: extUriToCwdUri(folderUri) }).projectSetup();
|
|
87
|
+
switch (projectSetupDiagnosis.kind) {
|
|
88
|
+
case 'SingleFile':
|
|
89
|
+
return await this.n.displaySetupWarning(singleFileWarningMessage);
|
|
90
|
+
case 'MissingLeanToolchain':
|
|
91
|
+
const parentProjectFolder = projectSetupDiagnosis.parentProjectFolder;
|
|
92
|
+
if (parentProjectFolder === undefined) {
|
|
93
|
+
return await this.n.displaySetupWarning(missingLeanToolchainWarningMessage);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
return this.n.displaySetupWarningWithInput(missingLeanToolchainWithParentProjectWarningMessage(parentProjectFolder), [
|
|
97
|
+
{
|
|
98
|
+
input: 'Open Parent Directory Project',
|
|
99
|
+
// this kills the extension host
|
|
100
|
+
action: () => commands.executeCommand('vscode.openFolder', parentProjectFolder),
|
|
101
|
+
},
|
|
102
|
+
]);
|
|
103
|
+
}
|
|
104
|
+
case 'ValidProjectSetup':
|
|
105
|
+
return 'Fulfilled';
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
async checkIsNestedProjectFolder(existingFolderUris, folderUri, fileUri, stopOtherServer) {
|
|
109
|
+
if (folderUri.scheme === 'untitled' || fileUri.scheme === 'untitled') {
|
|
110
|
+
if (existingFolderUris.some(existingFolderUri => existingFolderUri.scheme === 'untitled')) {
|
|
111
|
+
await displayInternalError('starting language server', 'Attempting to start new untitled language server while one already exists.');
|
|
112
|
+
return 'Fatal';
|
|
63
113
|
}
|
|
64
|
-
return await displayElanSetupWarning(installer, "Lean's version manager Elan is not installed. This means that the correct Lean 4 toolchain version of Lean 4 projects will not be selected or installed automatically.");
|
|
65
|
-
case 'ExecutionError':
|
|
66
|
-
return await displaySetupWarningWithOutput('Cannot determine Elan version: ' + elanDiagnosis.message, {
|
|
67
|
-
modal: options.modal,
|
|
68
|
-
});
|
|
69
|
-
case 'Outdated':
|
|
70
|
-
return await displayElanOutdatedSetupWarning(installer, elanDiagnosis.currentVersion, elanDiagnosis.recommendedVersion);
|
|
71
|
-
case 'UpToDate':
|
|
72
114
|
return 'Fulfilled';
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
switch (projectSetupDiagnosis.kind) {
|
|
78
|
-
case 'SingleFile':
|
|
79
|
-
return await displaySetupWarning(singleFileWarningMessage);
|
|
80
|
-
case 'MissingLeanToolchain':
|
|
81
|
-
const parentProjectFolder = projectSetupDiagnosis.parentProjectFolder;
|
|
82
|
-
if (parentProjectFolder === undefined) {
|
|
83
|
-
return await displaySetupWarning(missingLeanToolchainWarningMessage);
|
|
115
|
+
}
|
|
116
|
+
for (const existingFolderUri of existingFolderUris) {
|
|
117
|
+
if (existingFolderUri.scheme !== 'file') {
|
|
118
|
+
continue;
|
|
84
119
|
}
|
|
85
|
-
|
|
86
|
-
return
|
|
87
|
-
|
|
88
|
-
|
|
120
|
+
if (existingFolderUri.isInFolder(folderUri)) {
|
|
121
|
+
return await this.n.displaySetupErrorWithInput(newServerFolderContainsOldServerFolderErrorMessage(folderUri, fileUri, existingFolderUri), [
|
|
122
|
+
{
|
|
123
|
+
input: 'Stop Other Server',
|
|
124
|
+
continueDisplaying: false,
|
|
125
|
+
action: () => stopOtherServer(existingFolderUri),
|
|
126
|
+
},
|
|
127
|
+
]);
|
|
89
128
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
origin = 'Opened project';
|
|
129
|
+
if (folderUri.isInFolder(existingFolderUri)) {
|
|
130
|
+
return await this.n.displaySetupErrorWithInput(oldServerFolderContainsNewServerFolderErrorMessage(folderUri, fileUri, existingFolderUri), [
|
|
131
|
+
{
|
|
132
|
+
input: 'Stop Other Server',
|
|
133
|
+
continueDisplaying: false,
|
|
134
|
+
action: () => stopOtherServer(existingFolderUri),
|
|
135
|
+
},
|
|
136
|
+
]);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return 'Fulfilled';
|
|
104
140
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
141
|
+
async checkIsLeanVersionUpToDate(channel, context, folderUri, options) {
|
|
142
|
+
let origin;
|
|
143
|
+
if (options.toolchainOverride !== undefined) {
|
|
144
|
+
origin = `Project toolchain '${options.toolchainOverride}'`;
|
|
145
|
+
}
|
|
146
|
+
else if (folderUri.scheme === 'untitled') {
|
|
147
|
+
origin = 'Opened file';
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
origin = 'Opened project';
|
|
151
|
+
}
|
|
152
|
+
const projectLeanVersionDiagnosis = await diagnose({
|
|
153
|
+
channel,
|
|
154
|
+
cwdUri: extUriToCwdUri(folderUri),
|
|
155
|
+
toolchain: options.toolchainOverride,
|
|
156
|
+
context,
|
|
157
|
+
toolchainUpdateMode: options.toolchainUpdateMode,
|
|
158
|
+
}).leanVersion();
|
|
159
|
+
switch (projectLeanVersionDiagnosis.kind) {
|
|
160
|
+
case 'NotInstalled':
|
|
161
|
+
return this.n.displaySetupErrorWithOutput("Error while checking Lean version: 'lean' command was not found.");
|
|
162
|
+
case 'ExecutionError':
|
|
163
|
+
return this.n.displaySetupErrorWithOutput(`Error while checking Lean version: ${projectLeanVersionDiagnosis.message}`);
|
|
164
|
+
case 'Cancelled':
|
|
165
|
+
return this.n.displaySetupErrorWithOutput('Error while checking Lean version: Operation cancelled.');
|
|
166
|
+
case 'IsLean3Version':
|
|
167
|
+
return this.n.displaySetupError(lean3ProjectErrorMessage(origin, projectLeanVersionDiagnosis.version));
|
|
168
|
+
case 'IsAncientLean4Version':
|
|
169
|
+
return await this.n.displaySetupWarning(ancientLean4ProjectWarningMessage(origin, projectLeanVersionDiagnosis.version));
|
|
170
|
+
case 'UpToDate':
|
|
171
|
+
return 'Fulfilled';
|
|
172
|
+
}
|
|
119
173
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
174
|
+
async checkIsLakeInstalledCorrectly(channel, context, folderUri, options) {
|
|
175
|
+
const lakeAvailabilityResult = await diagnose({
|
|
176
|
+
channel,
|
|
177
|
+
cwdUri: extUriToCwdUri(folderUri),
|
|
178
|
+
toolchain: options.toolchainOverride,
|
|
179
|
+
context,
|
|
180
|
+
toolchainUpdateMode: options.toolchainUpdateMode,
|
|
181
|
+
}).checkLakeAvailable();
|
|
182
|
+
switch (lakeAvailabilityResult.kind) {
|
|
183
|
+
case 'NotAvailable':
|
|
184
|
+
return this.n.displaySetupErrorWithOutput("Error while checking Lake availability: 'lake' command was not found.");
|
|
185
|
+
case 'Error':
|
|
186
|
+
return this.n.displaySetupErrorWithOutput(`Error while checking Lake availability: ${lakeAvailabilityResult.message}`);
|
|
187
|
+
case 'Cancelled':
|
|
188
|
+
return this.n.displaySetupErrorWithOutput('Error while checking Lake availability: Operation cancelled.');
|
|
189
|
+
case 'Available':
|
|
190
|
+
return 'Fulfilled';
|
|
191
|
+
}
|
|
132
192
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
193
|
+
async checkIsVSCodeUpToDate() {
|
|
194
|
+
const vscodeVersionResult = diagnose({ channel: undefined, cwdUri: undefined }).queryVSCodeVersion();
|
|
195
|
+
switch (vscodeVersionResult.kind) {
|
|
196
|
+
case 'Outdated':
|
|
197
|
+
return await this.n.displaySetupWarning(`VS Code version is too out-of-date for new versions of the Lean 4 VS Code extension. The current VS Code version is ${vscodeVersionResult.currentVersion}, but a version of at least ${vscodeVersionResult.recommendedVersion} is recommended so that new versions of the Lean 4 VS Code extension can be installed.`);
|
|
198
|
+
case 'UpToDate':
|
|
199
|
+
return 'Fulfilled';
|
|
200
|
+
}
|
|
141
201
|
}
|
|
142
202
|
}
|
|
143
|
-
export async function
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
203
|
+
export async function checkAll(...checks) {
|
|
204
|
+
let worstViolation = 'Fulfilled';
|
|
205
|
+
for (const check of checks) {
|
|
206
|
+
const result = await check();
|
|
207
|
+
worstViolation = worstPreconditionViolation(worstViolation, result);
|
|
208
|
+
if (worstViolation === 'Fatal') {
|
|
209
|
+
return 'Fatal';
|
|
147
210
|
}
|
|
148
|
-
|
|
149
|
-
|
|
211
|
+
}
|
|
212
|
+
return worstViolation;
|
|
150
213
|
}
|
|
@@ -1,27 +1,40 @@
|
|
|
1
1
|
import { SemVer } from 'semver';
|
|
2
2
|
import { LeanInstaller } from '../utils/leanInstaller';
|
|
3
|
+
import { Input, StickyInput } from '../utils/notifs';
|
|
3
4
|
export type PreconditionCheckResult = 'Fulfilled' | 'Warning' | 'Fatal';
|
|
4
5
|
export declare function preconditionCheckResultToSeverity(result: PreconditionCheckResult): 0 | 1 | 2;
|
|
5
6
|
export declare function severityToPreconditionCheckResult(severity: 0 | 1 | 2): PreconditionCheckResult;
|
|
6
7
|
export declare function worstPreconditionViolation(...results: PreconditionCheckResult[]): PreconditionCheckResult;
|
|
7
|
-
export type
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
export type SetupNotificationOptions = {
|
|
9
|
+
errorMode: {
|
|
10
|
+
mode: 'Sticky';
|
|
11
|
+
retry: () => Promise<void>;
|
|
12
|
+
} | {
|
|
13
|
+
mode: 'Modal';
|
|
14
|
+
} | {
|
|
15
|
+
mode: 'NonModal';
|
|
16
|
+
};
|
|
17
|
+
warningMode: {
|
|
18
|
+
modal: boolean;
|
|
19
|
+
proceedByDefault: boolean;
|
|
20
|
+
};
|
|
12
21
|
};
|
|
13
|
-
export declare
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
export declare class SetupNotifier {
|
|
23
|
+
private options;
|
|
24
|
+
private subscriptions;
|
|
25
|
+
constructor(options: SetupNotificationOptions);
|
|
26
|
+
private error;
|
|
27
|
+
private warning;
|
|
28
|
+
displaySetupError(message: string): Promise<PreconditionCheckResult>;
|
|
29
|
+
displaySetupWarning(message: string): Promise<PreconditionCheckResult>;
|
|
30
|
+
displaySetupErrorWithInput(message: string, inputs: StickyInput<string>[]): Promise<PreconditionCheckResult>;
|
|
31
|
+
displaySetupWarningWithInput(message: string, inputs: Input<string>[]): Promise<PreconditionCheckResult>;
|
|
32
|
+
displaySetupErrorWithOutput(message: string): Promise<PreconditionCheckResult>;
|
|
33
|
+
displaySetupWarningWithOutput(message: string): Promise<PreconditionCheckResult>;
|
|
34
|
+
displaySetupErrorWithSetupGuide(message: string): Promise<PreconditionCheckResult>;
|
|
35
|
+
displaySetupWarningWithSetupGuide(message: string): Promise<PreconditionCheckResult>;
|
|
36
|
+
displayElanSetupError(installer: LeanInstaller, reason: string): Promise<PreconditionCheckResult>;
|
|
37
|
+
displayElanSetupWarning(installer: LeanInstaller, reason: string): Promise<PreconditionCheckResult>;
|
|
38
|
+
displayElanOutdatedSetupError(installer: LeanInstaller, currentVersion: SemVer, recommendedVersion: SemVer): Promise<PreconditionCheckResult>;
|
|
39
|
+
displayElanOutdatedSetupWarning(installer: LeanInstaller, currentVersion: SemVer, recommendedVersion: SemVer): Promise<PreconditionCheckResult>;
|
|
40
|
+
}
|