@codingame/monaco-vscode-api 1.76.9 → 1.78.0-next.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 (332) hide show
  1. package/README.md +87 -49
  2. package/dist/Bibtex.tmLanguage.js +2 -0
  3. package/dist/Handlebars.tmLanguage.js +2 -0
  4. package/dist/JSON.tmLanguage.js +2 -0
  5. package/dist/JSONC.tmLanguage.js +2 -0
  6. package/dist/JavaScript.tmLanguage.js +2 -0
  7. package/dist/JavaScriptReact.tmLanguage.js +2 -0
  8. package/dist/LaTeX.tmLanguage.js +2 -0
  9. package/dist/MagicPython.tmLanguage.js +2 -0
  10. package/dist/MagicRegExp.tmLanguage.js +2 -0
  11. package/dist/Red-color-theme.js +2 -0
  12. package/dist/Regular Expressions (JavaScript).js +2 -0
  13. package/dist/TeX.tmLanguage.js +2 -0
  14. package/dist/TypeScript.tmLanguage.js +2 -0
  15. package/dist/TypeScriptReact.tmLanguage.js +2 -0
  16. package/dist/_.contribution.js +1 -1
  17. package/dist/abyss-color-theme.js +2 -0
  18. package/dist/api.js +1 -3
  19. package/dist/api2.js +421 -18091
  20. package/dist/asp-vb-net.tmlanguage.js +2 -0
  21. package/dist/assets/diffLineDeleted.mp3 +0 -0
  22. package/dist/assets/diffLineInserted.mp3 +0 -0
  23. package/dist/assets/diffLineModified.mp3 +0 -0
  24. package/dist/audioCue.js +108 -478
  25. package/dist/bat.js +9 -0
  26. package/dist/batchfile.js +2 -0
  27. package/dist/batchfile.tmLanguage.js +2 -0
  28. package/dist/button.js +35 -8
  29. package/dist/c.js +2 -0
  30. package/dist/c.tmLanguage.js +2 -0
  31. package/dist/clojure.js +8 -0
  32. package/dist/clojure.tmLanguage.js +2 -0
  33. package/dist/coffeescript.js +9 -0
  34. package/dist/coffeescript.tmLanguage.js +2 -0
  35. package/dist/coffeescript2.js +2 -0
  36. package/dist/configuration.d.ts +269 -4
  37. package/dist/configuration.js +4326 -328
  38. package/dist/configuration2.js +14 -324
  39. package/dist/cpp-grammar-bailout.tmLanguage.js +2 -0
  40. package/dist/cpp.embedded.macro.tmLanguage.js +2 -0
  41. package/dist/cpp.js +16 -0
  42. package/dist/cpp.tmLanguage.js +2 -0
  43. package/dist/cpp2.js +2 -0
  44. package/dist/csharp.js +9 -0
  45. package/dist/csharp.tmLanguage.js +2 -0
  46. package/dist/csharp2.js +2 -0
  47. package/dist/cshtml.tmLanguage.js +2 -0
  48. package/dist/css.js +8 -0
  49. package/dist/css.tmLanguage.js +2 -0
  50. package/dist/cuda-cpp.tmLanguage.js +2 -0
  51. package/dist/dark_plus.js +2 -0
  52. package/dist/dark_plus_experimental.js +2 -0
  53. package/dist/dark_vs.js +2 -0
  54. package/dist/dart.js +8 -0
  55. package/dist/dart.tmLanguage.js +2 -0
  56. package/dist/debug.js +12115 -12209
  57. package/dist/default-extensions/bat.js +12 -0
  58. package/dist/default-extensions/clojure.js +11 -0
  59. package/dist/default-extensions/coffeescript.js +12 -0
  60. package/dist/default-extensions/cpp.js +19 -0
  61. package/dist/default-extensions/csharp.js +12 -0
  62. package/dist/default-extensions/css.js +11 -0
  63. package/dist/default-extensions/dart.js +11 -0
  64. package/dist/default-extensions/diff.js +11 -0
  65. package/dist/default-extensions/docker.js +11 -0
  66. package/dist/default-extensions/fsharp.js +12 -0
  67. package/dist/default-extensions/go.js +11 -0
  68. package/dist/default-extensions/groovy.js +12 -0
  69. package/dist/default-extensions/handlebars.js +11 -0
  70. package/dist/default-extensions/hlsl.js +11 -0
  71. package/dist/default-extensions/html.js +13 -0
  72. package/dist/default-extensions/ini.js +13 -0
  73. package/dist/default-extensions/java.js +12 -0
  74. package/dist/default-extensions/javascript.js +17 -0
  75. package/dist/default-extensions/json.js +13 -0
  76. package/dist/default-extensions/julia.js +11 -0
  77. package/dist/default-extensions/latex.js +14 -0
  78. package/dist/default-extensions/less.js +11 -0
  79. package/dist/default-extensions/log.js +10 -0
  80. package/dist/default-extensions/lua.js +11 -0
  81. package/dist/default-extensions/make.js +11 -0
  82. package/dist/default-extensions/markdown-basics.js +12 -0
  83. package/dist/default-extensions/objective-c.js +13 -0
  84. package/dist/default-extensions/perl.js +13 -0
  85. package/dist/default-extensions/php.js +13 -0
  86. package/dist/default-extensions/powershell.js +11 -0
  87. package/dist/default-extensions/pug.js +11 -0
  88. package/dist/default-extensions/python.js +12 -0
  89. package/dist/default-extensions/r.js +11 -0
  90. package/dist/default-extensions/razor.js +11 -0
  91. package/dist/default-extensions/ruby.js +11 -0
  92. package/dist/default-extensions/rust.js +11 -0
  93. package/dist/default-extensions/scss.js +12 -0
  94. package/dist/default-extensions/shaderlab.js +11 -0
  95. package/dist/default-extensions/shellscript.js +11 -0
  96. package/dist/default-extensions/sql.js +11 -0
  97. package/dist/default-extensions/swift.js +12 -0
  98. package/dist/default-extensions/theme-abyss.js +10 -0
  99. package/dist/default-extensions/theme-defaults.js +18 -0
  100. package/dist/default-extensions/theme-kimbie-dark.js +10 -0
  101. package/dist/default-extensions/theme-monokai-dimmed.js +10 -0
  102. package/dist/default-extensions/theme-monokai.js +10 -0
  103. package/dist/default-extensions/theme-quietlight.js +10 -0
  104. package/dist/default-extensions/theme-red.js +10 -0
  105. package/dist/default-extensions/theme-seti.js +10 -0
  106. package/dist/default-extensions/theme-solarized-dark.js +10 -0
  107. package/dist/default-extensions/theme-solarized-light.js +10 -0
  108. package/dist/default-extensions/theme-tomorrow-night-blue.js +10 -0
  109. package/dist/default-extensions/typescript-basics.js +17 -0
  110. package/dist/default-extensions/vb.js +12 -0
  111. package/dist/default-extensions/xml.js +13 -0
  112. package/dist/default-extensions/yaml.js +13 -0
  113. package/dist/dialogs.js +12 -216
  114. package/dist/diff.js +8 -0
  115. package/dist/diff.tmLanguage.js +2 -0
  116. package/dist/dimmed-monokai-color-theme.js +2 -0
  117. package/dist/docker.js +8 -0
  118. package/dist/docker.tmLanguage.js +2 -0
  119. package/dist/dom.js +101 -0
  120. package/dist/extensionManagement.js +4 -0
  121. package/dist/extensions.d.ts +368 -23
  122. package/dist/extensions.js +4 -85
  123. package/dist/extensionsRegistry.js +63 -64
  124. package/dist/files.d.ts +845 -0
  125. package/dist/files.js +1805 -1151
  126. package/dist/files2.js +32 -0
  127. package/dist/fsharp.js +9 -0
  128. package/dist/fsharp.tmLanguage.js +2 -0
  129. package/dist/fsharp2.js +2 -0
  130. package/dist/go.js +8 -0
  131. package/dist/go.tmLanguage.js +2 -0
  132. package/dist/groovy.js +9 -0
  133. package/dist/groovy.tmLanguage.js +2 -0
  134. package/dist/groovy2.js +2 -0
  135. package/dist/handlebars.js +8 -0
  136. package/dist/hc_black.js +2 -0
  137. package/dist/hc_light.js +2 -0
  138. package/dist/hlsl.js +8 -0
  139. package/dist/hlsl.tmLanguage.js +2 -0
  140. package/dist/html-derivative.tmLanguage.js +2 -0
  141. package/dist/html.js +10 -0
  142. package/dist/html.tmLanguage.js +2 -0
  143. package/dist/html.tmLanguage2.js +2 -0
  144. package/dist/html2.js +2 -0
  145. package/dist/ini.js +10 -0
  146. package/dist/ini.language-configuration.js +2 -0
  147. package/dist/ini.tmLanguage.js +2 -0
  148. package/dist/injection.js +1 -1
  149. package/dist/java.js +9 -0
  150. package/dist/java.tmLanguage.js +2 -0
  151. package/dist/java2.js +2 -0
  152. package/dist/javascript-language-configuration.js +2 -0
  153. package/dist/javascript.js +14 -0
  154. package/dist/javascript2.js +2 -0
  155. package/dist/jsdoc.js.injection.tmLanguage.js +2 -0
  156. package/dist/jsdoc.ts.injection.tmLanguage.js +2 -0
  157. package/dist/json.js +10 -0
  158. package/dist/jsonErrorMessages.js +1 -1
  159. package/dist/julia.js +8 -0
  160. package/dist/julia.tmLanguage.js +2 -0
  161. package/dist/keybindings.d.ts +1 -10
  162. package/dist/keybindings.js +291 -353
  163. package/dist/kimbie-dark-color-theme.js +2 -0
  164. package/dist/language-configuration.js +2 -0
  165. package/dist/language-configuration10.js +2 -0
  166. package/dist/language-configuration11.js +2 -0
  167. package/dist/language-configuration12.js +2 -0
  168. package/dist/language-configuration13.js +2 -0
  169. package/dist/language-configuration14.js +2 -0
  170. package/dist/language-configuration15.js +2 -0
  171. package/dist/language-configuration16.js +2 -0
  172. package/dist/language-configuration17.js +2 -0
  173. package/dist/language-configuration18.js +2 -0
  174. package/dist/language-configuration19.js +2 -0
  175. package/dist/language-configuration2.js +2 -0
  176. package/dist/language-configuration20.js +2 -0
  177. package/dist/language-configuration21.js +2 -0
  178. package/dist/language-configuration22.js +2 -0
  179. package/dist/language-configuration23.js +2 -0
  180. package/dist/language-configuration24.js +2 -0
  181. package/dist/language-configuration25.js +2 -0
  182. package/dist/language-configuration26.js +2 -0
  183. package/dist/language-configuration27.js +2 -0
  184. package/dist/language-configuration28.js +2 -0
  185. package/dist/language-configuration29.js +2 -0
  186. package/dist/language-configuration3.js +2 -0
  187. package/dist/language-configuration30.js +2 -0
  188. package/dist/language-configuration31.js +2 -0
  189. package/dist/language-configuration32.js +2 -0
  190. package/dist/language-configuration33.js +2 -0
  191. package/dist/language-configuration34.js +2 -0
  192. package/dist/language-configuration35.js +2 -0
  193. package/dist/language-configuration36.js +2 -0
  194. package/dist/language-configuration37.js +2 -0
  195. package/dist/language-configuration38.js +2 -0
  196. package/dist/language-configuration39.js +2 -0
  197. package/dist/language-configuration4.js +2 -0
  198. package/dist/language-configuration5.js +2 -0
  199. package/dist/language-configuration6.js +2 -0
  200. package/dist/language-configuration7.js +2 -0
  201. package/dist/language-configuration8.js +2 -0
  202. package/dist/language-configuration9.js +2 -0
  203. package/dist/languageService.js +5 -6
  204. package/dist/languages.d.ts +66 -1
  205. package/dist/languages.js +924 -5
  206. package/dist/latex.js +11 -0
  207. package/dist/layout.contribution.darwin.js +1 -1
  208. package/dist/layout.contribution.linux.js +1 -1
  209. package/dist/layout.contribution.win.js +1 -1
  210. package/dist/layout.js +4 -10
  211. package/dist/layoutService.js +10 -2
  212. package/dist/less.js +8 -0
  213. package/dist/less.tmLanguage.js +2 -0
  214. package/dist/light_plus.js +2 -0
  215. package/dist/light_plus_experimental.js +2 -0
  216. package/dist/light_vs.js +2 -0
  217. package/dist/log.js +7 -0
  218. package/dist/log.tmLanguage.js +2 -0
  219. package/dist/lua.js +8 -0
  220. package/dist/lua.tmLanguage.js +2 -0
  221. package/dist/make.js +8 -0
  222. package/dist/make.tmLanguage.js +2 -0
  223. package/dist/markdown-basics.js +9 -0
  224. package/dist/markdown-latex-combined.tmLanguage.js +2 -0
  225. package/dist/markdown.js +2 -0
  226. package/dist/markdown.tmLanguage.js +2 -0
  227. package/dist/memento.js +91 -0
  228. package/dist/modelEditor.d.ts +1480 -138
  229. package/dist/modelEditor.js +8700 -326
  230. package/dist/monaco.d.ts +987 -15
  231. package/dist/monaco.js +40 -10
  232. package/dist/monokai-color-theme.js +2 -0
  233. package/dist/notifications.js +86 -64
  234. package/dist/objective-c.js +10 -0
  235. package/dist/objective-c.tmLanguage.js +2 -0
  236. package/dist/objective-c__.tmLanguage.js +2 -0
  237. package/dist/perl.js +10 -0
  238. package/dist/perl.language-configuration.js +2 -0
  239. package/dist/perl.tmLanguage.js +2 -0
  240. package/dist/perl6.language-configuration.js +2 -0
  241. package/dist/perl6.tmLanguage.js +2 -0
  242. package/dist/php.js +10 -0
  243. package/dist/php.tmLanguage.js +2 -0
  244. package/dist/php2.js +2 -0
  245. package/dist/platform.js +105 -0
  246. package/dist/platform.tmLanguage.js +2 -0
  247. package/dist/polyfill.js +51923 -11069
  248. package/dist/powershell.js +8 -0
  249. package/dist/powershell.tmLanguage.js +2 -0
  250. package/dist/preferences.js +2532 -0
  251. package/dist/properties.language-configuration.js +2 -0
  252. package/dist/pug.js +8 -0
  253. package/dist/pug.tmLanguage.js +2 -0
  254. package/dist/python.js +9 -0
  255. package/dist/quietlight-color-theme.js +2 -0
  256. package/dist/r.js +8 -0
  257. package/dist/r.tmLanguage.js +2 -0
  258. package/dist/razor.js +8 -0
  259. package/dist/rollup-vsix-plugin.d.ts +8 -0
  260. package/dist/rollup-vsix-plugin.js +104 -0
  261. package/dist/ruby.js +8 -0
  262. package/dist/ruby.tmLanguage.js +2 -0
  263. package/dist/rust.js +8 -0
  264. package/dist/rust.tmLanguage.js +2 -0
  265. package/dist/sassdoc.tmLanguage.js +2 -0
  266. package/dist/scss.js +9 -0
  267. package/dist/scss.tmLanguage.js +2 -0
  268. package/dist/services.d.ts +12988 -12840
  269. package/dist/services.js +1 -1
  270. package/dist/shaderlab.js +8 -0
  271. package/dist/shaderlab.tmLanguage.js +2 -0
  272. package/dist/shell-unix-bash.tmLanguage.js +2 -0
  273. package/dist/shellscript.js +8 -0
  274. package/dist/snippets.js +6 -11
  275. package/dist/snippetsService.js +7 -10
  276. package/dist/solarized-dark-color-theme.js +2 -0
  277. package/dist/solarized-light-color-theme.js +2 -0
  278. package/dist/sql.js +8 -0
  279. package/dist/sql.tmLanguage.js +2 -0
  280. package/dist/swift.js +9 -0
  281. package/dist/swift.tmLanguage.js +2 -0
  282. package/dist/swift2.js +2 -0
  283. package/dist/tags-language-configuration.js +2 -0
  284. package/dist/textmate.d.ts +0 -264
  285. package/dist/textmate.js +402 -66
  286. package/dist/theme-abyss.js +7 -0
  287. package/dist/theme-defaults.js +15 -0
  288. package/dist/theme-kimbie-dark.js +7 -0
  289. package/dist/theme-monokai-dimmed.js +7 -0
  290. package/dist/theme-monokai.js +7 -0
  291. package/dist/theme-quietlight.js +7 -0
  292. package/dist/theme-red.js +7 -0
  293. package/dist/theme-seti.js +7 -0
  294. package/dist/theme-solarized-dark.js +7 -0
  295. package/dist/theme-solarized-light.js +7 -0
  296. package/dist/theme-tomorrow-night-blue.js +7 -0
  297. package/dist/theme.js +6 -11
  298. package/dist/{contextkeys.js → theme2.js} +165 -143
  299. package/dist/tokenClassificationRegistry.js +46 -2
  300. package/dist/tomorrow-night-blue-color-theme.js +2 -0
  301. package/dist/typescript-basics.js +14 -0
  302. package/dist/typescript.js +2 -0
  303. package/dist/unboundCommands.js +41 -0
  304. package/dist/utils.js +345 -0
  305. package/dist/vb.js +9 -0
  306. package/dist/vb2.js +2 -0
  307. package/dist/vs-seti-icon-theme.js +2 -0
  308. package/dist/vs_minimal-icon-theme.js +2 -0
  309. package/dist/xml.js +10 -0
  310. package/dist/xml.language-configuration.js +2 -0
  311. package/dist/xml.tmLanguage.js +2 -0
  312. package/dist/xsl.language-configuration.js +2 -0
  313. package/dist/xsl.tmLanguage.js +2 -0
  314. package/dist/yaml.js +10 -0
  315. package/dist/yaml.tmLanguage.js +2 -0
  316. package/package.json +50 -33
  317. package/dist/async.js +0 -301
  318. package/dist/cancellation.js +0 -3
  319. package/dist/configurationRegistry.js +0 -441
  320. package/dist/extensionResourceLoader.js +0 -96
  321. package/dist/labels.js +0 -14
  322. package/dist/languageConfiguration.js +0 -919
  323. package/dist/missing-services.js +0 -5554
  324. package/dist/resources.js +0 -197
  325. package/dist/services2.js +0 -3467
  326. package/dist/textFileEditorModel.js +0 -2985
  327. package/dist/tokenClassification.d.ts +0 -7
  328. package/dist/tokenClassification.js +0 -277
  329. package/dist/variableResolver.js +0 -1711
  330. package/dist/workbenchThemeService.js +0 -46
  331. package/dist/workspaceContext.js +0 -50
  332. /package/dist/{languageConfiguration.d.ts → preferences.d.ts} +0 -0
package/dist/monaco.d.ts CHANGED
@@ -64,6 +64,9 @@ declare abstract class Disposable implements IDisposable {
64
64
  */
65
65
  protected _register<T extends IDisposable>(o: T): T;
66
66
  }
67
+ interface IReference<T> extends IDisposable {
68
+ readonly object: T;
69
+ }
67
70
 
68
71
  /**
69
72
  * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.
@@ -337,15 +340,28 @@ declare namespace Event {
337
340
  */
338
341
  function map<I, O>(event: Event<I>, map: (i: I) => O, disposable?: DisposableStore): Event<O>;
339
342
  /**
343
+ * Wraps an event in another event that performs some function on the event object before firing.
344
+ *
340
345
  * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
341
346
  * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
342
347
  * returned event causes this utility to leak a listener on the original event.
348
+ *
349
+ * @param event The event source for the new event.
350
+ * @param each The function to perform on the event object.
351
+ * @param disposable A disposable store to add the new EventEmitter to.
343
352
  */
344
353
  function forEach<I>(event: Event<I>, each: (i: I) => void, disposable?: DisposableStore): Event<I>;
345
354
  /**
355
+ * Wraps an event in another event that fires only when some condition is met.
356
+ *
346
357
  * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
347
358
  * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
348
359
  * returned event causes this utility to leak a listener on the original event.
360
+ *
361
+ * @param event The event source for the new event.
362
+ * @param filter The filter function that defines the condition. The event will fire for the object if this function
363
+ * returns true.
364
+ * @param disposable A disposable store to add the new EventEmitter to.
349
365
  */
350
366
  function filter<T, U>(event: Event<T | U>, filter: (e: T | U) => e is T, disposable?: DisposableStore): Event<T>;
351
367
  function filter<T>(event: Event<T>, filter: (e: T) => boolean, disposable?: DisposableStore): Event<T>;
@@ -355,8 +371,7 @@ declare namespace Event {
355
371
  */
356
372
  function signal<T>(event: Event<T>): Event<void>;
357
373
  /**
358
- * Given a collection of events, returns a single event which emits
359
- * whenever any of the provided events emit.
374
+ * Given a collection of events, returns a single event which emits whenever any of the provided events emit.
360
375
  */
361
376
  function any<T>(...events: Event<T>[]): Event<T>;
362
377
  function any(...events: Event<any>[]): Event<void>;
@@ -395,9 +410,22 @@ declare namespace Event {
395
410
  */
396
411
  function accumulate<T>(event: Event<T>, delay?: number, disposable?: DisposableStore): Event<T[]>;
397
412
  /**
413
+ * Filters an event such that some condition is _not_ met more than once in a row, effectively ensuring duplicate
414
+ * event objects from different sources do not fire the same event object.
415
+ *
398
416
  * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
399
417
  * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
400
418
  * returned event causes this utility to leak a listener on the original event.
419
+ *
420
+ * @param event The event source for the new event.
421
+ * @param equals The equality condition.
422
+ * @param disposable A disposable store to add the new EventEmitter to.
423
+ *
424
+ * @example
425
+ * ```
426
+ * // Fire only one time when a single window is opened or focused
427
+ * Event.latch(Event.any(onDidOpenWindow, onDidFocusWindow))
428
+ * ```
401
429
  */
402
430
  function latch<T>(event: Event<T>, equals?: (a: T, b: T) => boolean, disposable?: DisposableStore): Event<T>;
403
431
  /**
@@ -419,9 +447,24 @@ declare namespace Event {
419
447
  */
420
448
  function split<T, U>(event: Event<T | U>, isT: (e: T | U) => e is T, disposable?: DisposableStore): [Event<T>, Event<U>];
421
449
  /**
450
+ * Buffers an event until it has a listener attached.
451
+ *
422
452
  * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
423
453
  * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
424
454
  * returned event causes this utility to leak a listener on the original event.
455
+ *
456
+ * @param event The event source for the new event.
457
+ * @param flushAfterTimeout Determines whether to flush the buffer after a timeout immediately or after a
458
+ * `setTimeout` when the first event listener is added.
459
+ * @param _buffer Internal: A source event array used for tests.
460
+ *
461
+ * @example
462
+ * ```
463
+ * // Start accumulating events, when the first listener is attached, flush
464
+ * // the event after a timeout such that multiple listeners attached before
465
+ * // the timeout would receive the event
466
+ * this.onInstallExtension = Event.buffer(service.onInstallExtension, true);
467
+ * ```
425
468
  */
426
469
  function buffer<T>(event: Event<T>, flushAfterTimeout?: boolean, _buffer?: T[]): Event<T>;
427
470
  interface IChainableEvent<T> extends IDisposable {
@@ -437,19 +480,59 @@ declare namespace Event {
437
480
  on(listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore): IDisposable;
438
481
  once(listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[]): IDisposable;
439
482
  }
483
+ /**
484
+ * Wraps the event in an {@link IChainableEvent}, allowing a more functional programming style.
485
+ *
486
+ * @example
487
+ * ```
488
+ * // Normal
489
+ * const onEnterPressNormal = Event.filter(
490
+ * Event.map(onKeyPress.event, e => new StandardKeyboardEvent(e)),
491
+ * e.keyCode === KeyCode.Enter
492
+ * ).event;
493
+ *
494
+ * // Using chain
495
+ * const onEnterPressChain = Event.chain(onKeyPress.event)
496
+ * .map(e => new StandardKeyboardEvent(e))
497
+ * .filter(e => e.keyCode === KeyCode.Enter)
498
+ * .event;
499
+ * ```
500
+ */
440
501
  function chain<T>(event: Event<T>): IChainableEvent<T>;
441
502
  interface NodeEventEmitter {
442
503
  on(event: string | symbol, listener: Function): unknown;
443
504
  removeListener(event: string | symbol, listener: Function): unknown;
444
505
  }
506
+ /**
507
+ * Creates an {@link Event} from a node event emitter.
508
+ */
445
509
  function fromNodeEventEmitter<T>(emitter: NodeEventEmitter, eventName: string, map?: (...args: any[]) => T): Event<T>;
446
510
  interface DOMEventEmitter {
447
511
  addEventListener(event: string | symbol, listener: Function): void;
448
512
  removeEventListener(event: string | symbol, listener: Function): void;
449
513
  }
514
+ /**
515
+ * Creates an {@link Event} from a DOM event emitter.
516
+ */
450
517
  function fromDOMEventEmitter<T>(emitter: DOMEventEmitter, eventName: string, map?: (...args: any[]) => T): Event<T>;
518
+ /**
519
+ * Creates a promise out of an event, using the {@link Event.once} helper.
520
+ */
451
521
  function toPromise<T>(event: Event<T>): Promise<T>;
522
+ /**
523
+ * Adds a listener to an event and calls the listener immediately with undefined as the event object.
524
+ *
525
+ * @example
526
+ * ```
527
+ * // Initialize the UI and update it when dataChangeEvent fires
528
+ * runAndSubscribe(dataChangeEvent, () => this._updateUI());
529
+ * ```
530
+ */
452
531
  function runAndSubscribe<T>(event: Event<T>, handler: (e: T | undefined) => any): IDisposable;
532
+ /**
533
+ * Adds a listener to an event and calls the listener immediately with undefined as the event object. A new
534
+ * {@link DisposableStore} is passed to the listener which is disposed when the returned disposable is disposed.
535
+ */
453
536
  function runAndSubscribeWithStore<T>(event: Event<T>, handler: (e: T | undefined, disposableStore: DisposableStore) => any): IDisposable;
454
537
  function fromObservable<T>(obs: IObservable<T, any>, store?: DisposableStore): Event<T>;
455
538
  }
@@ -776,16 +859,16 @@ interface IContextKeyChangeEvent {
776
859
  affectsSome(keys: IReadableSet<string>): boolean;
777
860
  allKeysContainedIn(keys: IReadableSet<string>): boolean;
778
861
  }
862
+ type IScopedContextKeyService = IContextKeyService & IDisposable;
779
863
  declare const IContextKeyService: ServiceIdentifier<IContextKeyService>;
780
864
  interface IContextKeyService {
781
865
  readonly _serviceBrand: undefined;
782
- dispose(): void;
783
866
  onDidChangeContext: Event<IContextKeyChangeEvent>;
784
867
  bufferChangeEvents(callback: Function): void;
785
868
  createKey<T extends ContextKeyValue>(key: string, defaultValue: T | undefined): IContextKey<T>;
786
869
  contextMatchesRules(rules: ContextKeyExpression | undefined): boolean;
787
870
  getContextKeyValue<T>(key: string): T | undefined;
788
- createScoped(target: IContextKeyServiceTarget): IContextKeyService;
871
+ createScoped(target: IContextKeyServiceTarget): IScopedContextKeyService;
789
872
  createOverlay(overlay: Iterable<[string, any]>): IContextKeyService;
790
873
  getContext(target: IContextKeyServiceTarget | null): IContext;
791
874
  updateParent(parentContextKeyService: IContextKeyService): void;
@@ -1308,6 +1391,54 @@ declare class Selection extends Range {
1308
1391
  static createWithDirection(startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number, direction: SelectionDirection): Selection;
1309
1392
  }
1310
1393
 
1394
+ declare class TextChange {
1395
+ readonly oldPosition: number;
1396
+ readonly oldText: string;
1397
+ readonly newPosition: number;
1398
+ readonly newText: string;
1399
+ get oldLength(): number;
1400
+ get oldEnd(): number;
1401
+ get newLength(): number;
1402
+ get newEnd(): number;
1403
+ constructor(oldPosition: number, oldText: string, newPosition: number, newText: string);
1404
+ toString(): string;
1405
+ private static _writeStringSize;
1406
+ private static _writeString;
1407
+ private static _readString;
1408
+ writeSize(): number;
1409
+ write(b: Uint8Array, offset: number): number;
1410
+ static read(b: Uint8Array, offset: number, dest: TextChange[]): number;
1411
+ }
1412
+
1413
+ /**
1414
+ * A fast character classifier that uses a compact array for ASCII values.
1415
+ */
1416
+ declare class CharacterClassifier<T extends number> {
1417
+ /**
1418
+ * Maintain a compact (fully initialized ASCII map for quickly classifying ASCII characters - used more often in code).
1419
+ */
1420
+ protected readonly _asciiMap: Uint8Array;
1421
+ /**
1422
+ * The entire map (sparse array).
1423
+ */
1424
+ protected readonly _map: Map<number, number>;
1425
+ protected readonly _defaultValue: number;
1426
+ constructor(_defaultValue: T);
1427
+ private static _createAsciiMap;
1428
+ set(charCode: number, _value: T): void;
1429
+ get(charCode: number): T;
1430
+ clear(): void;
1431
+ }
1432
+
1433
+ declare const enum WordCharacterClass {
1434
+ Regular = 0,
1435
+ Whitespace = 1,
1436
+ WordSeparator = 2
1437
+ }
1438
+ declare class WordCharacterClassifier extends CharacterClassifier<WordCharacterClass> {
1439
+ constructor(wordSeparators: string);
1440
+ }
1441
+
1311
1442
  interface ThemeColor {
1312
1443
  id: string;
1313
1444
  }
@@ -2469,6 +2600,10 @@ interface FormattingOptions {
2469
2600
  * Prefer spaces over tabs.
2470
2601
  */
2471
2602
  insertSpaces: boolean;
2603
+ /**
2604
+ * The list of multiple ranges to format at once, if the provider supports it.
2605
+ */
2606
+ ranges?: Range[];
2472
2607
  }
2473
2608
  /**
2474
2609
  * The document formatting provider interface defines the contract between extensions and
@@ -2503,6 +2638,7 @@ interface DocumentRangeFormattingEditProvider {
2503
2638
  * of the range to full syntax nodes.
2504
2639
  */
2505
2640
  provideDocumentRangeFormattingEdits(model: ITextModel, range: Range, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
2641
+ provideDocumentRangesFormattingEdits?(model: ITextModel, ranges: Range[], options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
2506
2642
  }
2507
2643
  /**
2508
2644
  * The document formatting provider interface defines the contract between extensions and
@@ -3407,6 +3543,25 @@ declare class ResolvedLanguageConfiguration {
3407
3543
  private static _handleComments;
3408
3544
  }
3409
3545
 
3546
+ interface IModelContentChange {
3547
+ /**
3548
+ * The range that got replaced.
3549
+ */
3550
+ readonly range: IRange;
3551
+ /**
3552
+ * The offset of the range that got replaced.
3553
+ */
3554
+ readonly rangeOffset: number;
3555
+ /**
3556
+ * The length of the range that got replaced.
3557
+ */
3558
+ readonly rangeLength: number;
3559
+ /**
3560
+ * The new text for the range.
3561
+ */
3562
+ readonly text: string;
3563
+ }
3564
+
3410
3565
  /**
3411
3566
  * Vertical Lane in the overview ruler of the editor.
3412
3567
  */
@@ -3477,6 +3632,8 @@ interface IModelDecorationOptions {
3477
3632
  * In this case, the range must be empty and set to the last line.
3478
3633
  */
3479
3634
  blockIsAfterEnd?: boolean | null;
3635
+ blockDoesNotCollapse?: boolean | null;
3636
+ blockPadding?: [top: number, right: number, bottom: number, left: number] | null;
3480
3637
  /**
3481
3638
  * Message to be rendered when hovering over the glyph margin decoration.
3482
3639
  */
@@ -3651,6 +3808,36 @@ interface IModelDecorationsChangeAccessor {
3651
3808
  */
3652
3809
  deltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[]): string[];
3653
3810
  }
3811
+ /**
3812
+ * End of line character preference.
3813
+ */
3814
+ declare const enum EndOfLinePreference {
3815
+ /**
3816
+ * Use the end of line character identified in the text buffer.
3817
+ */
3818
+ TextDefined = 0,
3819
+ /**
3820
+ * Use line feed (\n) as the end of line character.
3821
+ */
3822
+ LF = 1,
3823
+ /**
3824
+ * Use carriage return and line feed (\r\n) as the end of line character.
3825
+ */
3826
+ CRLF = 2
3827
+ }
3828
+ /**
3829
+ * The default end of line to use when instantiating models.
3830
+ */
3831
+ declare const enum DefaultEndOfLine {
3832
+ /**
3833
+ * Use line feed (\n) as the end of line character.
3834
+ */
3835
+ LF = 1,
3836
+ /**
3837
+ * Use carriage return and line feed (\r\n) as the end of line character.
3838
+ */
3839
+ CRLF = 2
3840
+ }
3654
3841
  /**
3655
3842
  * End of line character preference.
3656
3843
  */
@@ -3664,6 +3851,69 @@ declare const enum EndOfLineSequence {
3664
3851
  */
3665
3852
  CRLF = 1
3666
3853
  }
3854
+ /**
3855
+ * An identifier for a single edit operation.
3856
+ * @internal
3857
+ */
3858
+ interface ISingleEditOperationIdentifier {
3859
+ /**
3860
+ * Identifier major
3861
+ */
3862
+ major: number;
3863
+ /**
3864
+ * Identifier minor
3865
+ */
3866
+ minor: number;
3867
+ }
3868
+ /**
3869
+ * A single edit operation, that has an identifier.
3870
+ */
3871
+ interface IIdentifiedSingleEditOperation extends ISingleEditOperation {
3872
+ /**
3873
+ * An identifier associated with this single edit operation.
3874
+ * @internal
3875
+ */
3876
+ identifier?: ISingleEditOperationIdentifier | null;
3877
+ /**
3878
+ * This indicates that this operation is inserting automatic whitespace
3879
+ * that can be removed on next model edit operation if `config.trimAutoWhitespace` is true.
3880
+ * @internal
3881
+ */
3882
+ isAutoWhitespaceEdit?: boolean;
3883
+ /**
3884
+ * This indicates that this operation is in a set of operations that are tracked and should not be "simplified".
3885
+ * @internal
3886
+ */
3887
+ _isTracked?: boolean;
3888
+ }
3889
+ interface IValidEditOperation {
3890
+ /**
3891
+ * An identifier associated with this single edit operation.
3892
+ * @internal
3893
+ */
3894
+ identifier: ISingleEditOperationIdentifier | null;
3895
+ /**
3896
+ * The range to replace. This can be empty to emulate a simple insert.
3897
+ */
3898
+ range: Range;
3899
+ /**
3900
+ * The text to replace with. This can be empty to emulate a simple delete.
3901
+ */
3902
+ text: string;
3903
+ /**
3904
+ * @internal
3905
+ */
3906
+ textChange: TextChange;
3907
+ }
3908
+ declare class FindMatch {
3909
+ _findMatchBrand: void;
3910
+ readonly range: Range;
3911
+ readonly matches: string[] | null;
3912
+ /**
3913
+ * @internal
3914
+ */
3915
+ constructor(range: Range, matches: string[] | null);
3916
+ }
3667
3917
  /**
3668
3918
  * Describes the behavior of decorations when typing/editing near their edges.
3669
3919
  * Note: Please do not edit the values, as they very carefully match `DecorationRangeBehavior`
@@ -3674,10 +3924,113 @@ declare const enum TrackedRangeStickiness {
3674
3924
  GrowsOnlyWhenTypingBefore = 2,
3675
3925
  GrowsOnlyWhenTypingAfter = 3
3676
3926
  }
3927
+ /**
3928
+ * Text snapshot that works like an iterator.
3929
+ * Will try to return chunks of roughly ~64KB size.
3930
+ * Will return null when finished.
3931
+ */
3932
+ interface ITextSnapshot {
3933
+ read(): string | null;
3934
+ }
3677
3935
  /**
3678
3936
  * A model.
3679
3937
  */
3680
3938
  type ITextModel = monaco.editor.ITextModel
3939
+ /**
3940
+ * @internal
3941
+ */
3942
+ interface ITextBufferFactory {
3943
+ create(defaultEOL: DefaultEndOfLine): {
3944
+ textBuffer: ITextBuffer;
3945
+ disposable: IDisposable;
3946
+ };
3947
+ getFirstLineText(lengthLimit: number): string;
3948
+ }
3949
+ /**
3950
+ * @internal
3951
+ */
3952
+ declare class ValidAnnotatedEditOperation implements IIdentifiedSingleEditOperation {
3953
+ readonly identifier: ISingleEditOperationIdentifier | null;
3954
+ readonly range: Range;
3955
+ readonly text: string | null;
3956
+ readonly forceMoveMarkers: boolean;
3957
+ readonly isAutoWhitespaceEdit: boolean;
3958
+ readonly _isTracked: boolean;
3959
+ constructor(identifier: ISingleEditOperationIdentifier | null, range: Range, text: string | null, forceMoveMarkers: boolean, isAutoWhitespaceEdit: boolean, _isTracked: boolean);
3960
+ }
3961
+ /**
3962
+ * @internal
3963
+ *
3964
+ * `lineNumber` is 1 based.
3965
+ */
3966
+ interface IReadonlyTextBuffer {
3967
+ onDidChangeContent: Event<void>;
3968
+ equals(other: ITextBuffer): boolean;
3969
+ mightContainRTL(): boolean;
3970
+ mightContainUnusualLineTerminators(): boolean;
3971
+ resetMightContainUnusualLineTerminators(): void;
3972
+ mightContainNonBasicASCII(): boolean;
3973
+ getBOM(): string;
3974
+ getEOL(): string;
3975
+ getOffsetAt(lineNumber: number, column: number): number;
3976
+ getPositionAt(offset: number): Position;
3977
+ getRangeAt(offset: number, length: number): Range;
3978
+ getValueInRange(range: Range, eol: EndOfLinePreference): string;
3979
+ createSnapshot(preserveBOM: boolean): ITextSnapshot;
3980
+ getValueLengthInRange(range: Range, eol: EndOfLinePreference): number;
3981
+ getCharacterCountInRange(range: Range, eol: EndOfLinePreference): number;
3982
+ getLength(): number;
3983
+ getLineCount(): number;
3984
+ getLinesContent(): string[];
3985
+ getLineContent(lineNumber: number): string;
3986
+ getLineCharCode(lineNumber: number, index: number): number;
3987
+ getCharCode(offset: number): number;
3988
+ getLineLength(lineNumber: number): number;
3989
+ getLineFirstNonWhitespaceColumn(lineNumber: number): number;
3990
+ getLineLastNonWhitespaceColumn(lineNumber: number): number;
3991
+ findMatchesLineByLine(searchRange: Range, searchData: SearchData, captureMatches: boolean, limitResultCount: number): FindMatch[];
3992
+ }
3993
+ /**
3994
+ * @internal
3995
+ */
3996
+ declare class SearchData {
3997
+ /**
3998
+ * The regex to search for. Always defined.
3999
+ */
4000
+ readonly regex: RegExp;
4001
+ /**
4002
+ * The word separator classifier.
4003
+ */
4004
+ readonly wordSeparators: WordCharacterClassifier | null;
4005
+ /**
4006
+ * The simple string to search for (if possible).
4007
+ */
4008
+ readonly simpleSearch: string | null;
4009
+ constructor(regex: RegExp, wordSeparators: WordCharacterClassifier | null, simpleSearch: string | null);
4010
+ }
4011
+ /**
4012
+ * @internal
4013
+ */
4014
+ interface ITextBuffer extends IReadonlyTextBuffer {
4015
+ setEOL(newEOL: '\r\n' | '\n'): void;
4016
+ applyEdits(rawOperations: ValidAnnotatedEditOperation[], recordTrimAutoWhitespace: boolean, computeUndoEdits: boolean): ApplyEditsResult;
4017
+ }
4018
+ /**
4019
+ * @internal
4020
+ */
4021
+ declare class ApplyEditsResult {
4022
+ readonly reverseEdits: IValidEditOperation[] | null;
4023
+ readonly changes: IInternalModelContentChange[];
4024
+ readonly trimAutoWhitespaceLineNumbers: number[] | null;
4025
+ constructor(reverseEdits: IValidEditOperation[] | null, changes: IInternalModelContentChange[], trimAutoWhitespaceLineNumbers: number[] | null);
4026
+ }
4027
+ /**
4028
+ * @internal
4029
+ */
4030
+ interface IInternalModelContentChange extends IModelContentChange {
4031
+ range: Range;
4032
+ forceMoveMarkers: boolean;
4033
+ }
3681
4034
 
3682
4035
  /**
3683
4036
  * Configuration options for auto indentation in the editor
@@ -3766,6 +4119,29 @@ declare function registerColor(id: string, defaults: ColorDefaults | null, descr
3766
4119
  */
3767
4120
  type ICodeEditor = monaco.editor.ICodeEditor
3768
4121
 
4122
+ interface IEditorModel {
4123
+ /**
4124
+ * Emitted when the model is about to be disposed.
4125
+ */
4126
+ readonly onWillDispose: Event<void>;
4127
+ /**
4128
+ * Resolves the model.
4129
+ */
4130
+ resolve(): Promise<void>;
4131
+ /**
4132
+ * Find out if the editor model was resolved or not.
4133
+ */
4134
+ isResolved(): boolean;
4135
+ /**
4136
+ * Find out if this model has been disposed.
4137
+ */
4138
+ isDisposed(): boolean;
4139
+ /**
4140
+ * Dispose associated resources
4141
+ */
4142
+ dispose(): void;
4143
+ }
4144
+
3769
4145
  interface IAction {
3770
4146
  readonly id: string;
3771
4147
  label: string;
@@ -3773,7 +4149,7 @@ interface IAction {
3773
4149
  class: string | undefined;
3774
4150
  enabled: boolean;
3775
4151
  checked?: boolean;
3776
- run(event?: unknown): unknown;
4152
+ run(...args: unknown[]): unknown;
3777
4153
  }
3778
4154
 
3779
4155
  type TypeConstraint = string | Function;
@@ -3810,18 +4186,33 @@ declare const CommandsRegistry: ICommandRegistry;
3810
4186
 
3811
4187
  type Severity = Severity$1;
3812
4188
  type NotificationMessage = string | Error;
4189
+ declare enum NotificationPriority {
4190
+ /**
4191
+ * Default priority: notification will be visible unless do not disturb mode is enabled.
4192
+ */
4193
+ DEFAULT = 0,
4194
+ /**
4195
+ * Silent priority: notification will only be visible from the notifications center.
4196
+ */
4197
+ SILENT = 1,
4198
+ /**
4199
+ * Urgent priority: notification will be visible even when do not disturb mode is enabled.
4200
+ */
4201
+ URGENT = 2
4202
+ }
3813
4203
  interface INotificationProperties {
3814
4204
  /**
3815
- * Sticky notifications are not automatically removed after a certain timeout. By
3816
- * default, notifications with primary actions and severity error are always sticky.
4205
+ * Sticky notifications are not automatically removed after a certain timeout.
4206
+ *
4207
+ * Currently, only 2 kinds of notifications are sticky:
4208
+ * - Error notifications with primary actions
4209
+ * - Notifications that show progress
3817
4210
  */
3818
4211
  readonly sticky?: boolean;
3819
4212
  /**
3820
- * Silent notifications are not shown to the user unless the notification center
3821
- * is opened. The status bar will still indicate all number of notifications to
3822
- * catch some attention.
4213
+ * Allows to override the priority of the notification based on needs.
3823
4214
  */
3824
- readonly silent?: boolean;
4215
+ readonly priority?: NotificationPriority;
3825
4216
  /**
3826
4217
  * Adds an action to never show the notification again. The choice will be persisted
3827
4218
  * such as future requests will not cause the notification to show again.
@@ -4509,14 +4900,595 @@ interface IJSONContributionRegistry {
4509
4900
  getSchemaContributions(): ISchemaContributions;
4510
4901
  }
4511
4902
 
4903
+ interface ReadableStreamEvents<T> {
4904
+ /**
4905
+ * The 'data' event is emitted whenever the stream is
4906
+ * relinquishing ownership of a chunk of data to a consumer.
4907
+ *
4908
+ * NOTE: PLEASE UNDERSTAND THAT ADDING A DATA LISTENER CAN
4909
+ * TURN THE STREAM INTO FLOWING MODE. IT IS THEREFOR THE
4910
+ * LAST LISTENER THAT SHOULD BE ADDED AND NOT THE FIRST
4911
+ *
4912
+ * Use `listenStream` as a helper method to listen to
4913
+ * stream events in the right order.
4914
+ */
4915
+ on(event: 'data', callback: (data: T) => void): void;
4916
+ /**
4917
+ * Emitted when any error occurs.
4918
+ */
4919
+ on(event: 'error', callback: (err: Error) => void): void;
4920
+ /**
4921
+ * The 'end' event is emitted when there is no more data
4922
+ * to be consumed from the stream. The 'end' event will
4923
+ * not be emitted unless the data is completely consumed.
4924
+ */
4925
+ on(event: 'end', callback: () => void): void;
4926
+ }
4927
+ /**
4928
+ * A interface that emulates the API shape of a node.js readable
4929
+ * stream for use in native and web environments.
4930
+ */
4931
+ interface ReadableStream<T> extends ReadableStreamEvents<T> {
4932
+ /**
4933
+ * Stops emitting any events until resume() is called.
4934
+ */
4935
+ pause(): void;
4936
+ /**
4937
+ * Starts emitting events again after pause() was called.
4938
+ */
4939
+ resume(): void;
4940
+ /**
4941
+ * Destroys the stream and stops emitting any event.
4942
+ */
4943
+ destroy(): void;
4944
+ /**
4945
+ * Allows to remove a listener that was previously added.
4946
+ */
4947
+ removeListener(event: string, callback: Function): void;
4948
+ }
4949
+ /**
4950
+ * A interface that emulates the API shape of a node.js readable
4951
+ * for use in native and web environments.
4952
+ */
4953
+ interface Readable<T> {
4954
+ /**
4955
+ * Read data from the underlying source. Will return
4956
+ * null to indicate that no more data can be read.
4957
+ */
4958
+ read(): T | null;
4959
+ }
4960
+
4961
+ declare class VSBuffer {
4962
+ /**
4963
+ * When running in a nodejs context, the backing store for the returned `VSBuffer` instance
4964
+ * might use a nodejs Buffer allocated from node's Buffer pool, which is not transferrable.
4965
+ */
4966
+ static alloc(byteLength: number): VSBuffer;
4967
+ /**
4968
+ * When running in a nodejs context, if `actual` is not a nodejs Buffer, the backing store for
4969
+ * the returned `VSBuffer` instance might use a nodejs Buffer allocated from node's Buffer pool,
4970
+ * which is not transferrable.
4971
+ */
4972
+ static wrap(actual: Uint8Array): VSBuffer;
4973
+ /**
4974
+ * When running in a nodejs context, the backing store for the returned `VSBuffer` instance
4975
+ * might use a nodejs Buffer allocated from node's Buffer pool, which is not transferrable.
4976
+ */
4977
+ static fromString(source: string, options?: {
4978
+ dontUseNodeBuffer?: boolean;
4979
+ }): VSBuffer;
4980
+ /**
4981
+ * When running in a nodejs context, the backing store for the returned `VSBuffer` instance
4982
+ * might use a nodejs Buffer allocated from node's Buffer pool, which is not transferrable.
4983
+ */
4984
+ static fromByteArray(source: number[]): VSBuffer;
4985
+ /**
4986
+ * When running in a nodejs context, the backing store for the returned `VSBuffer` instance
4987
+ * might use a nodejs Buffer allocated from node's Buffer pool, which is not transferrable.
4988
+ */
4989
+ static concat(buffers: VSBuffer[], totalLength?: number): VSBuffer;
4990
+ readonly buffer: Uint8Array;
4991
+ readonly byteLength: number;
4992
+ private constructor();
4993
+ /**
4994
+ * When running in a nodejs context, the backing store for the returned `VSBuffer` instance
4995
+ * might use a nodejs Buffer allocated from node's Buffer pool, which is not transferrable.
4996
+ */
4997
+ clone(): VSBuffer;
4998
+ toString(): string;
4999
+ slice(start?: number, end?: number): VSBuffer;
5000
+ set(array: VSBuffer, offset?: number): void;
5001
+ set(array: Uint8Array, offset?: number): void;
5002
+ set(array: ArrayBuffer, offset?: number): void;
5003
+ set(array: ArrayBufferView, offset?: number): void;
5004
+ set(array: VSBuffer | Uint8Array | ArrayBuffer | ArrayBufferView, offset?: number): void;
5005
+ readUInt32BE(offset: number): number;
5006
+ writeUInt32BE(value: number, offset: number): void;
5007
+ readUInt32LE(offset: number): number;
5008
+ writeUInt32LE(value: number, offset: number): void;
5009
+ readUInt8(offset: number): number;
5010
+ writeUInt8(value: number, offset: number): void;
5011
+ }
5012
+ interface VSBufferReadable extends Readable<VSBuffer> {
5013
+ }
5014
+ interface VSBufferReadableStream extends ReadableStream<VSBuffer> {
5015
+ }
5016
+
5017
+ interface IFileReadLimits {
5018
+ /**
5019
+ * If the file exceeds the given size, an error of kind
5020
+ * `FILE_TOO_LARGE` will be thrown.
5021
+ */
5022
+ size?: number;
5023
+ /**
5024
+ * If the file exceeds the given size, an error of kind
5025
+ * `FILE_EXCEEDS_MEMORY_LIMIT` will be thrown.
5026
+ */
5027
+ memory?: number;
5028
+ }
5029
+ interface IFileDeleteOptions {
5030
+ /**
5031
+ * Set to `true` to recursively delete any children of the file. This
5032
+ * only applies to folders and can lead to an error unless provided
5033
+ * if the folder is not empty.
5034
+ */
5035
+ readonly recursive: boolean;
5036
+ /**
5037
+ * Set to `true` to attempt to move the file to trash
5038
+ * instead of deleting it permanently from disk. This
5039
+ * option maybe not be supported on all providers.
5040
+ */
5041
+ readonly useTrash: boolean;
5042
+ }
5043
+ interface IBaseFileStat {
5044
+ /**
5045
+ * The unified resource identifier of this file or folder.
5046
+ */
5047
+ readonly resource: URI;
5048
+ /**
5049
+ * The name which is the last segment
5050
+ * of the {{path}}.
5051
+ */
5052
+ readonly name: string;
5053
+ /**
5054
+ * The size of the file.
5055
+ *
5056
+ * The value may or may not be resolved as
5057
+ * it is optional.
5058
+ */
5059
+ readonly size?: number;
5060
+ /**
5061
+ * The last modification date represented as millis from unix epoch.
5062
+ *
5063
+ * The value may or may not be resolved as
5064
+ * it is optional.
5065
+ */
5066
+ readonly mtime?: number;
5067
+ /**
5068
+ * The creation date represented as millis from unix epoch.
5069
+ *
5070
+ * The value may or may not be resolved as
5071
+ * it is optional.
5072
+ */
5073
+ readonly ctime?: number;
5074
+ /**
5075
+ * A unique identifier that represents the
5076
+ * current state of the file or directory.
5077
+ *
5078
+ * The value may or may not be resolved as
5079
+ * it is optional.
5080
+ */
5081
+ readonly etag?: string;
5082
+ /**
5083
+ * The file is read-only.
5084
+ */
5085
+ readonly readonly?: boolean;
5086
+ }
5087
+ interface IBaseFileStatWithMetadata extends Required<IBaseFileStat> {
5088
+ }
5089
+ /**
5090
+ * A file resource with meta information and resolved children if any.
5091
+ */
5092
+ interface IFileStat extends IBaseFileStat {
5093
+ /**
5094
+ * The resource is a file.
5095
+ */
5096
+ readonly isFile: boolean;
5097
+ /**
5098
+ * The resource is a directory.
5099
+ */
5100
+ readonly isDirectory: boolean;
5101
+ /**
5102
+ * The resource is a symbolic link. Note: even when the
5103
+ * file is a symbolic link, you can test for `FileType.File`
5104
+ * and `FileType.Directory` to know the type of the target
5105
+ * the link points to.
5106
+ */
5107
+ readonly isSymbolicLink: boolean;
5108
+ /**
5109
+ * The children of the file stat or undefined if none.
5110
+ */
5111
+ children: IFileStat[] | undefined;
5112
+ }
5113
+ interface IFileStatWithMetadata extends IFileStat, IBaseFileStatWithMetadata {
5114
+ readonly mtime: number;
5115
+ readonly ctime: number;
5116
+ readonly etag: string;
5117
+ readonly size: number;
5118
+ readonly readonly: boolean;
5119
+ readonly children: IFileStatWithMetadata[] | undefined;
5120
+ }
5121
+
5122
+ interface ITextEditorModel extends IEditorModel {
5123
+ /**
5124
+ * Provides access to the underlying `ITextModel`.
5125
+ */
5126
+ readonly textEditorModel: ITextModel | null;
5127
+ /**
5128
+ * Creates a snapshot of the model's contents.
5129
+ */
5130
+ createSnapshot(this: IResolvedTextEditorModel): ITextSnapshot;
5131
+ createSnapshot(this: ITextEditorModel): ITextSnapshot | null;
5132
+ /**
5133
+ * Signals if this model is readonly or not.
5134
+ */
5135
+ isReadonly(): boolean;
5136
+ /**
5137
+ * The language id of the text model if known.
5138
+ */
5139
+ getLanguageId(): string | undefined;
5140
+ }
5141
+ interface IResolvedTextEditorModel extends ITextEditorModel {
5142
+ /**
5143
+ * Same as ITextEditorModel#textEditorModel, but never null.
5144
+ */
5145
+ readonly textEditorModel: ITextModel;
5146
+ }
5147
+
5148
+ declare const enum SaveReason {
5149
+ /**
5150
+ * Explicit user gesture.
5151
+ */
5152
+ EXPLICIT = 1,
5153
+ /**
5154
+ * Auto save after a timeout.
5155
+ */
5156
+ AUTO = 2,
5157
+ /**
5158
+ * Auto save after editor focus change.
5159
+ */
5160
+ FOCUS_CHANGE = 3,
5161
+ /**
5162
+ * Auto save after window change.
5163
+ */
5164
+ WINDOW_CHANGE = 4
5165
+ }
5166
+ type SaveSource = string;
5167
+ interface ISaveOptions {
5168
+ /**
5169
+ * An indicator how the save operation was triggered.
5170
+ */
5171
+ reason?: SaveReason;
5172
+ /**
5173
+ * An indicator about the source of the save operation.
5174
+ *
5175
+ * Must use `SaveSourceRegistry.registerSource()` to obtain.
5176
+ */
5177
+ readonly source?: SaveSource;
5178
+ /**
5179
+ * Forces to save the contents of the working copy
5180
+ * again even if the working copy is not dirty.
5181
+ */
5182
+ readonly force?: boolean;
5183
+ /**
5184
+ * Instructs the save operation to skip any save participants.
5185
+ */
5186
+ readonly skipSaveParticipants?: boolean;
5187
+ /**
5188
+ * A hint as to which file systems should be available for saving.
5189
+ */
5190
+ readonly availableFileSystems?: string[];
5191
+ }
5192
+ interface IRevertOptions {
5193
+ /**
5194
+ * Forces to load the contents of the working copy
5195
+ * again even if the working copy is not dirty.
5196
+ */
5197
+ readonly force?: boolean;
5198
+ /**
5199
+ * A soft revert will clear dirty state of a working copy
5200
+ * but will not attempt to load it from its persisted state.
5201
+ *
5202
+ * This option may be used in scenarios where an editor is
5203
+ * closed and where we do not require to load the contents.
5204
+ */
5205
+ readonly soft?: boolean;
5206
+ }
5207
+
5208
+ declare const enum WorkingCopyCapabilities {
5209
+ /**
5210
+ * Signals no specific capability for the working copy.
5211
+ */
5212
+ None = 0,
5213
+ /**
5214
+ * Signals that the working copy requires
5215
+ * additional input when saving, e.g. an
5216
+ * associated path to save to.
5217
+ */
5218
+ Untitled = 2
5219
+ }
5220
+ /**
5221
+ * Data to be associated with working copy backups. Use
5222
+ * `IWorkingCopyBackupService.resolve(workingCopy)` to
5223
+ * retrieve the backup when loading the working copy.
5224
+ */
5225
+ interface IWorkingCopyBackup {
5226
+ /**
5227
+ * Any serializable metadata to be associated with the backup.
5228
+ */
5229
+ meta?: IWorkingCopyBackupMeta;
5230
+ /**
5231
+ * The actual snapshot of the contents of the working copy at
5232
+ * the time the backup was made.
5233
+ */
5234
+ content?: VSBufferReadable | VSBufferReadableStream;
5235
+ }
5236
+ /**
5237
+ * Working copy backup metadata that can be associated
5238
+ * with the backup.
5239
+ *
5240
+ * Some properties may be reserved as outlined here and
5241
+ * cannot be used.
5242
+ */
5243
+ interface IWorkingCopyBackupMeta {
5244
+ /**
5245
+ * Any property needs to be serializable through JSON.
5246
+ */
5247
+ [key: string]: unknown;
5248
+ /**
5249
+ * `typeId` is a reserved property that cannot be used
5250
+ * as backup metadata.
5251
+ */
5252
+ typeId?: never;
5253
+ }
5254
+ /**
5255
+ * Every working copy has in common that it is identified by
5256
+ * a resource `URI` and a `typeId`. There can only be one
5257
+ * working copy registered with the same `URI` and `typeId`.
5258
+ */
5259
+ interface IWorkingCopyIdentifier {
5260
+ /**
5261
+ * The type identifier of the working copy for grouping
5262
+ * working copies of the same domain together.
5263
+ *
5264
+ * There can only be one working copy for a given resource
5265
+ * and type identifier.
5266
+ */
5267
+ readonly typeId: string;
5268
+ /**
5269
+ * The resource of the working copy must be unique for
5270
+ * working copies of the same `typeId`.
5271
+ */
5272
+ readonly resource: URI;
5273
+ }
5274
+ interface IWorkingCopySaveEvent {
5275
+ /**
5276
+ * The reason why the working copy was saved.
5277
+ */
5278
+ readonly reason?: SaveReason;
5279
+ /**
5280
+ * The source of the working copy save request.
5281
+ */
5282
+ readonly source?: SaveSource;
5283
+ }
5284
+ /**
5285
+ * A working copy is an abstract concept to unify handling of
5286
+ * data that can be worked on (e.g. edited) in an editor.
5287
+ *
5288
+ *
5289
+ * A working copy resource may be the backing store of the data
5290
+ * (e.g. a file on disk), but that is not a requirement. If
5291
+ * your working copy is file based, consider to use the
5292
+ * `IFileWorkingCopy` instead that simplifies a lot of things
5293
+ * when working with file based working copies.
5294
+ */
5295
+ interface IWorkingCopy extends IWorkingCopyIdentifier {
5296
+ /**
5297
+ * Human readable name of the working copy.
5298
+ */
5299
+ readonly name: string;
5300
+ /**
5301
+ * The capabilities of the working copy.
5302
+ */
5303
+ readonly capabilities: WorkingCopyCapabilities;
5304
+ /**
5305
+ * Used by the workbench to signal if the working copy
5306
+ * is dirty or not. Typically a working copy is dirty
5307
+ * once changed until saved or reverted.
5308
+ */
5309
+ readonly onDidChangeDirty: Event<void>;
5310
+ /**
5311
+ * Used by the workbench e.g. to trigger auto-save
5312
+ * (unless this working copy is untitled) and backups.
5313
+ */
5314
+ readonly onDidChangeContent: Event<void>;
5315
+ /**
5316
+ * Used by the workbench e.g. to track local history
5317
+ * (unless this working copy is untitled).
5318
+ */
5319
+ readonly onDidSave: Event<IWorkingCopySaveEvent>;
5320
+ isDirty(): boolean;
5321
+ /**
5322
+ * The workbench may call this method often after it receives
5323
+ * the `onDidChangeContent` event for the working copy. The motivation
5324
+ * is to allow to quit VSCode with dirty working copies present.
5325
+ *
5326
+ * Providers of working copies should use `IWorkingCopyBackupService.resolve(workingCopy)`
5327
+ * to retrieve the backup metadata associated when loading the working copy.
5328
+ *
5329
+ * @param token support for cancellation
5330
+ */
5331
+ backup(token: CancellationToken): Promise<IWorkingCopyBackup>;
5332
+ /**
5333
+ * Asks the working copy to save. If the working copy was dirty, it is
5334
+ * expected to be non-dirty after this operation has finished.
5335
+ *
5336
+ * @returns `true` if the operation was successful and `false` otherwise.
5337
+ */
5338
+ save(options?: ISaveOptions): Promise<boolean>;
5339
+ /**
5340
+ * Asks the working copy to revert. If the working copy was dirty, it is
5341
+ * expected to be non-dirty after this operation has finished.
5342
+ */
5343
+ revert(options?: IRevertOptions): Promise<void>;
5344
+ }
5345
+
5346
+ /**
5347
+ * States the text file editor model can be in.
5348
+ */
5349
+ declare const enum TextFileEditorModelState {
5350
+ /**
5351
+ * A model is saved.
5352
+ */
5353
+ SAVED = 0,
5354
+ /**
5355
+ * A model is dirty.
5356
+ */
5357
+ DIRTY = 1,
5358
+ /**
5359
+ * A model is currently being saved but this operation has not completed yet.
5360
+ */
5361
+ PENDING_SAVE = 2,
5362
+ /**
5363
+ * A model is in conflict mode when changes cannot be saved because the
5364
+ * underlying file has changed. Models in conflict mode are always dirty.
5365
+ */
5366
+ CONFLICT = 3,
5367
+ /**
5368
+ * A model is in orphan state when the underlying file has been deleted.
5369
+ */
5370
+ ORPHAN = 4,
5371
+ /**
5372
+ * Any error that happens during a save that is not causing the CONFLICT state.
5373
+ * Models in error mode are always dirty.
5374
+ */
5375
+ ERROR = 5
5376
+ }
5377
+ declare const enum TextFileResolveReason {
5378
+ EDITOR = 1,
5379
+ REFERENCE = 2,
5380
+ OTHER = 3
5381
+ }
5382
+ interface ITextFileSaveOptions extends ISaveOptions {
5383
+ /**
5384
+ * Save the file with an attempt to unlock it.
5385
+ */
5386
+ readonly writeUnlock?: boolean;
5387
+ /**
5388
+ * Save the file with elevated privileges.
5389
+ *
5390
+ * Note: This may not be supported in all environments.
5391
+ */
5392
+ readonly writeElevated?: boolean;
5393
+ /**
5394
+ * Allows to write to a file even if it has been modified on disk.
5395
+ */
5396
+ readonly ignoreModifiedSince?: boolean;
5397
+ /**
5398
+ * If set, will bubble up the error to the caller instead of handling it.
5399
+ */
5400
+ readonly ignoreErrorHandler?: boolean;
5401
+ }
5402
+ interface ITextFileResolveOptions {
5403
+ /**
5404
+ * The contents to use for the model if known. If not
5405
+ * provided, the contents will be retrieved from the
5406
+ * underlying resource or backup if present.
5407
+ */
5408
+ readonly contents?: ITextBufferFactory;
5409
+ /**
5410
+ * Go to file bypassing any cache of the model if any.
5411
+ */
5412
+ readonly forceReadFromFile?: boolean;
5413
+ /**
5414
+ * Allow to resolve a model even if we think it is a binary file.
5415
+ */
5416
+ readonly allowBinary?: boolean;
5417
+ /**
5418
+ * Context why the model is being resolved.
5419
+ */
5420
+ readonly reason?: TextFileResolveReason;
5421
+ /**
5422
+ * If provided, the size of the file will be checked against the limits
5423
+ * and an error will be thrown if any limit is exceeded.
5424
+ */
5425
+ readonly limits?: IFileReadLimits;
5426
+ }
5427
+ declare const enum EncodingMode {
5428
+ /**
5429
+ * Instructs the encoding support to encode the object with the provided encoding
5430
+ */
5431
+ Encode = 0,
5432
+ /**
5433
+ * Instructs the encoding support to decode the object with the provided encoding
5434
+ */
5435
+ Decode = 1
5436
+ }
5437
+ interface IEncodingSupport {
5438
+ /**
5439
+ * Gets the encoding of the object if known.
5440
+ */
5441
+ getEncoding(): string | undefined;
5442
+ /**
5443
+ * Sets the encoding for the object for saving.
5444
+ */
5445
+ setEncoding(encoding: string, mode: EncodingMode): Promise<void>;
5446
+ }
5447
+ interface ILanguageSupport {
5448
+ /**
5449
+ * Sets the language id of the object.
5450
+ */
5451
+ setLanguageId(languageId: string, source?: string): void;
5452
+ }
5453
+ interface ITextFileEditorModelSaveEvent extends IWorkingCopySaveEvent {
5454
+ /**
5455
+ * The resolved stat from the save operation.
5456
+ */
5457
+ readonly stat: IFileStatWithMetadata;
5458
+ }
5459
+ interface ITextFileEditorModel extends ITextEditorModel, IEncodingSupport, ILanguageSupport, IWorkingCopy {
5460
+ readonly onDidSave: Event<ITextFileEditorModelSaveEvent>;
5461
+ readonly onDidSaveError: Event<void>;
5462
+ readonly onDidChangeOrphaned: Event<void>;
5463
+ readonly onDidChangeReadonly: Event<void>;
5464
+ readonly onDidChangeEncoding: Event<void>;
5465
+ hasState(state: TextFileEditorModelState): boolean;
5466
+ joinState(state: TextFileEditorModelState.PENDING_SAVE): Promise<void>;
5467
+ updatePreferredEncoding(encoding: string | undefined): void;
5468
+ save(options?: ITextFileSaveOptions): Promise<boolean>;
5469
+ revert(options?: IRevertOptions): Promise<void>;
5470
+ resolve(options?: ITextFileResolveOptions): Promise<void>;
5471
+ isDirty(): this is IResolvedTextFileEditorModel;
5472
+ getLanguageId(): string | undefined;
5473
+ isResolved(): this is IResolvedTextFileEditorModel;
5474
+ }
5475
+ interface IResolvedTextFileEditorModel extends ITextFileEditorModel {
5476
+ readonly textEditorModel: ITextModel;
5477
+ createSnapshot(): ITextSnapshot;
5478
+ }
5479
+
5480
+ declare function writeFile(uri: URI, content: string): Promise<void>;
5481
+ declare function deleteFile(uri: URI, options?: Partial<IFileDeleteOptions>): Promise<void>;
5482
+ declare function createModelReference(resource: URI, content?: string): Promise<IReference<ITextFileEditorModel>>;
4512
5483
  declare const createConfiguredEditor: typeof create;
4513
5484
  declare const createConfiguredDiffEditor: typeof createDiffEditor;
4514
5485
  declare const Extensions: {
4515
5486
  Configuration: string;
4516
5487
  JSONContribution: string;
4517
5488
  };
4518
- type FileMatch = Partial<Record<string, string[]>>;
4519
- declare function getJsonSchemas(fileMatchs?: FileMatch): monaco.languages.json.DiagnosticsOptions['schemas'];
4520
- declare const onDidChangeJsonSchema: Event<string>;
5489
+ /**
5490
+ * Synchronize registered json schema on the monaco json worker
5491
+ */
5492
+ declare function synchronizeJsonSchemas(): monaco.IDisposable;
4521
5493
 
4522
- export { CommandsRegistry, ContextKeyExprType, DisposableStore, Extensions, FoldingController, FoldingModel, IJSONContributionRegistry, IJSONSchema, Registry, createConfiguredDiffEditor, createConfiguredEditor, errorHandler, getJsonSchemas, onDidChangeJsonSchema, registerColor, setCollapseStateForMatchingLines };
5494
+ export { CommandsRegistry, ContextKeyExprType, DisposableStore, Extensions, FoldingController, FoldingModel, IJSONContributionRegistry, IJSONSchema, Registry, createConfiguredDiffEditor, createConfiguredEditor, createModelReference, deleteFile, errorHandler, registerColor, setCollapseStateForMatchingLines, synchronizeJsonSchemas, writeFile };