@ng-util/monaco-editor 15.0.0 → 16.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/monaco.d.ts CHANGED
@@ -19,10 +19,45 @@ declare namespace monaco {
19
19
  export type Thenable<T> = PromiseLike<T>;
20
20
 
21
21
  export interface Environment {
22
+ /**
23
+ * Define a global `monaco` symbol.
24
+ * This is true by default in AMD and false by default in ESM.
25
+ */
22
26
  globalAPI?: boolean;
27
+ /**
28
+ * The base url where the editor sources are found (which contains the vs folder)
29
+ */
23
30
  baseUrl?: string;
31
+ /**
32
+ * A web worker factory.
33
+ * NOTE: If `getWorker` is defined, `getWorkerUrl` is not invoked.
34
+ */
24
35
  getWorker?(workerId: string, label: string): Promise<Worker> | Worker;
36
+ /**
37
+ * Return the location for web worker scripts.
38
+ * NOTE: If `getWorker` is defined, `getWorkerUrl` is not invoked.
39
+ */
25
40
  getWorkerUrl?(workerId: string, label: string): string;
41
+ /**
42
+ * Create a trusted types policy (same API as window.trustedTypes.createPolicy)
43
+ */
44
+ createTrustedTypesPolicy?(
45
+ policyName: string,
46
+ policyOptions?: ITrustedTypePolicyOptions,
47
+ ): undefined | ITrustedTypePolicy;
48
+ }
49
+
50
+ export interface ITrustedTypePolicyOptions {
51
+ createHTML?: (input: string, ...arguments: any[]) => string;
52
+ createScript?: (input: string, ...arguments: any[]) => string;
53
+ createScriptURL?: (input: string, ...arguments: any[]) => string;
54
+ }
55
+
56
+ export interface ITrustedTypePolicy {
57
+ readonly name: string;
58
+ createHTML?(input: string): any;
59
+ createScript?(input: string): any;
60
+ createScriptURL?(input: string): any;
26
61
  }
27
62
 
28
63
  export interface IDisposable {
@@ -179,13 +214,14 @@ declare namespace monaco {
179
214
  * @param path A file system path (see `Uri#fsPath`)
180
215
  */
181
216
  static file(path: string): Uri;
182
- static from(components: {
183
- scheme: string;
184
- authority?: string;
185
- path?: string;
186
- query?: string;
187
- fragment?: string;
188
- }): Uri;
217
+ /**
218
+ * Creates new Uri from uri components.
219
+ *
220
+ * Unless `strict` is `true` the scheme is defaults to be `file`. This function performs
221
+ * validation and should be used for untrusted uri components retrieved from storage,
222
+ * user input, command arguments etc
223
+ */
224
+ static from(components: UriComponents, strict?: boolean): Uri;
189
225
  /**
190
226
  * Join a Uri path with path fragments and normalizes the resulting path.
191
227
  *
@@ -207,6 +243,16 @@ declare namespace monaco {
207
243
  */
208
244
  toString(skipEncoding?: boolean): string;
209
245
  toJSON(): UriComponents;
246
+ /**
247
+ * A helper function to revive URIs.
248
+ *
249
+ * **Note** that this function should only be used when receiving Uri#toJSON generated data
250
+ * and that it doesn't do any validation. Use {@link Uri.from} when received "untrusted"
251
+ * uri components such as command arguments or data from storage.
252
+ *
253
+ * @param data The Uri components or Uri to revive.
254
+ * @returns The revived Uri or undefined or null.
255
+ */
210
256
  static revive(data: UriComponents | Uri): Uri;
211
257
  static revive(data: UriComponents | Uri | undefined): Uri | undefined;
212
258
  static revive(data: UriComponents | Uri | null): Uri | null;
@@ -215,10 +261,10 @@ declare namespace monaco {
215
261
 
216
262
  export interface UriComponents {
217
263
  scheme: string;
218
- authority: string;
219
- path: string;
220
- query: string;
221
- fragment: string;
264
+ authority?: string;
265
+ path?: string;
266
+ query?: string;
267
+ fragment?: string;
222
268
  }
223
269
  /**
224
270
  * Virtual Key Codes, the value does not hold any inherent meaning.
@@ -308,116 +354,121 @@ declare namespace monaco {
308
354
  F17 = 75,
309
355
  F18 = 76,
310
356
  F19 = 77,
311
- NumLock = 78,
312
- ScrollLock = 79,
357
+ F20 = 78,
358
+ F21 = 79,
359
+ F22 = 80,
360
+ F23 = 81,
361
+ F24 = 82,
362
+ NumLock = 83,
363
+ ScrollLock = 84,
313
364
  /**
314
365
  * Used for miscellaneous characters; it can vary by keyboard.
315
366
  * For the US standard keyboard, the ';:' key
316
367
  */
317
- Semicolon = 80,
368
+ Semicolon = 85,
318
369
  /**
319
370
  * For any country/region, the '+' key
320
371
  * For the US standard keyboard, the '=+' key
321
372
  */
322
- Equal = 81,
373
+ Equal = 86,
323
374
  /**
324
375
  * For any country/region, the ',' key
325
376
  * For the US standard keyboard, the ',<' key
326
377
  */
327
- Comma = 82,
378
+ Comma = 87,
328
379
  /**
329
380
  * For any country/region, the '-' key
330
381
  * For the US standard keyboard, the '-_' key
331
382
  */
332
- Minus = 83,
383
+ Minus = 88,
333
384
  /**
334
385
  * For any country/region, the '.' key
335
386
  * For the US standard keyboard, the '.>' key
336
387
  */
337
- Period = 84,
388
+ Period = 89,
338
389
  /**
339
390
  * Used for miscellaneous characters; it can vary by keyboard.
340
391
  * For the US standard keyboard, the '/?' key
341
392
  */
342
- Slash = 85,
393
+ Slash = 90,
343
394
  /**
344
395
  * Used for miscellaneous characters; it can vary by keyboard.
345
396
  * For the US standard keyboard, the '`~' key
346
397
  */
347
- Backquote = 86,
398
+ Backquote = 91,
348
399
  /**
349
400
  * Used for miscellaneous characters; it can vary by keyboard.
350
401
  * For the US standard keyboard, the '[{' key
351
402
  */
352
- BracketLeft = 87,
403
+ BracketLeft = 92,
353
404
  /**
354
405
  * Used for miscellaneous characters; it can vary by keyboard.
355
406
  * For the US standard keyboard, the '\|' key
356
407
  */
357
- Backslash = 88,
408
+ Backslash = 93,
358
409
  /**
359
410
  * Used for miscellaneous characters; it can vary by keyboard.
360
411
  * For the US standard keyboard, the ']}' key
361
412
  */
362
- BracketRight = 89,
413
+ BracketRight = 94,
363
414
  /**
364
415
  * Used for miscellaneous characters; it can vary by keyboard.
365
416
  * For the US standard keyboard, the ''"' key
366
417
  */
367
- Quote = 90,
418
+ Quote = 95,
368
419
  /**
369
420
  * Used for miscellaneous characters; it can vary by keyboard.
370
421
  */
371
- OEM_8 = 91,
422
+ OEM_8 = 96,
372
423
  /**
373
424
  * Either the angle bracket key or the backslash key on the RT 102-key keyboard.
374
425
  */
375
- IntlBackslash = 92,
376
- Numpad0 = 93,
377
- Numpad1 = 94,
378
- Numpad2 = 95,
379
- Numpad3 = 96,
380
- Numpad4 = 97,
381
- Numpad5 = 98,
382
- Numpad6 = 99,
383
- Numpad7 = 100,
384
- Numpad8 = 101,
385
- Numpad9 = 102,
386
- NumpadMultiply = 103,
387
- NumpadAdd = 104,
388
- NUMPAD_SEPARATOR = 105,
389
- NumpadSubtract = 106,
390
- NumpadDecimal = 107,
391
- NumpadDivide = 108,
426
+ IntlBackslash = 97,
427
+ Numpad0 = 98,// VK_NUMPAD0, 0x60, Numeric keypad 0 key
428
+ Numpad1 = 99,// VK_NUMPAD1, 0x61, Numeric keypad 1 key
429
+ Numpad2 = 100,// VK_NUMPAD2, 0x62, Numeric keypad 2 key
430
+ Numpad3 = 101,// VK_NUMPAD3, 0x63, Numeric keypad 3 key
431
+ Numpad4 = 102,// VK_NUMPAD4, 0x64, Numeric keypad 4 key
432
+ Numpad5 = 103,// VK_NUMPAD5, 0x65, Numeric keypad 5 key
433
+ Numpad6 = 104,// VK_NUMPAD6, 0x66, Numeric keypad 6 key
434
+ Numpad7 = 105,// VK_NUMPAD7, 0x67, Numeric keypad 7 key
435
+ Numpad8 = 106,// VK_NUMPAD8, 0x68, Numeric keypad 8 key
436
+ Numpad9 = 107,// VK_NUMPAD9, 0x69, Numeric keypad 9 key
437
+ NumpadMultiply = 108,// VK_MULTIPLY, 0x6A, Multiply key
438
+ NumpadAdd = 109,// VK_ADD, 0x6B, Add key
439
+ NUMPAD_SEPARATOR = 110,// VK_SEPARATOR, 0x6C, Separator key
440
+ NumpadSubtract = 111,// VK_SUBTRACT, 0x6D, Subtract key
441
+ NumpadDecimal = 112,// VK_DECIMAL, 0x6E, Decimal key
442
+ NumpadDivide = 113,// VK_DIVIDE, 0x6F,
392
443
  /**
393
444
  * Cover all key codes when IME is processing input.
394
445
  */
395
- KEY_IN_COMPOSITION = 109,
396
- ABNT_C1 = 110,
397
- ABNT_C2 = 111,
398
- AudioVolumeMute = 112,
399
- AudioVolumeUp = 113,
400
- AudioVolumeDown = 114,
401
- BrowserSearch = 115,
402
- BrowserHome = 116,
403
- BrowserBack = 117,
404
- BrowserForward = 118,
405
- MediaTrackNext = 119,
406
- MediaTrackPrevious = 120,
407
- MediaStop = 121,
408
- MediaPlayPause = 122,
409
- LaunchMediaPlayer = 123,
410
- LaunchMail = 124,
411
- LaunchApp2 = 125,
446
+ KEY_IN_COMPOSITION = 114,
447
+ ABNT_C1 = 115,// Brazilian (ABNT) Keyboard
448
+ ABNT_C2 = 116,// Brazilian (ABNT) Keyboard
449
+ AudioVolumeMute = 117,
450
+ AudioVolumeUp = 118,
451
+ AudioVolumeDown = 119,
452
+ BrowserSearch = 120,
453
+ BrowserHome = 121,
454
+ BrowserBack = 122,
455
+ BrowserForward = 123,
456
+ MediaTrackNext = 124,
457
+ MediaTrackPrevious = 125,
458
+ MediaStop = 126,
459
+ MediaPlayPause = 127,
460
+ LaunchMediaPlayer = 128,
461
+ LaunchMail = 129,
462
+ LaunchApp2 = 130,
412
463
  /**
413
464
  * VK_CLEAR, 0x0C, CLEAR key
414
465
  */
415
- Clear = 126,
466
+ Clear = 131,
416
467
  /**
417
468
  * Placed last to cover the length of the enum.
418
469
  * Please do not depend on this value!
419
470
  */
420
- MAX_VALUE = 127
471
+ MAX_VALUE = 132
421
472
  }
422
473
  export class KeyMod {
423
474
  static readonly CtrlCmd: number;
@@ -429,7 +480,7 @@ declare namespace monaco {
429
480
 
430
481
  export interface IMarkdownString {
431
482
  readonly value: string;
432
- readonly isTrusted?: boolean;
483
+ readonly isTrusted?: boolean | MarkdownStringTrustedOptions;
433
484
  readonly supportThemeIcons?: boolean;
434
485
  readonly supportHtml?: boolean;
435
486
  readonly baseUri?: UriComponents;
@@ -438,6 +489,10 @@ declare namespace monaco {
438
489
  };
439
490
  }
440
491
 
492
+ export interface MarkdownStringTrustedOptions {
493
+ readonly enabledCommands: readonly string[];
494
+ }
495
+
441
496
  export interface IKeyboardEvent {
442
497
  readonly _standardKeyboardEventBrand: true;
443
498
  readonly browserEvent: KeyboardEvent;
@@ -446,6 +501,7 @@ declare namespace monaco {
446
501
  readonly shiftKey: boolean;
447
502
  readonly altKey: boolean;
448
503
  readonly metaKey: boolean;
504
+ readonly altGraphKey: boolean;
449
505
  readonly keyCode: KeyCode;
450
506
  readonly code: string;
451
507
  equals(keybinding: number): boolean;
@@ -668,11 +724,11 @@ declare namespace monaco {
668
724
  /**
669
725
  * Test if this range equals other.
670
726
  */
671
- equalsRange(other: IRange | null): boolean;
727
+ equalsRange(other: IRange | null | undefined): boolean;
672
728
  /**
673
729
  * Test if range `a` equals `b`.
674
730
  */
675
- static equalsRange(a: IRange | null, b: IRange | null): boolean;
731
+ static equalsRange(a: IRange | null | undefined, b: IRange | null | undefined): boolean;
676
732
  /**
677
733
  * Return the end position (which will be after or equal to the start position)
678
734
  */
@@ -709,6 +765,18 @@ declare namespace monaco {
709
765
  * Create a new empty range using this range's start position.
710
766
  */
711
767
  static collapseToStart(range: IRange): Range;
768
+ /**
769
+ * Create a new empty range using this range's end position.
770
+ */
771
+ collapseToEnd(): Range;
772
+ /**
773
+ * Create a new empty range using this range's end position.
774
+ */
775
+ static collapseToEnd(range: IRange): Range;
776
+ /**
777
+ * Moves the range by the given amount of lines.
778
+ */
779
+ delta(lineCount: number): Range;
712
780
  static fromPositions(start: IPosition, end?: IPosition): Range;
713
781
  /**
714
782
  * Create a `Range` from an `IRange`.
@@ -863,10 +931,10 @@ declare namespace monaco {
863
931
  }
864
932
 
865
933
  export class Token {
866
- _tokenBrand: void;
867
934
  readonly offset: number;
868
935
  readonly type: string;
869
936
  readonly language: string;
937
+ _tokenBrand: void;
870
938
  constructor(offset: number, type: string, language: string);
871
939
  toString(): string;
872
940
  }
@@ -874,13 +942,6 @@ declare namespace monaco {
874
942
 
875
943
  declare namespace monaco.editor {
876
944
 
877
- export interface IDiffNavigator {
878
- canNavigate(): boolean;
879
- next(): void;
880
- previous(): void;
881
- dispose(): void;
882
- }
883
-
884
945
  /**
885
946
  * Create a new editor under `domElement`.
886
947
  * `domElement` should be empty (not contain other dom nodes).
@@ -918,14 +979,6 @@ declare namespace monaco.editor {
918
979
  */
919
980
  export function createDiffEditor(domElement: HTMLElement, options?: IStandaloneDiffEditorConstructionOptions, override?: IEditorOverrideServices): IStandaloneDiffEditor;
920
981
 
921
- export interface IDiffNavigatorOptions {
922
- readonly followsCaret?: boolean;
923
- readonly ignoreCharChanges?: boolean;
924
- readonly alwaysRevealFirst?: boolean;
925
- }
926
-
927
- export function createDiffNavigator(diffEditor: IStandaloneDiffEditor, opts?: IDiffNavigatorOptions): IDiffNavigator;
928
-
929
982
  /**
930
983
  * Description of a command contribution
931
984
  */
@@ -979,7 +1032,7 @@ declare namespace monaco.editor {
979
1032
  /**
980
1033
  * Change the language for a model.
981
1034
  */
982
- export function setModelLanguage(model: ITextModel, languageId: string): void;
1035
+ export function setModelLanguage(model: ITextModel, mimeTypeOrLanguageId: string): void;
983
1036
 
984
1037
  /**
985
1038
  * Set the markers for a model.
@@ -1085,6 +1138,43 @@ declare namespace monaco.editor {
1085
1138
  */
1086
1139
  export function registerCommand(id: string, handler: (accessor: any, ...args: any[]) => void): IDisposable;
1087
1140
 
1141
+ export interface ILinkOpener {
1142
+ open(resource: Uri): boolean | Promise<boolean>;
1143
+ }
1144
+
1145
+ /**
1146
+ * Registers a handler that is called when a link is opened in any editor. The handler callback should return `true` if the link was handled and `false` otherwise.
1147
+ * The handler that was registered last will be called first when a link is opened.
1148
+ *
1149
+ * Returns a disposable that can unregister the opener again.
1150
+ */
1151
+ export function registerLinkOpener(opener: ILinkOpener): IDisposable;
1152
+
1153
+ /**
1154
+ * Represents an object that can handle editor open operations (e.g. when "go to definition" is called
1155
+ * with a resource other than the current model).
1156
+ */
1157
+ export interface ICodeEditorOpener {
1158
+ /**
1159
+ * Callback that is invoked when a resource other than the current model should be opened (e.g. when "go to definition" is called).
1160
+ * The callback should return `true` if the request was handled and `false` otherwise.
1161
+ * @param source The code editor instance that initiated the request.
1162
+ * @param resource The Uri of the resource that should be opened.
1163
+ * @param selectionOrPosition An optional position or selection inside the model corresponding to `resource` that can be used to set the cursor.
1164
+ */
1165
+ openCodeEditor(source: ICodeEditor, resource: Uri, selectionOrPosition?: IRange | IPosition): boolean | Promise<boolean>;
1166
+ }
1167
+
1168
+ /**
1169
+ * Registers a handler that is called when a resource other than the current model should be opened in the editor (e.g. "go to definition").
1170
+ * The handler callback should return `true` if the request was handled and `false` otherwise.
1171
+ *
1172
+ * Returns a disposable that can unregister the opener again.
1173
+ *
1174
+ * If no handler is registered the default behavior is to do nothing for models other than the currently attached one.
1175
+ */
1176
+ export function registerEditorOpener(opener: ICodeEditorOpener): IDisposable;
1177
+
1088
1178
  export type BuiltinTheme = 'vs' | 'vs-dark' | 'hc-black' | 'hc-light';
1089
1179
 
1090
1180
  export interface IStandaloneThemeData {
@@ -1244,7 +1334,7 @@ declare namespace monaco.editor {
1244
1334
  */
1245
1335
  'semanticHighlighting.enabled'?: true | false | 'configuredByTheme';
1246
1336
  /**
1247
- * Keep peek editors open even when double clicking their content or when hitting `Escape`.
1337
+ * Keep peek editors open even when double-clicking their content or when hitting `Escape`.
1248
1338
  * Defaults to false.
1249
1339
  */
1250
1340
  stablePeek?: boolean;
@@ -1376,6 +1466,7 @@ declare namespace monaco.editor {
1376
1466
  startColumn: number;
1377
1467
  endLineNumber: number;
1378
1468
  endColumn: number;
1469
+ modelVersionId?: number;
1379
1470
  relatedInformation?: IRelatedInformation[];
1380
1471
  tags?: MarkerTag[];
1381
1472
  }
@@ -1395,6 +1486,7 @@ declare namespace monaco.editor {
1395
1486
  startColumn: number;
1396
1487
  endLineNumber: number;
1397
1488
  endColumn: number;
1489
+ modelVersionId?: number;
1398
1490
  relatedInformation?: IRelatedInformation[];
1399
1491
  tags?: MarkerTag[];
1400
1492
  }
@@ -1478,6 +1570,14 @@ declare namespace monaco.editor {
1478
1570
  Full = 7
1479
1571
  }
1480
1572
 
1573
+ /**
1574
+ * Vertical Lane in the glyph margin of the editor.
1575
+ */
1576
+ export enum GlyphMarginLane {
1577
+ Left = 1,
1578
+ Right = 2
1579
+ }
1580
+
1481
1581
  /**
1482
1582
  * Position in the minimap to render the decoration.
1483
1583
  */
@@ -1499,6 +1599,13 @@ declare namespace monaco.editor {
1499
1599
  darkColor?: string | ThemeColor;
1500
1600
  }
1501
1601
 
1602
+ export interface IModelDecorationGlyphMarginOptions {
1603
+ /**
1604
+ * The position in the glyph margin.
1605
+ */
1606
+ position: GlyphMarginLane;
1607
+ }
1608
+
1502
1609
  /**
1503
1610
  * Options for rendering a model decoration in the overview ruler.
1504
1611
  */
@@ -1510,11 +1617,11 @@ declare namespace monaco.editor {
1510
1617
  }
1511
1618
 
1512
1619
  /**
1513
- * Options for rendering a model decoration in the overview ruler.
1620
+ * Options for rendering a model decoration in the minimap.
1514
1621
  */
1515
1622
  export interface IModelDecorationMinimapOptions extends IDecorationOptions {
1516
1623
  /**
1517
- * The position in the overview ruler.
1624
+ * The position in the minimap.
1518
1625
  */
1519
1626
  position: MinimapPosition;
1520
1627
  }
@@ -1532,7 +1639,18 @@ declare namespace monaco.editor {
1532
1639
  * CSS class name describing the decoration.
1533
1640
  */
1534
1641
  className?: string | null;
1642
+ /**
1643
+ * Indicates whether the decoration should span across the entire line when it continues onto the next line.
1644
+ */
1645
+ shouldFillLineOnLineBreak?: boolean | null;
1535
1646
  blockClassName?: string | null;
1647
+ /**
1648
+ * Indicates if this block should be rendered after the last line.
1649
+ * In this case, the range must be empty and set to the last line.
1650
+ */
1651
+ blockIsAfterEnd?: boolean | null;
1652
+ blockDoesNotCollapse?: boolean | null;
1653
+ blockPadding?: [top: number, right: number, bottom: number, left: number] | null;
1536
1654
  /**
1537
1655
  * Message to be rendered when hovering over the glyph margin decoration.
1538
1656
  */
@@ -1567,6 +1685,11 @@ declare namespace monaco.editor {
1567
1685
  * If set, the decoration will be rendered in the glyph margin with this CSS class name.
1568
1686
  */
1569
1687
  glyphMarginClassName?: string | null;
1688
+ /**
1689
+ * If set and the decoration has {@link glyphMarginClassName} set, render this decoration
1690
+ * with the specified {@link IModelDecorationGlyphMarginOptions} in the glyph margin.
1691
+ */
1692
+ glyphMargin?: IModelDecorationGlyphMarginOptions | null;
1570
1693
  /**
1571
1694
  * If set, the decoration will be rendered in the lines decorations with this CSS class name.
1572
1695
  */
@@ -1759,6 +1882,7 @@ declare namespace monaco.editor {
1759
1882
  readonly defaultEOL: DefaultEndOfLine;
1760
1883
  readonly trimAutoWhitespace: boolean;
1761
1884
  readonly bracketPairColorizationOptions: BracketPairColorizationOptions;
1885
+ get originalIndentSize(): number | 'tabSize';
1762
1886
  }
1763
1887
 
1764
1888
  export interface BracketPairColorizationOptions {
@@ -1768,7 +1892,7 @@ declare namespace monaco.editor {
1768
1892
 
1769
1893
  export interface ITextModelUpdateOptions {
1770
1894
  tabSize?: number;
1771
- indentSize?: number;
1895
+ indentSize?: number | 'tabSize';
1772
1896
  insertSpaces?: boolean;
1773
1897
  trimAutoWhitespace?: boolean;
1774
1898
  bracketColorizationOptions?: BracketPairColorizationOptions;
@@ -1861,12 +1985,12 @@ declare namespace monaco.editor {
1861
1985
  * @param range The range describing what text length to get.
1862
1986
  * @return The text length.
1863
1987
  */
1864
- getValueLengthInRange(range: IRange): number;
1988
+ getValueLengthInRange(range: IRange, eol?: EndOfLinePreference): number;
1865
1989
  /**
1866
1990
  * Get the character count of text in a certain range.
1867
1991
  * @param range The range describing what text length to get.
1868
1992
  */
1869
- getCharacterCountInRange(range: IRange): number;
1993
+ getCharacterCountInRange(range: IRange, eol?: EndOfLinePreference): number;
1870
1994
  /**
1871
1995
  * Get the number of lines in the model.
1872
1996
  */
@@ -2061,15 +2185,22 @@ declare namespace monaco.editor {
2061
2185
  * @param range The range to search in
2062
2186
  * @param ownerId If set, it will ignore decorations belonging to other owners.
2063
2187
  * @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors).
2188
+ * @param onlyMinimapDecorations If set, it will return only decorations that render in the minimap.
2189
+ * @param onlyMarginDecorations If set, it will return only decorations that render in the glyph margin.
2064
2190
  * @return An array with the decorations
2065
2191
  */
2066
- getDecorationsInRange(range: IRange, ownerId?: number, filterOutValidation?: boolean): IModelDecoration[];
2192
+ getDecorationsInRange(range: IRange, ownerId?: number, filterOutValidation?: boolean, onlyMinimapDecorations?: boolean, onlyMarginDecorations?: boolean): IModelDecoration[];
2067
2193
  /**
2068
2194
  * Gets all the decorations as an array.
2069
2195
  * @param ownerId If set, it will ignore decorations belonging to other owners.
2070
2196
  * @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors).
2071
2197
  */
2072
2198
  getAllDecorations(ownerId?: number, filterOutValidation?: boolean): IModelDecoration[];
2199
+ /**
2200
+ * Gets all decorations that render in the glyph margin as an array.
2201
+ * @param ownerId If set, it will ignore decorations belonging to other owners.
2202
+ */
2203
+ getAllMarginDecorations(ownerId?: number): IModelDecoration[];
2073
2204
  /**
2074
2205
  * Gets all the decorations that should be rendered in the overview ruler as an array.
2075
2206
  * @param ownerId If set, it will ignore decorations belonging to other owners.
@@ -2308,6 +2439,11 @@ declare namespace monaco.editor {
2308
2439
  modified: ITextModel;
2309
2440
  }
2310
2441
 
2442
+ export interface IDiffEditorViewModel {
2443
+ readonly model: IDiffEditorModel;
2444
+ waitForDiff(): Promise<void>;
2445
+ }
2446
+
2311
2447
  /**
2312
2448
  * An event describing that an editor has had its model reset (i.e. `editor.setModel()`).
2313
2449
  */
@@ -2339,10 +2475,10 @@ declare namespace monaco.editor {
2339
2475
  readonly label: string;
2340
2476
  readonly alias: string;
2341
2477
  isSupported(): boolean;
2342
- run(): Promise<void>;
2478
+ run(args?: unknown): Promise<void>;
2343
2479
  }
2344
2480
 
2345
- export type IEditorModel = ITextModel | IDiffEditorModel;
2481
+ export type IEditorModel = ITextModel | IDiffEditorModel | IDiffEditorViewModel;
2346
2482
 
2347
2483
  /**
2348
2484
  * A (serializable) state of the cursors.
@@ -2383,6 +2519,7 @@ declare namespace monaco.editor {
2383
2519
  export interface IDiffEditorViewState {
2384
2520
  original: ICodeEditorViewState | null;
2385
2521
  modified: ICodeEditorViewState | null;
2522
+ modelState?: unknown;
2386
2523
  }
2387
2524
 
2388
2525
  /**
@@ -2634,7 +2771,7 @@ declare namespace monaco.editor {
2634
2771
  /**
2635
2772
  * Replace all previous decorations with `newDecorations`.
2636
2773
  */
2637
- set(newDecorations: IModelDeltaDecoration[]): void;
2774
+ set(newDecorations: readonly IModelDeltaDecoration[]): string[];
2638
2775
  /**
2639
2776
  * Remove all previous decorations.
2640
2777
  */
@@ -2679,6 +2816,10 @@ declare namespace monaco.editor {
2679
2816
  * New language
2680
2817
  */
2681
2818
  readonly newLanguage: string;
2819
+ /**
2820
+ * Source of the call that caused the event.
2821
+ */
2822
+ readonly source: string;
2682
2823
  }
2683
2824
 
2684
2825
  /**
@@ -2732,6 +2873,10 @@ declare namespace monaco.editor {
2732
2873
  * The model has been reset to a new value.
2733
2874
  */
2734
2875
  readonly isFlush: boolean;
2876
+ /**
2877
+ * Flag that indicates that this event describes an eol change.
2878
+ */
2879
+ readonly isEolChange: boolean;
2735
2880
  }
2736
2881
 
2737
2882
  /**
@@ -2740,6 +2885,7 @@ declare namespace monaco.editor {
2740
2885
  export interface IModelDecorationsChangedEvent {
2741
2886
  readonly affectsMinimap: boolean;
2742
2887
  readonly affectsOverviewRuler: boolean;
2888
+ readonly affectsGlyphMargin: boolean;
2743
2889
  }
2744
2890
 
2745
2891
  export interface IModelOptionsChangedEvent {
@@ -2886,6 +3032,14 @@ declare namespace monaco.editor {
2886
3032
  * The aria label for the editor's textarea (when it is focused).
2887
3033
  */
2888
3034
  ariaLabel?: string;
3035
+ /**
3036
+ * Whether the aria-required attribute should be set on the editors textarea.
3037
+ */
3038
+ ariaRequired?: boolean;
3039
+ /**
3040
+ * Control whether a screen reader announces inline suggestion content immediately.
3041
+ */
3042
+ screenReaderAnnounceInlineSuggestion?: boolean;
2889
3043
  /**
2890
3044
  * The `tabindex` property of the editor's textarea
2891
3045
  */
@@ -2926,9 +3080,9 @@ declare namespace monaco.editor {
2926
3080
  cursorSurroundingLinesStyle?: 'default' | 'all';
2927
3081
  /**
2928
3082
  * Render last line number when the file ends with a newline.
2929
- * Defaults to true.
3083
+ * Defaults to 'on' for Windows and macOS and 'dimmed' for Linux.
2930
3084
  */
2931
- renderFinalNewline?: boolean;
3085
+ renderFinalNewline?: 'on' | 'off' | 'dimmed';
2932
3086
  /**
2933
3087
  * Remove unusual line terminators like LINE SEPARATOR (LS), PARAGRAPH SEPARATOR (PS).
2934
3088
  * Defaults to 'prompt'.
@@ -2976,6 +3130,10 @@ declare namespace monaco.editor {
2976
3130
  * Defaults to false.
2977
3131
  */
2978
3132
  readOnly?: boolean;
3133
+ /**
3134
+ * The message to display when the editor is readonly.
3135
+ */
3136
+ readOnlyMessage?: IMarkdownString;
2979
3137
  /**
2980
3138
  * Should the textarea used for input use the DOM `readonly` attribute.
2981
3139
  * Defaults to false.
@@ -3000,9 +3158,9 @@ declare namespace monaco.editor {
3000
3158
  */
3001
3159
  scrollbar?: IEditorScrollbarOptions;
3002
3160
  /**
3003
- * Control the behavior of experimental options
3161
+ * Control the behavior of sticky scroll options
3004
3162
  */
3005
- experimental?: IEditorExperimentalOptions;
3163
+ stickyScroll?: IEditorStickyScrollOptions;
3006
3164
  /**
3007
3165
  * Control the behavior and rendering of the minimap.
3008
3166
  */
@@ -3043,9 +3201,9 @@ declare namespace monaco.editor {
3043
3201
  mouseStyle?: 'text' | 'default' | 'copy';
3044
3202
  /**
3045
3203
  * Enable smooth caret animation.
3046
- * Defaults to false.
3204
+ * Defaults to 'off'.
3047
3205
  */
3048
- cursorSmoothCaretAnimation?: boolean;
3206
+ cursorSmoothCaretAnimation?: 'off' | 'explicit' | 'on';
3049
3207
  /**
3050
3208
  * Control the cursor style, either 'block' or 'line'.
3051
3209
  * Defaults to 'line'.
@@ -3060,6 +3218,15 @@ declare namespace monaco.editor {
3060
3218
  * Defaults to false.
3061
3219
  */
3062
3220
  fontLigatures?: boolean | string;
3221
+ /**
3222
+ * Enable font variations.
3223
+ * Defaults to false.
3224
+ */
3225
+ fontVariations?: boolean | string;
3226
+ /**
3227
+ * Controls whether to use default color decorations or not using the default document color provider
3228
+ */
3229
+ defaultColorDecorators?: boolean;
3063
3230
  /**
3064
3231
  * Disable the use of `transform: translate3d(0px, 0px, 0px)` for the editor margin and lines layers.
3065
3232
  * The usage of `transform: translate3d(0px, 0px, 0px)` acts as a hint for browsers to create an extra layer.
@@ -3092,8 +3259,7 @@ declare namespace monaco.editor {
3092
3259
  */
3093
3260
  smoothScrolling?: boolean;
3094
3261
  /**
3095
- * Enable that the editor will install an interval to check if its container dom node size has changed.
3096
- * Enabling this might have a severe performance impact.
3262
+ * Enable that the editor will install a ResizeObserver to check if its container dom node size has changed.
3097
3263
  * Defaults to false.
3098
3264
  */
3099
3265
  automaticLayout?: boolean;
@@ -3141,6 +3307,12 @@ declare namespace monaco.editor {
3141
3307
  * Configure word wrapping characters. A break will be introduced after these characters.
3142
3308
  */
3143
3309
  wordWrapBreakAfterCharacters?: string;
3310
+ /**
3311
+ * Sets whether line breaks appear wherever the text would otherwise overflow its content box.
3312
+ * When wordBreak = 'normal', Use the default line break rule.
3313
+ * When wordBreak = 'keepAll', Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.
3314
+ */
3315
+ wordBreak?: 'normal' | 'keepAll';
3144
3316
  /**
3145
3317
  * Performance guard: Stop rendering a line after x characters.
3146
3318
  * Defaults to 10000.
@@ -3160,6 +3332,14 @@ declare namespace monaco.editor {
3160
3332
  * Enable inline color decorators and color picker rendering.
3161
3333
  */
3162
3334
  colorDecorators?: boolean;
3335
+ /**
3336
+ * Controls what is the condition to spawn a color picker from a color dectorator
3337
+ */
3338
+ colorDecoratorsActivatedOn?: 'clickAndHover' | 'click' | 'hover';
3339
+ /**
3340
+ * Controls the max number of color decorators that can be rendered in an editor at once.
3341
+ */
3342
+ colorDecoratorsLimit?: number;
3163
3343
  /**
3164
3344
  * Control the behaviour of comments in the editor.
3165
3345
  */
@@ -3204,6 +3384,10 @@ declare namespace monaco.editor {
3204
3384
  * Defaults to 'spread'.
3205
3385
  */
3206
3386
  multiCursorPaste?: 'spread' | 'full';
3387
+ /**
3388
+ * Controls the max number of text cursors that can be in an active editor at once.
3389
+ */
3390
+ multiCursorLimit?: number;
3207
3391
  /**
3208
3392
  * Configure the editor's accessibility support.
3209
3393
  * Defaults to 'auto'. It is best to leave this to 'auto'.
@@ -3249,6 +3433,11 @@ declare namespace monaco.editor {
3249
3433
  * Defaults to language defined behavior.
3250
3434
  */
3251
3435
  autoClosingBrackets?: EditorAutoClosingStrategy;
3436
+ /**
3437
+ * Options for auto closing comments.
3438
+ * Defaults to language defined behavior.
3439
+ */
3440
+ autoClosingComments?: EditorAutoClosingStrategy;
3252
3441
  /**
3253
3442
  * Options for auto closing quotes.
3254
3443
  * Defaults to language defined behavior.
@@ -3408,6 +3597,11 @@ declare namespace monaco.editor {
3408
3597
  * Defaults to 'always'.
3409
3598
  */
3410
3599
  matchBrackets?: 'never' | 'near' | 'always';
3600
+ /**
3601
+ * Enable experimental whitespace rendering.
3602
+ * Defaults to 'svg'.
3603
+ */
3604
+ experimentalWhitespaceRendering?: 'svg' | 'font' | 'off';
3411
3605
  /**
3412
3606
  * Enable rendering of whitespace.
3413
3607
  * Defaults to 'selection'.
@@ -3470,6 +3664,10 @@ declare namespace monaco.editor {
3470
3664
  * Controls strikethrough deprecated variables.
3471
3665
  */
3472
3666
  showDeprecated?: boolean;
3667
+ /**
3668
+ * Controls whether suggestions allow matches in the middle of the word instead of only at the beginning
3669
+ */
3670
+ matchOnWordStartOnly?: boolean;
3473
3671
  /**
3474
3672
  * Control the behavior and rendering of the inline hints.
3475
3673
  */
@@ -3497,6 +3695,18 @@ declare namespace monaco.editor {
3497
3695
  * When enabled, this shows a preview of the drop location and triggers an `onDropIntoEditor` event.
3498
3696
  */
3499
3697
  dropIntoEditor?: IDropIntoEditorOptions;
3698
+ /**
3699
+ * Controls support for changing how content is pasted into the editor.
3700
+ */
3701
+ pasteAs?: IPasteAsOptions;
3702
+ /**
3703
+ * Controls whether the editor / terminal receives tabs or defers them to the workbench for navigation.
3704
+ */
3705
+ tabFocusMode?: boolean;
3706
+ /**
3707
+ * Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.
3708
+ */
3709
+ inlineCompletionsAccessibilityVerbose?: boolean;
3500
3710
  }
3501
3711
 
3502
3712
  export interface IDiffEditorBaseOptions {
@@ -3505,11 +3715,27 @@ declare namespace monaco.editor {
3505
3715
  * Defaults to true.
3506
3716
  */
3507
3717
  enableSplitViewResizing?: boolean;
3718
+ /**
3719
+ * The default ratio when rendering side-by-side editors.
3720
+ * Must be a number between 0 and 1, min sizes apply.
3721
+ * Defaults to 0.5
3722
+ */
3723
+ splitViewDefaultRatio?: number;
3508
3724
  /**
3509
3725
  * Render the differences in two side-by-side editors.
3510
3726
  * Defaults to true.
3511
3727
  */
3512
3728
  renderSideBySide?: boolean;
3729
+ /**
3730
+ * When `renderSideBySide` is enabled, `useInlineViewWhenSpaceIsLimited` is set,
3731
+ * and the diff editor has a width less than `renderSideBySideInlineBreakpoint`, the inline view is used.
3732
+ */
3733
+ renderSideBySideInlineBreakpoint?: number | undefined;
3734
+ /**
3735
+ * When `renderSideBySide` is enabled, `useInlineViewWhenSpaceIsLimited` is set,
3736
+ * and the diff editor has a width less than `renderSideBySideInlineBreakpoint`, the inline view is used.
3737
+ */
3738
+ useInlineViewWhenSpaceIsLimited?: boolean;
3513
3739
  /**
3514
3740
  * Timeout in milliseconds after which diff computation is cancelled.
3515
3741
  * Defaults to 5000.
@@ -3554,6 +3780,36 @@ declare namespace monaco.editor {
3554
3780
  * Control the wrapping of the diff editor.
3555
3781
  */
3556
3782
  diffWordWrap?: 'off' | 'on' | 'inherit';
3783
+ /**
3784
+ * Diff Algorithm
3785
+ */
3786
+ diffAlgorithm?: 'legacy' | 'advanced';
3787
+ /**
3788
+ * Whether the diff editor aria label should be verbose.
3789
+ */
3790
+ accessibilityVerbose?: boolean;
3791
+ experimental?: {
3792
+ /**
3793
+ * Defaults to false.
3794
+ */
3795
+ showMoves?: boolean;
3796
+ showEmptyDecorations?: boolean;
3797
+ };
3798
+ /**
3799
+ * Is the diff editor inside another editor
3800
+ * Defaults to false
3801
+ */
3802
+ isInEmbeddedEditor?: boolean;
3803
+ /**
3804
+ * If the diff editor should only show the difference review mode.
3805
+ */
3806
+ onlyShowAccessibleDiffViewer?: boolean;
3807
+ hideUnchangedRegions?: {
3808
+ enabled?: boolean;
3809
+ revealLineCount?: number;
3810
+ minimumLineCount?: number;
3811
+ contextLineCount?: number;
3812
+ };
3557
3813
  }
3558
3814
 
3559
3815
  /**
@@ -3686,7 +3942,7 @@ declare namespace monaco.editor {
3686
3942
  autoFindInSelection?: 'never' | 'always' | 'multiline';
3687
3943
  addExtraSpaceOnTop?: boolean;
3688
3944
  /**
3689
- * Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found
3945
+ * Controls whether the search result and diff result automatically restarts from the beginning (or the end) when no further matches can be found
3690
3946
  */
3691
3947
  loop?: boolean;
3692
3948
  }
@@ -3729,6 +3985,11 @@ declare namespace monaco.editor {
3729
3985
  * Defaults to true.
3730
3986
  */
3731
3987
  sticky?: boolean;
3988
+ /**
3989
+ * Controls how long the hover is visible after you hovered out of it.
3990
+ * Require sticky setting to be true.
3991
+ */
3992
+ hidingDelay?: number;
3732
3993
  /**
3733
3994
  * Should the hover be shown above the line if possible?
3734
3995
  * Defaults to false.
@@ -3784,6 +4045,10 @@ declare namespace monaco.editor {
3784
4045
  * The width of the glyph margin.
3785
4046
  */
3786
4047
  readonly glyphMarginWidth: number;
4048
+ /**
4049
+ * The number of decoration lanes to render in the glyph margin.
4050
+ */
4051
+ readonly glyphMarginDecorationLaneCount: number;
3787
4052
  /**
3788
4053
  * Left position for the line numbers.
3789
4054
  */
@@ -3861,22 +4126,23 @@ declare namespace monaco.editor {
3861
4126
  enabled?: boolean;
3862
4127
  }
3863
4128
 
3864
- export interface IEditorExperimentalOptions {
4129
+ export interface IEditorStickyScrollOptions {
3865
4130
  /**
3866
- * Configuration options for editor sticky scroll
4131
+ * Enable the sticky scroll
3867
4132
  */
3868
- stickyScroll?: {
3869
- /**
3870
- * Enable the sticky scroll
3871
- */
3872
- enabled?: boolean;
3873
- };
3874
- }
3875
-
3876
- export interface EditorExperimentalOptions {
3877
- stickyScroll: {
3878
- enabled: boolean;
3879
- };
4133
+ enabled?: boolean;
4134
+ /**
4135
+ * Maximum number of sticky lines to show
4136
+ */
4137
+ maxLineCount?: number;
4138
+ /**
4139
+ * Model to choose for sticky scroll by default
4140
+ */
4141
+ defaultModel?: 'outlineModel' | 'foldingProviderModel' | 'indentationModel';
4142
+ /**
4143
+ * Define whether to scroll sticky scroll with editor horizontal scrollbae
4144
+ */
4145
+ scrollWithEditor?: boolean;
3880
4146
  }
3881
4147
 
3882
4148
  /**
@@ -4159,6 +4425,12 @@ declare namespace monaco.editor {
4159
4425
  * Defaults to `prefix`.
4160
4426
  */
4161
4427
  mode?: 'prefix' | 'subword' | 'subwordSmart';
4428
+ showToolbar?: 'always' | 'onHover';
4429
+ suppressSuggestions?: boolean;
4430
+ /**
4431
+ * Does not clear active inline suggestions when the editor loses focus.
4432
+ */
4433
+ keepOnBlur?: boolean;
4162
4434
  }
4163
4435
 
4164
4436
  export interface IBracketPairColorizationOptions {
@@ -4224,6 +4496,10 @@ declare namespace monaco.editor {
4224
4496
  * Enable using global storage for remembering suggestions.
4225
4497
  */
4226
4498
  shareSuggestSelections?: boolean;
4499
+ /**
4500
+ * Select suggestions when triggered via quick suggest or trigger characters
4501
+ */
4502
+ selectionMode?: 'always' | 'never' | 'whenTriggerCharacter' | 'whenQuickSuggestion';
4227
4503
  /**
4228
4504
  * Enable or disable icons in suggestions. Defaults to true.
4229
4505
  */
@@ -4260,6 +4536,10 @@ declare namespace monaco.editor {
4260
4536
  * Show deprecated-suggestions.
4261
4537
  */
4262
4538
  showDeprecated?: boolean;
4539
+ /**
4540
+ * Controls whether suggestions allow matches in the middle of the word instead of only at the beginning
4541
+ */
4542
+ matchOnWordStartOnly?: boolean;
4263
4543
  /**
4264
4544
  * Show field-suggestions.
4265
4545
  */
@@ -4360,6 +4640,7 @@ declare namespace monaco.editor {
4360
4640
 
4361
4641
  export interface ISmartSelectOptions {
4362
4642
  selectLeadingAndTrailingWhitespace?: boolean;
4643
+ selectSubwords?: boolean;
4363
4644
  }
4364
4645
 
4365
4646
  /**
@@ -4396,10 +4677,31 @@ declare namespace monaco.editor {
4396
4677
  */
4397
4678
  export interface IDropIntoEditorOptions {
4398
4679
  /**
4399
- * Enable the dropping into editor.
4680
+ * Enable dropping into editor.
4400
4681
  * Defaults to true.
4401
4682
  */
4402
4683
  enabled?: boolean;
4684
+ /**
4685
+ * Controls if a widget is shown after a drop.
4686
+ * Defaults to 'afterDrop'.
4687
+ */
4688
+ showDropSelector?: 'afterDrop' | 'never';
4689
+ }
4690
+
4691
+ /**
4692
+ * Configuration options for editor pasting as into behavior
4693
+ */
4694
+ export interface IPasteAsOptions {
4695
+ /**
4696
+ * Enable paste as functionality in editors.
4697
+ * Defaults to true.
4698
+ */
4699
+ enabled?: boolean;
4700
+ /**
4701
+ * Controls if a widget is shown after a drop.
4702
+ * Defaults to 'afterPaste'.
4703
+ */
4704
+ showPasteSelector?: 'afterPaste' | 'never';
4403
4705
  }
4404
4706
 
4405
4707
  export enum EditorOption {
@@ -4408,136 +4710,149 @@ declare namespace monaco.editor {
4408
4710
  accessibilitySupport = 2,
4409
4711
  accessibilityPageSize = 3,
4410
4712
  ariaLabel = 4,
4411
- autoClosingBrackets = 5,
4412
- autoClosingDelete = 6,
4413
- autoClosingOvertype = 7,
4414
- autoClosingQuotes = 8,
4415
- autoIndent = 9,
4416
- automaticLayout = 10,
4417
- autoSurround = 11,
4418
- bracketPairColorization = 12,
4419
- guides = 13,
4420
- codeLens = 14,
4421
- codeLensFontFamily = 15,
4422
- codeLensFontSize = 16,
4423
- colorDecorators = 17,
4424
- columnSelection = 18,
4425
- comments = 19,
4426
- contextmenu = 20,
4427
- copyWithSyntaxHighlighting = 21,
4428
- cursorBlinking = 22,
4429
- cursorSmoothCaretAnimation = 23,
4430
- cursorStyle = 24,
4431
- cursorSurroundingLines = 25,
4432
- cursorSurroundingLinesStyle = 26,
4433
- cursorWidth = 27,
4434
- disableLayerHinting = 28,
4435
- disableMonospaceOptimizations = 29,
4436
- domReadOnly = 30,
4437
- dragAndDrop = 31,
4438
- dropIntoEditor = 32,
4439
- emptySelectionClipboard = 33,
4440
- experimental = 34,
4441
- extraEditorClassName = 35,
4442
- fastScrollSensitivity = 36,
4443
- find = 37,
4444
- fixedOverflowWidgets = 38,
4445
- folding = 39,
4446
- foldingStrategy = 40,
4447
- foldingHighlight = 41,
4448
- foldingImportsByDefault = 42,
4449
- foldingMaximumRegions = 43,
4450
- unfoldOnClickAfterEndOfLine = 44,
4451
- fontFamily = 45,
4452
- fontInfo = 46,
4453
- fontLigatures = 47,
4454
- fontSize = 48,
4455
- fontWeight = 49,
4456
- formatOnPaste = 50,
4457
- formatOnType = 51,
4458
- glyphMargin = 52,
4459
- gotoLocation = 53,
4460
- hideCursorInOverviewRuler = 54,
4461
- hover = 55,
4462
- inDiffEditor = 56,
4463
- inlineSuggest = 57,
4464
- letterSpacing = 58,
4465
- lightbulb = 59,
4466
- lineDecorationsWidth = 60,
4467
- lineHeight = 61,
4468
- lineNumbers = 62,
4469
- lineNumbersMinChars = 63,
4470
- linkedEditing = 64,
4471
- links = 65,
4472
- matchBrackets = 66,
4473
- minimap = 67,
4474
- mouseStyle = 68,
4475
- mouseWheelScrollSensitivity = 69,
4476
- mouseWheelZoom = 70,
4477
- multiCursorMergeOverlapping = 71,
4478
- multiCursorModifier = 72,
4479
- multiCursorPaste = 73,
4480
- occurrencesHighlight = 74,
4481
- overviewRulerBorder = 75,
4482
- overviewRulerLanes = 76,
4483
- padding = 77,
4484
- parameterHints = 78,
4485
- peekWidgetDefaultFocus = 79,
4486
- definitionLinkOpensInPeek = 80,
4487
- quickSuggestions = 81,
4488
- quickSuggestionsDelay = 82,
4489
- readOnly = 83,
4490
- renameOnType = 84,
4491
- renderControlCharacters = 85,
4492
- renderFinalNewline = 86,
4493
- renderLineHighlight = 87,
4494
- renderLineHighlightOnlyWhenFocus = 88,
4495
- renderValidationDecorations = 89,
4496
- renderWhitespace = 90,
4497
- revealHorizontalRightPadding = 91,
4498
- roundedSelection = 92,
4499
- rulers = 93,
4500
- scrollbar = 94,
4501
- scrollBeyondLastColumn = 95,
4502
- scrollBeyondLastLine = 96,
4503
- scrollPredominantAxis = 97,
4504
- selectionClipboard = 98,
4505
- selectionHighlight = 99,
4506
- selectOnLineNumbers = 100,
4507
- showFoldingControls = 101,
4508
- showUnused = 102,
4509
- snippetSuggestions = 103,
4510
- smartSelect = 104,
4511
- smoothScrolling = 105,
4512
- stickyTabStops = 106,
4513
- stopRenderingLineAfter = 107,
4514
- suggest = 108,
4515
- suggestFontSize = 109,
4516
- suggestLineHeight = 110,
4517
- suggestOnTriggerCharacters = 111,
4518
- suggestSelection = 112,
4519
- tabCompletion = 113,
4520
- tabIndex = 114,
4521
- unicodeHighlighting = 115,
4522
- unusualLineTerminators = 116,
4523
- useShadowDOM = 117,
4524
- useTabStops = 118,
4525
- wordSeparators = 119,
4526
- wordWrap = 120,
4527
- wordWrapBreakAfterCharacters = 121,
4528
- wordWrapBreakBeforeCharacters = 122,
4529
- wordWrapColumn = 123,
4530
- wordWrapOverride1 = 124,
4531
- wordWrapOverride2 = 125,
4532
- wrappingIndent = 126,
4533
- wrappingStrategy = 127,
4534
- showDeprecated = 128,
4535
- inlayHints = 129,
4536
- editorClassName = 130,
4537
- pixelRatio = 131,
4538
- tabFocusMode = 132,
4539
- layoutInfo = 133,
4540
- wrappingInfo = 134
4713
+ ariaRequired = 5,
4714
+ autoClosingBrackets = 6,
4715
+ autoClosingComments = 7,
4716
+ screenReaderAnnounceInlineSuggestion = 8,
4717
+ autoClosingDelete = 9,
4718
+ autoClosingOvertype = 10,
4719
+ autoClosingQuotes = 11,
4720
+ autoIndent = 12,
4721
+ automaticLayout = 13,
4722
+ autoSurround = 14,
4723
+ bracketPairColorization = 15,
4724
+ guides = 16,
4725
+ codeLens = 17,
4726
+ codeLensFontFamily = 18,
4727
+ codeLensFontSize = 19,
4728
+ colorDecorators = 20,
4729
+ colorDecoratorsLimit = 21,
4730
+ columnSelection = 22,
4731
+ comments = 23,
4732
+ contextmenu = 24,
4733
+ copyWithSyntaxHighlighting = 25,
4734
+ cursorBlinking = 26,
4735
+ cursorSmoothCaretAnimation = 27,
4736
+ cursorStyle = 28,
4737
+ cursorSurroundingLines = 29,
4738
+ cursorSurroundingLinesStyle = 30,
4739
+ cursorWidth = 31,
4740
+ disableLayerHinting = 32,
4741
+ disableMonospaceOptimizations = 33,
4742
+ domReadOnly = 34,
4743
+ dragAndDrop = 35,
4744
+ dropIntoEditor = 36,
4745
+ emptySelectionClipboard = 37,
4746
+ experimentalWhitespaceRendering = 38,
4747
+ extraEditorClassName = 39,
4748
+ fastScrollSensitivity = 40,
4749
+ find = 41,
4750
+ fixedOverflowWidgets = 42,
4751
+ folding = 43,
4752
+ foldingStrategy = 44,
4753
+ foldingHighlight = 45,
4754
+ foldingImportsByDefault = 46,
4755
+ foldingMaximumRegions = 47,
4756
+ unfoldOnClickAfterEndOfLine = 48,
4757
+ fontFamily = 49,
4758
+ fontInfo = 50,
4759
+ fontLigatures = 51,
4760
+ fontSize = 52,
4761
+ fontWeight = 53,
4762
+ fontVariations = 54,
4763
+ formatOnPaste = 55,
4764
+ formatOnType = 56,
4765
+ glyphMargin = 57,
4766
+ gotoLocation = 58,
4767
+ hideCursorInOverviewRuler = 59,
4768
+ hover = 60,
4769
+ inDiffEditor = 61,
4770
+ inlineSuggest = 62,
4771
+ letterSpacing = 63,
4772
+ lightbulb = 64,
4773
+ lineDecorationsWidth = 65,
4774
+ lineHeight = 66,
4775
+ lineNumbers = 67,
4776
+ lineNumbersMinChars = 68,
4777
+ linkedEditing = 69,
4778
+ links = 70,
4779
+ matchBrackets = 71,
4780
+ minimap = 72,
4781
+ mouseStyle = 73,
4782
+ mouseWheelScrollSensitivity = 74,
4783
+ mouseWheelZoom = 75,
4784
+ multiCursorMergeOverlapping = 76,
4785
+ multiCursorModifier = 77,
4786
+ multiCursorPaste = 78,
4787
+ multiCursorLimit = 79,
4788
+ occurrencesHighlight = 80,
4789
+ overviewRulerBorder = 81,
4790
+ overviewRulerLanes = 82,
4791
+ padding = 83,
4792
+ pasteAs = 84,
4793
+ parameterHints = 85,
4794
+ peekWidgetDefaultFocus = 86,
4795
+ definitionLinkOpensInPeek = 87,
4796
+ quickSuggestions = 88,
4797
+ quickSuggestionsDelay = 89,
4798
+ readOnly = 90,
4799
+ readOnlyMessage = 91,
4800
+ renameOnType = 92,
4801
+ renderControlCharacters = 93,
4802
+ renderFinalNewline = 94,
4803
+ renderLineHighlight = 95,
4804
+ renderLineHighlightOnlyWhenFocus = 96,
4805
+ renderValidationDecorations = 97,
4806
+ renderWhitespace = 98,
4807
+ revealHorizontalRightPadding = 99,
4808
+ roundedSelection = 100,
4809
+ rulers = 101,
4810
+ scrollbar = 102,
4811
+ scrollBeyondLastColumn = 103,
4812
+ scrollBeyondLastLine = 104,
4813
+ scrollPredominantAxis = 105,
4814
+ selectionClipboard = 106,
4815
+ selectionHighlight = 107,
4816
+ selectOnLineNumbers = 108,
4817
+ showFoldingControls = 109,
4818
+ showUnused = 110,
4819
+ snippetSuggestions = 111,
4820
+ smartSelect = 112,
4821
+ smoothScrolling = 113,
4822
+ stickyScroll = 114,
4823
+ stickyTabStops = 115,
4824
+ stopRenderingLineAfter = 116,
4825
+ suggest = 117,
4826
+ suggestFontSize = 118,
4827
+ suggestLineHeight = 119,
4828
+ suggestOnTriggerCharacters = 120,
4829
+ suggestSelection = 121,
4830
+ tabCompletion = 122,
4831
+ tabIndex = 123,
4832
+ unicodeHighlighting = 124,
4833
+ unusualLineTerminators = 125,
4834
+ useShadowDOM = 126,
4835
+ useTabStops = 127,
4836
+ wordBreak = 128,
4837
+ wordSeparators = 129,
4838
+ wordWrap = 130,
4839
+ wordWrapBreakAfterCharacters = 131,
4840
+ wordWrapBreakBeforeCharacters = 132,
4841
+ wordWrapColumn = 133,
4842
+ wordWrapOverride1 = 134,
4843
+ wordWrapOverride2 = 135,
4844
+ wrappingIndent = 136,
4845
+ wrappingStrategy = 137,
4846
+ showDeprecated = 138,
4847
+ inlayHints = 139,
4848
+ editorClassName = 140,
4849
+ pixelRatio = 141,
4850
+ tabFocusMode = 142,
4851
+ layoutInfo = 143,
4852
+ wrappingInfo = 144,
4853
+ defaultColorDecorators = 145,
4854
+ colorDecoratorsActivatedOn = 146,
4855
+ inlineCompletionsAccessibilityVerbose = 147
4541
4856
  }
4542
4857
 
4543
4858
  export const EditorOptions: {
@@ -4546,7 +4861,10 @@ declare namespace monaco.editor {
4546
4861
  accessibilitySupport: IEditorOption<EditorOption.accessibilitySupport, AccessibilitySupport>;
4547
4862
  accessibilityPageSize: IEditorOption<EditorOption.accessibilityPageSize, number>;
4548
4863
  ariaLabel: IEditorOption<EditorOption.ariaLabel, string>;
4864
+ ariaRequired: IEditorOption<EditorOption.ariaRequired, boolean>;
4865
+ screenReaderAnnounceInlineSuggestion: IEditorOption<EditorOption.screenReaderAnnounceInlineSuggestion, boolean>;
4549
4866
  autoClosingBrackets: IEditorOption<EditorOption.autoClosingBrackets, 'always' | 'languageDefined' | 'beforeWhitespace' | 'never'>;
4867
+ autoClosingComments: IEditorOption<EditorOption.autoClosingComments, 'always' | 'languageDefined' | 'beforeWhitespace' | 'never'>;
4550
4868
  autoClosingDelete: IEditorOption<EditorOption.autoClosingDelete, 'always' | 'never' | 'auto'>;
4551
4869
  autoClosingOvertype: IEditorOption<EditorOption.autoClosingOvertype, 'always' | 'never' | 'auto'>;
4552
4870
  autoClosingQuotes: IEditorOption<EditorOption.autoClosingQuotes, 'always' | 'languageDefined' | 'beforeWhitespace' | 'never'>;
@@ -4560,12 +4878,14 @@ declare namespace monaco.editor {
4560
4878
  codeLensFontFamily: IEditorOption<EditorOption.codeLensFontFamily, string>;
4561
4879
  codeLensFontSize: IEditorOption<EditorOption.codeLensFontSize, number>;
4562
4880
  colorDecorators: IEditorOption<EditorOption.colorDecorators, boolean>;
4881
+ colorDecoratorActivatedOn: IEditorOption<EditorOption.colorDecoratorsActivatedOn, 'clickAndHover' | 'click' | 'hover'>;
4882
+ colorDecoratorsLimit: IEditorOption<EditorOption.colorDecoratorsLimit, number>;
4563
4883
  columnSelection: IEditorOption<EditorOption.columnSelection, boolean>;
4564
4884
  comments: IEditorOption<EditorOption.comments, Readonly<Required<IEditorCommentsOptions>>>;
4565
4885
  contextmenu: IEditorOption<EditorOption.contextmenu, boolean>;
4566
4886
  copyWithSyntaxHighlighting: IEditorOption<EditorOption.copyWithSyntaxHighlighting, boolean>;
4567
4887
  cursorBlinking: IEditorOption<EditorOption.cursorBlinking, TextEditorCursorBlinkingStyle>;
4568
- cursorSmoothCaretAnimation: IEditorOption<EditorOption.cursorSmoothCaretAnimation, boolean>;
4888
+ cursorSmoothCaretAnimation: IEditorOption<EditorOption.cursorSmoothCaretAnimation, 'on' | 'off' | 'explicit'>;
4569
4889
  cursorStyle: IEditorOption<EditorOption.cursorStyle, TextEditorCursorStyle>;
4570
4890
  cursorSurroundingLines: IEditorOption<EditorOption.cursorSurroundingLines, number>;
4571
4891
  cursorSurroundingLinesStyle: IEditorOption<EditorOption.cursorSurroundingLinesStyle, 'default' | 'all'>;
@@ -4576,7 +4896,8 @@ declare namespace monaco.editor {
4576
4896
  dragAndDrop: IEditorOption<EditorOption.dragAndDrop, boolean>;
4577
4897
  emptySelectionClipboard: IEditorOption<EditorOption.emptySelectionClipboard, boolean>;
4578
4898
  dropIntoEditor: IEditorOption<EditorOption.dropIntoEditor, Readonly<Required<IDropIntoEditorOptions>>>;
4579
- experimental: IEditorOption<EditorOption.experimental, EditorExperimentalOptions>;
4899
+ stickyScroll: IEditorOption<EditorOption.stickyScroll, Readonly<Required<IEditorStickyScrollOptions>>>;
4900
+ experimentalWhitespaceRendering: IEditorOption<EditorOption.experimentalWhitespaceRendering, 'off' | 'svg' | 'font'>;
4580
4901
  extraEditorClassName: IEditorOption<EditorOption.extraEditorClassName, string>;
4581
4902
  fastScrollSensitivity: IEditorOption<EditorOption.fastScrollSensitivity, number>;
4582
4903
  find: IEditorOption<EditorOption.find, Readonly<Required<IEditorFindOptions>>>;
@@ -4592,6 +4913,7 @@ declare namespace monaco.editor {
4592
4913
  fontLigatures2: IEditorOption<EditorOption.fontLigatures, string>;
4593
4914
  fontSize: IEditorOption<EditorOption.fontSize, number>;
4594
4915
  fontWeight: IEditorOption<EditorOption.fontWeight, string>;
4916
+ fontVariations: IEditorOption<EditorOption.fontVariations, string>;
4595
4917
  formatOnPaste: IEditorOption<EditorOption.formatOnPaste, boolean>;
4596
4918
  formatOnType: IEditorOption<EditorOption.formatOnType, boolean>;
4597
4919
  glyphMargin: IEditorOption<EditorOption.glyphMargin, boolean>;
@@ -4601,7 +4923,7 @@ declare namespace monaco.editor {
4601
4923
  inDiffEditor: IEditorOption<EditorOption.inDiffEditor, boolean>;
4602
4924
  letterSpacing: IEditorOption<EditorOption.letterSpacing, number>;
4603
4925
  lightbulb: IEditorOption<EditorOption.lightbulb, Readonly<Required<IEditorLightbulbOptions>>>;
4604
- lineDecorationsWidth: IEditorOption<EditorOption.lineDecorationsWidth, string | number>;
4926
+ lineDecorationsWidth: IEditorOption<EditorOption.lineDecorationsWidth, number>;
4605
4927
  lineHeight: IEditorOption<EditorOption.lineHeight, number>;
4606
4928
  lineNumbers: IEditorOption<EditorOption.lineNumbers, InternalEditorRenderLineNumbersOptions>;
4607
4929
  lineNumbersMinChars: IEditorOption<EditorOption.lineNumbersMinChars, number>;
@@ -4615,19 +4937,22 @@ declare namespace monaco.editor {
4615
4937
  multiCursorMergeOverlapping: IEditorOption<EditorOption.multiCursorMergeOverlapping, boolean>;
4616
4938
  multiCursorModifier: IEditorOption<EditorOption.multiCursorModifier, 'altKey' | 'metaKey' | 'ctrlKey'>;
4617
4939
  multiCursorPaste: IEditorOption<EditorOption.multiCursorPaste, 'spread' | 'full'>;
4940
+ multiCursorLimit: IEditorOption<EditorOption.multiCursorLimit, number>;
4618
4941
  occurrencesHighlight: IEditorOption<EditorOption.occurrencesHighlight, boolean>;
4619
4942
  overviewRulerBorder: IEditorOption<EditorOption.overviewRulerBorder, boolean>;
4620
4943
  overviewRulerLanes: IEditorOption<EditorOption.overviewRulerLanes, number>;
4621
4944
  padding: IEditorOption<EditorOption.padding, Readonly<Required<IEditorPaddingOptions>>>;
4945
+ pasteAs: IEditorOption<EditorOption.pasteAs, Readonly<Required<IPasteAsOptions>>>;
4622
4946
  parameterHints: IEditorOption<EditorOption.parameterHints, Readonly<Required<IEditorParameterHintOptions>>>;
4623
4947
  peekWidgetDefaultFocus: IEditorOption<EditorOption.peekWidgetDefaultFocus, 'tree' | 'editor'>;
4624
4948
  definitionLinkOpensInPeek: IEditorOption<EditorOption.definitionLinkOpensInPeek, boolean>;
4625
4949
  quickSuggestions: IEditorOption<EditorOption.quickSuggestions, InternalQuickSuggestionsOptions>;
4626
4950
  quickSuggestionsDelay: IEditorOption<EditorOption.quickSuggestionsDelay, number>;
4627
4951
  readOnly: IEditorOption<EditorOption.readOnly, boolean>;
4952
+ readOnlyMessage: IEditorOption<EditorOption.readOnlyMessage, any>;
4628
4953
  renameOnType: IEditorOption<EditorOption.renameOnType, boolean>;
4629
4954
  renderControlCharacters: IEditorOption<EditorOption.renderControlCharacters, boolean>;
4630
- renderFinalNewline: IEditorOption<EditorOption.renderFinalNewline, boolean>;
4955
+ renderFinalNewline: IEditorOption<EditorOption.renderFinalNewline, 'on' | 'off' | 'dimmed'>;
4631
4956
  renderLineHighlight: IEditorOption<EditorOption.renderLineHighlight, 'all' | 'line' | 'none' | 'gutter'>;
4632
4957
  renderLineHighlightOnlyWhenFocus: IEditorOption<EditorOption.renderLineHighlightOnlyWhenFocus, boolean>;
4633
4958
  renderValidationDecorations: IEditorOption<EditorOption.renderValidationDecorations, 'on' | 'off' | 'editable'>;
@@ -4652,6 +4977,7 @@ declare namespace monaco.editor {
4652
4977
  stopRenderingLineAfter: IEditorOption<EditorOption.stopRenderingLineAfter, number>;
4653
4978
  suggest: IEditorOption<EditorOption.suggest, Readonly<Required<ISuggestOptions>>>;
4654
4979
  inlineSuggest: IEditorOption<EditorOption.inlineSuggest, Readonly<Required<IInlineSuggestOptions>>>;
4980
+ inlineCompletionsAccessibilityVerbose: IEditorOption<EditorOption.inlineCompletionsAccessibilityVerbose, boolean>;
4655
4981
  suggestFontSize: IEditorOption<EditorOption.suggestFontSize, number>;
4656
4982
  suggestLineHeight: IEditorOption<EditorOption.suggestLineHeight, number>;
4657
4983
  suggestOnTriggerCharacters: IEditorOption<EditorOption.suggestOnTriggerCharacters, boolean>;
@@ -4662,6 +4988,7 @@ declare namespace monaco.editor {
4662
4988
  unusualLineTerminators: IEditorOption<EditorOption.unusualLineTerminators, 'auto' | 'off' | 'prompt'>;
4663
4989
  useShadowDOM: IEditorOption<EditorOption.useShadowDOM, boolean>;
4664
4990
  useTabStops: IEditorOption<EditorOption.useTabStops, boolean>;
4991
+ wordBreak: IEditorOption<EditorOption.wordBreak, 'normal' | 'keepAll'>;
4665
4992
  wordSeparators: IEditorOption<EditorOption.wordSeparators, string>;
4666
4993
  wordWrap: IEditorOption<EditorOption.wordWrap, 'on' | 'off' | 'wordWrapColumn' | 'bounded'>;
4667
4994
  wordWrapBreakAfterCharacters: IEditorOption<EditorOption.wordWrapBreakAfterCharacters, string>;
@@ -4669,13 +4996,14 @@ declare namespace monaco.editor {
4669
4996
  wordWrapColumn: IEditorOption<EditorOption.wordWrapColumn, number>;
4670
4997
  wordWrapOverride1: IEditorOption<EditorOption.wordWrapOverride1, 'on' | 'off' | 'inherit'>;
4671
4998
  wordWrapOverride2: IEditorOption<EditorOption.wordWrapOverride2, 'on' | 'off' | 'inherit'>;
4672
- wrappingIndent: IEditorOption<EditorOption.wrappingIndent, WrappingIndent>;
4673
- wrappingStrategy: IEditorOption<EditorOption.wrappingStrategy, 'simple' | 'advanced'>;
4674
4999
  editorClassName: IEditorOption<EditorOption.editorClassName, string>;
5000
+ defaultColorDecorators: IEditorOption<EditorOption.defaultColorDecorators, boolean>;
4675
5001
  pixelRatio: IEditorOption<EditorOption.pixelRatio, number>;
4676
5002
  tabFocusMode: IEditorOption<EditorOption.tabFocusMode, boolean>;
4677
5003
  layoutInfo: IEditorOption<EditorOption.layoutInfo, EditorLayoutInfo>;
4678
5004
  wrappingInfo: IEditorOption<EditorOption.wrappingInfo, EditorWrappingInfo>;
5005
+ wrappingIndent: IEditorOption<EditorOption.wrappingIndent, WrappingIndent>;
5006
+ wrappingStrategy: IEditorOption<EditorOption.wrappingStrategy, 'simple' | 'advanced'>;
4679
5007
  };
4680
5008
 
4681
5009
  type EditorOptionsType = typeof EditorOptions;
@@ -4720,6 +5048,15 @@ declare namespace monaco.editor {
4720
5048
  * If the `afterColumn` has multiple view columns, the affinity specifies which one to use. Defaults to `none`.
4721
5049
  */
4722
5050
  afterColumnAffinity?: PositionAffinity;
5051
+ /**
5052
+ * Render the zone even when its line is hidden.
5053
+ */
5054
+ showInHiddenAreas?: boolean;
5055
+ /**
5056
+ * Tiebreaker that is used when multiple view zones want to be after the same line.
5057
+ * Defaults to `afterColumn` otherwise 10000;
5058
+ */
5059
+ ordinal?: number;
4723
5060
  /**
4724
5061
  * Suppress mouse down events.
4725
5062
  * If set, the editor will attach a mouse down listener to the view zone and .preventDefault on it.
@@ -4806,15 +5143,24 @@ declare namespace monaco.editor {
4806
5143
  */
4807
5144
  export interface IContentWidgetPosition {
4808
5145
  /**
4809
- * Desired position for the content widget.
4810
- * `preference` will also affect the placement.
5146
+ * Desired position which serves as an anchor for placing the content widget.
5147
+ * The widget will be placed above, at, or below the specified position, based on the
5148
+ * provided preference. The widget will always touch this position.
5149
+ *
5150
+ * Given sufficient horizontal space, the widget will be placed to the right of the
5151
+ * passed in position. This can be tweaked by providing a `secondaryPosition`.
5152
+ *
5153
+ * @see preference
5154
+ * @see secondaryPosition
4811
5155
  */
4812
5156
  position: IPosition | null;
4813
5157
  /**
4814
- * Optionally, a range can be provided to further
4815
- * define the position of the content widget.
5158
+ * Optionally, a secondary position can be provided to further define the placing of
5159
+ * the content widget. The secondary position must have the same line number as the
5160
+ * primary position. If possible, the widget will be placed such that it also touches
5161
+ * the secondary position.
4816
5162
  */
4817
- range?: IRange | null;
5163
+ secondaryPosition?: IPosition | null;
4818
5164
  /**
4819
5165
  * Placement preference for position, in order of preference.
4820
5166
  */
@@ -4910,6 +5256,47 @@ declare namespace monaco.editor {
4910
5256
  * If null is returned, the overlay widget is responsible to place itself.
4911
5257
  */
4912
5258
  getPosition(): IOverlayWidgetPosition | null;
5259
+ /**
5260
+ * The editor will ensure that the scroll width is >= than this value.
5261
+ */
5262
+ getMinContentWidthInPx?(): number;
5263
+ }
5264
+
5265
+ /**
5266
+ * A glyph margin widget renders in the editor glyph margin.
5267
+ */
5268
+ export interface IGlyphMarginWidget {
5269
+ /**
5270
+ * Get a unique identifier of the glyph widget.
5271
+ */
5272
+ getId(): string;
5273
+ /**
5274
+ * Get the dom node of the glyph widget.
5275
+ */
5276
+ getDomNode(): HTMLElement;
5277
+ /**
5278
+ * Get the placement of the glyph widget.
5279
+ */
5280
+ getPosition(): IGlyphMarginWidgetPosition;
5281
+ }
5282
+
5283
+ /**
5284
+ * A position for rendering glyph margin widgets.
5285
+ */
5286
+ export interface IGlyphMarginWidgetPosition {
5287
+ /**
5288
+ * The glyph margin lane where the widget should be shown.
5289
+ */
5290
+ lane: GlyphMarginLane;
5291
+ /**
5292
+ * The priority order of the widget, used for determining which widget
5293
+ * to render when there are multiple.
5294
+ */
5295
+ zIndex: number;
5296
+ /**
5297
+ * The editor range that this widget applies to.
5298
+ */
5299
+ range: IRange;
4913
5300
  }
4914
5301
 
4915
5302
  /**
@@ -4978,7 +5365,7 @@ declare namespace monaco.editor {
4978
5365
  /**
4979
5366
  * The target element
4980
5367
  */
4981
- readonly element: Element | null;
5368
+ readonly element: HTMLElement | null;
4982
5369
  /**
4983
5370
  * The 'approximate' editor position
4984
5371
  */
@@ -5082,6 +5469,8 @@ declare namespace monaco.editor {
5082
5469
 
5083
5470
  export interface IMouseTargetOutsideEditor extends IBaseMouseTarget {
5084
5471
  readonly type: MouseTargetType.OUTSIDE_EDITOR;
5472
+ readonly outsidePosition: 'above' | 'below' | 'left' | 'right';
5473
+ readonly outsideDistance: number;
5085
5474
  }
5086
5475
 
5087
5476
  /**
@@ -5110,11 +5499,7 @@ declare namespace monaco.editor {
5110
5499
  readonly languageId: string | null;
5111
5500
  }
5112
5501
 
5113
- export interface IDiffEditorConstructionOptions extends IDiffEditorOptions {
5114
- /**
5115
- * The initial editor dimension (to avoid measuring the container).
5116
- */
5117
- dimension?: IDimension;
5502
+ export interface IDiffEditorConstructionOptions extends IDiffEditorOptions, IEditorConstructionOptions {
5118
5503
  /**
5119
5504
  * Place overflow widgets inside an external DOM node.
5120
5505
  * Defaults to an internal DOM node.
@@ -5128,11 +5513,6 @@ declare namespace monaco.editor {
5128
5513
  * Aria label for modified editor.
5129
5514
  */
5130
5515
  modifiedAriaLabel?: string;
5131
- /**
5132
- * Is the diff editor inside another editor
5133
- * Defaults to false
5134
- */
5135
- isInEmbeddedEditor?: boolean;
5136
5516
  }
5137
5517
 
5138
5518
  /**
@@ -5371,12 +5751,16 @@ declare namespace monaco.editor {
5371
5751
  * Change the scroll position of the editor's viewport.
5372
5752
  */
5373
5753
  setScrollPosition(position: INewScrollPosition, scrollType?: ScrollType): void;
5754
+ /**
5755
+ * Check if the editor is currently scrolling towards a different scroll position.
5756
+ */
5757
+ hasPendingScrollAnimation(): boolean;
5374
5758
  /**
5375
5759
  * Get an action that is a contribution to this editor.
5376
5760
  * @id Unique identifier of the contribution.
5377
5761
  * @return The action or null if action not found.
5378
5762
  */
5379
- getAction(id: string): IEditorAction;
5763
+ getAction(id: string): IEditorAction | null;
5380
5764
  /**
5381
5765
  * Execute a command on the editor.
5382
5766
  * The edits will land on the undo-redo stack, but no "undo stop" will be pushed.
@@ -5416,7 +5800,8 @@ declare namespace monaco.editor {
5416
5800
  getDecorationsInRange(range: Range): IModelDecoration[] | null;
5417
5801
  /**
5418
5802
  * All decorations added through this call will get the ownerId of this editor.
5419
- * @deprecated
5803
+ * @deprecated Use `createDecorationsCollection`
5804
+ * @see createDecorationsCollection
5420
5805
  */
5421
5806
  deltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[]): string[];
5422
5807
  /**
@@ -5435,7 +5820,7 @@ declare namespace monaco.editor {
5435
5820
  /**
5436
5821
  * Get the vertical position (top offset) for the line's top w.r.t. to the first line.
5437
5822
  */
5438
- getTopForLineNumber(lineNumber: number): number;
5823
+ getTopForLineNumber(lineNumber: number, includeViewZones?: boolean): number;
5439
5824
  /**
5440
5825
  * Get the vertical position (top offset) for the line's bottom w.r.t. to the first line.
5441
5826
  */
@@ -5444,6 +5829,10 @@ declare namespace monaco.editor {
5444
5829
  * Get the vertical position (top offset) for the position w.r.t. to the first line.
5445
5830
  */
5446
5831
  getTopForPosition(lineNumber: number, column: number): number;
5832
+ /**
5833
+ * Write the screen reader content to be the current selection
5834
+ */
5835
+ writeScreenReaderContent(reason: string): void;
5447
5836
  /**
5448
5837
  * Returns the editor's container dom node
5449
5838
  */
@@ -5478,6 +5867,19 @@ declare namespace monaco.editor {
5478
5867
  * Remove an overlay widget.
5479
5868
  */
5480
5869
  removeOverlayWidget(widget: IOverlayWidget): void;
5870
+ /**
5871
+ * Add a glyph margin widget. Widgets must have unique ids, otherwise they will be overwritten.
5872
+ */
5873
+ addGlyphMarginWidget(widget: IGlyphMarginWidget): void;
5874
+ /**
5875
+ * Layout/Reposition a glyph margin widget. This is a ping to the editor to call widget.getPosition()
5876
+ * and update appropriately.
5877
+ */
5878
+ layoutGlyphMarginWidget(widget: IGlyphMarginWidget): void;
5879
+ /**
5880
+ * Remove a glyph margin widget.
5881
+ */
5882
+ removeGlyphMarginWidget(widget: IGlyphMarginWidget): void;
5481
5883
  /**
5482
5884
  * Change the view zones. View zones are lost when a new model is attached to the editor.
5483
5885
  */
@@ -5516,13 +5918,11 @@ declare namespace monaco.editor {
5516
5918
  */
5517
5919
  applyFontInfo(target: HTMLElement): void;
5518
5920
  setBanner(bannerDomNode: HTMLElement | null, height: number): void;
5519
- }
5520
-
5521
- /**
5522
- * Information about a line in the diff editor
5523
- */
5524
- export interface IDiffLineInformation {
5525
- readonly equivalentLineNumber: number;
5921
+ /**
5922
+ * Is called when the model has been set, view state was restored and options are updated.
5923
+ * This is the best place to compute data for the viewport (such as tokens).
5924
+ */
5925
+ handleInitialized?(): void;
5526
5926
  }
5527
5927
 
5528
5928
  /**
@@ -5538,6 +5938,11 @@ declare namespace monaco.editor {
5538
5938
  * @event
5539
5939
  */
5540
5940
  readonly onDidUpdateDiff: IEvent<void>;
5941
+ /**
5942
+ * An event emitted when the diff model is changed (i.e. the diff editor shows new content).
5943
+ * @event
5944
+ */
5945
+ readonly onDidChangeModel: IEvent<void>;
5541
5946
  /**
5542
5947
  * Saves current view state of the editor in a serializable object.
5543
5948
  */
@@ -5550,6 +5955,7 @@ declare namespace monaco.editor {
5550
5955
  * Type the getModel() of IEditor.
5551
5956
  */
5552
5957
  getModel(): IDiffEditorModel | null;
5958
+ createViewModel(model: IDiffEditorModel): IDiffEditorViewModel;
5553
5959
  /**
5554
5960
  * Sets the current model attached to this editor.
5555
5961
  * If the previous model was created by the editor via the value key in the options
@@ -5558,7 +5964,7 @@ declare namespace monaco.editor {
5558
5964
  * will not be destroyed.
5559
5965
  * It is safe to call setModel(null) to simply detach the current model from the editor.
5560
5966
  */
5561
- setModel(model: IDiffEditorModel | null): void;
5967
+ setModel(model: IDiffEditorModel | IDiffEditorViewModel | null): void;
5562
5968
  /**
5563
5969
  * Get the `original` editor.
5564
5970
  */
@@ -5571,20 +5977,12 @@ declare namespace monaco.editor {
5571
5977
  * Get the computed diff information.
5572
5978
  */
5573
5979
  getLineChanges(): ILineChange[] | null;
5574
- /**
5575
- * Get information based on computed diff about a line number from the original model.
5576
- * If the diff computation is not finished or the model is missing, will return null.
5577
- */
5578
- getDiffLineInformationForOriginal(lineNumber: number): IDiffLineInformation | null;
5579
- /**
5580
- * Get information based on computed diff about a line number from the modified model.
5581
- * If the diff computation is not finished or the model is missing, will return null.
5582
- */
5583
- getDiffLineInformationForModified(lineNumber: number): IDiffLineInformation | null;
5584
5980
  /**
5585
5981
  * Update the editor's options after the editor has been created.
5586
5982
  */
5587
5983
  updateOptions(newOptions: IDiffEditorOptions): void;
5984
+ accessibleDiffViewerNext(): void;
5985
+ accessibleDiffViewerPrev(): void;
5588
5986
  }
5589
5987
 
5590
5988
  export class FontInfo extends BareFontInfo {
@@ -5608,10 +6006,19 @@ declare namespace monaco.editor {
5608
6006
  readonly fontWeight: string;
5609
6007
  readonly fontSize: number;
5610
6008
  readonly fontFeatureSettings: string;
6009
+ readonly fontVariationSettings: string;
5611
6010
  readonly lineHeight: number;
5612
6011
  readonly letterSpacing: number;
5613
6012
  }
5614
6013
 
6014
+ export const EditorZoom: IEditorZoom;
6015
+
6016
+ export interface IEditorZoom {
6017
+ onDidChangeZoomLevel: IEvent<number>;
6018
+ getZoomLevel(): number;
6019
+ setZoomLevel(zoomLevel: number): void;
6020
+ }
6021
+
5615
6022
  //compatibility:
5616
6023
  export type IReadOnlyModel = ITextModel;
5617
6024
  export type IModel = ITextModel;
@@ -5646,6 +6053,10 @@ declare namespace monaco.languages {
5646
6053
  */
5647
6054
  readonly hasAccessToAllModels?: boolean;
5648
6055
  readonly exclusive?: boolean;
6056
+ /**
6057
+ * This provider comes from a builtin extension.
6058
+ */
6059
+ readonly isBuiltin?: boolean;
5649
6060
  }
5650
6061
 
5651
6062
  /**
@@ -5661,11 +6072,18 @@ declare namespace monaco.languages {
5661
6072
  export function getEncodedLanguageId(languageId: string): number;
5662
6073
 
5663
6074
  /**
5664
- * An event emitted when a language is needed for the first time (e.g. a model has it set).
6075
+ * An event emitted when a language is associated for the first time with a text model.
5665
6076
  * @event
5666
6077
  */
5667
6078
  export function onLanguage(languageId: string, callback: () => void): IDisposable;
5668
6079
 
6080
+ /**
6081
+ * An event emitted when a language is associated for the first time with a text model or
6082
+ * when a language is encountered during the tokenization of another language.
6083
+ * @event
6084
+ */
6085
+ export function onLanguageEncountered(languageId: string, callback: () => void): IDisposable;
6086
+
5669
6087
  /**
5670
6088
  * Set the editing configuration for a language.
5671
6089
  */
@@ -6293,6 +6711,7 @@ declare namespace monaco.languages {
6293
6711
  }
6294
6712
 
6295
6713
  export enum CompletionItemInsertTextRule {
6714
+ None = 0,
6296
6715
  /**
6297
6716
  * Adjust whitespace/indentation of multiline insert texts to
6298
6717
  * match the current line indentation.
@@ -6477,11 +6896,13 @@ declare namespace monaco.languages {
6477
6896
  readonly selectedSuggestionInfo: SelectedSuggestionInfo | undefined;
6478
6897
  }
6479
6898
 
6480
- export interface SelectedSuggestionInfo {
6481
- range: IRange;
6482
- text: string;
6483
- isSnippetText: boolean;
6484
- completionKind: CompletionItemKind;
6899
+ export class SelectedSuggestionInfo {
6900
+ readonly range: IRange;
6901
+ readonly text: string;
6902
+ readonly completionKind: CompletionItemKind;
6903
+ readonly isSnippetText: boolean;
6904
+ constructor(range: IRange, text: string, completionKind: CompletionItemKind, isSnippetText: boolean);
6905
+ equals(other: SelectedSuggestionInfo): boolean;
6485
6906
  }
6486
6907
 
6487
6908
  export interface InlineCompletion {
@@ -6526,18 +6947,41 @@ declare namespace monaco.languages {
6526
6947
  * A list of commands associated with the inline completions of this list.
6527
6948
  */
6528
6949
  readonly commands?: Command[];
6950
+ readonly suppressSuggestions?: boolean | undefined;
6951
+ /**
6952
+ * When set and the user types a suggestion without derivating from it, the inline suggestion is not updated.
6953
+ */
6954
+ readonly enableForwardStability?: boolean | undefined;
6529
6955
  }
6530
6956
 
6957
+ export type InlineCompletionProviderGroupId = string;
6958
+
6531
6959
  export interface InlineCompletionsProvider<T extends InlineCompletions = InlineCompletions> {
6532
6960
  provideInlineCompletions(model: editor.ITextModel, position: Position, context: InlineCompletionContext, token: CancellationToken): ProviderResult<T>;
6533
6961
  /**
6534
6962
  * Will be called when an item is shown.
6963
+ * @param updatedInsertText Is useful to understand bracket completion.
6535
6964
  */
6536
- handleItemDidShow?(completions: T, item: T['items'][number]): void;
6965
+ handleItemDidShow?(completions: T, item: T['items'][number], updatedInsertText: string): void;
6966
+ /**
6967
+ * Will be called when an item is partially accepted.
6968
+ */
6969
+ handlePartialAccept?(completions: T, item: T['items'][number], acceptedCharacters: number): void;
6537
6970
  /**
6538
6971
  * Will be called when a completions list is no longer in use and can be garbage-collected.
6539
6972
  */
6540
6973
  freeInlineCompletions(completions: T): void;
6974
+ /**
6975
+ * Only used for {@link yieldsToGroupIds}.
6976
+ * Multiple providers can have the same group id.
6977
+ */
6978
+ groupId?: InlineCompletionProviderGroupId;
6979
+ /**
6980
+ * Returns a list of preferred provider {@link groupId}s.
6981
+ * The current provider is only requested for completions if no provider with a preferred group id returned a result.
6982
+ */
6983
+ yieldsToGroupIds?: InlineCompletionProviderGroupId[];
6984
+ toString?(): string;
6541
6985
  }
6542
6986
 
6543
6987
  export interface CodeAction {
@@ -6937,6 +7381,7 @@ declare namespace monaco.languages {
6937
7381
  * of the range to full syntax nodes.
6938
7382
  */
6939
7383
  provideDocumentRangeFormattingEdits(model: editor.ITextModel, range: Range, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
7384
+ provideDocumentRangesFormattingEdits?(model: editor.ITextModel, ranges: Range[], options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
6940
7385
  }
6941
7386
 
6942
7387
  /**
@@ -7110,6 +7555,12 @@ declare namespace monaco.languages {
7110
7555
  * The value of the kind is 'region'.
7111
7556
  */
7112
7557
  static readonly Region: FoldingRangeKind;
7558
+ /**
7559
+ * Returns a {@link FoldingRangeKind} for the given value.
7560
+ *
7561
+ * @param value of the kind.
7562
+ */
7563
+ static fromValue(value: string): FoldingRangeKind;
7113
7564
  /**
7114
7565
  * Creates a new {@link FoldingRangeKind}.
7115
7566
  *
@@ -7176,6 +7627,13 @@ declare namespace monaco.languages {
7176
7627
  arguments?: any[];
7177
7628
  }
7178
7629
 
7630
+ export interface PendingCommentThread {
7631
+ body: string;
7632
+ range: IRange;
7633
+ uri: Uri;
7634
+ owner: string;
7635
+ }
7636
+
7179
7637
  export interface CodeLens {
7180
7638
  range: IRange;
7181
7639
  id?: string;
@@ -7260,6 +7718,31 @@ declare namespace monaco.languages {
7260
7718
  provideDocumentRangeSemanticTokens(model: editor.ITextModel, range: Range, token: CancellationToken): ProviderResult<SemanticTokens>;
7261
7719
  }
7262
7720
 
7721
+ export interface DocumentContextItem {
7722
+ readonly uri: Uri;
7723
+ readonly version: number;
7724
+ readonly ranges: IRange[];
7725
+ }
7726
+
7727
+ export interface MappedEditsContext {
7728
+ /** The outer array is sorted by priority - from highest to lowest. The inner arrays contain elements of the same priority. */
7729
+ documents: DocumentContextItem[][];
7730
+ }
7731
+
7732
+ export interface MappedEditsProvider {
7733
+ /**
7734
+ * Provider maps code blocks from the chat into a workspace edit.
7735
+ *
7736
+ * @param document The document to provide mapped edits for.
7737
+ * @param codeBlocks Code blocks that come from an LLM's reply.
7738
+ * "Insert at cursor" in the panel chat only sends one edit that the user clicks on, but inline chat can send multiple blocks and let the lang server decide what to do with them.
7739
+ * @param context The context for providing mapped edits.
7740
+ * @param token A cancellation token.
7741
+ * @returns A provider result of text edits.
7742
+ */
7743
+ provideMappedEdits(document: editor.ITextModel, codeBlocks: string[], context: MappedEditsContext, token: CancellationToken): Promise<WorkspaceEdit | null>;
7744
+ }
7745
+
7263
7746
  export interface ILanguageExtensionPoint {
7264
7747
  id: string;
7265
7748
  extensions?: string[];
@@ -7387,7 +7870,7 @@ declare namespace monaco.languages {
7387
7870
  log?: string;
7388
7871
  }
7389
7872
 
7390
- export type IMonarchLanguageAction = IShortMonarchLanguageAction | IExpandedMonarchLanguageAction | IShortMonarchLanguageAction[] | IExpandedMonarchLanguageAction[];
7873
+ export type IMonarchLanguageAction = IShortMonarchLanguageAction | IExpandedMonarchLanguageAction | (IShortMonarchLanguageAction | IExpandedMonarchLanguageAction)[];
7391
7874
 
7392
7875
  /**
7393
7876
  * This interface can be shortened as an array, ie. ['{','}','delimiter.curly']
@@ -8113,6 +8596,60 @@ declare namespace monaco.languages.typescript {
8113
8596
  writeByteOrderMark: boolean;
8114
8597
  text: string;
8115
8598
  }
8599
+ export interface ModeConfiguration {
8600
+ /**
8601
+ * Defines whether the built-in completionItemProvider is enabled.
8602
+ */
8603
+ readonly completionItems?: boolean;
8604
+ /**
8605
+ * Defines whether the built-in hoverProvider is enabled.
8606
+ */
8607
+ readonly hovers?: boolean;
8608
+ /**
8609
+ * Defines whether the built-in documentSymbolProvider is enabled.
8610
+ */
8611
+ readonly documentSymbols?: boolean;
8612
+ /**
8613
+ * Defines whether the built-in definitions provider is enabled.
8614
+ */
8615
+ readonly definitions?: boolean;
8616
+ /**
8617
+ * Defines whether the built-in references provider is enabled.
8618
+ */
8619
+ readonly references?: boolean;
8620
+ /**
8621
+ * Defines whether the built-in references provider is enabled.
8622
+ */
8623
+ readonly documentHighlights?: boolean;
8624
+ /**
8625
+ * Defines whether the built-in rename provider is enabled.
8626
+ */
8627
+ readonly rename?: boolean;
8628
+ /**
8629
+ * Defines whether the built-in diagnostic provider is enabled.
8630
+ */
8631
+ readonly diagnostics?: boolean;
8632
+ /**
8633
+ * Defines whether the built-in document formatting range edit provider is enabled.
8634
+ */
8635
+ readonly documentRangeFormattingEdits?: boolean;
8636
+ /**
8637
+ * Defines whether the built-in signature help provider is enabled.
8638
+ */
8639
+ readonly signatureHelp?: boolean;
8640
+ /**
8641
+ * Defines whether the built-in onType formatting edit provider is enabled.
8642
+ */
8643
+ readonly onTypeFormattingEdits?: boolean;
8644
+ /**
8645
+ * Defines whether the built-in code actions provider is enabled.
8646
+ */
8647
+ readonly codeActions?: boolean;
8648
+ /**
8649
+ * Defines whether the built-in inlay hints provider is enabled.
8650
+ */
8651
+ readonly inlayHints?: boolean;
8652
+ }
8116
8653
  export interface LanguageServiceDefaults {
8117
8654
  /**
8118
8655
  * Event fired when compiler options or diagnostics options are changed.
@@ -8124,6 +8661,8 @@ declare namespace monaco.languages.typescript {
8124
8661
  readonly onDidExtraLibsChange: IEvent<void>;
8125
8662
  readonly workerOptions: WorkerOptions;
8126
8663
  readonly inlayHintsOptions: InlayHintsOptions;
8664
+ readonly modeConfiguration: ModeConfiguration;
8665
+ setModeConfiguration(modeConfiguration: ModeConfiguration): void;
8127
8666
  /**
8128
8667
  * Get the current extra libs registered with the language service.
8129
8668
  */
@@ -8231,11 +8770,7 @@ declare namespace monaco.languages.typescript {
8231
8770
  * @returns `Promise<typescript.QuickInfo | undefined>`
8232
8771
  */
8233
8772
  getQuickInfoAtPosition(fileName: string, position: number): Promise<any | undefined>;
8234
- /**
8235
- * Get other ranges which are related to the item at the given position in the file (often used for highlighting).
8236
- * @returns `Promise<ReadonlyArray<typescript.ReferenceEntry> | undefined>`
8237
- */
8238
- getOccurrencesAtPosition(fileName: string, position: number): Promise<ReadonlyArray<any> | undefined>;
8773
+ getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): Promise<ReadonlyArray<any> | undefined>;
8239
8774
  /**
8240
8775
  * Get the definition of the item at the given position in the file.
8241
8776
  * @returns `Promise<ReadonlyArray<typescript.DefinitionInfo> | undefined>`
@@ -8248,9 +8783,9 @@ declare namespace monaco.languages.typescript {
8248
8783
  getReferencesAtPosition(fileName: string, position: number): Promise<any[] | undefined>;
8249
8784
  /**
8250
8785
  * Get outline entries for the item at the given position in the file.
8251
- * @returns `Promise<typescript.NavigationBarItem[]>`
8786
+ * @returns `Promise<typescript.NavigationTree | undefined>`
8252
8787
  */
8253
- getNavigationBarItems(fileName: string): Promise<any[]>;
8788
+ getNavigationTree(fileName: string): Promise<any | undefined>;
8254
8789
  /**
8255
8790
  * Get changes which should be applied to format the given file.
8256
8791
  * @param options `typescript.FormatCodeOptions`