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.
Files changed (209) hide show
  1. package/README.md +75 -0
  2. package/dist/JuliaMono-Regular.ttf +0 -0
  3. package/dist/css/custom.css +7 -1
  4. package/dist/infowebview.d.ts +3 -4
  5. package/dist/infowebview.js +4 -4
  6. package/dist/lean4-infoview/codicon.ttf +0 -0
  7. package/dist/lean4-infoview/esm-shims/react-dom.d.ts +5 -0
  8. package/dist/lean4-infoview/esm-shims/react-jsx-runtime.d.ts +5 -0
  9. package/dist/lean4-infoview/esm-shims/react.d.ts +5 -0
  10. package/dist/lean4-infoview/index.css +4161 -0
  11. package/dist/lean4-infoview/index.d.ts +16 -0
  12. package/dist/lean4-infoview/index.development.js +37312 -0
  13. package/dist/lean4-infoview/index.production.min.js +1528 -0
  14. package/dist/lean4-infoview/infoview/collapsing.d.ts +12 -0
  15. package/dist/lean4-infoview/infoview/contexts.d.ts +10 -0
  16. package/dist/lean4-infoview/infoview/editorConnection.d.ts +22 -0
  17. package/dist/lean4-infoview/infoview/errors.d.ts +14 -0
  18. package/dist/lean4-infoview/infoview/event.d.ts +33 -0
  19. package/dist/lean4-infoview/infoview/goalLocation.d.ts +61 -0
  20. package/dist/lean4-infoview/infoview/goals.d.ts +46 -0
  21. package/dist/lean4-infoview/infoview/info.d.ts +18 -0
  22. package/dist/lean4-infoview/infoview/infos.d.ts +2 -0
  23. package/dist/lean4-infoview/infoview/interactiveCode.d.ts +19 -0
  24. package/dist/lean4-infoview/infoview/main.d.ts +13 -0
  25. package/dist/lean4-infoview/infoview/messages.d.ts +19 -0
  26. package/dist/lean4-infoview/infoview/rpcSessions.d.ts +11 -0
  27. package/dist/lean4-infoview/infoview/serverVersion.d.ts +10 -0
  28. package/dist/lean4-infoview/infoview/tooltips.d.ts +32 -0
  29. package/dist/lean4-infoview/infoview/traceExplorer.d.ts +11 -0
  30. package/dist/lean4-infoview/infoview/userWidget.d.ts +39 -0
  31. package/dist/lean4-infoview/infoview/util.d.ts +144 -0
  32. package/dist/lean4-infoview/loader.d.ts +20 -0
  33. package/dist/lean4-infoview/loader.development.js +1006 -0
  34. package/dist/lean4-infoview/loader.production.min.js +1 -0
  35. package/dist/lean4-infoview/react-dom.development.js +30537 -0
  36. package/dist/lean4-infoview/react-dom.production.min.js +21 -0
  37. package/dist/lean4-infoview/react-jsx-runtime.development.js +1362 -0
  38. package/dist/lean4-infoview/react-jsx-runtime.production.min.js +1 -0
  39. package/dist/lean4-infoview/react.development.js +2823 -0
  40. package/dist/lean4-infoview/react.production.min.js +1 -0
  41. package/dist/leanmonaco.js +5 -4
  42. package/dist/monaco-lean4/vscode-lean4/package.json +944 -0
  43. package/dist/monaco-lean4/vscode-lean4/src/abbreviation/AbbreviationFeature.d.ts +9 -0
  44. package/dist/monaco-lean4/vscode-lean4/src/abbreviation/AbbreviationFeature.js +20 -0
  45. package/dist/monaco-lean4/vscode-lean4/src/abbreviation/AbbreviationHoverProvider.d.ts +12 -0
  46. package/dist/monaco-lean4/vscode-lean4/src/abbreviation/AbbreviationHoverProvider.js +40 -0
  47. package/dist/monaco-lean4/vscode-lean4/src/abbreviation/AbbreviationRewriterFeature.d.ts +20 -0
  48. package/dist/monaco-lean4/vscode-lean4/src/abbreviation/AbbreviationRewriterFeature.js +79 -0
  49. package/dist/monaco-lean4/vscode-lean4/src/abbreviation/VSCodeAbbreviationConfig.d.ts +13 -0
  50. package/dist/monaco-lean4/vscode-lean4/src/abbreviation/VSCodeAbbreviationConfig.js +29 -0
  51. package/dist/monaco-lean4/vscode-lean4/src/abbreviation/VSCodeAbbreviationRewriter.d.ts +28 -0
  52. package/dist/monaco-lean4/vscode-lean4/src/abbreviation/VSCodeAbbreviationRewriter.js +124 -0
  53. package/dist/monaco-lean4/vscode-lean4/src/config.d.ts +33 -0
  54. package/dist/monaco-lean4/vscode-lean4/src/config.js +119 -0
  55. package/dist/monaco-lean4/vscode-lean4/src/diagnostics/setupNotifs.d.ts +27 -0
  56. package/dist/monaco-lean4/vscode-lean4/src/diagnostics/setupNotifs.js +133 -0
  57. package/dist/monaco-lean4/vscode-lean4/src/infoview.d.ts +69 -0
  58. package/dist/monaco-lean4/vscode-lean4/src/infoview.js +711 -0
  59. package/dist/monaco-lean4/vscode-lean4/src/leanclient.d.ts +67 -0
  60. package/dist/monaco-lean4/vscode-lean4/src/leanclient.js +443 -0
  61. package/dist/monaco-lean4/vscode-lean4/src/rpc.d.ts +16 -0
  62. package/dist/monaco-lean4/vscode-lean4/src/rpc.js +102 -0
  63. package/dist/monaco-lean4/vscode-lean4/src/taskgutter.d.ts +11 -0
  64. package/dist/monaco-lean4/vscode-lean4/src/taskgutter.js +130 -0
  65. package/dist/monaco-lean4/vscode-lean4/src/utils/batch.d.ts +37 -0
  66. package/dist/monaco-lean4/vscode-lean4/src/utils/batch.js +203 -0
  67. package/dist/monaco-lean4/vscode-lean4/src/utils/clientProvider.d.ts +41 -0
  68. package/dist/monaco-lean4/vscode-lean4/src/utils/clientProvider.js +205 -0
  69. package/dist/monaco-lean4/vscode-lean4/src/utils/converters.d.ts +16 -0
  70. package/dist/monaco-lean4/vscode-lean4/src/utils/converters.js +129 -0
  71. package/dist/monaco-lean4/vscode-lean4/src/utils/elan.d.ts +3 -0
  72. package/dist/monaco-lean4/vscode-lean4/src/utils/elan.js +4 -0
  73. package/dist/monaco-lean4/vscode-lean4/src/utils/envPath.d.ts +21 -0
  74. package/dist/monaco-lean4/vscode-lean4/src/utils/envPath.js +53 -0
  75. package/dist/monaco-lean4/vscode-lean4/src/utils/exturi.d.ts +35 -0
  76. package/dist/monaco-lean4/vscode-lean4/src/utils/exturi.js +136 -0
  77. package/dist/monaco-lean4/vscode-lean4/src/utils/fsHelper.d.ts +17 -0
  78. package/dist/monaco-lean4/vscode-lean4/src/utils/fsHelper.js +36 -0
  79. package/dist/monaco-lean4/vscode-lean4/src/utils/leanInstaller.d.ts +37 -0
  80. package/dist/monaco-lean4/vscode-lean4/src/utils/leanInstaller.js +210 -0
  81. package/dist/monaco-lean4/vscode-lean4/src/utils/logger.d.ts +7 -0
  82. package/dist/monaco-lean4/vscode-lean4/src/utils/logger.js +20 -0
  83. package/dist/monaco-lean4/vscode-lean4/src/utils/notifs.d.ts +24 -0
  84. package/dist/monaco-lean4/vscode-lean4/src/utils/notifs.js +110 -0
  85. package/dist/monaco-lean4/vscode-lean4/src/utils/projectInfo.d.ts +9 -0
  86. package/dist/monaco-lean4/vscode-lean4/src/utils/projectInfo.js +125 -0
  87. package/dist/monacoleanclient.d.ts +1 -2
  88. package/dist/monacoleanclient.js +3 -3
  89. package/dist/vscode-lean4/lean4-infoview/package.json +25 -23
  90. package/dist/vscode-lean4/lean4-infoview/src/infoview/highlightjs.css +210 -0
  91. package/dist/vscode-lean4/lean4-infoview/tsconfig.json +6 -2
  92. package/dist/vscode-lean4/lean4-infoview-api/package.json +1 -1
  93. package/dist/vscode-lean4/lean4-unicode-input/package.json +1 -1
  94. package/dist/vscode-lean4/lean4-unicode-input/src/abbreviations.json +12 -12
  95. package/dist/vscode-lean4/lean4-unicode-input-component/package.json +2 -2
  96. package/dist/vscode-lean4/package-lock.json +6129 -3245
  97. package/dist/vscode-lean4/vscode-lean4/language-configuration.json +1 -1
  98. package/dist/vscode-lean4/vscode-lean4/loogleview/static/index.css +19 -16
  99. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-dark.svg +91 -0
  100. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-i-dark.svg +114 -0
  101. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-i-light.svg +114 -0
  102. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-i-passthrough-dark.svg +109 -0
  103. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-i-passthrough-light.svg +109 -0
  104. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-init-dark.svg +100 -0
  105. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-init-light.svg +100 -0
  106. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-l-dark.svg +123 -0
  107. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-l-light.svg +123 -0
  108. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-l-passthrough-dark.svg +109 -0
  109. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-l-passthrough-light.svg +109 -0
  110. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-light.svg +91 -0
  111. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-t-dark.svg +123 -0
  112. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-t-light.svg +123 -0
  113. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-t-passthrough-dark.svg +118 -0
  114. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/error-t-passthrough-light.svg +118 -0
  115. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-checkmark-dark.svg +138 -0
  116. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-checkmark-i-passthrough-dark.svg +160 -0
  117. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-checkmark-i-passthrough-light.svg +160 -0
  118. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-checkmark-l-passthrough-dark.svg +158 -0
  119. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-checkmark-l-passthrough-light.svg +158 -0
  120. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-checkmark-light.svg +138 -0
  121. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-checkmark-t-passthrough-dark.svg +169 -0
  122. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-checkmark-t-passthrough-light.svg +169 -0
  123. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-circled-checkmark-dark.svg +147 -0
  124. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-circled-checkmark-i-passthrough-dark.svg +170 -0
  125. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-circled-checkmark-i-passthrough-light.svg +170 -0
  126. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-circled-checkmark-l-passthrough-dark.svg +167 -0
  127. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-circled-checkmark-l-passthrough-light.svg +167 -0
  128. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-circled-checkmark-light.svg +147 -0
  129. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-circled-checkmark-t-passthrough-dark.svg +179 -0
  130. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-circled-checkmark-t-passthrough-light.svg +179 -0
  131. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-octopus-dark.svg +165 -0
  132. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-octopus-i-passthrough-dark.svg +187 -0
  133. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-octopus-i-passthrough-light.svg +187 -0
  134. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-octopus-l-passthrough-dark.svg +185 -0
  135. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-octopus-l-passthrough-light.svg +185 -0
  136. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-octopus-light.svg +165 -0
  137. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-octopus-t-passthrough-dark.svg +196 -0
  138. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-octopus-t-passthrough-light.svg +196 -0
  139. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-tada-dark.svg +184 -0
  140. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-tada-i-passthrough-dark.svg +206 -0
  141. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-tada-i-passthrough-light.svg +206 -0
  142. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-tada-l-passthrough-dark.svg +204 -0
  143. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-tada-l-passthrough-light.svg +204 -0
  144. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-tada-light.svg +184 -0
  145. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-tada-t-passthrough-dark.svg +215 -0
  146. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/goals-accomplished-tada-t-passthrough-light.svg +215 -0
  147. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/warning-dark.svg +132 -0
  148. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/warning-i-passthrough-dark.svg +154 -0
  149. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/warning-i-passthrough-light.svg +154 -0
  150. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/warning-l-passthrough-dark.svg +152 -0
  151. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/warning-l-passthrough-light.svg +152 -0
  152. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/warning-light.svg +132 -0
  153. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/warning-t-passthrough-dark.svg +163 -0
  154. package/dist/vscode-lean4/vscode-lean4/media/diagnostic-gutter-icons/warning-t-passthrough-light.svg +163 -0
  155. package/dist/vscode-lean4/vscode-lean4/moogleview/static/index.css +198 -0
  156. package/dist/vscode-lean4/vscode-lean4/moogleview/tsconfig.json +10 -0
  157. package/dist/vscode-lean4/vscode-lean4/package.json +638 -18
  158. package/dist/vscode-lean4/vscode-lean4/src/abbreviation/AbbreviationFeature.d.ts +2 -2
  159. package/dist/vscode-lean4/vscode-lean4/src/abbreviation/AbbreviationFeature.js +2 -2
  160. package/dist/vscode-lean4/vscode-lean4/src/abbreviation/AbbreviationRewriterFeature.d.ts +2 -3
  161. package/dist/vscode-lean4/vscode-lean4/src/abbreviation/AbbreviationRewriterFeature.js +3 -5
  162. package/dist/vscode-lean4/vscode-lean4/src/abbreviation/VSCodeAbbreviationRewriter.d.ts +1 -2
  163. package/dist/vscode-lean4/vscode-lean4/src/abbreviation/VSCodeAbbreviationRewriter.js +4 -8
  164. package/dist/vscode-lean4/vscode-lean4/src/config.d.ts +14 -1
  165. package/dist/vscode-lean4/vscode-lean4/src/config.js +56 -5
  166. package/dist/vscode-lean4/vscode-lean4/src/diagnostics/setupDiagnoser.d.ts +36 -5
  167. package/dist/vscode-lean4/vscode-lean4/src/diagnostics/setupDiagnoser.js +59 -23
  168. package/dist/vscode-lean4/vscode-lean4/src/diagnostics/setupDiagnostics.d.ts +22 -17
  169. package/dist/vscode-lean4/vscode-lean4/src/diagnostics/setupDiagnostics.js +182 -119
  170. package/dist/vscode-lean4/vscode-lean4/src/diagnostics/setupNotifs.d.ts +33 -20
  171. package/dist/vscode-lean4/vscode-lean4/src/diagnostics/setupNotifs.js +235 -89
  172. package/dist/vscode-lean4/vscode-lean4/src/infoview.d.ts +7 -18
  173. package/dist/vscode-lean4/vscode-lean4/src/infoview.js +217 -102
  174. package/dist/vscode-lean4/vscode-lean4/src/leanclient.d.ts +12 -7
  175. package/dist/vscode-lean4/vscode-lean4/src/leanclient.js +187 -64
  176. package/dist/vscode-lean4/vscode-lean4/src/taskgutter.d.ts +35 -3
  177. package/dist/vscode-lean4/vscode-lean4/src/taskgutter.js +533 -93
  178. package/dist/vscode-lean4/vscode-lean4/src/utils/batch.d.ts +12 -4
  179. package/dist/vscode-lean4/vscode-lean4/src/utils/batch.js +78 -72
  180. package/dist/vscode-lean4/vscode-lean4/src/utils/clientProvider.d.ts +9 -9
  181. package/dist/vscode-lean4/vscode-lean4/src/utils/clientProvider.js +121 -77
  182. package/dist/vscode-lean4/vscode-lean4/src/utils/converters.d.ts +15 -0
  183. package/dist/vscode-lean4/vscode-lean4/src/utils/converters.js +9 -0
  184. package/dist/vscode-lean4/vscode-lean4/src/utils/elan.d.ts +179 -1
  185. package/dist/vscode-lean4/vscode-lean4/src/utils/elan.js +422 -3
  186. package/dist/vscode-lean4/vscode-lean4/src/utils/exturi.d.ts +3 -1
  187. package/dist/vscode-lean4/vscode-lean4/src/utils/exturi.js +11 -11
  188. package/dist/vscode-lean4/vscode-lean4/src/utils/groupBy.d.ts +2 -0
  189. package/dist/vscode-lean4/vscode-lean4/src/utils/groupBy.js +17 -0
  190. package/dist/vscode-lean4/vscode-lean4/src/utils/internalErrors.d.ts +2 -0
  191. package/dist/vscode-lean4/vscode-lean4/src/utils/internalErrors.js +35 -0
  192. package/dist/vscode-lean4/vscode-lean4/src/utils/leanCmdRunner.d.ts +34 -0
  193. package/dist/vscode-lean4/vscode-lean4/src/utils/leanCmdRunner.js +249 -0
  194. package/dist/vscode-lean4/vscode-lean4/src/utils/leanEditorProvider.d.ts +83 -0
  195. package/dist/vscode-lean4/vscode-lean4/src/utils/leanEditorProvider.js +323 -0
  196. package/dist/vscode-lean4/vscode-lean4/src/utils/leanInstaller.d.ts +41 -12
  197. package/dist/vscode-lean4/vscode-lean4/src/utils/leanInstaller.js +245 -128
  198. package/dist/vscode-lean4/vscode-lean4/src/utils/notifs.d.ts +27 -22
  199. package/dist/vscode-lean4/vscode-lean4/src/utils/notifs.js +177 -82
  200. package/dist/vscode-lean4/vscode-lean4/src/utils/projectInfo.d.ts +11 -4
  201. package/dist/vscode-lean4/vscode-lean4/src/utils/projectInfo.js +18 -16
  202. package/dist/vscode-lean4/vscode-lean4/src/utils/semverRegex.d.ts +1 -0
  203. package/dist/vscode-lean4/vscode-lean4/src/utils/semverRegex.js +2 -0
  204. package/dist/vscode-lean4/vscode-lean4/src/utils/viewColumn.d.ts +3 -0
  205. package/dist/vscode-lean4/vscode-lean4/src/utils/viewColumn.js +22 -0
  206. package/dist/vscode-lean4/vscode-lean4/tsconfig.json +2 -1
  207. package/dist/vscode-lean4/vscode-lean4/webview/tsconfig.json +3 -1
  208. package/dist/vscode.css +7 -0
  209. package/package.json +7 -5
@@ -1,127 +1,567 @@
1
1
  import { LeanFileProgressKind } from '@leanprover/infoview-api';
2
- import { OverviewRulerLane, Range, window } from 'vscode';
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
- decorations;
6
- processed;
11
+ editDelayMs = decorationEditDelay();
7
12
  timeout;
8
- constructor(uri, decorations, processed) {
13
+ editDelayTimeout;
14
+ lastEditTimestampMs;
15
+ subscriptions = [];
16
+ decorationStates = [];
17
+ constructor(uri) {
9
18
  this.uri = uri;
10
- this.decorations = decorations;
11
- this.processed = processed;
12
- this.schedule(100);
13
- }
14
- setProcessed(processed) {
15
- if (processed === this.processed)
16
- return;
17
- const oldProcessed = this.processed;
18
- this.processed = processed;
19
- if (processed === undefined) {
20
- this.processed = [];
21
- this.clearTimeout();
22
- this.updateDecos();
23
- }
24
- else if (this.timeout === undefined) {
25
- this.schedule(oldProcessed === undefined ? 500 : 20);
26
- }
27
- }
28
- schedule(ms) {
29
- this.timeout = setTimeout(() => {
30
- this.timeout = undefined;
31
- this.updateDecos();
32
- }, ms);
33
- }
34
- clearTimeout() {
35
- if (this.timeout !== undefined) {
36
- clearTimeout(this.timeout);
37
- this.timeout = undefined;
38
- }
39
- }
40
- updateDecos() {
41
- for (const editor of window.visibleTextEditors) {
42
- if (editor.document.uri.toString() === this.uri) {
43
- for (const [kind, [decoration, message]] of this.decorations) {
44
- editor.setDecorations(decoration, this.processed
45
- .filter(info => (info.kind === undefined ? LeanFileProgressKind.Processing : info.kind) === kind)
46
- .map(info => ({
47
- range: new Range(info.range.start.line, 0, info.range.end.line, 0),
48
- hoverMessage: message,
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.clearTimeout();
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
- decorations = new Map();
60
- status = {};
61
- gutters = {};
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.decorations.set(LeanFileProgressKind.Processing, [
65
- window.createTextEditorDecorationType({
66
- overviewRulerLane: OverviewRulerLane.Left,
67
- overviewRulerColor: 'rgba(255, 165, 0, 0.5)',
68
- dark: {
69
- gutterIconPath: context.asAbsolutePath('media/progress-dark.svg'),
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
- light: {
72
- gutterIconPath: context.asAbsolutePath('media/progress-light.svg'),
284
+ },
285
+ light: {
286
+ after: {
287
+ contentText: '🛠',
288
+ color: unsolvedGoalsDecorationLightThemeColor(),
289
+ margin: '0 0 0 1ch',
73
290
  },
74
- gutterIconSize: 'contain',
75
- }),
76
- 'busily processing...',
77
- ]);
78
- this.decorations.set(LeanFileProgressKind.FatalError, [
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('media/progress-error-dark.svg'),
297
+ gutterIconPath: this.context.asAbsolutePath(`media/diagnostic-gutter-icons/${kind}-dark.svg`),
298
+ gutterIconSize: '100%',
84
299
  },
85
300
  light: {
86
- gutterIconPath: context.asAbsolutePath('media/progress-error-light.svg'),
301
+ gutterIconPath: this.context.asAbsolutePath(`media/diagnostic-gutter-icons/${kind}-light.svg`),
302
+ gutterIconSize: '100%',
87
303
  },
88
- gutterIconSize: 'contain',
89
- }),
90
- 'processing stopped',
91
- ]);
92
- this.subscriptions.push(window.onDidChangeVisibleTextEditors(() => this.updateDecos()), client.progressChanged(([uri, processing]) => {
93
- this.status[uri] = processing;
94
- this.updateDecos();
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
- updateDecos() {
98
- const uris = {};
99
- for (const editor of window.visibleTextEditors) {
100
- if (editor.document.languageId !== 'lean4')
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
- else {
111
- this.gutters[uri] = new LeanFileTaskGutter(uri, this.decorations, processed);
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
- for (const uri of Object.getOwnPropertyNames(this.gutters)) {
115
- if (!uris[uri]) {
116
- this.gutters[uri]?.dispose();
117
- this.gutters[uri] = undefined;
118
- // TODO: also clear this.status for this uri ?
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 [decoration, _message] of this.decorations.values()) {
124
- decoration.dispose();
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();