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,127 +1,567 @@
|
|
|
1
1
|
import { LeanFileProgressKind } from '@leanprover/infoview-api';
|
|
2
|
-
import
|
|
2
|
+
import assert from 'assert';
|
|
3
|
+
import { Range as CodeRange, extensions, OverviewRulerLane, window, workspace, } from 'vscode';
|
|
4
|
+
import { DiagnosticSeverity } from 'vscode-languageclient';
|
|
5
|
+
import { decorationEditDelay, goalsAccomplishedDecorationKind, showDiagnosticGutterDecorations, showUnsolvedGoalsDecoration, unsolvedGoalsDecorationDarkThemeColor, unsolvedGoalsDecorationLightThemeColor, } from './config';
|
|
6
|
+
import { LeanTag } from './utils/converters';
|
|
7
|
+
import { parseExtUri } from './utils/exturi';
|
|
8
|
+
import { lean } from './utils/leanEditorProvider';
|
|
3
9
|
class LeanFileTaskGutter {
|
|
4
10
|
uri;
|
|
5
|
-
|
|
6
|
-
processed;
|
|
11
|
+
editDelayMs = decorationEditDelay();
|
|
7
12
|
timeout;
|
|
8
|
-
|
|
13
|
+
editDelayTimeout;
|
|
14
|
+
lastEditTimestampMs;
|
|
15
|
+
subscriptions = [];
|
|
16
|
+
decorationStates = [];
|
|
17
|
+
constructor(uri) {
|
|
9
18
|
this.uri = uri;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
this.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
19
|
+
workspace.onDidChangeTextDocument(e => {
|
|
20
|
+
if (!uri.equalsUri(e.document.uri)) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
this.onDidChange();
|
|
24
|
+
}, this.subscriptions);
|
|
25
|
+
}
|
|
26
|
+
onDidChange() {
|
|
27
|
+
clearTimeout(this.editDelayTimeout);
|
|
28
|
+
this.lastEditTimestampMs = Date.now();
|
|
29
|
+
}
|
|
30
|
+
onDidReveal() {
|
|
31
|
+
this.scheduleUpdate([], 100);
|
|
32
|
+
}
|
|
33
|
+
onDidUpdateState(newDecorationStates) {
|
|
34
|
+
this.scheduleUpdate(newDecorationStates, 100);
|
|
35
|
+
}
|
|
36
|
+
clear(clearedDecorationTypes) {
|
|
37
|
+
const clearedDecorationStates = this.decorationStates
|
|
38
|
+
.filter(state => clearedDecorationTypes.find(clearedType => clearedType.key === state.type.key) !== undefined)
|
|
39
|
+
.map(state => ({
|
|
40
|
+
...state,
|
|
41
|
+
decos: [],
|
|
42
|
+
}));
|
|
43
|
+
this.scheduleUpdate(clearedDecorationStates, 100);
|
|
44
|
+
}
|
|
45
|
+
scheduleUpdate(newDecorationStates, ms) {
|
|
46
|
+
this.updateDecorationStates(newDecorationStates);
|
|
47
|
+
if (this.timeout === undefined) {
|
|
48
|
+
this.timeout = setTimeout(() => {
|
|
49
|
+
this.timeout = undefined;
|
|
50
|
+
this.displayDecorations('Instantaneous');
|
|
51
|
+
}, ms);
|
|
52
|
+
}
|
|
53
|
+
clearTimeout(this.editDelayTimeout);
|
|
54
|
+
const remainingDelayMs = this.lastEditTimestampMs !== undefined
|
|
55
|
+
? Math.max(ms, this.editDelayMs - (Date.now() - this.lastEditTimestampMs))
|
|
56
|
+
: ms;
|
|
57
|
+
this.editDelayTimeout = setTimeout(() => {
|
|
58
|
+
this.editDelayTimeout = undefined;
|
|
59
|
+
this.displayDecorations('EditDelayed');
|
|
60
|
+
}, remainingDelayMs);
|
|
61
|
+
}
|
|
62
|
+
updateDecorationStates(newDecorationStates) {
|
|
63
|
+
for (const newState of newDecorationStates) {
|
|
64
|
+
const idx = this.decorationStates.findIndex(oldState => oldState.type.key === newState.type.key);
|
|
65
|
+
if (idx === -1) {
|
|
66
|
+
this.decorationStates.push(newState);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
this.decorationStates[idx] = newState;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
this.decorationStates.sort((a, b) => a.prio - b.prio);
|
|
73
|
+
}
|
|
74
|
+
displayDecorations(kind) {
|
|
75
|
+
for (const leanEditor of lean.getVisibleLeanEditorsByUri(this.uri)) {
|
|
76
|
+
for (const state of this.decorationStates) {
|
|
77
|
+
if (state.kind === kind) {
|
|
78
|
+
leanEditor.editor.setDecorations(state.type, state.decos);
|
|
50
79
|
}
|
|
51
80
|
}
|
|
52
81
|
}
|
|
53
82
|
}
|
|
54
83
|
dispose() {
|
|
55
|
-
this.
|
|
84
|
+
clearTimeout(this.timeout);
|
|
85
|
+
clearTimeout(this.editDelayTimeout);
|
|
86
|
+
for (const s of this.subscriptions) {
|
|
87
|
+
s.dispose();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function diagRange(d) {
|
|
92
|
+
if (d.severity !== DiagnosticSeverity.Error) {
|
|
93
|
+
return d.range;
|
|
94
|
+
}
|
|
95
|
+
if (d.fullRange === undefined) {
|
|
96
|
+
return d.range;
|
|
97
|
+
}
|
|
98
|
+
return d.fullRange;
|
|
99
|
+
}
|
|
100
|
+
function inclusiveEndLine(r) {
|
|
101
|
+
if (r.start.line === r.end.line) {
|
|
102
|
+
return r.end.line;
|
|
103
|
+
}
|
|
104
|
+
if (r.end.character === 0) {
|
|
105
|
+
return r.end.line - 1;
|
|
106
|
+
}
|
|
107
|
+
return r.end.line;
|
|
108
|
+
}
|
|
109
|
+
function diagStartKindPrio(kind) {
|
|
110
|
+
switch (kind) {
|
|
111
|
+
case 'Error':
|
|
112
|
+
return 2;
|
|
113
|
+
case 'Warning':
|
|
114
|
+
return 1;
|
|
115
|
+
case 'GoalsAccomplished':
|
|
116
|
+
return 0;
|
|
56
117
|
}
|
|
57
118
|
}
|
|
119
|
+
function diagStartRangePrio(range) {
|
|
120
|
+
switch (range) {
|
|
121
|
+
case 'SingleLine':
|
|
122
|
+
return 0;
|
|
123
|
+
case 'MultiLine':
|
|
124
|
+
return 1;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function mergeDiagStarts(a, b) {
|
|
128
|
+
if (a === 'None') {
|
|
129
|
+
return b;
|
|
130
|
+
}
|
|
131
|
+
if (b === 'None') {
|
|
132
|
+
return a;
|
|
133
|
+
}
|
|
134
|
+
const kind = diagStartKindPrio(a.kind) >= diagStartKindPrio(b.kind) ? a.kind : b.kind;
|
|
135
|
+
const range = diagStartRangePrio(a.range) >= diagStartRangePrio(b.range) ? a.range : b.range;
|
|
136
|
+
return {
|
|
137
|
+
kind,
|
|
138
|
+
range,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function mergeDiagnosticGutterDecos(a, b) {
|
|
142
|
+
assert(a.line === b.line);
|
|
143
|
+
const line = a.line;
|
|
144
|
+
const diagStart = mergeDiagStarts(a.diagStart, b.diagStart);
|
|
145
|
+
const isPreviousDiagContinue = a.isPreviousDiagContinue || b.isPreviousDiagContinue;
|
|
146
|
+
const isPreviousDiagEnd = a.isPreviousDiagEnd || b.isPreviousDiagEnd;
|
|
147
|
+
return {
|
|
148
|
+
line,
|
|
149
|
+
diagStart,
|
|
150
|
+
isPreviousDiagContinue,
|
|
151
|
+
isPreviousDiagEnd,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function isGoalsAccomplishedDiagnostic(d) {
|
|
155
|
+
return d.leanTags !== undefined && d.leanTags.some(t => t === LeanTag.GoalsAccomplished);
|
|
156
|
+
}
|
|
157
|
+
function determineDiagStart(d, startLine, endLine, line) {
|
|
158
|
+
if (line !== startLine) {
|
|
159
|
+
return 'None';
|
|
160
|
+
}
|
|
161
|
+
if (d.severity === DiagnosticSeverity.Error) {
|
|
162
|
+
return {
|
|
163
|
+
kind: 'Error',
|
|
164
|
+
range: startLine === endLine ? 'SingleLine' : 'MultiLine',
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
else if (d.severity === DiagnosticSeverity.Warning) {
|
|
168
|
+
return {
|
|
169
|
+
kind: 'Warning',
|
|
170
|
+
range: 'SingleLine',
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
else if (isGoalsAccomplishedDiagnostic(d)) {
|
|
174
|
+
return {
|
|
175
|
+
kind: 'GoalsAccomplished',
|
|
176
|
+
range: 'SingleLine',
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
throw new Error();
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
function determineDiagnosticGutterDeco(d, startLine, endLine, line) {
|
|
184
|
+
const diagStart = determineDiagStart(d, startLine, endLine, line);
|
|
185
|
+
if (diagStart !== 'None') {
|
|
186
|
+
return {
|
|
187
|
+
line,
|
|
188
|
+
diagStart,
|
|
189
|
+
isPreviousDiagContinue: false,
|
|
190
|
+
isPreviousDiagEnd: false,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
line,
|
|
195
|
+
diagStart,
|
|
196
|
+
isPreviousDiagContinue: line < endLine,
|
|
197
|
+
isPreviousDiagEnd: line === endLine,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
function updateDecos(decos, deco) {
|
|
201
|
+
const oldDeco = decos.get(deco.line);
|
|
202
|
+
if (oldDeco === undefined) {
|
|
203
|
+
decos.set(deco.line, deco);
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
const mergedDeco = mergeDiagnosticGutterDecos(oldDeco, deco);
|
|
207
|
+
decos.set(deco.line, mergedDeco);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
const diagnosticGutterDecoKinds = [
|
|
211
|
+
'error',
|
|
212
|
+
'error-init',
|
|
213
|
+
'error-i',
|
|
214
|
+
'error-i-passthrough',
|
|
215
|
+
'error-l',
|
|
216
|
+
'error-l-passthrough',
|
|
217
|
+
'error-t',
|
|
218
|
+
'error-t-passthrough',
|
|
219
|
+
'warning',
|
|
220
|
+
'warning-i-passthrough',
|
|
221
|
+
'warning-l-passthrough',
|
|
222
|
+
'warning-t-passthrough',
|
|
223
|
+
'goals-accomplished-checkmark',
|
|
224
|
+
'goals-accomplished-checkmark-i-passthrough',
|
|
225
|
+
'goals-accomplished-checkmark-l-passthrough',
|
|
226
|
+
'goals-accomplished-checkmark-t-passthrough',
|
|
227
|
+
'goals-accomplished-circled-checkmark',
|
|
228
|
+
'goals-accomplished-circled-checkmark-i-passthrough',
|
|
229
|
+
'goals-accomplished-circled-checkmark-l-passthrough',
|
|
230
|
+
'goals-accomplished-circled-checkmark-t-passthrough',
|
|
231
|
+
'goals-accomplished-octopus',
|
|
232
|
+
'goals-accomplished-octopus-i-passthrough',
|
|
233
|
+
'goals-accomplished-octopus-l-passthrough',
|
|
234
|
+
'goals-accomplished-octopus-t-passthrough',
|
|
235
|
+
'goals-accomplished-tada',
|
|
236
|
+
'goals-accomplished-tada-i-passthrough',
|
|
237
|
+
'goals-accomplished-tada-l-passthrough',
|
|
238
|
+
'goals-accomplished-tada-t-passthrough',
|
|
239
|
+
];
|
|
58
240
|
export class LeanTaskGutter {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
241
|
+
context;
|
|
242
|
+
processingDecorationType;
|
|
243
|
+
fatalErrorDecorationType;
|
|
244
|
+
unsolvedGoalsDecorationType;
|
|
245
|
+
diagnosticGutterDecorationTypes = new Map();
|
|
246
|
+
gutters = new Map();
|
|
62
247
|
subscriptions = [];
|
|
248
|
+
showDiagnosticGutterDecorations = true;
|
|
249
|
+
goalsAccomplishedDecorationKind;
|
|
250
|
+
showUnsolvedGoalsDecoration = true;
|
|
63
251
|
constructor(client, context) {
|
|
64
|
-
this.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
252
|
+
this.context = context;
|
|
253
|
+
this.processingDecorationType = window.createTextEditorDecorationType({
|
|
254
|
+
overviewRulerLane: OverviewRulerLane.Left,
|
|
255
|
+
overviewRulerColor: 'rgba(255, 165, 0, 0.5)',
|
|
256
|
+
dark: {
|
|
257
|
+
gutterIconPath: context.asAbsolutePath('media/progress-dark.svg'),
|
|
258
|
+
gutterIconSize: 'contain',
|
|
259
|
+
},
|
|
260
|
+
light: {
|
|
261
|
+
gutterIconPath: context.asAbsolutePath('media/progress-light.svg'),
|
|
262
|
+
gutterIconSize: 'contain',
|
|
263
|
+
},
|
|
264
|
+
});
|
|
265
|
+
this.fatalErrorDecorationType = window.createTextEditorDecorationType({
|
|
266
|
+
overviewRulerLane: OverviewRulerLane.Left,
|
|
267
|
+
overviewRulerColor: 'rgba(255, 0, 0, 0.5)',
|
|
268
|
+
dark: {
|
|
269
|
+
gutterIconPath: context.asAbsolutePath('media/progress-error-dark.svg'),
|
|
270
|
+
gutterIconSize: 'contain',
|
|
271
|
+
},
|
|
272
|
+
light: {
|
|
273
|
+
gutterIconPath: context.asAbsolutePath('media/progress-error-light.svg'),
|
|
274
|
+
gutterIconSize: 'contain',
|
|
275
|
+
},
|
|
276
|
+
});
|
|
277
|
+
this.unsolvedGoalsDecorationType = window.createTextEditorDecorationType({
|
|
278
|
+
dark: {
|
|
279
|
+
after: {
|
|
280
|
+
contentText: '🛠',
|
|
281
|
+
color: unsolvedGoalsDecorationDarkThemeColor(),
|
|
282
|
+
margin: '0 0 0 1ch',
|
|
70
283
|
},
|
|
71
|
-
|
|
72
|
-
|
|
284
|
+
},
|
|
285
|
+
light: {
|
|
286
|
+
after: {
|
|
287
|
+
contentText: '🛠',
|
|
288
|
+
color: unsolvedGoalsDecorationLightThemeColor(),
|
|
289
|
+
margin: '0 0 0 1ch',
|
|
73
290
|
},
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
window.createTextEditorDecorationType({
|
|
80
|
-
overviewRulerLane: OverviewRulerLane.Left,
|
|
81
|
-
overviewRulerColor: 'rgba(255, 0, 0, 0.5)',
|
|
291
|
+
},
|
|
292
|
+
isWholeLine: true,
|
|
293
|
+
});
|
|
294
|
+
for (const kind of diagnosticGutterDecoKinds) {
|
|
295
|
+
this.diagnosticGutterDecorationTypes.set(kind, window.createTextEditorDecorationType({
|
|
82
296
|
dark: {
|
|
83
|
-
gutterIconPath: context.asAbsolutePath(
|
|
297
|
+
gutterIconPath: this.context.asAbsolutePath(`media/diagnostic-gutter-icons/${kind}-dark.svg`),
|
|
298
|
+
gutterIconSize: '100%',
|
|
84
299
|
},
|
|
85
300
|
light: {
|
|
86
|
-
gutterIconPath: context.asAbsolutePath(
|
|
301
|
+
gutterIconPath: this.context.asAbsolutePath(`media/diagnostic-gutter-icons/${kind}-light.svg`),
|
|
302
|
+
gutterIconSize: '100%',
|
|
87
303
|
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
this.
|
|
94
|
-
this.
|
|
304
|
+
}));
|
|
305
|
+
}
|
|
306
|
+
this.checkContext();
|
|
307
|
+
this.subscriptions.push(this.processingDecorationType, this.fatalErrorDecorationType, this.unsolvedGoalsDecorationType, lean.onDidCloseLeanDocument(doc => {
|
|
308
|
+
const uri = doc.extUri.toString();
|
|
309
|
+
this.gutters.get(uri)?.dispose();
|
|
310
|
+
this.gutters.delete(uri);
|
|
311
|
+
}), lean.onDidRevealLeanEditor(editor => this.onDidReveal(editor)), window.onDidChangeActiveColorTheme(() => this.onDidChangeColorTheme()), extensions.onDidChange(() => this.checkContext()), workspace.onDidChangeConfiguration(() => this.checkContext()), client.progressChanged(([uri, processingInfos]) => {
|
|
312
|
+
const extUri = parseExtUri(uri);
|
|
313
|
+
if (extUri === undefined) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
this.onProgressChanged(extUri, processingInfos);
|
|
317
|
+
}), client.diagnosticsChanged(params => {
|
|
318
|
+
const extUri = parseExtUri(params.uri);
|
|
319
|
+
if (extUri === undefined) {
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
this.onDiagnosticsChanged(extUri, params.diagnostics);
|
|
95
323
|
}));
|
|
96
324
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
325
|
+
checkContext() {
|
|
326
|
+
// Use the error lens gutter for diagnostics if it is enabled.
|
|
327
|
+
const errorLensExtensions = extensions.getExtension('usernamehw.errorlens');
|
|
328
|
+
const isErrorLensGutterEnabled = errorLensExtensions !== undefined &&
|
|
329
|
+
errorLensExtensions.isActive &&
|
|
330
|
+
workspace.getConfiguration('errorLens').get('gutterIconsEnabled', false);
|
|
331
|
+
this.showDiagnosticGutterDecorations = !isErrorLensGutterEnabled && showDiagnosticGutterDecorations();
|
|
332
|
+
this.goalsAccomplishedDecorationKind = goalsAccomplishedDecorationKind();
|
|
333
|
+
this.showUnsolvedGoalsDecoration = showUnsolvedGoalsDecoration();
|
|
334
|
+
if (!this.showDiagnosticGutterDecorations) {
|
|
335
|
+
for (const gutter of this.gutters.values()) {
|
|
336
|
+
gutter.clear([...this.diagnosticGutterDecorationTypes.values()]);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
if (!this.showUnsolvedGoalsDecoration) {
|
|
340
|
+
for (const gutter of this.gutters.values()) {
|
|
341
|
+
gutter.clear([this.unsolvedGoalsDecorationType]);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
getGutter(uri) {
|
|
346
|
+
const uriKey = uri.toString();
|
|
347
|
+
if (!this.gutters.has(uriKey)) {
|
|
348
|
+
const newGutter = new LeanFileTaskGutter(uri);
|
|
349
|
+
this.gutters.set(uriKey, newGutter);
|
|
350
|
+
return newGutter;
|
|
351
|
+
}
|
|
352
|
+
return this.gutters.get(uriKey);
|
|
353
|
+
}
|
|
354
|
+
onDidChangeColorTheme() {
|
|
355
|
+
for (const leanEditor of lean.visibleLeanEditors) {
|
|
356
|
+
this.getGutter(leanEditor.documentExtUri).onDidReveal();
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
onDidReveal(leanEditor) {
|
|
360
|
+
this.getGutter(leanEditor.documentExtUri).onDidReveal();
|
|
361
|
+
}
|
|
362
|
+
onProgressChanged(uri, processingInfos) {
|
|
363
|
+
const processingState = {
|
|
364
|
+
type: this.processingDecorationType,
|
|
365
|
+
prio: 1,
|
|
366
|
+
kind: 'Instantaneous',
|
|
367
|
+
decos: processingInfos
|
|
368
|
+
.filter(i => i.kind === undefined || i.kind === LeanFileProgressKind.Processing)
|
|
369
|
+
.map(i => ({
|
|
370
|
+
range: new CodeRange(i.range.start.line, 0, i.range.end.line, 0),
|
|
371
|
+
hoverMessage: 'Processing ...',
|
|
372
|
+
})),
|
|
373
|
+
};
|
|
374
|
+
const fatalErrorState = {
|
|
375
|
+
type: this.fatalErrorDecorationType,
|
|
376
|
+
prio: 1,
|
|
377
|
+
kind: 'Instantaneous',
|
|
378
|
+
decos: processingInfos
|
|
379
|
+
.filter(i => i.kind === LeanFileProgressKind.FatalError)
|
|
380
|
+
.map(i => ({
|
|
381
|
+
range: new CodeRange(i.range.start.line, 0, i.range.end.line, 0),
|
|
382
|
+
hoverMessage: 'Processing stopped',
|
|
383
|
+
})),
|
|
384
|
+
};
|
|
385
|
+
this.getGutter(uri).onDidUpdateState([processingState, fatalErrorState]);
|
|
386
|
+
}
|
|
387
|
+
onDiagnosticsChanged(uri, diagnostics) {
|
|
388
|
+
const decoStates = [];
|
|
389
|
+
if (this.showDiagnosticGutterDecorations) {
|
|
390
|
+
decoStates.push(...this.computeDiagnosticGutterDecoStates(diagnostics));
|
|
391
|
+
}
|
|
392
|
+
if (this.showUnsolvedGoalsDecoration) {
|
|
393
|
+
decoStates.push(this.computeUnsolvedGoalsDecoState(diagnostics));
|
|
394
|
+
}
|
|
395
|
+
this.getGutter(uri).onDidUpdateState(decoStates);
|
|
396
|
+
}
|
|
397
|
+
computeDiagnosticGutterDecoStates(diagnostics) {
|
|
398
|
+
const decoStates = new Map();
|
|
399
|
+
for (const [kind, type] of this.diagnosticGutterDecorationTypes.entries()) {
|
|
400
|
+
decoStates.set(kind, {
|
|
401
|
+
type,
|
|
402
|
+
prio: 0,
|
|
403
|
+
kind: 'Instantaneous',
|
|
404
|
+
decos: [],
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
const decos = this.computeDiagnosticGutterDecos(diagnostics);
|
|
408
|
+
for (const deco of decos) {
|
|
409
|
+
const kind = this.determineDiagnosticGutterDecoKind(deco);
|
|
410
|
+
if (kind === undefined) {
|
|
101
411
|
continue;
|
|
102
|
-
const uri = editor.document.uri.toString();
|
|
103
|
-
uris[uri] = true;
|
|
104
|
-
const processed = uri in this.status ? this.status[uri] : [];
|
|
105
|
-
if (this.gutters[uri]) {
|
|
106
|
-
const gutter = this.gutters[uri];
|
|
107
|
-
if (gutter)
|
|
108
|
-
gutter.setProcessed(processed);
|
|
109
412
|
}
|
|
110
|
-
|
|
111
|
-
|
|
413
|
+
decoStates.get(kind).decos.push({
|
|
414
|
+
range: new CodeRange(deco.line, 0, deco.line, 0),
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
return [...decoStates.values()];
|
|
418
|
+
}
|
|
419
|
+
computeDiagnosticGutterDecos(diagnostics) {
|
|
420
|
+
const decos = new Map();
|
|
421
|
+
for (const d of diagnostics) {
|
|
422
|
+
if (!this.isGutterDecoDiagnostic(d)) {
|
|
423
|
+
continue;
|
|
424
|
+
}
|
|
425
|
+
const range = diagRange(d);
|
|
426
|
+
const startLine = range.start.line;
|
|
427
|
+
const endLine = inclusiveEndLine(range);
|
|
428
|
+
const startDeco = determineDiagnosticGutterDeco(d, startLine, endLine, startLine);
|
|
429
|
+
updateDecos(decos, startDeco);
|
|
430
|
+
if (startDeco.diagStart !== 'None' && startDeco.diagStart.range === 'SingleLine') {
|
|
431
|
+
continue;
|
|
112
432
|
}
|
|
433
|
+
for (let line = startLine + 1; line <= endLine; line++) {
|
|
434
|
+
const deco = determineDiagnosticGutterDeco(d, startLine, endLine, line);
|
|
435
|
+
updateDecos(decos, deco);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
const result = [...decos.values()];
|
|
439
|
+
result.sort((a, b) => a.line - b.line);
|
|
440
|
+
return result;
|
|
441
|
+
}
|
|
442
|
+
isGutterDecoDiagnostic(d) {
|
|
443
|
+
return (d.severity === DiagnosticSeverity.Error ||
|
|
444
|
+
d.severity === DiagnosticSeverity.Warning ||
|
|
445
|
+
(isGoalsAccomplishedDiagnostic(d) && this.goalsAccomplishedDecorationKind !== 'Off'));
|
|
446
|
+
}
|
|
447
|
+
getGoalsAccomplishedDiagnosticGutterDecoKindName() {
|
|
448
|
+
const configName = this.goalsAccomplishedDecorationKind;
|
|
449
|
+
if (configName === 'Double Checkmark') {
|
|
450
|
+
return 'goals-accomplished-checkmark';
|
|
451
|
+
}
|
|
452
|
+
if (configName === 'Circled Checkmark') {
|
|
453
|
+
return 'goals-accomplished-circled-checkmark';
|
|
454
|
+
}
|
|
455
|
+
if (configName === 'Octopus') {
|
|
456
|
+
return 'goals-accomplished-octopus';
|
|
457
|
+
}
|
|
458
|
+
if (configName === 'Tada') {
|
|
459
|
+
return 'goals-accomplished-tada';
|
|
113
460
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
461
|
+
return 'goals-accomplished-checkmark';
|
|
462
|
+
}
|
|
463
|
+
determineSingleLineDiagnosticGutterDecoKind(d, name) {
|
|
464
|
+
const c = d.isPreviousDiagContinue;
|
|
465
|
+
const e = d.isPreviousDiagEnd;
|
|
466
|
+
if (!c && !e) {
|
|
467
|
+
return name;
|
|
468
|
+
}
|
|
469
|
+
if (!c && e) {
|
|
470
|
+
return `${name}-l-passthrough`;
|
|
471
|
+
}
|
|
472
|
+
if (c && !e) {
|
|
473
|
+
return `${name}-i-passthrough`;
|
|
474
|
+
}
|
|
475
|
+
if (c && e) {
|
|
476
|
+
return `${name}-t-passthrough`;
|
|
477
|
+
}
|
|
478
|
+
assert(false);
|
|
479
|
+
}
|
|
480
|
+
determineDiagnosticGutterDecoKind(d) {
|
|
481
|
+
const s = d.diagStart;
|
|
482
|
+
const c = d.isPreviousDiagContinue;
|
|
483
|
+
const e = d.isPreviousDiagEnd;
|
|
484
|
+
if (s !== 'None') {
|
|
485
|
+
const k = s.kind;
|
|
486
|
+
const r = s.range;
|
|
487
|
+
if (k === 'Error') {
|
|
488
|
+
if (!c && !e) {
|
|
489
|
+
if (r === 'SingleLine') {
|
|
490
|
+
return 'error';
|
|
491
|
+
}
|
|
492
|
+
if (r === 'MultiLine') {
|
|
493
|
+
return 'error-init';
|
|
494
|
+
}
|
|
495
|
+
r;
|
|
496
|
+
}
|
|
497
|
+
if (!c && e) {
|
|
498
|
+
if (r === 'SingleLine') {
|
|
499
|
+
return 'error-l-passthrough';
|
|
500
|
+
}
|
|
501
|
+
if (r === 'MultiLine') {
|
|
502
|
+
return 'error-t-passthrough';
|
|
503
|
+
}
|
|
504
|
+
r;
|
|
505
|
+
}
|
|
506
|
+
if (c && !e) {
|
|
507
|
+
// All designs I can think of that would distinguish `SingleLine` and `MultiLine` in this case
|
|
508
|
+
// have too much visual complexity for the small gutter.
|
|
509
|
+
return 'error-i-passthrough';
|
|
510
|
+
}
|
|
511
|
+
if (c && e) {
|
|
512
|
+
// All designs I can think of that would distinguish `SingleLine` and `MultiLine` in this case
|
|
513
|
+
// have too much visual complexity for the small gutter.
|
|
514
|
+
return 'error-t-passthrough';
|
|
515
|
+
}
|
|
516
|
+
assert(false);
|
|
517
|
+
}
|
|
518
|
+
if (k === 'Warning') {
|
|
519
|
+
return this.determineSingleLineDiagnosticGutterDecoKind(d, 'warning');
|
|
520
|
+
}
|
|
521
|
+
if (k === 'GoalsAccomplished') {
|
|
522
|
+
return this.determineSingleLineDiagnosticGutterDecoKind(d, this.getGoalsAccomplishedDiagnosticGutterDecoKindName());
|
|
119
523
|
}
|
|
524
|
+
k;
|
|
120
525
|
}
|
|
526
|
+
assert(s === 'None');
|
|
527
|
+
if (!c && !e) {
|
|
528
|
+
return undefined;
|
|
529
|
+
}
|
|
530
|
+
if (!c && e) {
|
|
531
|
+
return 'error-l';
|
|
532
|
+
}
|
|
533
|
+
if (c && !e) {
|
|
534
|
+
return 'error-i';
|
|
535
|
+
}
|
|
536
|
+
if (c && e) {
|
|
537
|
+
return 'error-t';
|
|
538
|
+
}
|
|
539
|
+
assert(false);
|
|
540
|
+
}
|
|
541
|
+
computeUnsolvedGoalsDecoState(diagnostics) {
|
|
542
|
+
const unsolvedGoalsLines = diagnostics
|
|
543
|
+
.filter(d => {
|
|
544
|
+
return d.leanTags?.some(t => t === LeanTag.UnsolvedGoals);
|
|
545
|
+
})
|
|
546
|
+
.map(d => {
|
|
547
|
+
const range = diagRange(d);
|
|
548
|
+
return inclusiveEndLine(range);
|
|
549
|
+
});
|
|
550
|
+
return {
|
|
551
|
+
type: this.unsolvedGoalsDecorationType,
|
|
552
|
+
prio: 0,
|
|
553
|
+
kind: 'EditDelayed',
|
|
554
|
+
decos: unsolvedGoalsLines.map(line => ({
|
|
555
|
+
range: new CodeRange(line, 0, line, 0),
|
|
556
|
+
})),
|
|
557
|
+
};
|
|
121
558
|
}
|
|
122
559
|
dispose() {
|
|
123
|
-
for (const
|
|
124
|
-
|
|
560
|
+
for (const gutter of this.gutters.values()) {
|
|
561
|
+
gutter.dispose();
|
|
562
|
+
}
|
|
563
|
+
for (const t of this.diagnosticGutterDecorationTypes.values()) {
|
|
564
|
+
t.dispose();
|
|
125
565
|
}
|
|
126
566
|
for (const s of this.subscriptions) {
|
|
127
567
|
s.dispose();
|