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,8 +1,8 @@
|
|
|
1
|
-
import { AbbreviationProvider
|
|
1
|
+
import { AbbreviationProvider } from '@leanprover/unicode-input';
|
|
2
2
|
import { OutputChannel } from 'vscode';
|
|
3
3
|
export declare class AbbreviationFeature {
|
|
4
4
|
private readonly disposables;
|
|
5
5
|
readonly abbreviations: AbbreviationProvider;
|
|
6
|
-
constructor(outputChannel: OutputChannel
|
|
6
|
+
constructor(outputChannel: OutputChannel);
|
|
7
7
|
dispose(): void;
|
|
8
8
|
}
|
|
@@ -6,11 +6,11 @@ import { VSCodeAbbreviationConfig } from './VSCodeAbbreviationConfig';
|
|
|
6
6
|
export class AbbreviationFeature {
|
|
7
7
|
disposables = new Array();
|
|
8
8
|
abbreviations;
|
|
9
|
-
constructor(outputChannel
|
|
9
|
+
constructor(outputChannel) {
|
|
10
10
|
const config = new VSCodeAbbreviationConfig();
|
|
11
11
|
this.disposables.push(config);
|
|
12
12
|
this.abbreviations = new AbbreviationProvider(config);
|
|
13
|
-
this.disposables.push(languages.registerHoverProvider(config.languages, new AbbreviationHoverProvider(config, this.abbreviations)), new AbbreviationRewriterFeature(config, this.abbreviations, outputChannel
|
|
13
|
+
this.disposables.push(languages.registerHoverProvider(config.languages, new AbbreviationHoverProvider(config, this.abbreviations)), new AbbreviationRewriterFeature(config, this.abbreviations, outputChannel));
|
|
14
14
|
}
|
|
15
15
|
dispose() {
|
|
16
16
|
for (const d of this.disposables) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AbbreviationProvider
|
|
1
|
+
import { AbbreviationProvider } from '@leanprover/unicode-input';
|
|
2
2
|
import { OutputChannel } from 'vscode';
|
|
3
3
|
import { VSCodeAbbreviationConfig } from './VSCodeAbbreviationConfig';
|
|
4
4
|
/**
|
|
@@ -9,10 +9,9 @@ export declare class AbbreviationRewriterFeature {
|
|
|
9
9
|
private readonly config;
|
|
10
10
|
private readonly abbreviationProvider;
|
|
11
11
|
private readonly outputChannel;
|
|
12
|
-
private readonly selectionMoveMove?;
|
|
13
12
|
private readonly disposables;
|
|
14
13
|
private activeAbbreviationRewriter;
|
|
15
|
-
constructor(config: VSCodeAbbreviationConfig, abbreviationProvider: AbbreviationProvider, outputChannel: OutputChannel
|
|
14
|
+
constructor(config: VSCodeAbbreviationConfig, abbreviationProvider: AbbreviationProvider, outputChannel: OutputChannel);
|
|
16
15
|
private disposeActiveAbbreviationRewriter;
|
|
17
16
|
private changedActiveTextEditor;
|
|
18
17
|
private shouldEnableRewriterForEditor;
|
|
@@ -9,14 +9,12 @@ export class AbbreviationRewriterFeature {
|
|
|
9
9
|
config;
|
|
10
10
|
abbreviationProvider;
|
|
11
11
|
outputChannel;
|
|
12
|
-
selectionMoveMove;
|
|
13
12
|
disposables = new Array();
|
|
14
13
|
activeAbbreviationRewriter;
|
|
15
|
-
constructor(config, abbreviationProvider, outputChannel
|
|
14
|
+
constructor(config, abbreviationProvider, outputChannel) {
|
|
16
15
|
this.config = config;
|
|
17
16
|
this.abbreviationProvider = abbreviationProvider;
|
|
18
17
|
this.outputChannel = outputChannel;
|
|
19
|
-
this.selectionMoveMove = selectionMoveMove;
|
|
20
18
|
void this.changedActiveTextEditor(window.activeTextEditor);
|
|
21
19
|
this.disposables.push(commands.registerTextEditorCommand('lean4.input.convert', async () => {
|
|
22
20
|
if (this.activeAbbreviationRewriter === undefined) {
|
|
@@ -35,7 +33,7 @@ export class AbbreviationRewriterFeature {
|
|
|
35
33
|
}
|
|
36
34
|
if (this.activeAbbreviationRewriter === undefined &&
|
|
37
35
|
this.shouldEnableRewriterForEditor(window.activeTextEditor)) {
|
|
38
|
-
this.activeAbbreviationRewriter = new VSCodeAbbreviationRewriter(config, abbreviationProvider, outputChannel, window.activeTextEditor
|
|
36
|
+
this.activeAbbreviationRewriter = new VSCodeAbbreviationRewriter(config, abbreviationProvider, outputChannel, window.activeTextEditor);
|
|
39
37
|
}
|
|
40
38
|
else if (this.activeAbbreviationRewriter !== undefined &&
|
|
41
39
|
!this.shouldEnableRewriterForEditor(window.activeTextEditor)) {
|
|
@@ -62,7 +60,7 @@ export class AbbreviationRewriterFeature {
|
|
|
62
60
|
if (!this.shouldEnableRewriterForEditor(activeTextEditor)) {
|
|
63
61
|
return;
|
|
64
62
|
}
|
|
65
|
-
this.activeAbbreviationRewriter = new VSCodeAbbreviationRewriter(this.config, this.abbreviationProvider, this.outputChannel, activeTextEditor
|
|
63
|
+
this.activeAbbreviationRewriter = new VSCodeAbbreviationRewriter(this.config, this.abbreviationProvider, this.outputChannel, activeTextEditor);
|
|
66
64
|
}
|
|
67
65
|
shouldEnableRewriterForEditor(editor) {
|
|
68
66
|
if (!this.config.inputModeEnabled) {
|
|
@@ -8,14 +8,13 @@ export declare class VSCodeAbbreviationRewriter implements AbbreviationTextSourc
|
|
|
8
8
|
readonly abbreviationProvider: AbbreviationProvider;
|
|
9
9
|
private readonly outputChannel;
|
|
10
10
|
private readonly textEditor;
|
|
11
|
-
private selectionMoveMoveOverride?;
|
|
12
11
|
private readonly disposables;
|
|
13
12
|
private readonly rewriter;
|
|
14
13
|
private readonly decorationType;
|
|
15
14
|
private firstOutput;
|
|
16
15
|
private isVimExtensionInstalled;
|
|
17
16
|
private checkIsVimExtensionInstalled;
|
|
18
|
-
constructor(config: AbbreviationConfig, abbreviationProvider: AbbreviationProvider, outputChannel: OutputChannel, textEditor: TextEditor
|
|
17
|
+
constructor(config: AbbreviationConfig, abbreviationProvider: AbbreviationProvider, outputChannel: OutputChannel, textEditor: TextEditor);
|
|
19
18
|
private writeError;
|
|
20
19
|
selectionMoveMode(): SelectionMoveMode;
|
|
21
20
|
collectSelections(): Range[];
|
|
@@ -8,7 +8,6 @@ export class VSCodeAbbreviationRewriter {
|
|
|
8
8
|
abbreviationProvider;
|
|
9
9
|
outputChannel;
|
|
10
10
|
textEditor;
|
|
11
|
-
selectionMoveMoveOverride;
|
|
12
11
|
disposables = new Array();
|
|
13
12
|
rewriter;
|
|
14
13
|
decorationType = window.createTextEditorDecorationType({
|
|
@@ -19,12 +18,11 @@ export class VSCodeAbbreviationRewriter {
|
|
|
19
18
|
checkIsVimExtensionInstalled() {
|
|
20
19
|
this.isVimExtensionInstalled = extensions.getExtension('vscodevim.vim') !== undefined;
|
|
21
20
|
}
|
|
22
|
-
constructor(config, abbreviationProvider, outputChannel, textEditor
|
|
21
|
+
constructor(config, abbreviationProvider, outputChannel, textEditor) {
|
|
23
22
|
this.config = config;
|
|
24
23
|
this.abbreviationProvider = abbreviationProvider;
|
|
25
24
|
this.outputChannel = outputChannel;
|
|
26
25
|
this.textEditor = textEditor;
|
|
27
|
-
this.selectionMoveMoveOverride = selectionMoveMoveOverride;
|
|
28
26
|
this.rewriter = new AbbreviationRewriter(config, abbreviationProvider, this);
|
|
29
27
|
this.disposables.push(this.decorationType);
|
|
30
28
|
this.disposables.push(workspace.onDidChangeTextDocument(async (e) => {
|
|
@@ -36,7 +34,7 @@ export class VSCodeAbbreviationRewriter {
|
|
|
36
34
|
newText: changeEvent.text,
|
|
37
35
|
}));
|
|
38
36
|
this.rewriter.changeInput(changes);
|
|
39
|
-
//
|
|
37
|
+
// lean4monaco: We need to wait for changes to take effect. Otherwise, the cursor will be at the wrong position.
|
|
40
38
|
await new Promise(resolve => setTimeout(resolve, 0));
|
|
41
39
|
await this.rewriter.triggerAbbreviationReplacement();
|
|
42
40
|
this.updateState();
|
|
@@ -60,10 +58,8 @@ export class VSCodeAbbreviationRewriter {
|
|
|
60
58
|
}
|
|
61
59
|
}
|
|
62
60
|
selectionMoveMode() {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
updateUnchangedSelections: this.isVimExtensionInstalled,
|
|
66
|
-
});
|
|
61
|
+
// lean4monaco: This setting ensures that the cursor will move correctly in the browser.
|
|
62
|
+
return { kind: 'MoveAllSelections' };
|
|
67
63
|
}
|
|
68
64
|
collectSelections() {
|
|
69
65
|
return this.textEditor.selections.map(s => fromVsCodeRange(s, this.textEditor.document));
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { ThemeColor } from 'vscode';
|
|
1
2
|
import { PATH } from './utils/envPath';
|
|
2
3
|
export declare function getPowerShellPath(): string;
|
|
3
4
|
export declare function automaticallyBuildDependencies(): boolean;
|
|
4
5
|
export declare function envPathExtensions(): PATH;
|
|
6
|
+
export declare function alwaysAskBeforeInstallingLeanVersions(): boolean;
|
|
7
|
+
export declare function setAlwaysAskBeforeInstallingLeanVersions(alwaysAskBeforeInstallingLeanVersions: boolean): Promise<void>;
|
|
5
8
|
export declare function serverArgs(): string[];
|
|
6
9
|
export declare function serverLoggingEnabled(): boolean;
|
|
7
10
|
export declare function serverLoggingPath(): string;
|
|
@@ -11,14 +14,24 @@ export declare function getInfoViewAutoOpen(): boolean;
|
|
|
11
14
|
export declare function getInfoViewAutoOpenShowsGoal(): boolean;
|
|
12
15
|
export declare function getInfoViewAllErrorsOnLine(): boolean;
|
|
13
16
|
export declare function getInfoViewDebounceTime(): number;
|
|
14
|
-
export declare function
|
|
17
|
+
export declare function getInfoViewExpectedTypeVisibility(): 'Expanded by default' | 'Collapsed by default' | 'Hidden';
|
|
15
18
|
export declare function getInfoViewShowGoalNames(): boolean;
|
|
16
19
|
export declare function getInfoViewEmphasizeFirstGoal(): boolean;
|
|
17
20
|
export declare function getInfoViewReverseTacticState(): boolean;
|
|
21
|
+
export declare function getInfoViewHideTypeAssumptions(): boolean;
|
|
22
|
+
export declare function getInfoViewHideInstanceAssumptions(): boolean;
|
|
23
|
+
export declare function getInfoViewHideInaccessibleAssumptions(): boolean;
|
|
24
|
+
export declare function getInfoViewHideLetValues(): boolean;
|
|
18
25
|
export declare function getInfoViewShowTooltipOnHover(): boolean;
|
|
19
26
|
export declare function getElaborationDelay(): number;
|
|
20
27
|
export declare function shouldShowSetupWarnings(): boolean;
|
|
21
28
|
export declare function getFallBackToStringOccurrenceHighlighting(): boolean;
|
|
29
|
+
export declare function showDiagnosticGutterDecorations(): boolean;
|
|
30
|
+
export declare function showUnsolvedGoalsDecoration(): boolean;
|
|
31
|
+
export declare function unsolvedGoalsDecorationLightThemeColor(): ThemeColor | string;
|
|
32
|
+
export declare function unsolvedGoalsDecorationDarkThemeColor(): ThemeColor | string;
|
|
33
|
+
export declare function goalsAccomplishedDecorationKind(): string;
|
|
34
|
+
export declare function decorationEditDelay(): number;
|
|
22
35
|
export declare function isRunningTest(): boolean;
|
|
23
36
|
export declare function getTestFolder(): string;
|
|
24
37
|
export declare function getDefaultLeanVersion(): string;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { workspace } from 'vscode';
|
|
1
|
+
import { ConfigurationTarget, ThemeColor, workspace } from 'vscode';
|
|
2
|
+
import { elanStableChannel } from './utils/elan';
|
|
2
3
|
import { PATH } from './utils/envPath';
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
function processConfigColor(c) {
|
|
5
|
+
if (c.match(/^(#|rgb\(|rgba\(|hsl\(|hsla\()/)) {
|
|
6
|
+
return c;
|
|
7
|
+
}
|
|
8
|
+
return new ThemeColor(c);
|
|
9
|
+
}
|
|
5
10
|
export function getPowerShellPath() {
|
|
6
11
|
const windir = process.env.windir;
|
|
7
12
|
return `${windir}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
@@ -12,6 +17,14 @@ export function automaticallyBuildDependencies() {
|
|
|
12
17
|
export function envPathExtensions() {
|
|
13
18
|
return new PATH(workspace.getConfiguration('lean4').get('envPathExtensions', []));
|
|
14
19
|
}
|
|
20
|
+
export function alwaysAskBeforeInstallingLeanVersions() {
|
|
21
|
+
return workspace.getConfiguration('lean4').get('alwaysAskBeforeInstallingLeanVersions', false);
|
|
22
|
+
}
|
|
23
|
+
export async function setAlwaysAskBeforeInstallingLeanVersions(alwaysAskBeforeInstallingLeanVersions) {
|
|
24
|
+
await workspace
|
|
25
|
+
.getConfiguration('lean4')
|
|
26
|
+
.update('alwaysAskBeforeInstallingLeanVersions', alwaysAskBeforeInstallingLeanVersions, ConfigurationTarget.Global);
|
|
27
|
+
}
|
|
15
28
|
export function serverArgs() {
|
|
16
29
|
return workspace.getConfiguration('lean4').get('serverArgs', []);
|
|
17
30
|
}
|
|
@@ -52,9 +65,17 @@ export function getInfoViewAllErrorsOnLine() {
|
|
|
52
65
|
export function getInfoViewDebounceTime() {
|
|
53
66
|
return workspace.getConfiguration('lean4.infoview').get('debounceTime', 50);
|
|
54
67
|
}
|
|
55
|
-
|
|
68
|
+
function getInfoViewShowExpectedType() {
|
|
56
69
|
return workspace.getConfiguration('lean4.infoview').get('showExpectedType', true);
|
|
57
70
|
}
|
|
71
|
+
export function getInfoViewExpectedTypeVisibility() {
|
|
72
|
+
const show = getInfoViewShowExpectedType();
|
|
73
|
+
const visibility = workspace.getConfiguration('lean4.infoview').get('expectedTypeVisibility', 'Expanded by default');
|
|
74
|
+
if (!show && visibility === 'Expanded by default') {
|
|
75
|
+
return 'Collapsed by default';
|
|
76
|
+
}
|
|
77
|
+
return visibility;
|
|
78
|
+
}
|
|
58
79
|
export function getInfoViewShowGoalNames() {
|
|
59
80
|
return workspace.getConfiguration('lean4.infoview').get('showGoalNames', true);
|
|
60
81
|
}
|
|
@@ -64,6 +85,18 @@ export function getInfoViewEmphasizeFirstGoal() {
|
|
|
64
85
|
export function getInfoViewReverseTacticState() {
|
|
65
86
|
return workspace.getConfiguration('lean4.infoview').get('reverseTacticState', false);
|
|
66
87
|
}
|
|
88
|
+
export function getInfoViewHideTypeAssumptions() {
|
|
89
|
+
return workspace.getConfiguration('lean4.infoview').get('hideTypeAssumptions', false);
|
|
90
|
+
}
|
|
91
|
+
export function getInfoViewHideInstanceAssumptions() {
|
|
92
|
+
return workspace.getConfiguration('lean4.infoview').get('hideInstanceAssumptions', false);
|
|
93
|
+
}
|
|
94
|
+
export function getInfoViewHideInaccessibleAssumptions() {
|
|
95
|
+
return workspace.getConfiguration('lean4.infoview').get('hideInaccessibleAssumptions', false);
|
|
96
|
+
}
|
|
97
|
+
export function getInfoViewHideLetValues() {
|
|
98
|
+
return workspace.getConfiguration('lean4.infoview').get('hideLetValues', false);
|
|
99
|
+
}
|
|
67
100
|
export function getInfoViewShowTooltipOnHover() {
|
|
68
101
|
return workspace.getConfiguration('lean4.infoview').get('showTooltipOnHover', true);
|
|
69
102
|
}
|
|
@@ -76,6 +109,24 @@ export function shouldShowSetupWarnings() {
|
|
|
76
109
|
export function getFallBackToStringOccurrenceHighlighting() {
|
|
77
110
|
return workspace.getConfiguration('lean4').get('fallBackToStringOccurrenceHighlighting', false);
|
|
78
111
|
}
|
|
112
|
+
export function showDiagnosticGutterDecorations() {
|
|
113
|
+
return workspace.getConfiguration('lean4').get('showDiagnosticGutterDecorations', true);
|
|
114
|
+
}
|
|
115
|
+
export function showUnsolvedGoalsDecoration() {
|
|
116
|
+
return workspace.getConfiguration('lean4').get('showUnsolvedGoalsDecoration', true);
|
|
117
|
+
}
|
|
118
|
+
export function unsolvedGoalsDecorationLightThemeColor() {
|
|
119
|
+
return processConfigColor(workspace.getConfiguration('lean4').get('unsolvedGoalsDecorationLightThemeColor', 'editorInfo.foreground'));
|
|
120
|
+
}
|
|
121
|
+
export function unsolvedGoalsDecorationDarkThemeColor() {
|
|
122
|
+
return processConfigColor(workspace.getConfiguration('lean4').get('unsolvedGoalsDecorationDarkThemeColor', 'editorInfo.foreground'));
|
|
123
|
+
}
|
|
124
|
+
export function goalsAccomplishedDecorationKind() {
|
|
125
|
+
return workspace.getConfiguration('lean4').get('goalsAccomplishedDecorationKind', 'Double Checkmark');
|
|
126
|
+
}
|
|
127
|
+
export function decorationEditDelay() {
|
|
128
|
+
return workspace.getConfiguration('lean4').get('decorationEditDelay', 750);
|
|
129
|
+
}
|
|
79
130
|
export function isRunningTest() {
|
|
80
131
|
return typeof process.env.LEAN4_TEST_FOLDER === 'string';
|
|
81
132
|
}
|
|
@@ -85,7 +136,7 @@ export function getTestFolder() {
|
|
|
85
136
|
export function getDefaultLeanVersion() {
|
|
86
137
|
return typeof process.env.DEFAULT_LEAN_TOOLCHAIN === 'string'
|
|
87
138
|
? process.env.DEFAULT_LEAN_TOOLCHAIN
|
|
88
|
-
:
|
|
139
|
+
: elanStableChannel;
|
|
89
140
|
}
|
|
90
141
|
/** The editor line height, in pixels. */
|
|
91
142
|
export function getEditorLineHeight() {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { SemVer } from 'semver';
|
|
2
2
|
import { OutputChannel } from 'vscode';
|
|
3
3
|
import { ExecutionResult } from '../utils/batch';
|
|
4
|
+
import { ElanDumpStateWithNetResult, ElanDumpStateWithoutNetResult } from '../utils/elan';
|
|
4
5
|
import { FileUri } from '../utils/exturi';
|
|
6
|
+
import { ToolchainUpdateMode } from '../utils/leanCmdRunner';
|
|
5
7
|
export type SystemQueryResult = {
|
|
6
8
|
operatingSystem: string;
|
|
7
9
|
cpuArchitecture: string;
|
|
@@ -16,10 +18,28 @@ export type VersionQueryResult = {
|
|
|
16
18
|
} | {
|
|
17
19
|
kind: 'CommandError';
|
|
18
20
|
message: string;
|
|
21
|
+
} | {
|
|
22
|
+
kind: 'Cancelled';
|
|
19
23
|
} | {
|
|
20
24
|
kind: 'InvalidVersion';
|
|
21
25
|
versionResult: string;
|
|
22
26
|
};
|
|
27
|
+
export type LakeAvailabilityResult = {
|
|
28
|
+
kind: 'Available';
|
|
29
|
+
} | {
|
|
30
|
+
kind: 'NotAvailable';
|
|
31
|
+
} | {
|
|
32
|
+
kind: 'Error';
|
|
33
|
+
message: string;
|
|
34
|
+
} | {
|
|
35
|
+
kind: 'Cancelled';
|
|
36
|
+
};
|
|
37
|
+
export type ElanDumpStateWithoutNetQueryResult = ElanDumpStateWithoutNetResult | {
|
|
38
|
+
kind: 'PreEagerResolutionVersion';
|
|
39
|
+
};
|
|
40
|
+
export type ElanDumpStateWithNetQueryResult = ElanDumpStateWithNetResult | {
|
|
41
|
+
kind: 'PreEagerResolutionVersion';
|
|
42
|
+
};
|
|
23
43
|
export type ElanVersionDiagnosis = {
|
|
24
44
|
kind: 'UpToDate';
|
|
25
45
|
version: SemVer;
|
|
@@ -54,6 +74,8 @@ export type LeanVersionDiagnosis = {
|
|
|
54
74
|
version: SemVer;
|
|
55
75
|
} | {
|
|
56
76
|
kind: 'NotInstalled';
|
|
77
|
+
} | {
|
|
78
|
+
kind: 'Cancelled';
|
|
57
79
|
} | {
|
|
58
80
|
kind: 'ExecutionError';
|
|
59
81
|
message: string;
|
|
@@ -69,26 +91,35 @@ export type VSCodeVersionDiagnosis = {
|
|
|
69
91
|
export declare function versionQueryResult(executionResult: ExecutionResult, versionRegex: RegExp): VersionQueryResult;
|
|
70
92
|
export declare function checkElanVersion(elanVersionResult: VersionQueryResult): ElanVersionDiagnosis;
|
|
71
93
|
export declare function checkLeanVersion(leanVersionResult: VersionQueryResult): LeanVersionDiagnosis;
|
|
94
|
+
export type SetupDiagnoserOptions = {
|
|
95
|
+
channel: OutputChannel | undefined;
|
|
96
|
+
cwdUri: FileUri | undefined;
|
|
97
|
+
context?: string | undefined;
|
|
98
|
+
toolchain?: string | undefined;
|
|
99
|
+
toolchainUpdateMode?: ToolchainUpdateMode | undefined;
|
|
100
|
+
};
|
|
72
101
|
export declare class SetupDiagnoser {
|
|
73
102
|
readonly channel: OutputChannel | undefined;
|
|
74
103
|
readonly cwdUri: FileUri | undefined;
|
|
104
|
+
readonly context: string | undefined;
|
|
75
105
|
readonly toolchain: string | undefined;
|
|
76
|
-
|
|
106
|
+
readonly toolchainUpdateMode: ToolchainUpdateMode | undefined;
|
|
107
|
+
constructor(options: SetupDiagnoserOptions);
|
|
77
108
|
checkCurlAvailable(): Promise<boolean>;
|
|
78
109
|
checkGitAvailable(): Promise<boolean>;
|
|
79
|
-
|
|
80
|
-
checkLakeAvailable(): Promise<boolean>;
|
|
110
|
+
checkLakeAvailable(): Promise<LakeAvailabilityResult>;
|
|
81
111
|
querySystemInformation(): SystemQueryResult;
|
|
82
112
|
queryExtensionVersion(): SemVer;
|
|
83
113
|
queryVSCodeVersion(): VSCodeVersionDiagnosis;
|
|
84
114
|
queryLeanVersion(): Promise<VersionQueryResult>;
|
|
85
115
|
queryElanVersion(): Promise<VersionQueryResult>;
|
|
86
116
|
queryElanShow(): Promise<ExecutionResult>;
|
|
117
|
+
queryElanStateDumpWithoutNet(): Promise<ElanDumpStateWithoutNetQueryResult>;
|
|
118
|
+
queryElanStateDumpWithNet(): Promise<ElanDumpStateWithNetQueryResult>;
|
|
87
119
|
elanVersion(): Promise<ElanVersionDiagnosis>;
|
|
88
120
|
projectSetup(): Promise<ProjectSetupDiagnosis>;
|
|
89
121
|
leanVersion(): Promise<LeanVersionDiagnosis>;
|
|
90
122
|
private runSilently;
|
|
91
|
-
private runWithProgress;
|
|
92
123
|
private runLeanCommand;
|
|
93
124
|
}
|
|
94
|
-
export declare function diagnose(
|
|
125
|
+
export declare function diagnose(options: SetupDiagnoserOptions): SetupDiagnoser;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as os from 'os';
|
|
2
2
|
import { SemVer } from 'semver';
|
|
3
3
|
import { extensions, version } from 'vscode';
|
|
4
|
-
import { ExecutionExitCode, batchExecute
|
|
4
|
+
import { ExecutionExitCode, batchExecute } from '../utils/batch';
|
|
5
|
+
import { elanDumpStateWithNet, elanDumpStateWithoutNet, isElanEagerResolutionVersion, } from '../utils/elan';
|
|
6
|
+
import { leanRunner } from '../utils/leanCmdRunner';
|
|
5
7
|
import { checkParentFoldersForLeanProject, isValidLeanProject } from '../utils/projectInfo';
|
|
6
8
|
const recommendedElanVersion = new SemVer('3.1.1');
|
|
7
9
|
// Should be bumped in a release *before* we bump the version requirement of the VS Code extension so that
|
|
@@ -14,6 +16,9 @@ export function versionQueryResult(executionResult, versionRegex) {
|
|
|
14
16
|
if (executionResult.exitCode === ExecutionExitCode.ExecutionError) {
|
|
15
17
|
return { kind: 'CommandError', message: executionResult.combined };
|
|
16
18
|
}
|
|
19
|
+
if (executionResult.exitCode === ExecutionExitCode.Cancelled) {
|
|
20
|
+
return { kind: 'Cancelled' };
|
|
21
|
+
}
|
|
17
22
|
const match = versionRegex.exec(executionResult.stdout);
|
|
18
23
|
if (!match) {
|
|
19
24
|
return { kind: 'InvalidVersion', versionResult: executionResult.stdout };
|
|
@@ -31,6 +36,8 @@ export function checkElanVersion(elanVersionResult) {
|
|
|
31
36
|
kind: 'ExecutionError',
|
|
32
37
|
message: `Invalid Elan version format: '${elanVersionResult.versionResult}'`,
|
|
33
38
|
};
|
|
39
|
+
case 'Cancelled':
|
|
40
|
+
throw new Error('Unexpected cancellation of `elan --version` query.');
|
|
34
41
|
case 'Success':
|
|
35
42
|
if (elanVersionResult.version.compare(recommendedElanVersion) < 0) {
|
|
36
43
|
return {
|
|
@@ -58,6 +65,9 @@ export function checkLeanVersion(leanVersionResult) {
|
|
|
58
65
|
message: `Invalid Lean version format: '${leanVersionResult.versionResult}'`,
|
|
59
66
|
};
|
|
60
67
|
}
|
|
68
|
+
if (leanVersionResult.kind === 'Cancelled') {
|
|
69
|
+
return { kind: 'Cancelled' };
|
|
70
|
+
}
|
|
61
71
|
const leanVersion = leanVersionResult.version;
|
|
62
72
|
if (leanVersion.major === 3) {
|
|
63
73
|
return { kind: 'IsLean3Version', version: leanVersion };
|
|
@@ -70,11 +80,15 @@ export function checkLeanVersion(leanVersionResult) {
|
|
|
70
80
|
export class SetupDiagnoser {
|
|
71
81
|
channel;
|
|
72
82
|
cwdUri;
|
|
83
|
+
context;
|
|
73
84
|
toolchain;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
this.
|
|
77
|
-
this.
|
|
85
|
+
toolchainUpdateMode;
|
|
86
|
+
constructor(options) {
|
|
87
|
+
this.channel = options.channel;
|
|
88
|
+
this.cwdUri = options.cwdUri;
|
|
89
|
+
this.context = options.context;
|
|
90
|
+
this.toolchain = options.toolchain;
|
|
91
|
+
this.toolchainUpdateMode = options.toolchainUpdateMode;
|
|
78
92
|
}
|
|
79
93
|
async checkCurlAvailable() {
|
|
80
94
|
const curlVersionResult = await this.runSilently('curl', ['--version']);
|
|
@@ -84,13 +98,18 @@ export class SetupDiagnoser {
|
|
|
84
98
|
const gitVersionResult = await this.runSilently('git', ['--version']);
|
|
85
99
|
return gitVersionResult.exitCode === ExecutionExitCode.Success;
|
|
86
100
|
}
|
|
87
|
-
async queryLakeVersion() {
|
|
88
|
-
const lakeVersionResult = await this.runLeanCommand('lake', ['--version'], 'Checking Lake version');
|
|
89
|
-
return versionQueryResult(lakeVersionResult, /version (\d+\.\d+\.\d+(\w|-)*)/);
|
|
90
|
-
}
|
|
91
101
|
async checkLakeAvailable() {
|
|
92
|
-
const lakeVersionResult = await this.
|
|
93
|
-
|
|
102
|
+
const lakeVersionResult = await this.runLeanCommand('lake', ['--version'], 'Checking Lake version');
|
|
103
|
+
switch (lakeVersionResult.exitCode) {
|
|
104
|
+
case ExecutionExitCode.Success:
|
|
105
|
+
return { kind: 'Available' };
|
|
106
|
+
case ExecutionExitCode.CannotLaunch:
|
|
107
|
+
return { kind: 'NotAvailable' };
|
|
108
|
+
case ExecutionExitCode.ExecutionError:
|
|
109
|
+
return { kind: 'Error', message: lakeVersionResult.combined };
|
|
110
|
+
case ExecutionExitCode.Cancelled:
|
|
111
|
+
return { kind: 'Cancelled' };
|
|
112
|
+
}
|
|
94
113
|
}
|
|
95
114
|
querySystemInformation() {
|
|
96
115
|
const cpuModels = os.cpus().map(cpu => cpu.model);
|
|
@@ -140,6 +159,26 @@ export class SetupDiagnoser {
|
|
|
140
159
|
async queryElanShow() {
|
|
141
160
|
return await this.runSilently('elan', ['show']);
|
|
142
161
|
}
|
|
162
|
+
async queryElanStateDumpWithoutNet() {
|
|
163
|
+
const dumpStateResult = await elanDumpStateWithoutNet(this.cwdUri, this.toolchain);
|
|
164
|
+
if (dumpStateResult.kind === 'ExecutionError') {
|
|
165
|
+
const versionResult = await this.queryElanVersion();
|
|
166
|
+
if (versionResult.kind === 'Success' && !isElanEagerResolutionVersion(versionResult.version)) {
|
|
167
|
+
return { kind: 'PreEagerResolutionVersion' };
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return dumpStateResult;
|
|
171
|
+
}
|
|
172
|
+
async queryElanStateDumpWithNet() {
|
|
173
|
+
const dumpStateResult = await elanDumpStateWithNet(this.cwdUri, this.toolchain);
|
|
174
|
+
if (dumpStateResult.kind === 'ExecutionError') {
|
|
175
|
+
const versionResult = await this.queryElanVersion();
|
|
176
|
+
if (versionResult.kind === 'Success' && !isElanEagerResolutionVersion(versionResult.version)) {
|
|
177
|
+
return { kind: 'PreEagerResolutionVersion' };
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return dumpStateResult;
|
|
181
|
+
}
|
|
143
182
|
async elanVersion() {
|
|
144
183
|
const elanVersionResult = await this.queryElanVersion();
|
|
145
184
|
return checkElanVersion(elanVersionResult);
|
|
@@ -161,20 +200,17 @@ export class SetupDiagnoser {
|
|
|
161
200
|
async runSilently(executablePath, args) {
|
|
162
201
|
return batchExecute(executablePath, args, this.cwdUri?.fsPath, { combined: this.channel });
|
|
163
202
|
}
|
|
164
|
-
async
|
|
165
|
-
return
|
|
166
|
-
cwd: this.cwdUri?.fsPath,
|
|
203
|
+
async runLeanCommand(executablePath, args, title) {
|
|
204
|
+
return await leanRunner.runLeanCommand(executablePath, args, {
|
|
167
205
|
channel: this.channel,
|
|
206
|
+
context: this.context,
|
|
207
|
+
cwdUri: this.cwdUri,
|
|
208
|
+
waitingPrompt: title,
|
|
209
|
+
toolchain: this.toolchain,
|
|
210
|
+
toolchainUpdateMode: this.toolchainUpdateMode ?? 'UpdateAutomatically',
|
|
168
211
|
});
|
|
169
212
|
}
|
|
170
|
-
async runLeanCommand(executablePath, args, title) {
|
|
171
|
-
const leanArgs = [...args];
|
|
172
|
-
if (this.toolchain !== undefined) {
|
|
173
|
-
leanArgs.unshift(`+${this.toolchain}`);
|
|
174
|
-
}
|
|
175
|
-
return await this.runWithProgress(executablePath, leanArgs, title);
|
|
176
|
-
}
|
|
177
213
|
}
|
|
178
|
-
export function diagnose(
|
|
179
|
-
return new SetupDiagnoser(
|
|
214
|
+
export function diagnose(options) {
|
|
215
|
+
return new SetupDiagnoser(options);
|
|
180
216
|
}
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
import { OutputChannel } from 'vscode';
|
|
2
2
|
import { ExtUri, FileUri } from '../utils/exturi';
|
|
3
|
+
import { ToolchainUpdateMode } from '../utils/leanCmdRunner';
|
|
3
4
|
import { LeanInstaller } from '../utils/leanInstaller';
|
|
4
|
-
import { PreconditionCheckResult } from './setupNotifs';
|
|
5
|
+
import { PreconditionCheckResult, SetupNotificationOptions } from './setupNotifs';
|
|
6
|
+
export declare class SetupDiagnostics {
|
|
7
|
+
private n;
|
|
8
|
+
constructor(o: SetupNotificationOptions);
|
|
9
|
+
checkAreDependenciesInstalled(channel: OutputChannel, cwdUri: FileUri | undefined): Promise<PreconditionCheckResult>;
|
|
10
|
+
checkIsLean4Installed(installer: LeanInstaller, context: string, cwdUri: FileUri | undefined, toolchainUpdateMode: ToolchainUpdateMode): Promise<PreconditionCheckResult>;
|
|
11
|
+
checkIsElanUpToDate(installer: LeanInstaller, cwdUri: FileUri | undefined, options: {
|
|
12
|
+
elanMustBeInstalled: boolean;
|
|
13
|
+
}): Promise<PreconditionCheckResult>;
|
|
14
|
+
checkIsValidProjectFolder(channel: OutputChannel, folderUri: ExtUri): Promise<PreconditionCheckResult>;
|
|
15
|
+
checkIsNestedProjectFolder(existingFolderUris: ExtUri[], folderUri: ExtUri, fileUri: ExtUri, stopOtherServer: (folderUri: FileUri) => Promise<void>): Promise<PreconditionCheckResult>;
|
|
16
|
+
checkIsLeanVersionUpToDate(channel: OutputChannel, context: string, folderUri: ExtUri, options: {
|
|
17
|
+
toolchainOverride?: string | undefined;
|
|
18
|
+
toolchainUpdateMode: ToolchainUpdateMode;
|
|
19
|
+
}): Promise<PreconditionCheckResult>;
|
|
20
|
+
checkIsLakeInstalledCorrectly(channel: OutputChannel, context: string, folderUri: ExtUri, options: {
|
|
21
|
+
toolchainOverride?: string | undefined;
|
|
22
|
+
toolchainUpdateMode: ToolchainUpdateMode;
|
|
23
|
+
}): Promise<PreconditionCheckResult>;
|
|
24
|
+
checkIsVSCodeUpToDate(): Promise<PreconditionCheckResult>;
|
|
25
|
+
}
|
|
5
26
|
export declare function checkAll(...checks: (() => Promise<PreconditionCheckResult>)[]): Promise<PreconditionCheckResult>;
|
|
6
|
-
export declare function checkAreDependenciesInstalled(channel: OutputChannel, cwdUri: FileUri | undefined): Promise<PreconditionCheckResult>;
|
|
7
|
-
export declare function checkIsLean4Installed(installer: LeanInstaller, cwdUri: FileUri | undefined): Promise<PreconditionCheckResult>;
|
|
8
|
-
export declare function checkIsElanUpToDate(installer: LeanInstaller, cwdUri: FileUri | undefined, options: {
|
|
9
|
-
elanMustBeInstalled: boolean;
|
|
10
|
-
modal: boolean;
|
|
11
|
-
}): Promise<PreconditionCheckResult>;
|
|
12
|
-
export declare function checkIsValidProjectFolder(channel: OutputChannel, folderUri: ExtUri): Promise<PreconditionCheckResult>;
|
|
13
|
-
export declare function checkIsLeanVersionUpToDate(channel: OutputChannel, folderUri: ExtUri, options: {
|
|
14
|
-
toolchainOverride?: string | undefined;
|
|
15
|
-
modal: boolean;
|
|
16
|
-
}): Promise<PreconditionCheckResult>;
|
|
17
|
-
export declare function checkIsLakeInstalledCorrectly(channel: OutputChannel, folderUri: ExtUri, options: {
|
|
18
|
-
toolchainOverride?: string | undefined;
|
|
19
|
-
}): Promise<PreconditionCheckResult>;
|
|
20
|
-
export declare function checkIsVSCodeUpToDate(): Promise<PreconditionCheckResult>;
|
|
21
|
-
export declare function checkLean4ProjectPreconditions(channel: OutputChannel, folderUri: ExtUri): Promise<PreconditionCheckResult>;
|