@ng-util/monaco-editor 11.2.0 → 12.1.2

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
@@ -15,6 +15,7 @@ declare namespace monaco {
15
15
  export type Thenable<T> = PromiseLike<T>;
16
16
 
17
17
  export interface Environment {
18
+ globalAPI?: boolean;
18
19
  baseUrl?: string;
19
20
  getWorker?(workerId: string, label: string): Worker;
20
21
  getWorkerUrl?(workerId: string, label: string): string;
@@ -59,12 +60,19 @@ declare namespace monaco {
59
60
  }
60
61
 
61
62
  export interface CancellationToken {
63
+ /**
64
+ * A flag signalling is cancellation has been requested.
65
+ */
62
66
  readonly isCancellationRequested: boolean;
63
67
  /**
64
- * An event emitted when cancellation is requested
68
+ * An event which fires when cancellation is requested. This event
69
+ * only ever fires `once` as cancellation can only happen once. Listeners
70
+ * that are registered after cancellation will be called (next event loop run),
71
+ * but also only once.
72
+ *
65
73
  * @event
66
74
  */
67
- readonly onCancellationRequested: IEvent<any>;
75
+ readonly onCancellationRequested: (listener: (e: any) => any, thisArgs?: any, disposables?: IDisposable[]) => IDisposable;
68
76
  }
69
77
  /**
70
78
  * Uniform Resource Identifier (Uri) http://tools.ietf.org/html/rfc3986.
@@ -72,6 +80,7 @@ declare namespace monaco {
72
80
  * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation
73
81
  * and encoding.
74
82
  *
83
+ * ```txt
75
84
  * foo://example.com:8042/over/there?name=ferret#nose
76
85
  * \_/ \______________/\_________/ \_________/ \__/
77
86
  * | | | | |
@@ -79,6 +88,7 @@ declare namespace monaco {
79
88
  * | _____________________|__
80
89
  * / \ / \
81
90
  * urn:example:animal:ferret:nose
91
+ * ```
82
92
  */
83
93
  export class Uri implements UriComponents {
84
94
  static isUri(thing: any): thing is Uri;
@@ -172,6 +182,14 @@ declare namespace monaco {
172
182
  query?: string;
173
183
  fragment?: string;
174
184
  }): Uri;
185
+ /**
186
+ * Join a Uri path with path fragments and normalizes the resulting path.
187
+ *
188
+ * @param uri The input Uri.
189
+ * @param pathFragment The path fragment to add to the Uri path.
190
+ * @returns The resulting Uri.
191
+ */
192
+ static joinPath(uri: Uri, ...pathFragment: string[]): Uri;
175
193
  /**
176
194
  * Creates a string representation for this Uri. It's guaranteed that calling
177
195
  * `Uri.parse` with the result of this function creates an Uri which is equal
@@ -205,6 +223,7 @@ declare namespace monaco {
205
223
  * But these are "more general", as they should work across browsers & OS`s.
206
224
  */
207
225
  export enum KeyCode {
226
+ DependsOnKbLayout = -1,
208
227
  /**
209
228
  * Placed first to cover the 0 value of the enum.
210
229
  */
@@ -379,7 +398,6 @@ declare namespace monaco {
379
398
  */
380
399
  MAX_VALUE = 112
381
400
  }
382
-
383
401
  export class KeyMod {
384
402
  static readonly CtrlCmd: number;
385
403
  static readonly Shift: number;
@@ -636,10 +654,18 @@ declare namespace monaco {
636
654
  * Return the end position (which will be after or equal to the start position)
637
655
  */
638
656
  getEndPosition(): Position;
657
+ /**
658
+ * Return the end position (which will be after or equal to the start position)
659
+ */
660
+ static getEndPosition(range: IRange): Position;
639
661
  /**
640
662
  * Return the start position (which will be before or equal to the end position)
641
663
  */
642
664
  getStartPosition(): Position;
665
+ /**
666
+ * Return the start position (which will be before or equal to the end position)
667
+ */
668
+ static getStartPosition(range: IRange): Position;
643
669
  /**
644
670
  * Transform to a user presentable string representation.
645
671
  */
@@ -878,6 +904,12 @@ declare namespace monaco.editor {
878
904
  take?: number;
879
905
  }): IMarker[];
880
906
 
907
+ /**
908
+ * Emitted when markers change for a model.
909
+ * @event
910
+ */
911
+ export function onDidChangeMarkers(listener: (e: readonly Uri[]) => void): IDisposable;
912
+
881
913
  /**
882
914
  * Get the model that has `uri` if it exists.
883
915
  */
@@ -950,6 +982,11 @@ declare namespace monaco.editor {
950
982
  */
951
983
  export function remeasureFonts(): void;
952
984
 
985
+ /**
986
+ * Register a command.
987
+ */
988
+ export function registerCommand(id: string, handler: (accessor: any, ...args: any[]) => void): IDisposable;
989
+
953
990
  export type BuiltinTheme = 'vs' | 'vs-dark' | 'hc-black';
954
991
 
955
992
  export interface IStandaloneThemeData {
@@ -1096,6 +1133,18 @@ declare namespace monaco.editor {
1096
1133
  * Defaults to true.
1097
1134
  */
1098
1135
  wordBasedSuggestions?: boolean;
1136
+ /**
1137
+ * Controls whether word based completions should be included from opened documents of the same language or any language.
1138
+ */
1139
+ wordBasedSuggestionsOnlySameLanguage?: boolean;
1140
+ /**
1141
+ * Controls whether the semanticHighlighting is shown for the languages that support it.
1142
+ * true: semanticHighlighting is enabled for all themes
1143
+ * false: semanticHighlighting is disabled for all themes
1144
+ * 'configuredByTheme': semanticHighlighting is controlled by the current color theme's semanticHighlighting setting.
1145
+ * Defaults to 'byTheme'.
1146
+ */
1147
+ 'semanticHighlighting.enabled'?: true | false | 'configuredByTheme';
1099
1148
  /**
1100
1149
  * Keep peek editors open even when double clicking their content or when hitting `Escape`.
1101
1150
  * Defaults to false.
@@ -1106,6 +1155,19 @@ declare namespace monaco.editor {
1106
1155
  * Defaults to 20000.
1107
1156
  */
1108
1157
  maxTokenizationLineLength?: number;
1158
+ /**
1159
+ * Theme to be used for rendering.
1160
+ * The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black'.
1161
+ * You can create custom themes via `monaco.editor.defineTheme`.
1162
+ * To switch a theme, use `monaco.editor.setTheme`.
1163
+ * **NOTE**: The theme might be overwritten if the OS is in high contrast mode, unless `autoDetectHighContrast` is set to false.
1164
+ */
1165
+ theme?: string;
1166
+ /**
1167
+ * If enabled, will automatically change to high contrast theme if the OS is using a high contrast theme.
1168
+ * Defaults to true.
1169
+ */
1170
+ autoDetectHighContrast?: boolean;
1109
1171
  }
1110
1172
 
1111
1173
  /**
@@ -1130,9 +1192,15 @@ declare namespace monaco.editor {
1130
1192
  * Initial theme to be used for rendering.
1131
1193
  * The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black'.
1132
1194
  * You can create custom themes via `monaco.editor.defineTheme`.
1133
- * To switch a theme, use `monaco.editor.setTheme`
1195
+ * To switch a theme, use `monaco.editor.setTheme`.
1196
+ * **NOTE**: The theme might be overwritten if the OS is in high contrast mode, unless `autoDetectHighContrast` is set to false.
1134
1197
  */
1135
1198
  theme?: string;
1199
+ /**
1200
+ * If enabled, will automatically change to high contrast theme if the OS is using a high contrast theme.
1201
+ * Defaults to true.
1202
+ */
1203
+ autoDetectHighContrast?: boolean;
1136
1204
  /**
1137
1205
  * An URL to open when Ctrl+H (Windows and Linux) or Cmd+H (OSX) is pressed in
1138
1206
  * the accessibility help dialog in the editor.
@@ -1150,9 +1218,15 @@ declare namespace monaco.editor {
1150
1218
  * Initial theme to be used for rendering.
1151
1219
  * The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black'.
1152
1220
  * You can create custom themes via `monaco.editor.defineTheme`.
1153
- * To switch a theme, use `monaco.editor.setTheme`
1221
+ * To switch a theme, use `monaco.editor.setTheme`.
1222
+ * **NOTE**: The theme might be overwritten if the OS is in high contrast mode, unless `autoDetectHighContrast` is set to false.
1154
1223
  */
1155
1224
  theme?: string;
1225
+ /**
1226
+ * If enabled, will automatically change to high contrast theme if the OS is using a high contrast theme.
1227
+ * Defaults to true.
1228
+ */
1229
+ autoDetectHighContrast?: boolean;
1156
1230
  }
1157
1231
 
1158
1232
  export interface IStandaloneCodeEditor extends ICodeEditor {
@@ -1189,7 +1263,7 @@ declare namespace monaco.editor {
1189
1263
  severity: MarkerSeverity;
1190
1264
  code?: string | {
1191
1265
  value: string;
1192
- link: Uri;
1266
+ target: Uri;
1193
1267
  };
1194
1268
  message: string;
1195
1269
  source?: string;
@@ -1207,7 +1281,7 @@ declare namespace monaco.editor {
1207
1281
  export interface IMarkerData {
1208
1282
  code?: string | {
1209
1283
  value: string;
1210
- link: Uri;
1284
+ target: Uri;
1211
1285
  };
1212
1286
  severity: MarkerSeverity;
1213
1287
  message: string;
@@ -1348,6 +1422,10 @@ declare namespace monaco.editor {
1348
1422
  * If set, the decoration will be rendered in the lines decorations with this CSS class name.
1349
1423
  */
1350
1424
  linesDecorationsClassName?: string | null;
1425
+ /**
1426
+ * If set, the decoration will be rendered in the lines decorations with this CSS class name, but only for the first line in case of line wrapping.
1427
+ */
1428
+ firstLineDecorationClassName?: string | null;
1351
1429
  /**
1352
1430
  * If set, the decoration will be rendered in the margin (covering its full width) with this CSS class name.
1353
1431
  */
@@ -1499,7 +1577,7 @@ declare namespace monaco.editor {
1499
1577
  /**
1500
1578
  * The range to replace. This can be empty to emulate a simple insert.
1501
1579
  */
1502
- range: Range;
1580
+ range: IRange;
1503
1581
  /**
1504
1582
  * The text to replace with. This can be null to emulate a simple delete.
1505
1583
  */
@@ -1511,6 +1589,17 @@ declare namespace monaco.editor {
1511
1589
  forceMoveMarkers?: boolean;
1512
1590
  }
1513
1591
 
1592
+ export interface IValidEditOperation {
1593
+ /**
1594
+ * The range to replace. This can be empty to emulate a simple insert.
1595
+ */
1596
+ range: Range;
1597
+ /**
1598
+ * The text to replace with. This can be empty to emulate a simple delete.
1599
+ */
1600
+ text: string;
1601
+ }
1602
+
1514
1603
  /**
1515
1604
  * A callback that can compute the cursor state after applying a series of edit operations.
1516
1605
  */
@@ -1518,7 +1607,7 @@ declare namespace monaco.editor {
1518
1607
  /**
1519
1608
  * A callback that can compute the resulting cursors state after some edit operations have been executed.
1520
1609
  */
1521
- (inverseEditOperations: IIdentifiedSingleEditOperation[]): Selection[] | null;
1610
+ (inverseEditOperations: IValidEditOperation[]): Selection[] | null;
1522
1611
  }
1523
1612
 
1524
1613
  export class TextModelResolvedOptions {
@@ -1636,6 +1725,10 @@ declare namespace monaco.editor {
1636
1725
  * @return EOL char sequence (e.g.: '\n' or '\r\n').
1637
1726
  */
1638
1727
  getEOL(): string;
1728
+ /**
1729
+ * Get the end of line sequence predominantly used in the text buffer.
1730
+ */
1731
+ getEndOfLineSequence(): EndOfLineSequence;
1639
1732
  /**
1640
1733
  * Get the minimum legal column for line at `lineNumber`
1641
1734
  */
@@ -1712,7 +1805,7 @@ declare namespace monaco.editor {
1712
1805
  /**
1713
1806
  * Search the model.
1714
1807
  * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true.
1715
- * @param searchScope Limit the searching to only search inside this range.
1808
+ * @param searchScope Limit the searching to only search inside these ranges.
1716
1809
  * @param isRegex Used to indicate that `searchString` is a regular expression.
1717
1810
  * @param matchCase Force the matching to match lower/upper case exactly.
1718
1811
  * @param wordSeparators Force the matching to match entire words only. Pass null otherwise.
@@ -1720,7 +1813,7 @@ declare namespace monaco.editor {
1720
1813
  * @param limitResultCount Limit the number of results
1721
1814
  * @return The ranges where the matches are. It is empty if no matches have been found.
1722
1815
  */
1723
- findMatches(searchString: string, searchScope: IRange, isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean, limitResultCount?: number): FindMatch[];
1816
+ findMatches(searchString: string, searchScope: IRange | IRange[], isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean, limitResultCount?: number): FindMatch[];
1724
1817
  /**
1725
1818
  * Search the model for the next match. Loops to the beginning of the model if needed.
1726
1819
  * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true.
@@ -1833,11 +1926,15 @@ declare namespace monaco.editor {
1833
1926
  */
1834
1927
  detectIndentation(defaultInsertSpaces: boolean, defaultTabSize: number): void;
1835
1928
  /**
1836
- * Push a stack element onto the undo stack. This acts as an undo/redo point.
1837
- * The idea is to use `pushEditOperations` to edit the model and then to
1838
- * `pushStackElement` to create an undo/redo stop point.
1929
+ * Close the current undo-redo element.
1930
+ * This offers a way to create an undo/redo stop point.
1839
1931
  */
1840
1932
  pushStackElement(): void;
1933
+ /**
1934
+ * Open the current undo-redo element.
1935
+ * This offers a way to remove the current undo/redo stop point.
1936
+ */
1937
+ popStackElement(): void;
1841
1938
  /**
1842
1939
  * Push edit operations, basically editing the model. This is the preferred way
1843
1940
  * of editing the model. The edit operations will land on the undo stack.
@@ -1846,7 +1943,7 @@ declare namespace monaco.editor {
1846
1943
  * @param cursorStateComputer A callback that can compute the resulting cursors state after the edit operations have been executed.
1847
1944
  * @return The cursor state returned by the `cursorStateComputer`.
1848
1945
  */
1849
- pushEditOperations(beforeCursorState: Selection[], editOperations: IIdentifiedSingleEditOperation[], cursorStateComputer: ICursorStateComputer): Selection[] | null;
1946
+ pushEditOperations(beforeCursorState: Selection[] | null, editOperations: IIdentifiedSingleEditOperation[], cursorStateComputer: ICursorStateComputer): Selection[] | null;
1850
1947
  /**
1851
1948
  * Change the end of line sequence. This is the preferred way of
1852
1949
  * changing the eol sequence. This will land on the undo stack.
@@ -1856,9 +1953,11 @@ declare namespace monaco.editor {
1856
1953
  * Edit the model without adding the edits to the undo stack.
1857
1954
  * This can have dire consequences on the undo stack! See @pushEditOperations for the preferred way.
1858
1955
  * @param operations The edit operations.
1859
- * @return The inverse edit operations, that, when applied, will bring the model back to the previous state.
1956
+ * @return If desired, the inverse edit operations, that, when applied, will bring the model back to the previous state.
1860
1957
  */
1861
- applyEdits(operations: IIdentifiedSingleEditOperation[]): IIdentifiedSingleEditOperation[];
1958
+ applyEdits(operations: IIdentifiedSingleEditOperation[]): void;
1959
+ applyEdits(operations: IIdentifiedSingleEditOperation[], computeUndoEdits: false): void;
1960
+ applyEdits(operations: IIdentifiedSingleEditOperation[], computeUndoEdits: true): IValidEditOperation[];
1862
1961
  /**
1863
1962
  * Change the end of line sequence without recording in the undo stack.
1864
1963
  * This can have dire consequences on the undo stack! See @pushEOL for the preferred way.
@@ -1889,6 +1988,11 @@ declare namespace monaco.editor {
1889
1988
  * @event
1890
1989
  */
1891
1990
  onDidChangeLanguageConfiguration(listener: (e: IModelLanguageConfigurationChangedEvent) => void): IDisposable;
1991
+ /**
1992
+ * An event emitted when the model has been attached to the first editor or detached from the last editor.
1993
+ * @event
1994
+ */
1995
+ onDidChangeAttached(listener: () => void): IDisposable;
1892
1996
  /**
1893
1997
  * An event emitted right before disposing the model.
1894
1998
  * @event
@@ -1899,6 +2003,10 @@ declare namespace monaco.editor {
1899
2003
  * and make all necessary clean-up to release this object to the GC.
1900
2004
  */
1901
2005
  dispose(): void;
2006
+ /**
2007
+ * Returns if this model is attached to an editor or not.
2008
+ */
2009
+ isAttachedToEditor(): boolean;
1902
2010
  }
1903
2011
 
1904
2012
  /**
@@ -1910,14 +2018,14 @@ declare namespace monaco.editor {
1910
2018
  * @param range The range to replace (delete). May be empty to represent a simple insert.
1911
2019
  * @param text The text to replace with. May be null to represent a simple delete.
1912
2020
  */
1913
- addEditOperation(range: Range, text: string | null, forceMoveMarkers?: boolean): void;
2021
+ addEditOperation(range: IRange, text: string | null, forceMoveMarkers?: boolean): void;
1914
2022
  /**
1915
2023
  * Add a new edit operation (a replace operation).
1916
2024
  * The inverse edits will be accessible in `ICursorStateComputerData.getInverseEditOperations()`
1917
2025
  * @param range The range to replace (delete). May be empty to represent a simple insert.
1918
2026
  * @param text The text to replace with. May be null to represent a simple delete.
1919
2027
  */
1920
- addTrackedEditOperation(range: Range, text: string | null, forceMoveMarkers?: boolean): void;
2028
+ addTrackedEditOperation(range: IRange, text: string | null, forceMoveMarkers?: boolean): void;
1921
2029
  /**
1922
2030
  * Track `selection` when applying edit operations.
1923
2031
  * A best effort will be made to not grow/expand the selection.
@@ -1937,7 +2045,7 @@ declare namespace monaco.editor {
1937
2045
  /**
1938
2046
  * Get the inverse edit operations of the added edit operations.
1939
2047
  */
1940
- getInverseEditOperations(): IIdentifiedSingleEditOperation[];
2048
+ getInverseEditOperations(): IValidEditOperation[];
1941
2049
  /**
1942
2050
  * Get a previously tracked selection.
1943
2051
  * @param id The unique identifier returned by `trackSelection`.
@@ -2176,6 +2284,11 @@ declare namespace monaco.editor {
2176
2284
  * Scroll vertically as necessary and reveal a line centered vertically only if it lies outside the viewport.
2177
2285
  */
2178
2286
  revealLineInCenterIfOutsideViewport(lineNumber: number, scrollType?: ScrollType): void;
2287
+ /**
2288
+ * Scroll vertically as necessary and reveal a line close to the top of the viewport,
2289
+ * optimized for viewing a code definition.
2290
+ */
2291
+ revealLineNearTop(lineNumber: number, scrollType?: ScrollType): void;
2179
2292
  /**
2180
2293
  * Scroll vertically or horizontally as necessary and reveal a position.
2181
2294
  */
@@ -2188,6 +2301,11 @@ declare namespace monaco.editor {
2188
2301
  * Scroll vertically or horizontally as necessary and reveal a position centered vertically only if it lies outside the viewport.
2189
2302
  */
2190
2303
  revealPositionInCenterIfOutsideViewport(position: IPosition, scrollType?: ScrollType): void;
2304
+ /**
2305
+ * Scroll vertically or horizontally as necessary and reveal a position close to the top of the viewport,
2306
+ * optimized for viewing a code definition.
2307
+ */
2308
+ revealPositionNearTop(position: IPosition, scrollType?: ScrollType): void;
2191
2309
  /**
2192
2310
  * Returns the primary selection of the editor.
2193
2311
  */
@@ -2233,6 +2351,11 @@ declare namespace monaco.editor {
2233
2351
  * Scroll vertically as necessary and reveal lines centered vertically only if it lies outside the viewport.
2234
2352
  */
2235
2353
  revealLinesInCenterIfOutsideViewport(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void;
2354
+ /**
2355
+ * Scroll vertically as necessary and reveal lines close to the top of the viewport,
2356
+ * optimized for viewing a code definition.
2357
+ */
2358
+ revealLinesNearTop(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void;
2236
2359
  /**
2237
2360
  * Scroll vertically or horizontally as necessary and reveal a range.
2238
2361
  */
@@ -2249,13 +2372,23 @@ declare namespace monaco.editor {
2249
2372
  * Scroll vertically or horizontally as necessary and reveal a range centered vertically only if it lies outside the viewport.
2250
2373
  */
2251
2374
  revealRangeInCenterIfOutsideViewport(range: IRange, scrollType?: ScrollType): void;
2375
+ /**
2376
+ * Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport,
2377
+ * optimized for viewing a code definition.
2378
+ */
2379
+ revealRangeNearTop(range: IRange, scrollType?: ScrollType): void;
2380
+ /**
2381
+ * Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport,
2382
+ * optimized for viewing a code definition. Only if it lies outside the viewport.
2383
+ */
2384
+ revealRangeNearTopIfOutsideViewport(range: IRange, scrollType?: ScrollType): void;
2252
2385
  /**
2253
2386
  * Directly trigger a handler or an editor action.
2254
2387
  * @param source The source of the call.
2255
2388
  * @param handlerId The id of the handler or the id of a contribution.
2256
2389
  * @param payload Extra data to be sent to the handler.
2257
2390
  */
2258
- trigger(source: string, handlerId: string, payload: any): void;
2391
+ trigger(source: string | null | undefined, handlerId: string, payload: any): void;
2259
2392
  /**
2260
2393
  * Gets the current model attached to this editor.
2261
2394
  */
@@ -2368,6 +2501,8 @@ declare namespace monaco.editor {
2368
2501
  * An event describing that model decorations have changed.
2369
2502
  */
2370
2503
  export interface IModelDecorationsChangedEvent {
2504
+ readonly affectsMinimap: boolean;
2505
+ readonly affectsOverviewRuler: boolean;
2371
2506
  }
2372
2507
 
2373
2508
  export interface IModelOptionsChangedEvent {
@@ -2489,7 +2624,7 @@ declare namespace monaco.editor {
2489
2624
  /**
2490
2625
  * Configuration options for typing over closing quotes or brackets
2491
2626
  */
2492
- export type EditorAutoClosingOvertypeStrategy = 'always' | 'auto' | 'never';
2627
+ export type EditorAutoClosingEditStrategy = 'always' | 'auto' | 'never';
2493
2628
 
2494
2629
  /**
2495
2630
  * Configuration options for auto indentation in the editor
@@ -2514,11 +2649,15 @@ declare namespace monaco.editor {
2514
2649
  * The aria label for the editor's textarea (when it is focused).
2515
2650
  */
2516
2651
  ariaLabel?: string;
2652
+ /**
2653
+ * The `tabindex` property of the editor's textarea
2654
+ */
2655
+ tabIndex?: number;
2517
2656
  /**
2518
2657
  * Render vertical lines at the specified columns.
2519
2658
  * Defaults to empty array.
2520
2659
  */
2521
- rulers?: number[];
2660
+ rulers?: (number | IRulerOption)[];
2522
2661
  /**
2523
2662
  * A string containing the word separators used when doing word navigation.
2524
2663
  * Defaults to `~!@#$%^&*()-=+[{]}\\|;:\'",.<>/?
@@ -2553,6 +2692,11 @@ declare namespace monaco.editor {
2553
2692
  * Defaults to true.
2554
2693
  */
2555
2694
  renderFinalNewline?: boolean;
2695
+ /**
2696
+ * Remove unusual line terminators like LINE SEPARATOR (LS), PARAGRAPH SEPARATOR (PS).
2697
+ * Defaults to 'prompt'.
2698
+ */
2699
+ unusualLineTerminators?: 'auto' | 'off' | 'prompt';
2556
2700
  /**
2557
2701
  * Should the corresponding line be selected when clicking on the line number?
2558
2702
  * Defaults to true.
@@ -2591,10 +2735,24 @@ declare namespace monaco.editor {
2591
2735
  */
2592
2736
  extraEditorClassName?: string;
2593
2737
  /**
2594
- * Should the editor be read only.
2738
+ * Should the editor be read only. See also `domReadOnly`.
2595
2739
  * Defaults to false.
2596
2740
  */
2597
2741
  readOnly?: boolean;
2742
+ /**
2743
+ * Should the textarea used for input use the DOM `readonly` attribute.
2744
+ * Defaults to false.
2745
+ */
2746
+ domReadOnly?: boolean;
2747
+ /**
2748
+ * Enable linked editing.
2749
+ * Defaults to false.
2750
+ */
2751
+ linkedEditing?: boolean;
2752
+ /**
2753
+ * deprecated, use linkedEditing instead
2754
+ */
2755
+ renameOnType?: boolean;
2598
2756
  /**
2599
2757
  * Should the editor render validation decorations.
2600
2758
  * Defaults to editable.
@@ -2707,6 +2865,14 @@ declare namespace monaco.editor {
2707
2865
  * Defaults to "off".
2708
2866
  */
2709
2867
  wordWrap?: 'off' | 'on' | 'wordWrapColumn' | 'bounded';
2868
+ /**
2869
+ * Override the `wordWrap` setting.
2870
+ */
2871
+ wordWrapOverride1?: 'off' | 'on' | 'inherit';
2872
+ /**
2873
+ * Override the `wordWrapOverride1` setting.
2874
+ */
2875
+ wordWrapOverride2?: 'off' | 'on' | 'inherit';
2710
2876
  /**
2711
2877
  * Control the wrapping of the editor.
2712
2878
  * When `wordWrap` = "off", the lines will never wrap.
@@ -2716,11 +2882,6 @@ declare namespace monaco.editor {
2716
2882
  * Defaults to 80.
2717
2883
  */
2718
2884
  wordWrapColumn?: number;
2719
- /**
2720
- * Force word wrapping when the text appears to be of a minified/generated file.
2721
- * Defaults to true.
2722
- */
2723
- wordWrapMinified?: boolean;
2724
2885
  /**
2725
2886
  * Control indentation of wrapped lines. Can be: 'none', 'same', 'indent' or 'deepIndent'.
2726
2887
  * Defaults to 'same' in vscode and to 'none' in monaco-editor.
@@ -2779,6 +2940,16 @@ declare namespace monaco.editor {
2779
2940
  * Defaults to 5.
2780
2941
  */
2781
2942
  fastScrollSensitivity?: number;
2943
+ /**
2944
+ * Enable that the editor scrolls only the predominant axis. Prevents horizontal drift when scrolling vertically on a trackpad.
2945
+ * Defaults to true.
2946
+ */
2947
+ scrollPredominantAxis?: boolean;
2948
+ /**
2949
+ * Enable that the selection with the mouse and keys is doing column selection.
2950
+ * Defaults to false.
2951
+ */
2952
+ columnSelection?: boolean;
2782
2953
  /**
2783
2954
  * The modifier to be used to add multiple cursors with the mouse.
2784
2955
  * Defaults to 'alt'
@@ -2807,6 +2978,10 @@ declare namespace monaco.editor {
2807
2978
  * Suggest options.
2808
2979
  */
2809
2980
  suggest?: ISuggestOptions;
2981
+ /**
2982
+ * Smart select options.
2983
+ */
2984
+ smartSelect?: ISmartSelectOptions;
2810
2985
  /**
2811
2986
  *
2812
2987
  */
@@ -2821,6 +2996,10 @@ declare namespace monaco.editor {
2821
2996
  * Defaults to 10 (ms)
2822
2997
  */
2823
2998
  quickSuggestionsDelay?: number;
2999
+ /**
3000
+ * Controls the spacing around the editor.
3001
+ */
3002
+ padding?: IEditorPaddingOptions;
2824
3003
  /**
2825
3004
  * Parameter hint options.
2826
3005
  */
@@ -2835,10 +3014,14 @@ declare namespace monaco.editor {
2835
3014
  * Defaults to language defined behavior.
2836
3015
  */
2837
3016
  autoClosingQuotes?: EditorAutoClosingStrategy;
3017
+ /**
3018
+ * Options for pressing backspace near quotes or bracket pairs.
3019
+ */
3020
+ autoClosingDelete?: EditorAutoClosingEditStrategy;
2838
3021
  /**
2839
3022
  * Options for typing over closing quotes or brackets.
2840
3023
  */
2841
- autoClosingOvertype?: EditorAutoClosingOvertypeStrategy;
3024
+ autoClosingOvertype?: EditorAutoClosingEditStrategy;
2842
3025
  /**
2843
3026
  * Options for auto surrounding.
2844
3027
  * Defaults to always allowing auto surrounding.
@@ -2849,6 +3032,11 @@ declare namespace monaco.editor {
2849
3032
  * Defaults to advanced.
2850
3033
  */
2851
3034
  autoIndent?: 'none' | 'keep' | 'brackets' | 'advanced' | 'full';
3035
+ /**
3036
+ * Emulate selection behaviour of tab characters when using spaces for indentation.
3037
+ * This means selection will stick to tab stops.
3038
+ */
3039
+ stickyTabStops?: boolean;
2852
3040
  /**
2853
3041
  * Enable format on type.
2854
3042
  * Defaults to false.
@@ -2924,6 +3112,14 @@ declare namespace monaco.editor {
2924
3112
  * Defaults to true.
2925
3113
  */
2926
3114
  codeLens?: boolean;
3115
+ /**
3116
+ * Code lens font family. Defaults to editor font family.
3117
+ */
3118
+ codeLensFontFamily?: string;
3119
+ /**
3120
+ * Code lens font size. Default to 90% of the editor font size
3121
+ */
3122
+ codeLensFontSize?: number;
2927
3123
  /**
2928
3124
  * Control the behavior and rendering of the code action lightbulb.
2929
3125
  */
@@ -2952,6 +3148,11 @@ declare namespace monaco.editor {
2952
3148
  * Defaults to 'mouseover'.
2953
3149
  */
2954
3150
  showFoldingControls?: 'always' | 'mouseover';
3151
+ /**
3152
+ * Controls whether clicking on the empty content after a folded line will unfold the line.
3153
+ * Defaults to false.
3154
+ */
3155
+ unfoldOnClickAfterEndOfLine?: boolean;
2955
3156
  /**
2956
3157
  * Enable highlighting of matching brackets.
2957
3158
  * Defaults to 'always'.
@@ -2961,7 +3162,7 @@ declare namespace monaco.editor {
2961
3162
  * Enable rendering of whitespace.
2962
3163
  * Defaults to none.
2963
3164
  */
2964
- renderWhitespace?: 'none' | 'boundary' | 'selection' | 'all';
3165
+ renderWhitespace?: 'none' | 'boundary' | 'selection' | 'trailing' | 'all';
2965
3166
  /**
2966
3167
  * Enable rendering of control characters.
2967
3168
  * Defaults to false.
@@ -2982,6 +3183,11 @@ declare namespace monaco.editor {
2982
3183
  * Defaults to all.
2983
3184
  */
2984
3185
  renderLineHighlight?: 'none' | 'gutter' | 'line' | 'all';
3186
+ /**
3187
+ * Control if the current line highlight should be rendered only the editor is focused.
3188
+ * Defaults to false.
3189
+ */
3190
+ renderLineHighlightOnlyWhenFocus?: boolean;
2985
3191
  /**
2986
3192
  * Inserting and deleting whitespace follows tab stops.
2987
3193
  */
@@ -3015,13 +3221,23 @@ declare namespace monaco.editor {
3015
3221
  * Defaults to false.
3016
3222
  */
3017
3223
  peekWidgetDefaultFocus?: 'tree' | 'editor';
3018
- }
3019
-
3020
- export interface IEditorConstructionOptions extends IEditorOptions {
3021
3224
  /**
3022
- * The initial editor dimension (to avoid measuring the container).
3225
+ * Controls whether the definition link opens element in the peek widget.
3226
+ * Defaults to false.
3023
3227
  */
3024
- dimension?: IDimension;
3228
+ definitionLinkOpensInPeek?: boolean;
3229
+ /**
3230
+ * Controls strikethrough deprecated variables.
3231
+ */
3232
+ showDeprecated?: boolean;
3233
+ /**
3234
+ * Control the behavior and rendering of the inline hints.
3235
+ */
3236
+ inlineHints?: IEditorInlineHintsOptions;
3237
+ /**
3238
+ * Control if the editor should use shadow DOM.
3239
+ */
3240
+ useShadowDOM?: boolean;
3025
3241
  }
3026
3242
 
3027
3243
  /**
@@ -3058,6 +3274,33 @@ declare namespace monaco.editor {
3058
3274
  * Defaults to false.
3059
3275
  */
3060
3276
  originalEditable?: boolean;
3277
+ /**
3278
+ * Should the diff editor enable code lens?
3279
+ * Defaults to false.
3280
+ */
3281
+ diffCodeLens?: boolean;
3282
+ /**
3283
+ * Is the diff editor inside another editor
3284
+ * Defaults to false
3285
+ */
3286
+ isInEmbeddedEditor?: boolean;
3287
+ /**
3288
+ * Is the diff editor should render overview ruler
3289
+ * Defaults to true
3290
+ */
3291
+ renderOverviewRuler?: boolean;
3292
+ /**
3293
+ * Control the wrapping of the diff editor.
3294
+ */
3295
+ diffWordWrap?: 'off' | 'on' | 'inherit';
3296
+ /**
3297
+ * Aria label for original editor.
3298
+ */
3299
+ originalAriaLabel?: string;
3300
+ /**
3301
+ * Aria label for modifed editor.
3302
+ */
3303
+ modifiedAriaLabel?: string;
3061
3304
  }
3062
3305
 
3063
3306
  /**
@@ -3089,6 +3332,11 @@ declare namespace monaco.editor {
3089
3332
  * Defaults to true.
3090
3333
  */
3091
3334
  insertSpace?: boolean;
3335
+ /**
3336
+ * Ignore empty lines when inserting line comments.
3337
+ * Defaults to true.
3338
+ */
3339
+ ignoreEmptyLines?: boolean;
3092
3340
  }
3093
3341
 
3094
3342
  export type EditorCommentsOptions = Readonly<Required<IEditorCommentsOptions>>;
@@ -3157,6 +3405,10 @@ declare namespace monaco.editor {
3157
3405
  * Configuration options for editor find widget
3158
3406
  */
3159
3407
  export interface IEditorFindOptions {
3408
+ /**
3409
+ * Controls whether the cursor should move to find matches while typing.
3410
+ */
3411
+ cursorMoveOnType?: boolean;
3160
3412
  /**
3161
3413
  * Controls if we seed search string in the Find Widget with editor selection.
3162
3414
  */
@@ -3166,6 +3418,10 @@ declare namespace monaco.editor {
3166
3418
  */
3167
3419
  autoFindInSelection?: 'never' | 'always' | 'multiline';
3168
3420
  addExtraSpaceOnTop?: boolean;
3421
+ /**
3422
+ * Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found
3423
+ */
3424
+ loop?: boolean;
3169
3425
  }
3170
3426
 
3171
3427
  export type EditorFindOptions = Readonly<Required<IEditorFindOptions>>;
@@ -3287,21 +3543,16 @@ declare namespace monaco.editor {
3287
3543
  */
3288
3544
  readonly contentWidth: number;
3289
3545
  /**
3290
- * The position for the minimap
3546
+ * Layout information for the minimap
3291
3547
  */
3292
- readonly minimapLeft: number;
3293
- /**
3294
- * The width of the minimap
3295
- */
3296
- readonly minimapWidth: number;
3297
- /**
3298
- * Minimap render type
3299
- */
3300
- readonly renderMinimap: RenderMinimap;
3548
+ readonly minimap: EditorMinimapLayoutInfo;
3301
3549
  /**
3302
3550
  * The number of columns (of typical characters) fitting on a viewport line.
3303
3551
  */
3304
3552
  readonly viewportColumn: number;
3553
+ readonly isWordWrapMinified: boolean;
3554
+ readonly isViewportWrapping: boolean;
3555
+ readonly wrappingColumn: number;
3305
3556
  /**
3306
3557
  * The width of the vertical scrollbar.
3307
3558
  */
@@ -3316,6 +3567,23 @@ declare namespace monaco.editor {
3316
3567
  readonly overviewRuler: OverviewRulerPosition;
3317
3568
  }
3318
3569
 
3570
+ /**
3571
+ * The internal layout details of the editor.
3572
+ */
3573
+ export interface EditorMinimapLayoutInfo {
3574
+ readonly renderMinimap: RenderMinimap;
3575
+ readonly minimapLeft: number;
3576
+ readonly minimapWidth: number;
3577
+ readonly minimapHeightIsEditorHeight: boolean;
3578
+ readonly minimapIsSampling: boolean;
3579
+ readonly minimapScale: number;
3580
+ readonly minimapLineHeight: number;
3581
+ readonly minimapCanvasInnerWidth: number;
3582
+ readonly minimapCanvasInnerHeight: number;
3583
+ readonly minimapCanvasOuterWidth: number;
3584
+ readonly minimapCanvasOuterHeight: number;
3585
+ }
3586
+
3319
3587
  /**
3320
3588
  * Configuration options for editor lightbulb
3321
3589
  */
@@ -3329,6 +3597,29 @@ declare namespace monaco.editor {
3329
3597
 
3330
3598
  export type EditorLightbulbOptions = Readonly<Required<IEditorLightbulbOptions>>;
3331
3599
 
3600
+ /**
3601
+ * Configuration options for editor inlineHints
3602
+ */
3603
+ export interface IEditorInlineHintsOptions {
3604
+ /**
3605
+ * Enable the inline hints.
3606
+ * Defaults to true.
3607
+ */
3608
+ enabled?: boolean;
3609
+ /**
3610
+ * Font size of inline hints.
3611
+ * Default to 90% of the editor font size.
3612
+ */
3613
+ fontSize?: number;
3614
+ /**
3615
+ * Font family of inline hints.
3616
+ * Defaults to editor font family.
3617
+ */
3618
+ fontFamily?: string;
3619
+ }
3620
+
3621
+ export type EditorInlineHintsOptions = Readonly<Required<IEditorInlineHintsOptions>>;
3622
+
3332
3623
  /**
3333
3624
  * Configuration options for editor minimap
3334
3625
  */
@@ -3343,6 +3634,11 @@ declare namespace monaco.editor {
3343
3634
  * Defaults to 'right'.
3344
3635
  */
3345
3636
  side?: 'right' | 'left';
3637
+ /**
3638
+ * Control the minimap rendering mode.
3639
+ * Defaults to 'actual'.
3640
+ */
3641
+ size?: 'proportional' | 'fill' | 'fit';
3346
3642
  /**
3347
3643
  * Control the rendering of the minimap slider.
3348
3644
  * Defaults to 'mouseover'.
@@ -3366,6 +3662,25 @@ declare namespace monaco.editor {
3366
3662
 
3367
3663
  export type EditorMinimapOptions = Readonly<Required<IEditorMinimapOptions>>;
3368
3664
 
3665
+ /**
3666
+ * Configuration options for editor padding
3667
+ */
3668
+ export interface IEditorPaddingOptions {
3669
+ /**
3670
+ * Spacing between top edge of editor and first line.
3671
+ */
3672
+ top?: number;
3673
+ /**
3674
+ * Spacing between bottom edge of editor and last line.
3675
+ */
3676
+ bottom?: number;
3677
+ }
3678
+
3679
+ export interface InternalEditorPaddingOptions {
3680
+ readonly top: number;
3681
+ readonly bottom: number;
3682
+ }
3683
+
3369
3684
  /**
3370
3685
  * Configuration options for parameter hints
3371
3686
  */
@@ -3388,9 +3703,9 @@ declare namespace monaco.editor {
3388
3703
  * Configuration options for quick suggestions
3389
3704
  */
3390
3705
  export interface IQuickSuggestionsOptions {
3391
- other: boolean;
3392
- comments: boolean;
3393
- strings: boolean;
3706
+ other?: boolean;
3707
+ comments?: boolean;
3708
+ strings?: boolean;
3394
3709
  }
3395
3710
 
3396
3711
  export type ValidQuickSuggestionsOptions = boolean | Readonly<Required<IQuickSuggestionsOptions>>;
@@ -3410,6 +3725,11 @@ declare namespace monaco.editor {
3410
3725
  readonly renderFn: ((lineNumber: number) => string) | null;
3411
3726
  }
3412
3727
 
3728
+ export interface IRulerOption {
3729
+ readonly column: number;
3730
+ readonly color: string | null;
3731
+ }
3732
+
3413
3733
  /**
3414
3734
  * Configuration options for editor scrollbars
3415
3735
  */
@@ -3474,6 +3794,11 @@ declare namespace monaco.editor {
3474
3794
  * Defaults to `horizontalScrollbarSize`.
3475
3795
  */
3476
3796
  horizontalSliderSize?: number;
3797
+ /**
3798
+ * Scroll gutter clicks move by page vs jump to position.
3799
+ * Defaults to false.
3800
+ */
3801
+ scrollByPage?: boolean;
3477
3802
  }
3478
3803
 
3479
3804
  export interface InternalEditorScrollbarOptions {
@@ -3489,6 +3814,7 @@ declare namespace monaco.editor {
3489
3814
  readonly horizontalSliderSize: number;
3490
3815
  readonly verticalScrollbarSize: number;
3491
3816
  readonly verticalSliderSize: number;
3817
+ readonly scrollByPage: boolean;
3492
3818
  }
3493
3819
 
3494
3820
  /**
@@ -3499,10 +3825,6 @@ declare namespace monaco.editor {
3499
3825
  * Overwrite word ends on accept. Default to false.
3500
3826
  */
3501
3827
  insertMode?: 'insert' | 'replace';
3502
- /**
3503
- * Show a highlight when suggestion replaces or keep text after the cursor. Defaults to false.
3504
- */
3505
- insertHighlight?: boolean;
3506
3828
  /**
3507
3829
  * Enable graceful matching. Defaults to true.
3508
3830
  */
@@ -3512,7 +3834,7 @@ declare namespace monaco.editor {
3512
3834
  */
3513
3835
  snippetsPreventQuickSuggestions?: boolean;
3514
3836
  /**
3515
- * Favours words that appear close to the cursor.
3837
+ * Favors words that appear close to the cursor.
3516
3838
  */
3517
3839
  localityBonus?: boolean;
3518
3840
  /**
@@ -3524,9 +3846,13 @@ declare namespace monaco.editor {
3524
3846
  */
3525
3847
  showIcons?: boolean;
3526
3848
  /**
3527
- * Max suggestions to show in suggestions. Defaults to 12.
3849
+ * Enable or disable the suggest status bar.
3850
+ */
3851
+ showStatusBar?: boolean;
3852
+ /**
3853
+ * Show details inline with the label. Defaults to true.
3528
3854
  */
3529
- maxVisibleSuggestions?: number;
3855
+ showInlineDetails?: boolean;
3530
3856
  /**
3531
3857
  * Show method-suggestions.
3532
3858
  */
@@ -3624,17 +3950,27 @@ declare namespace monaco.editor {
3624
3950
  */
3625
3951
  showTypeParameters?: boolean;
3626
3952
  /**
3627
- * Show snippet-suggestions.
3953
+ * Show issue-suggestions.
3628
3954
  */
3629
- showSnippets?: boolean;
3955
+ showIssues?: boolean;
3630
3956
  /**
3631
- * Controls the visibility of the status bar at the bottom of the suggest widget.
3957
+ * Show user-suggestions.
3632
3958
  */
3633
- hideStatusBar?: boolean;
3959
+ showUsers?: boolean;
3960
+ /**
3961
+ * Show snippet-suggestions.
3962
+ */
3963
+ showSnippets?: boolean;
3634
3964
  }
3635
3965
 
3636
3966
  export type InternalSuggestOptions = Readonly<Required<ISuggestOptions>>;
3637
3967
 
3968
+ export interface ISmartSelectOptions {
3969
+ selectLeadingAndTrailingWhitespace?: boolean;
3970
+ }
3971
+
3972
+ export type SmartSelectOptions = Readonly<Required<ISmartSelectOptions>>;
3973
+
3638
3974
  /**
3639
3975
  * Describes how to indent wrapped lines.
3640
3976
  */
@@ -3671,109 +4007,129 @@ declare namespace monaco.editor {
3671
4007
  accessibilityPageSize = 3,
3672
4008
  ariaLabel = 4,
3673
4009
  autoClosingBrackets = 5,
3674
- autoClosingOvertype = 6,
3675
- autoClosingQuotes = 7,
3676
- autoIndent = 8,
3677
- automaticLayout = 9,
3678
- autoSurround = 10,
3679
- codeLens = 11,
3680
- colorDecorators = 12,
3681
- comments = 13,
3682
- contextmenu = 14,
3683
- copyWithSyntaxHighlighting = 15,
3684
- cursorBlinking = 16,
3685
- cursorSmoothCaretAnimation = 17,
3686
- cursorStyle = 18,
3687
- cursorSurroundingLines = 19,
3688
- cursorSurroundingLinesStyle = 20,
3689
- cursorWidth = 21,
3690
- disableLayerHinting = 22,
3691
- disableMonospaceOptimizations = 23,
3692
- dragAndDrop = 24,
3693
- emptySelectionClipboard = 25,
3694
- extraEditorClassName = 26,
3695
- fastScrollSensitivity = 27,
3696
- find = 28,
3697
- fixedOverflowWidgets = 29,
3698
- folding = 30,
3699
- foldingStrategy = 31,
3700
- foldingHighlight = 32,
3701
- fontFamily = 33,
3702
- fontInfo = 34,
3703
- fontLigatures = 35,
3704
- fontSize = 36,
3705
- fontWeight = 37,
3706
- formatOnPaste = 38,
3707
- formatOnType = 39,
3708
- glyphMargin = 40,
3709
- gotoLocation = 41,
3710
- hideCursorInOverviewRuler = 42,
3711
- highlightActiveIndentGuide = 43,
3712
- hover = 44,
3713
- inDiffEditor = 45,
3714
- letterSpacing = 46,
3715
- lightbulb = 47,
3716
- lineDecorationsWidth = 48,
3717
- lineHeight = 49,
3718
- lineNumbers = 50,
3719
- lineNumbersMinChars = 51,
3720
- links = 52,
3721
- matchBrackets = 53,
3722
- minimap = 54,
3723
- mouseStyle = 55,
3724
- mouseWheelScrollSensitivity = 56,
3725
- mouseWheelZoom = 57,
3726
- multiCursorMergeOverlapping = 58,
3727
- multiCursorModifier = 59,
3728
- multiCursorPaste = 60,
3729
- occurrencesHighlight = 61,
3730
- overviewRulerBorder = 62,
3731
- overviewRulerLanes = 63,
3732
- parameterHints = 64,
3733
- peekWidgetDefaultFocus = 65,
3734
- quickSuggestions = 66,
3735
- quickSuggestionsDelay = 67,
3736
- readOnly = 68,
3737
- renderControlCharacters = 69,
3738
- renderIndentGuides = 70,
3739
- renderFinalNewline = 71,
3740
- renderLineHighlight = 72,
3741
- renderValidationDecorations = 73,
3742
- renderWhitespace = 74,
3743
- revealHorizontalRightPadding = 75,
3744
- roundedSelection = 76,
3745
- rulers = 77,
3746
- scrollbar = 78,
3747
- scrollBeyondLastColumn = 79,
3748
- scrollBeyondLastLine = 80,
3749
- selectionClipboard = 81,
3750
- selectionHighlight = 82,
3751
- selectOnLineNumbers = 83,
3752
- showFoldingControls = 84,
3753
- showUnused = 85,
3754
- snippetSuggestions = 86,
3755
- smoothScrolling = 87,
3756
- stopRenderingLineAfter = 88,
3757
- suggest = 89,
3758
- suggestFontSize = 90,
3759
- suggestLineHeight = 91,
3760
- suggestOnTriggerCharacters = 92,
3761
- suggestSelection = 93,
3762
- tabCompletion = 94,
3763
- useTabStops = 95,
3764
- wordSeparators = 96,
3765
- wordWrap = 97,
3766
- wordWrapBreakAfterCharacters = 98,
3767
- wordWrapBreakBeforeCharacters = 99,
3768
- wordWrapColumn = 100,
3769
- wordWrapMinified = 101,
3770
- wrappingIndent = 102,
3771
- wrappingStrategy = 103,
3772
- editorClassName = 104,
3773
- pixelRatio = 105,
3774
- tabFocusMode = 106,
3775
- layoutInfo = 107,
3776
- wrappingInfo = 108
4010
+ autoClosingDelete = 6,
4011
+ autoClosingOvertype = 7,
4012
+ autoClosingQuotes = 8,
4013
+ autoIndent = 9,
4014
+ automaticLayout = 10,
4015
+ autoSurround = 11,
4016
+ codeLens = 12,
4017
+ codeLensFontFamily = 13,
4018
+ codeLensFontSize = 14,
4019
+ colorDecorators = 15,
4020
+ columnSelection = 16,
4021
+ comments = 17,
4022
+ contextmenu = 18,
4023
+ copyWithSyntaxHighlighting = 19,
4024
+ cursorBlinking = 20,
4025
+ cursorSmoothCaretAnimation = 21,
4026
+ cursorStyle = 22,
4027
+ cursorSurroundingLines = 23,
4028
+ cursorSurroundingLinesStyle = 24,
4029
+ cursorWidth = 25,
4030
+ disableLayerHinting = 26,
4031
+ disableMonospaceOptimizations = 27,
4032
+ domReadOnly = 28,
4033
+ dragAndDrop = 29,
4034
+ emptySelectionClipboard = 30,
4035
+ extraEditorClassName = 31,
4036
+ fastScrollSensitivity = 32,
4037
+ find = 33,
4038
+ fixedOverflowWidgets = 34,
4039
+ folding = 35,
4040
+ foldingStrategy = 36,
4041
+ foldingHighlight = 37,
4042
+ unfoldOnClickAfterEndOfLine = 38,
4043
+ fontFamily = 39,
4044
+ fontInfo = 40,
4045
+ fontLigatures = 41,
4046
+ fontSize = 42,
4047
+ fontWeight = 43,
4048
+ formatOnPaste = 44,
4049
+ formatOnType = 45,
4050
+ glyphMargin = 46,
4051
+ gotoLocation = 47,
4052
+ hideCursorInOverviewRuler = 48,
4053
+ highlightActiveIndentGuide = 49,
4054
+ hover = 50,
4055
+ inDiffEditor = 51,
4056
+ letterSpacing = 52,
4057
+ lightbulb = 53,
4058
+ lineDecorationsWidth = 54,
4059
+ lineHeight = 55,
4060
+ lineNumbers = 56,
4061
+ lineNumbersMinChars = 57,
4062
+ linkedEditing = 58,
4063
+ links = 59,
4064
+ matchBrackets = 60,
4065
+ minimap = 61,
4066
+ mouseStyle = 62,
4067
+ mouseWheelScrollSensitivity = 63,
4068
+ mouseWheelZoom = 64,
4069
+ multiCursorMergeOverlapping = 65,
4070
+ multiCursorModifier = 66,
4071
+ multiCursorPaste = 67,
4072
+ occurrencesHighlight = 68,
4073
+ overviewRulerBorder = 69,
4074
+ overviewRulerLanes = 70,
4075
+ padding = 71,
4076
+ parameterHints = 72,
4077
+ peekWidgetDefaultFocus = 73,
4078
+ definitionLinkOpensInPeek = 74,
4079
+ quickSuggestions = 75,
4080
+ quickSuggestionsDelay = 76,
4081
+ readOnly = 77,
4082
+ renameOnType = 78,
4083
+ renderControlCharacters = 79,
4084
+ renderIndentGuides = 80,
4085
+ renderFinalNewline = 81,
4086
+ renderLineHighlight = 82,
4087
+ renderLineHighlightOnlyWhenFocus = 83,
4088
+ renderValidationDecorations = 84,
4089
+ renderWhitespace = 85,
4090
+ revealHorizontalRightPadding = 86,
4091
+ roundedSelection = 87,
4092
+ rulers = 88,
4093
+ scrollbar = 89,
4094
+ scrollBeyondLastColumn = 90,
4095
+ scrollBeyondLastLine = 91,
4096
+ scrollPredominantAxis = 92,
4097
+ selectionClipboard = 93,
4098
+ selectionHighlight = 94,
4099
+ selectOnLineNumbers = 95,
4100
+ showFoldingControls = 96,
4101
+ showUnused = 97,
4102
+ snippetSuggestions = 98,
4103
+ smartSelect = 99,
4104
+ smoothScrolling = 100,
4105
+ stickyTabStops = 101,
4106
+ stopRenderingLineAfter = 102,
4107
+ suggest = 103,
4108
+ suggestFontSize = 104,
4109
+ suggestLineHeight = 105,
4110
+ suggestOnTriggerCharacters = 106,
4111
+ suggestSelection = 107,
4112
+ tabCompletion = 108,
4113
+ tabIndex = 109,
4114
+ unusualLineTerminators = 110,
4115
+ useShadowDOM = 111,
4116
+ useTabStops = 112,
4117
+ wordSeparators = 113,
4118
+ wordWrap = 114,
4119
+ wordWrapBreakAfterCharacters = 115,
4120
+ wordWrapBreakBeforeCharacters = 116,
4121
+ wordWrapColumn = 117,
4122
+ wordWrapOverride1 = 118,
4123
+ wordWrapOverride2 = 119,
4124
+ wrappingIndent = 120,
4125
+ wrappingStrategy = 121,
4126
+ showDeprecated = 122,
4127
+ inlineHints = 123,
4128
+ editorClassName = 124,
4129
+ pixelRatio = 125,
4130
+ tabFocusMode = 126,
4131
+ layoutInfo = 127,
4132
+ wrappingInfo = 128
3777
4133
  }
3778
4134
  export const EditorOptions: {
3779
4135
  acceptSuggestionOnCommitCharacter: IEditorOption<EditorOption.acceptSuggestionOnCommitCharacter, boolean>;
@@ -3781,14 +4137,19 @@ declare namespace monaco.editor {
3781
4137
  accessibilitySupport: IEditorOption<EditorOption.accessibilitySupport, AccessibilitySupport>;
3782
4138
  accessibilityPageSize: IEditorOption<EditorOption.accessibilityPageSize, number>;
3783
4139
  ariaLabel: IEditorOption<EditorOption.ariaLabel, string>;
3784
- autoClosingBrackets: IEditorOption<EditorOption.autoClosingBrackets, EditorAutoClosingStrategy>;
3785
- autoClosingOvertype: IEditorOption<EditorOption.autoClosingOvertype, EditorAutoClosingOvertypeStrategy>;
3786
- autoClosingQuotes: IEditorOption<EditorOption.autoClosingQuotes, EditorAutoClosingStrategy>;
4140
+ autoClosingBrackets: IEditorOption<EditorOption.autoClosingBrackets, 'always' | 'languageDefined' | 'beforeWhitespace' | 'never'>;
4141
+ autoClosingDelete: IEditorOption<EditorOption.autoClosingDelete, 'always' | 'never' | 'auto'>;
4142
+ autoClosingOvertype: IEditorOption<EditorOption.autoClosingOvertype, 'always' | 'never' | 'auto'>;
4143
+ autoClosingQuotes: IEditorOption<EditorOption.autoClosingQuotes, 'always' | 'languageDefined' | 'beforeWhitespace' | 'never'>;
3787
4144
  autoIndent: IEditorOption<EditorOption.autoIndent, EditorAutoIndentStrategy>;
3788
4145
  automaticLayout: IEditorOption<EditorOption.automaticLayout, boolean>;
3789
- autoSurround: IEditorOption<EditorOption.autoSurround, EditorAutoSurroundStrategy>;
4146
+ autoSurround: IEditorOption<EditorOption.autoSurround, 'languageDefined' | 'never' | 'quotes' | 'brackets'>;
4147
+ stickyTabStops: IEditorOption<EditorOption.stickyTabStops, boolean>;
3790
4148
  codeLens: IEditorOption<EditorOption.codeLens, boolean>;
4149
+ codeLensFontFamily: IEditorOption<EditorOption.codeLensFontFamily, string>;
4150
+ codeLensFontSize: IEditorOption<EditorOption.codeLensFontSize, number>;
3791
4151
  colorDecorators: IEditorOption<EditorOption.colorDecorators, boolean>;
4152
+ columnSelection: IEditorOption<EditorOption.columnSelection, boolean>;
3792
4153
  comments: IEditorOption<EditorOption.comments, EditorCommentsOptions>;
3793
4154
  contextmenu: IEditorOption<EditorOption.contextmenu, boolean>;
3794
4155
  copyWithSyntaxHighlighting: IEditorOption<EditorOption.copyWithSyntaxHighlighting, boolean>;
@@ -3800,6 +4161,7 @@ declare namespace monaco.editor {
3800
4161
  cursorWidth: IEditorOption<EditorOption.cursorWidth, number>;
3801
4162
  disableLayerHinting: IEditorOption<EditorOption.disableLayerHinting, boolean>;
3802
4163
  disableMonospaceOptimizations: IEditorOption<EditorOption.disableMonospaceOptimizations, boolean>;
4164
+ domReadOnly: IEditorOption<EditorOption.domReadOnly, boolean>;
3803
4165
  dragAndDrop: IEditorOption<EditorOption.dragAndDrop, boolean>;
3804
4166
  emptySelectionClipboard: IEditorOption<EditorOption.emptySelectionClipboard, boolean>;
3805
4167
  extraEditorClassName: IEditorOption<EditorOption.extraEditorClassName, string>;
@@ -3809,6 +4171,7 @@ declare namespace monaco.editor {
3809
4171
  folding: IEditorOption<EditorOption.folding, boolean>;
3810
4172
  foldingStrategy: IEditorOption<EditorOption.foldingStrategy, 'auto' | 'indentation'>;
3811
4173
  foldingHighlight: IEditorOption<EditorOption.foldingHighlight, boolean>;
4174
+ unfoldOnClickAfterEndOfLine: IEditorOption<EditorOption.unfoldOnClickAfterEndOfLine, boolean>;
3812
4175
  fontFamily: IEditorOption<EditorOption.fontFamily, string>;
3813
4176
  fontInfo: IEditorOption<EditorOption.fontInfo, FontInfo>;
3814
4177
  fontLigatures2: IEditorOption<EditorOption.fontLigatures, string>;
@@ -3828,6 +4191,7 @@ declare namespace monaco.editor {
3828
4191
  lineHeight: IEditorOption<EditorOption.lineHeight, number>;
3829
4192
  lineNumbers: IEditorOption<EditorOption.lineNumbers, InternalEditorRenderLineNumbersOptions>;
3830
4193
  lineNumbersMinChars: IEditorOption<EditorOption.lineNumbersMinChars, number>;
4194
+ linkedEditing: IEditorOption<EditorOption.linkedEditing, boolean>;
3831
4195
  links: IEditorOption<EditorOption.links, boolean>;
3832
4196
  matchBrackets: IEditorOption<EditorOption.matchBrackets, 'always' | 'never' | 'near'>;
3833
4197
  minimap: IEditorOption<EditorOption.minimap, EditorMinimapOptions>;
@@ -3840,29 +4204,37 @@ declare namespace monaco.editor {
3840
4204
  occurrencesHighlight: IEditorOption<EditorOption.occurrencesHighlight, boolean>;
3841
4205
  overviewRulerBorder: IEditorOption<EditorOption.overviewRulerBorder, boolean>;
3842
4206
  overviewRulerLanes: IEditorOption<EditorOption.overviewRulerLanes, number>;
4207
+ padding: IEditorOption<EditorOption.padding, InternalEditorPaddingOptions>;
3843
4208
  parameterHints: IEditorOption<EditorOption.parameterHints, InternalParameterHintOptions>;
3844
4209
  peekWidgetDefaultFocus: IEditorOption<EditorOption.peekWidgetDefaultFocus, 'tree' | 'editor'>;
4210
+ definitionLinkOpensInPeek: IEditorOption<EditorOption.definitionLinkOpensInPeek, boolean>;
3845
4211
  quickSuggestions: IEditorOption<EditorOption.quickSuggestions, ValidQuickSuggestionsOptions>;
3846
4212
  quickSuggestionsDelay: IEditorOption<EditorOption.quickSuggestionsDelay, number>;
3847
4213
  readOnly: IEditorOption<EditorOption.readOnly, boolean>;
4214
+ renameOnType: IEditorOption<EditorOption.renameOnType, boolean>;
3848
4215
  renderControlCharacters: IEditorOption<EditorOption.renderControlCharacters, boolean>;
3849
4216
  renderIndentGuides: IEditorOption<EditorOption.renderIndentGuides, boolean>;
3850
4217
  renderFinalNewline: IEditorOption<EditorOption.renderFinalNewline, boolean>;
3851
4218
  renderLineHighlight: IEditorOption<EditorOption.renderLineHighlight, 'all' | 'line' | 'none' | 'gutter'>;
4219
+ renderLineHighlightOnlyWhenFocus: IEditorOption<EditorOption.renderLineHighlightOnlyWhenFocus, boolean>;
3852
4220
  renderValidationDecorations: IEditorOption<EditorOption.renderValidationDecorations, 'on' | 'off' | 'editable'>;
3853
- renderWhitespace: IEditorOption<EditorOption.renderWhitespace, 'all' | 'none' | 'boundary' | 'selection'>;
4221
+ renderWhitespace: IEditorOption<EditorOption.renderWhitespace, 'all' | 'none' | 'boundary' | 'selection' | 'trailing'>;
3854
4222
  revealHorizontalRightPadding: IEditorOption<EditorOption.revealHorizontalRightPadding, number>;
3855
4223
  roundedSelection: IEditorOption<EditorOption.roundedSelection, boolean>;
3856
4224
  rulers: IEditorOption<EditorOption.rulers, {}>;
3857
4225
  scrollbar: IEditorOption<EditorOption.scrollbar, InternalEditorScrollbarOptions>;
3858
4226
  scrollBeyondLastColumn: IEditorOption<EditorOption.scrollBeyondLastColumn, number>;
3859
4227
  scrollBeyondLastLine: IEditorOption<EditorOption.scrollBeyondLastLine, boolean>;
4228
+ scrollPredominantAxis: IEditorOption<EditorOption.scrollPredominantAxis, boolean>;
3860
4229
  selectionClipboard: IEditorOption<EditorOption.selectionClipboard, boolean>;
3861
4230
  selectionHighlight: IEditorOption<EditorOption.selectionHighlight, boolean>;
3862
4231
  selectOnLineNumbers: IEditorOption<EditorOption.selectOnLineNumbers, boolean>;
3863
4232
  showFoldingControls: IEditorOption<EditorOption.showFoldingControls, 'always' | 'mouseover'>;
3864
4233
  showUnused: IEditorOption<EditorOption.showUnused, boolean>;
4234
+ showDeprecated: IEditorOption<EditorOption.showDeprecated, boolean>;
4235
+ inlineHints: IEditorOption<EditorOption.inlineHints, any>;
3865
4236
  snippetSuggestions: IEditorOption<EditorOption.snippetSuggestions, 'none' | 'top' | 'bottom' | 'inline'>;
4237
+ smartSelect: IEditorOption<EditorOption.smartSelect, any>;
3866
4238
  smoothScrolling: IEditorOption<EditorOption.smoothScrolling, boolean>;
3867
4239
  stopRenderingLineAfter: IEditorOption<EditorOption.stopRenderingLineAfter, number>;
3868
4240
  suggest: IEditorOption<EditorOption.suggest, InternalSuggestOptions>;
@@ -3871,13 +4243,17 @@ declare namespace monaco.editor {
3871
4243
  suggestOnTriggerCharacters: IEditorOption<EditorOption.suggestOnTriggerCharacters, boolean>;
3872
4244
  suggestSelection: IEditorOption<EditorOption.suggestSelection, 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix'>;
3873
4245
  tabCompletion: IEditorOption<EditorOption.tabCompletion, 'on' | 'off' | 'onlySnippets'>;
4246
+ tabIndex: IEditorOption<EditorOption.tabIndex, number>;
4247
+ unusualLineTerminators: IEditorOption<EditorOption.unusualLineTerminators, 'auto' | 'off' | 'prompt'>;
4248
+ useShadowDOM: IEditorOption<EditorOption.useShadowDOM, boolean>;
3874
4249
  useTabStops: IEditorOption<EditorOption.useTabStops, boolean>;
3875
4250
  wordSeparators: IEditorOption<EditorOption.wordSeparators, string>;
3876
4251
  wordWrap: IEditorOption<EditorOption.wordWrap, 'on' | 'off' | 'wordWrapColumn' | 'bounded'>;
3877
4252
  wordWrapBreakAfterCharacters: IEditorOption<EditorOption.wordWrapBreakAfterCharacters, string>;
3878
4253
  wordWrapBreakBeforeCharacters: IEditorOption<EditorOption.wordWrapBreakBeforeCharacters, string>;
3879
4254
  wordWrapColumn: IEditorOption<EditorOption.wordWrapColumn, number>;
3880
- wordWrapMinified: IEditorOption<EditorOption.wordWrapMinified, boolean>;
4255
+ wordWrapOverride1: IEditorOption<EditorOption.wordWrapOverride1, 'on' | 'off' | 'inherit'>;
4256
+ wordWrapOverride2: IEditorOption<EditorOption.wordWrapOverride2, 'on' | 'off' | 'inherit'>;
3881
4257
  wrappingIndent: IEditorOption<EditorOption.wrappingIndent, WrappingIndent>;
3882
4258
  wrappingStrategy: IEditorOption<EditorOption.wrappingStrategy, 'simple' | 'advanced'>;
3883
4259
  editorClassName: IEditorOption<EditorOption.editorClassName, string>;
@@ -4035,6 +4411,18 @@ declare namespace monaco.editor {
4035
4411
  * If null is returned, the content widget will be placed off screen.
4036
4412
  */
4037
4413
  getPosition(): IContentWidgetPosition | null;
4414
+ /**
4415
+ * Optional function that is invoked before rendering
4416
+ * the content widget. If a dimension is returned the editor will
4417
+ * attempt to use it.
4418
+ */
4419
+ beforeRender?(): IDimension | null;
4420
+ /**
4421
+ * Optional function that is invoked after rendering the content
4422
+ * widget. Is being invoked with the selected position preference
4423
+ * or `null` if not rendered.
4424
+ */
4425
+ afterRender?(position: ContentWidgetPositionPreference | null): void;
4038
4426
  }
4039
4427
 
4040
4428
  /**
@@ -4197,6 +4585,30 @@ declare namespace monaco.editor {
4197
4585
  readonly mode: string | null;
4198
4586
  }
4199
4587
 
4588
+ export interface IEditorConstructionOptions extends IEditorOptions {
4589
+ /**
4590
+ * The initial editor dimension (to avoid measuring the container).
4591
+ */
4592
+ dimension?: IDimension;
4593
+ /**
4594
+ * Place overflow widgets inside an external DOM node.
4595
+ * Defaults to an internal DOM node.
4596
+ */
4597
+ overflowWidgetsDomNode?: HTMLElement;
4598
+ }
4599
+
4600
+ export interface IDiffEditorConstructionOptions extends IDiffEditorOptions {
4601
+ /**
4602
+ * The initial editor dimension (to avoid measuring the container).
4603
+ */
4604
+ dimension?: IDimension;
4605
+ /**
4606
+ * Place overflow widgets inside an external DOM node.
4607
+ * Defaults to an internal DOM node.
4608
+ */
4609
+ overflowWidgetsDomNode?: HTMLElement;
4610
+ }
4611
+
4200
4612
  /**
4201
4613
  * A rich code editor.
4202
4614
  */
@@ -4274,6 +4686,11 @@ declare namespace monaco.editor {
4274
4686
  * An event emitted after composition has ended.
4275
4687
  */
4276
4688
  onDidCompositionEnd(listener: () => void): IDisposable;
4689
+ /**
4690
+ * An event emitted when editing failed because the editor is read-only.
4691
+ * @event
4692
+ */
4693
+ onDidAttemptReadOnlyEdit(listener: () => void): IDisposable;
4277
4694
  /**
4278
4695
  * An event emitted when users paste text in the editor.
4279
4696
  * @event
@@ -4414,15 +4831,15 @@ declare namespace monaco.editor {
4414
4831
  /**
4415
4832
  * Change the scrollLeft of the editor's viewport.
4416
4833
  */
4417
- setScrollLeft(newScrollLeft: number): void;
4834
+ setScrollLeft(newScrollLeft: number, scrollType?: ScrollType): void;
4418
4835
  /**
4419
4836
  * Change the scrollTop of the editor's viewport.
4420
4837
  */
4421
- setScrollTop(newScrollTop: number): void;
4838
+ setScrollTop(newScrollTop: number, scrollType?: ScrollType): void;
4422
4839
  /**
4423
4840
  * Change the scroll position of the editor's viewport.
4424
4841
  */
4425
- setScrollPosition(position: INewScrollPosition): void;
4842
+ setScrollPosition(position: INewScrollPosition, scrollType?: ScrollType): void;
4426
4843
  /**
4427
4844
  * Get an action that is a contribution to this editor.
4428
4845
  * @id Unique identifier of the contribution.
@@ -4435,11 +4852,15 @@ declare namespace monaco.editor {
4435
4852
  * @param source The source of the call.
4436
4853
  * @param command The command to execute
4437
4854
  */
4438
- executeCommand(source: string, command: ICommand): void;
4855
+ executeCommand(source: string | null | undefined, command: ICommand): void;
4439
4856
  /**
4440
- * Push an "undo stop" in the undo-redo stack.
4857
+ * Create an "undo stop" in the undo-redo stack.
4441
4858
  */
4442
4859
  pushUndoStop(): boolean;
4860
+ /**
4861
+ * Remove the "undo stop" in the undo-redo stack.
4862
+ */
4863
+ popUndoStop(): boolean;
4443
4864
  /**
4444
4865
  * Execute edits on the editor.
4445
4866
  * The edits will land on the undo-redo stack, but no "undo stop" will be pushed.
@@ -4447,13 +4868,13 @@ declare namespace monaco.editor {
4447
4868
  * @param edits The edits to execute.
4448
4869
  * @param endCursorState Cursor state after the edits were applied.
4449
4870
  */
4450
- executeEdits(source: string, edits: IIdentifiedSingleEditOperation[], endCursorState?: ICursorStateComputer | Selection[]): boolean;
4871
+ executeEdits(source: string | null | undefined, edits: IIdentifiedSingleEditOperation[], endCursorState?: ICursorStateComputer | Selection[]): boolean;
4451
4872
  /**
4452
4873
  * Execute multiple (concomitant) commands on the editor.
4453
4874
  * @param source The source of the call.
4454
4875
  * @param command The commands to execute
4455
4876
  */
4456
- executeCommands(source: string, commands: (ICommand | null)[]): void;
4877
+ executeCommands(source: string | null | undefined, commands: (ICommand | null)[]): void;
4457
4878
  /**
4458
4879
  * Get all the decorations on a line (filtering out decorations from other editors).
4459
4880
  */
@@ -4624,6 +5045,7 @@ declare namespace monaco.editor {
4624
5045
 
4625
5046
  export class FontInfo extends BareFontInfo {
4626
5047
  readonly _editorStylingBrand: void;
5048
+ readonly version: number;
4627
5049
  readonly isTrusted: boolean;
4628
5050
  readonly isMonospace: boolean;
4629
5051
  readonly typicalHalfwidthCharacterWidth: number;
@@ -4631,12 +5053,14 @@ declare namespace monaco.editor {
4631
5053
  readonly canUseHalfwidthRightwardsArrow: boolean;
4632
5054
  readonly spaceWidth: number;
4633
5055
  readonly middotWidth: number;
5056
+ readonly wsmiddotWidth: number;
4634
5057
  readonly maxDigitWidth: number;
4635
5058
  }
4636
5059
 
4637
5060
  export class BareFontInfo {
4638
5061
  readonly _bareFontInfoBrand: void;
4639
5062
  readonly zoomLevel: number;
5063
+ readonly pixelRatio: number;
4640
5064
  readonly fontFamily: string;
4641
5065
  readonly fontWeight: string;
4642
5066
  readonly fontSize: number;
@@ -4757,8 +5181,18 @@ declare namespace monaco.languages {
4757
5181
  * Tokenize a line given the state at the beginning of the line.
4758
5182
  */
4759
5183
  tokenizeEncoded(line: string, state: IState): IEncodedLineTokens;
5184
+ /**
5185
+ * Tokenize a line given the state at the beginning of the line.
5186
+ */
5187
+ tokenize?(line: string, state: IState): ILineTokens;
4760
5188
  }
4761
5189
 
5190
+ /**
5191
+ * Change the color map that is used for token colors.
5192
+ * Supported formats (hex): #RRGGBB, $RRGGBBAA, #RGB, #RGBA
5193
+ */
5194
+ export function setColorMap(colorMap: string[] | null): void;
5195
+
4762
5196
  /**
4763
5197
  * Set the tokens provider for a language (manual implementation).
4764
5198
  */
@@ -4799,6 +5233,11 @@ declare namespace monaco.languages {
4799
5233
  */
4800
5234
  export function registerDocumentHighlightProvider(languageId: string, provider: DocumentHighlightProvider): IDisposable;
4801
5235
 
5236
+ /**
5237
+ * Register an linked editing range provider.
5238
+ */
5239
+ export function registerLinkedEditingRangeProvider(languageId: string, provider: LinkedEditingRangeProvider): IDisposable;
5240
+
4802
5241
  /**
4803
5242
  * Register a definition provider (used by e.g. go to definition).
4804
5243
  */
@@ -5045,7 +5484,7 @@ declare namespace monaco.languages {
5045
5484
  /**
5046
5485
  * This rule will only execute if the text above the this line matches this regular expression.
5047
5486
  */
5048
- oneLineAboveText?: RegExp;
5487
+ previousLineText?: RegExp;
5049
5488
  /**
5050
5489
  * The action to execute.
5051
5490
  */
@@ -5197,7 +5636,9 @@ declare namespace monaco.languages {
5197
5636
  Customcolor = 22,
5198
5637
  Folder = 23,
5199
5638
  TypeParameter = 24,
5200
- Snippet = 25
5639
+ User = 25,
5640
+ Issue = 26,
5641
+ Snippet = 27
5201
5642
  }
5202
5643
 
5203
5644
  export interface CompletionItemLabel {
@@ -5206,9 +5647,9 @@ declare namespace monaco.languages {
5206
5647
  */
5207
5648
  name: string;
5208
5649
  /**
5209
- * The signature without the return type. Render after `name`.
5650
+ * The parameters without the return type. Render after `name`.
5210
5651
  */
5211
- signature?: string;
5652
+ parameters?: string;
5212
5653
  /**
5213
5654
  * The fully qualified name, like package name or file path. Rendered after `signature`.
5214
5655
  */
@@ -5285,7 +5726,7 @@ declare namespace monaco.languages {
5285
5726
  preselect?: boolean;
5286
5727
  /**
5287
5728
  * A string or snippet that should be inserted in a document when selecting
5288
- * this completion. When `falsy` the [label](#CompletionItem.label)
5729
+ * this completion.
5289
5730
  * is used.
5290
5731
  */
5291
5732
  insertText: string;
@@ -5380,7 +5821,7 @@ declare namespace monaco.languages {
5380
5821
  *
5381
5822
  * The editor will only resolve a completion item once.
5382
5823
  */
5383
- resolveCompletionItem?(model: editor.ITextModel, position: Position, item: CompletionItem, token: CancellationToken): ProviderResult<CompletionItem>;
5824
+ resolveCompletionItem?(item: CompletionItem, token: CancellationToken): ProviderResult<CompletionItem>;
5384
5825
  }
5385
5826
 
5386
5827
  export interface CodeAction {
@@ -5434,6 +5875,12 @@ declare namespace monaco.languages {
5434
5875
  * The parameters of this signature.
5435
5876
  */
5436
5877
  parameters: ParameterInformation[];
5878
+ /**
5879
+ * Index of the active parameter.
5880
+ *
5881
+ * If provided, this is used in place of `SignatureHelp.activeSignature`.
5882
+ */
5883
+ activeParameter?: number;
5437
5884
  }
5438
5885
 
5439
5886
  /**
@@ -5532,6 +5979,33 @@ declare namespace monaco.languages {
5532
5979
  provideDocumentHighlights(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<DocumentHighlight[]>;
5533
5980
  }
5534
5981
 
5982
+ /**
5983
+ * The linked editing range provider interface defines the contract between extensions and
5984
+ * the linked editing feature.
5985
+ */
5986
+ export interface LinkedEditingRangeProvider {
5987
+ /**
5988
+ * Provide a list of ranges that can be edited together.
5989
+ */
5990
+ provideLinkedEditingRanges(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<LinkedEditingRanges>;
5991
+ }
5992
+
5993
+ /**
5994
+ * Represents a list of ranges that can be edited together along with a word pattern to describe valid contents.
5995
+ */
5996
+ export interface LinkedEditingRanges {
5997
+ /**
5998
+ * A list of ranges that can be edited together. The ranges must have
5999
+ * identical length and text content. The ranges cannot overlap
6000
+ */
6001
+ ranges: IRange[];
6002
+ /**
6003
+ * An optional word pattern that describes valid contents for the given ranges.
6004
+ * If no pattern is provided, the language configuration's word pattern will be used.
6005
+ */
6006
+ wordPattern?: RegExp;
6007
+ }
6008
+
5535
6009
  /**
5536
6010
  * Value-object that contains additional information when
5537
6011
  * requesting references.
@@ -5869,11 +6343,15 @@ declare namespace monaco.languages {
5869
6343
  }
5870
6344
 
5871
6345
  /**
5872
- * A provider of colors for editor models.
6346
+ * A provider of folding ranges for editor models.
5873
6347
  */
5874
6348
  export interface FoldingRangeProvider {
5875
6349
  /**
5876
- * Provides the color ranges for a specific model.
6350
+ * An optional event to signal that the folding ranges from this provider have changed.
6351
+ */
6352
+ onDidChange?: IEvent<this>;
6353
+ /**
6354
+ * Provides the folding ranges for a specific model.
5877
6355
  */
5878
6356
  provideFoldingRanges(model: editor.ITextModel, context: FoldingContext, token: CancellationToken): ProviderResult<FoldingRange[]>;
5879
6357
  }
@@ -5923,12 +6401,6 @@ declare namespace monaco.languages {
5923
6401
  needsConfirmation: boolean;
5924
6402
  label: string;
5925
6403
  description?: string;
5926
- iconPath?: {
5927
- id: string;
5928
- } | {
5929
- light: Uri;
5930
- dark: Uri;
5931
- };
5932
6404
  }
5933
6405
 
5934
6406
  export interface WorkspaceFileEditOptions {
@@ -5936,6 +6408,10 @@ declare namespace monaco.languages {
5936
6408
  ignoreIfNotExists?: boolean;
5937
6409
  ignoreIfExists?: boolean;
5938
6410
  recursive?: boolean;
6411
+ copy?: boolean;
6412
+ folder?: boolean;
6413
+ skipTrashBin?: boolean;
6414
+ maxSize?: number;
5939
6415
  }
5940
6416
 
5941
6417
  export interface WorkspaceFileEdit {
@@ -5994,6 +6470,26 @@ declare namespace monaco.languages {
5994
6470
  resolveCodeLens?(model: editor.ITextModel, codeLens: CodeLens, token: CancellationToken): ProviderResult<CodeLens>;
5995
6471
  }
5996
6472
 
6473
+ export enum InlineHintKind {
6474
+ Other = 0,
6475
+ Type = 1,
6476
+ Parameter = 2
6477
+ }
6478
+
6479
+ export interface InlineHint {
6480
+ text: string;
6481
+ range: IRange;
6482
+ kind: InlineHintKind;
6483
+ description?: string | IMarkdownString;
6484
+ whitespaceBefore?: boolean;
6485
+ whitespaceAfter?: boolean;
6486
+ }
6487
+
6488
+ export interface InlineHintsProvider {
6489
+ onDidChangeInlineHints?: IEvent<void> | undefined;
6490
+ provideInlineHints(model: editor.ITextModel, range: Range, token: CancellationToken): ProviderResult<InlineHint[]>;
6491
+ }
6492
+
5997
6493
  export interface SemanticTokensLegend {
5998
6494
  readonly tokenTypes: string[];
5999
6495
  readonly tokenModifiers: string[];
@@ -6016,6 +6512,7 @@ declare namespace monaco.languages {
6016
6512
  }
6017
6513
 
6018
6514
  export interface DocumentSemanticTokensProvider {
6515
+ onDidChange?: IEvent<void>;
6019
6516
  getLegend(): SemanticTokensLegend;
6020
6517
  provideDocumentSemanticTokens(model: editor.ITextModel, lastResultId: string | null, token: CancellationToken): ProviderResult<SemanticTokens | SemanticTokensEdits>;
6021
6518
  releaseDocumentSemanticTokens(resultId: string | undefined): void;
@@ -6050,6 +6547,10 @@ declare namespace monaco.languages {
6050
6547
  * is the language case insensitive?
6051
6548
  */
6052
6549
  ignoreCase?: boolean;
6550
+ /**
6551
+ * is the language unicode-aware? (i.e., /\u{1D306}/)
6552
+ */
6553
+ unicode?: boolean;
6053
6554
  /**
6054
6555
  * if no match in the tokenizer assign this token class (default 'source')
6055
6556
  */
@@ -6066,6 +6567,15 @@ declare namespace monaco.languages {
6066
6567
  * attach this to every token class (by default '.' + name)
6067
6568
  */
6068
6569
  tokenPostfix?: string;
6570
+ /**
6571
+ * include line feeds (in the form of a \n character) at the end of lines
6572
+ * Defaults to false
6573
+ */
6574
+ includeLF?: boolean;
6575
+ /**
6576
+ * Other keys that can be referred to by the tokenizer.
6577
+ */
6578
+ [key: string]: any;
6069
6579
  }
6070
6580
 
6071
6581
  /**
@@ -6073,9 +6583,9 @@ declare namespace monaco.languages {
6073
6583
  * shorthands: [reg,act] == { regex: reg, action: act}
6074
6584
  * and : [reg,act,nxt] == { regex: reg, action: act{ next: nxt }}
6075
6585
  */
6076
- export type IShortMonarchLanguageRule1 = [RegExp, IMonarchLanguageAction];
6586
+ export type IShortMonarchLanguageRule1 = [string | RegExp, IMonarchLanguageAction];
6077
6587
 
6078
- export type IShortMonarchLanguageRule2 = [RegExp, IMonarchLanguageAction, string];
6588
+ export type IShortMonarchLanguageRule2 = [string | RegExp, IMonarchLanguageAction, string];
6079
6589
 
6080
6590
  export interface IExpandedMonarchLanguageRule {
6081
6591
  /**
@@ -6165,7 +6675,11 @@ declare namespace monaco.languages {
6165
6675
  declare namespace monaco.worker {
6166
6676
 
6167
6677
 
6168
- export interface IMirrorModel {
6678
+ export interface IMirrorTextModel {
6679
+ readonly version: number;
6680
+ }
6681
+
6682
+ export interface IMirrorModel extends IMirrorTextModel {
6169
6683
  readonly uri: Uri;
6170
6684
  readonly version: number;
6171
6685
  getValue(): string;
@@ -6186,10 +6700,14 @@ declare namespace monaco.worker {
6186
6700
 
6187
6701
  //dtsv=3
6188
6702
 
6703
+ /*---------------------------------------------------------------------------------------------
6704
+ * Copyright (c) Microsoft Corporation. All rights reserved.
6705
+ * Licensed under the MIT License. See License.txt in the project root for license information.
6706
+ *--------------------------------------------------------------------------------------------*/
6189
6707
 
6190
- declare namespace monaco.languages.typescript {
6191
6708
 
6192
- enum ModuleKind {
6709
+ declare namespace monaco.languages.typescript {
6710
+ export enum ModuleKind {
6193
6711
  None = 0,
6194
6712
  CommonJS = 1,
6195
6713
  AMD = 2,
@@ -6198,19 +6716,19 @@ declare namespace monaco.languages.typescript {
6198
6716
  ES2015 = 5,
6199
6717
  ESNext = 99
6200
6718
  }
6201
-
6202
- enum JsxEmit {
6719
+ export enum JsxEmit {
6203
6720
  None = 0,
6204
6721
  Preserve = 1,
6205
6722
  React = 2,
6206
- ReactNative = 3
6723
+ ReactNative = 3,
6724
+ ReactJSX = 4,
6725
+ ReactJSXDev = 5
6207
6726
  }
6208
- enum NewLineKind {
6727
+ export enum NewLineKind {
6209
6728
  CarriageReturnLineFeed = 0,
6210
6729
  LineFeed = 1
6211
6730
  }
6212
-
6213
- enum ScriptTarget {
6731
+ export enum ScriptTarget {
6214
6732
  ES3 = 0,
6215
6733
  ES5 = 1,
6216
6734
  ES2015 = 2,
@@ -6221,19 +6739,24 @@ declare namespace monaco.languages.typescript {
6221
6739
  ES2020 = 7,
6222
6740
  ESNext = 99,
6223
6741
  JSON = 100,
6224
- Latest = ESNext,
6742
+ Latest = 99
6225
6743
  }
6226
-
6227
6744
  export enum ModuleResolutionKind {
6228
6745
  Classic = 1,
6229
6746
  NodeJs = 2
6230
6747
  }
6231
-
6232
6748
  interface MapLike<T> {
6233
6749
  [index: string]: T;
6234
6750
  }
6235
-
6236
- type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string[]> | null | undefined;
6751
+ type CompilerOptionsValue =
6752
+ | string
6753
+ | number
6754
+ | boolean
6755
+ | (string | number)[]
6756
+ | string[]
6757
+ | MapLike<string[]>
6758
+ | null
6759
+ | undefined;
6237
6760
  interface CompilerOptions {
6238
6761
  allowJs?: boolean;
6239
6762
  allowSyntheticDefaultImports?: boolean;
@@ -6317,23 +6840,28 @@ declare namespace monaco.languages.typescript {
6317
6840
  useDefineForClassFields?: boolean;
6318
6841
  [option: string]: CompilerOptionsValue | undefined;
6319
6842
  }
6320
-
6321
6843
  export interface DiagnosticsOptions {
6322
6844
  noSemanticValidation?: boolean;
6323
6845
  noSyntaxValidation?: boolean;
6324
6846
  noSuggestionDiagnostics?: boolean;
6847
+ /**
6848
+ * Limit diagnostic computation to only visible files.
6849
+ * Defaults to false.
6850
+ */
6851
+ onlyVisible?: boolean;
6325
6852
  diagnosticCodesToIgnore?: number[];
6326
6853
  }
6327
-
6854
+ export interface WorkerOptions {
6855
+ /** A full HTTP path to a JavaScript file which adds a function `customTSWorkerFactory` to the self inside a web-worker */
6856
+ customWorkerPath?: string;
6857
+ }
6328
6858
  interface IExtraLib {
6329
6859
  content: string;
6330
6860
  version: number;
6331
6861
  }
6332
-
6333
- interface IExtraLibs {
6862
+ export interface IExtraLibs {
6334
6863
  [path: string]: IExtraLib;
6335
6864
  }
6336
-
6337
6865
  /**
6338
6866
  * A linked list of formatted diagnostic messages to be used as part of a multiline message.
6339
6867
  * It is built from the bottom up, leaving the head to be the "main" diagnostic.
@@ -6345,23 +6873,27 @@ declare namespace monaco.languages.typescript {
6345
6873
  code: number;
6346
6874
  next?: DiagnosticMessageChain[];
6347
6875
  }
6348
- interface Diagnostic extends DiagnosticRelatedInformation {
6876
+ export interface Diagnostic extends DiagnosticRelatedInformation {
6349
6877
  /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
6350
6878
  reportsUnnecessary?: {};
6879
+ reportsDeprecated?: {};
6351
6880
  source?: string;
6352
6881
  relatedInformation?: DiagnosticRelatedInformation[];
6353
6882
  }
6354
- interface DiagnosticRelatedInformation {
6883
+ export interface DiagnosticRelatedInformation {
6355
6884
  /** Diagnostic category: warning = 0, error = 1, suggestion = 2, message = 3 */
6356
6885
  category: 0 | 1 | 2 | 3;
6357
6886
  code: number;
6358
- /** TypeScriptWorker removes this to avoid serializing circular JSON structures. */
6359
- file: undefined;
6887
+ /** TypeScriptWorker removes all but the `fileName` property to avoid serializing circular JSON structures. */
6888
+ file:
6889
+ | {
6890
+ fileName: string;
6891
+ }
6892
+ | undefined;
6360
6893
  start: number | undefined;
6361
6894
  length: number | undefined;
6362
6895
  messageText: string | DiagnosticMessageChain;
6363
6896
  }
6364
-
6365
6897
  interface EmitOutput {
6366
6898
  outputFiles: OutputFile[];
6367
6899
  emitSkipped: boolean;
@@ -6371,23 +6903,20 @@ declare namespace monaco.languages.typescript {
6371
6903
  writeByteOrderMark: boolean;
6372
6904
  text: string;
6373
6905
  }
6374
-
6375
6906
  export interface LanguageServiceDefaults {
6376
6907
  /**
6377
6908
  * Event fired when compiler options or diagnostics options are changed.
6378
6909
  */
6379
6910
  readonly onDidChange: IEvent<void>;
6380
-
6381
6911
  /**
6382
6912
  * Event fired when extra libraries registered with the language service change.
6383
6913
  */
6384
6914
  readonly onDidExtraLibsChange: IEvent<void>;
6385
-
6915
+ readonly workerOptions: WorkerOptions;
6386
6916
  /**
6387
6917
  * Get the current extra libs registered with the language service.
6388
6918
  */
6389
6919
  getExtraLibs(): IExtraLibs;
6390
-
6391
6920
  /**
6392
6921
  * Add an additional source file to the language service. Use this
6393
6922
  * for typescript (definition) files that won't be loaded as editor
@@ -6399,177 +6928,196 @@ declare namespace monaco.languages.typescript {
6399
6928
  * language service upon disposal.
6400
6929
  */
6401
6930
  addExtraLib(content: string, filePath?: string): IDisposable;
6402
-
6403
6931
  /**
6404
6932
  * Remove all existing extra libs and set the additional source
6405
6933
  * files to the language service. Use this for typescript definition
6406
6934
  * files that won't be loaded as editor documents, like `jquery.d.ts`.
6407
6935
  * @param libs An array of entries to register.
6408
6936
  */
6409
- setExtraLibs(libs: { content: string; filePath?: string }[]): void;
6410
-
6937
+ setExtraLibs(
6938
+ libs: {
6939
+ content: string;
6940
+ filePath?: string;
6941
+ }[]
6942
+ ): void;
6411
6943
  /**
6412
6944
  * Get current TypeScript compiler options for the language service.
6413
6945
  */
6414
6946
  getCompilerOptions(): CompilerOptions;
6415
-
6416
6947
  /**
6417
6948
  * Set TypeScript compiler options.
6418
6949
  */
6419
6950
  setCompilerOptions(options: CompilerOptions): void;
6420
-
6421
6951
  /**
6422
6952
  * Get the current diagnostics options for the language service.
6423
6953
  */
6424
6954
  getDiagnosticsOptions(): DiagnosticsOptions;
6425
-
6426
6955
  /**
6427
6956
  * Configure whether syntactic and/or semantic validation should
6428
6957
  * be performed
6429
6958
  */
6430
6959
  setDiagnosticsOptions(options: DiagnosticsOptions): void;
6431
-
6960
+ /**
6961
+ * Configure webworker options
6962
+ */
6963
+ setWorkerOptions(options: WorkerOptions): void;
6432
6964
  /**
6433
6965
  * No-op.
6434
6966
  */
6435
6967
  setMaximumWorkerIdleTime(value: number): void;
6436
-
6437
6968
  /**
6438
6969
  * Configure if all existing models should be eagerly sync'd
6439
6970
  * to the worker on start or restart.
6440
6971
  */
6441
6972
  setEagerModelSync(value: boolean): void;
6442
-
6443
6973
  /**
6444
6974
  * Get the current setting for whether all existing models should be eagerly sync'd
6445
6975
  * to the worker on start or restart.
6446
6976
  */
6447
6977
  getEagerModelSync(): boolean;
6448
6978
  }
6449
-
6450
6979
  export interface TypeScriptWorker {
6451
6980
  /**
6452
6981
  * Get diagnostic messages for any syntax issues in the given file.
6453
6982
  */
6454
6983
  getSyntacticDiagnostics(fileName: string): Promise<Diagnostic[]>;
6455
-
6456
6984
  /**
6457
6985
  * Get diagnostic messages for any semantic issues in the given file.
6458
6986
  */
6459
6987
  getSemanticDiagnostics(fileName: string): Promise<Diagnostic[]>;
6460
-
6461
6988
  /**
6462
6989
  * Get diagnostic messages for any suggestions related to the given file.
6463
6990
  */
6464
6991
  getSuggestionDiagnostics(fileName: string): Promise<Diagnostic[]>;
6465
-
6992
+ /**
6993
+ * Get the content of a given file.
6994
+ */
6995
+ getScriptText(fileName: string): Promise<string | undefined>;
6466
6996
  /**
6467
6997
  * Get diagnostic messages related to the current compiler options.
6468
6998
  * @param fileName Not used
6469
6999
  */
6470
7000
  getCompilerOptionsDiagnostics(fileName: string): Promise<Diagnostic[]>;
6471
-
6472
7001
  /**
6473
7002
  * Get code completions for the given file and position.
6474
7003
  * @returns `Promise<typescript.CompletionInfo | undefined>`
6475
7004
  */
6476
7005
  getCompletionsAtPosition(fileName: string, position: number): Promise<any | undefined>;
6477
-
6478
7006
  /**
6479
7007
  * Get code completion details for the given file, position, and entry.
6480
7008
  * @returns `Promise<typescript.CompletionEntryDetails | undefined>`
6481
7009
  */
6482
- getCompletionEntryDetails(fileName: string, position: number, entry: string): Promise<any | undefined>;
6483
-
7010
+ getCompletionEntryDetails(
7011
+ fileName: string,
7012
+ position: number,
7013
+ entry: string
7014
+ ): Promise<any | undefined>;
6484
7015
  /**
6485
7016
  * Get signature help items for the item at the given file and position.
6486
7017
  * @returns `Promise<typescript.SignatureHelpItems | undefined>`
6487
7018
  */
6488
- getSignatureHelpItems(fileName: string, position: number): Promise<any | undefined>;
6489
-
7019
+ getSignatureHelpItems(
7020
+ fileName: string,
7021
+ position: number,
7022
+ options: any
7023
+ ): Promise<any | undefined>;
6490
7024
  /**
6491
7025
  * Get quick info for the item at the given position in the file.
6492
7026
  * @returns `Promise<typescript.QuickInfo | undefined>`
6493
7027
  */
6494
7028
  getQuickInfoAtPosition(fileName: string, position: number): Promise<any | undefined>;
6495
-
6496
7029
  /**
6497
7030
  * Get other ranges which are related to the item at the given position in the file (often used for highlighting).
6498
7031
  * @returns `Promise<ReadonlyArray<typescript.ReferenceEntry> | undefined>`
6499
7032
  */
6500
- getOccurrencesAtPosition(fileName: string, position: number): Promise<ReadonlyArray<any> | undefined>;
6501
-
7033
+ getOccurrencesAtPosition(
7034
+ fileName: string,
7035
+ position: number
7036
+ ): Promise<ReadonlyArray<any> | undefined>;
6502
7037
  /**
6503
7038
  * Get the definition of the item at the given position in the file.
6504
7039
  * @returns `Promise<ReadonlyArray<typescript.DefinitionInfo> | undefined>`
6505
7040
  */
6506
- getDefinitionAtPosition(fileName: string, position: number): Promise<ReadonlyArray<any> | undefined>;
6507
-
7041
+ getDefinitionAtPosition(
7042
+ fileName: string,
7043
+ position: number
7044
+ ): Promise<ReadonlyArray<any> | undefined>;
6508
7045
  /**
6509
7046
  * Get references to the item at the given position in the file.
6510
7047
  * @returns `Promise<typescript.ReferenceEntry[] | undefined>`
6511
7048
  */
6512
7049
  getReferencesAtPosition(fileName: string, position: number): Promise<any[] | undefined>;
6513
-
6514
7050
  /**
6515
7051
  * Get outline entries for the item at the given position in the file.
6516
7052
  * @returns `Promise<typescript.NavigationBarItem[]>`
6517
7053
  */
6518
7054
  getNavigationBarItems(fileName: string): Promise<any[]>;
6519
-
6520
7055
  /**
6521
7056
  * Get changes which should be applied to format the given file.
6522
7057
  * @param options `typescript.FormatCodeOptions`
6523
7058
  * @returns `Promise<typescript.TextChange[]>`
6524
7059
  */
6525
7060
  getFormattingEditsForDocument(fileName: string, options: any): Promise<any[]>;
6526
-
6527
7061
  /**
6528
7062
  * Get changes which should be applied to format the given range in the file.
6529
7063
  * @param options `typescript.FormatCodeOptions`
6530
7064
  * @returns `Promise<typescript.TextChange[]>`
6531
7065
  */
6532
- getFormattingEditsForRange(fileName: string, start: number, end: number, options: any): Promise<any[]>;
6533
-
7066
+ getFormattingEditsForRange(
7067
+ fileName: string,
7068
+ start: number,
7069
+ end: number,
7070
+ options: any
7071
+ ): Promise<any[]>;
6534
7072
  /**
6535
7073
  * Get formatting changes which should be applied after the given keystroke.
6536
7074
  * @param options `typescript.FormatCodeOptions`
6537
7075
  * @returns `Promise<typescript.TextChange[]>`
6538
7076
  */
6539
- getFormattingEditsAfterKeystroke(fileName: string, postion: number, ch: string, options: any): Promise<any[]>;
6540
-
7077
+ getFormattingEditsAfterKeystroke(
7078
+ fileName: string,
7079
+ postion: number,
7080
+ ch: string,
7081
+ options: any
7082
+ ): Promise<any[]>;
6541
7083
  /**
6542
7084
  * Get other occurrences which should be updated when renaming the item at the given file and position.
6543
7085
  * @returns `Promise<readonly typescript.RenameLocation[] | undefined>`
6544
7086
  */
6545
- findRenameLocations(fileName: string, positon: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename: boolean): Promise<readonly any[] | undefined>;
6546
-
7087
+ findRenameLocations(
7088
+ fileName: string,
7089
+ positon: number,
7090
+ findInStrings: boolean,
7091
+ findInComments: boolean,
7092
+ providePrefixAndSuffixTextForRename: boolean
7093
+ ): Promise<readonly any[] | undefined>;
6547
7094
  /**
6548
7095
  * Get edits which should be applied to rename the item at the given file and position (or a failure reason).
6549
7096
  * @param options `typescript.RenameInfoOptions`
6550
7097
  * @returns `Promise<typescript.RenameInfo>`
6551
7098
  */
6552
7099
  getRenameInfo(fileName: string, positon: number, options: any): Promise<any>;
6553
-
6554
7100
  /**
6555
7101
  * Get transpiled output for the given file.
6556
7102
  * @returns `typescript.EmitOutput`
6557
7103
  */
6558
- getEmitOutput(fileName: string): Promise<any>;
6559
-
7104
+ getEmitOutput(fileName: string): Promise<EmitOutput>;
6560
7105
  /**
6561
7106
  * Get possible code fixes at the given position in the file.
6562
7107
  * @param formatOptions `typescript.FormatCodeOptions`
6563
7108
  * @returns `Promise<ReadonlyArray<typescript.CodeFixAction>>`
6564
7109
  */
6565
- getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: any): Promise<ReadonlyArray<any>>;
7110
+ getCodeFixesAtPosition(
7111
+ fileName: string,
7112
+ start: number,
7113
+ end: number,
7114
+ errorCodes: number[],
7115
+ formatOptions: any
7116
+ ): Promise<ReadonlyArray<any>>;
6566
7117
  }
6567
-
6568
7118
  export const typescriptVersion: string;
6569
-
6570
7119
  export const typescriptDefaults: LanguageServiceDefaults;
6571
7120
  export const javascriptDefaults: LanguageServiceDefaults;
6572
-
6573
7121
  export const getTypeScriptWorker: () => Promise<(...uris: Uri[]) => Promise<TypeScriptWorker>>;
6574
7122
  export const getJavaScriptWorker: () => Promise<(...uris: Uri[]) => Promise<TypeScriptWorker>>;
6575
7123
  }
@@ -6578,114 +7126,107 @@ declare namespace monaco.languages.typescript {
6578
7126
  * Copyright (c) Microsoft Corporation. All rights reserved.
6579
7127
  * Licensed under the MIT License. See License.txt in the project root for license information.
6580
7128
  *--------------------------------------------------------------------------------------------*/
7129
+
7130
+
6581
7131
  declare namespace monaco.languages.css {
6582
7132
  export interface DiagnosticsOptions {
6583
7133
  readonly validate?: boolean;
6584
7134
  readonly lint?: {
6585
- readonly compatibleVendorPrefixes?: 'ignore' | 'warning' | 'error',
6586
- readonly vendorPrefix?: 'ignore' | 'warning' | 'error',
6587
- readonly duplicateProperties?: 'ignore' | 'warning' | 'error',
6588
- readonly emptyRules?: 'ignore' | 'warning' | 'error',
6589
- readonly importStatement?: 'ignore' | 'warning' | 'error',
6590
- readonly boxModel?: 'ignore' | 'warning' | 'error',
6591
- readonly universalSelector?: 'ignore' | 'warning' | 'error',
6592
- readonly zeroUnits?: 'ignore' | 'warning' | 'error',
6593
- readonly fontFaceProperties?: 'ignore' | 'warning' | 'error',
6594
- readonly hexColorLength?: 'ignore' | 'warning' | 'error',
6595
- readonly argumentsInColorFunction?: 'ignore' | 'warning' | 'error',
6596
- readonly unknownProperties?: 'ignore' | 'warning' | 'error',
6597
- readonly ieHack?: 'ignore' | 'warning' | 'error',
6598
- readonly unknownVendorSpecificProperties?: 'ignore' | 'warning' | 'error',
6599
- readonly propertyIgnoredDueToDisplay?: 'ignore' | 'warning' | 'error',
6600
- readonly important?: 'ignore' | 'warning' | 'error',
6601
- readonly float?: 'ignore' | 'warning' | 'error',
6602
- readonly idSelector?: 'ignore' | 'warning' | 'error'
6603
- }
7135
+ readonly compatibleVendorPrefixes?: 'ignore' | 'warning' | 'error';
7136
+ readonly vendorPrefix?: 'ignore' | 'warning' | 'error';
7137
+ readonly duplicateProperties?: 'ignore' | 'warning' | 'error';
7138
+ readonly emptyRules?: 'ignore' | 'warning' | 'error';
7139
+ readonly importStatement?: 'ignore' | 'warning' | 'error';
7140
+ readonly boxModel?: 'ignore' | 'warning' | 'error';
7141
+ readonly universalSelector?: 'ignore' | 'warning' | 'error';
7142
+ readonly zeroUnits?: 'ignore' | 'warning' | 'error';
7143
+ readonly fontFaceProperties?: 'ignore' | 'warning' | 'error';
7144
+ readonly hexColorLength?: 'ignore' | 'warning' | 'error';
7145
+ readonly argumentsInColorFunction?: 'ignore' | 'warning' | 'error';
7146
+ readonly unknownProperties?: 'ignore' | 'warning' | 'error';
7147
+ readonly ieHack?: 'ignore' | 'warning' | 'error';
7148
+ readonly unknownVendorSpecificProperties?: 'ignore' | 'warning' | 'error';
7149
+ readonly propertyIgnoredDueToDisplay?: 'ignore' | 'warning' | 'error';
7150
+ readonly important?: 'ignore' | 'warning' | 'error';
7151
+ readonly float?: 'ignore' | 'warning' | 'error';
7152
+ readonly idSelector?: 'ignore' | 'warning' | 'error';
7153
+ };
6604
7154
  }
6605
-
6606
7155
  export interface ModeConfiguration {
6607
7156
  /**
6608
7157
  * Defines whether the built-in completionItemProvider is enabled.
6609
7158
  */
6610
7159
  readonly completionItems?: boolean;
6611
-
6612
7160
  /**
6613
7161
  * Defines whether the built-in hoverProvider is enabled.
6614
7162
  */
6615
7163
  readonly hovers?: boolean;
6616
-
6617
7164
  /**
6618
7165
  * Defines whether the built-in documentSymbolProvider is enabled.
6619
7166
  */
6620
7167
  readonly documentSymbols?: boolean;
6621
-
6622
7168
  /**
6623
7169
  * Defines whether the built-in definitions provider is enabled.
6624
7170
  */
6625
7171
  readonly definitions?: boolean;
6626
-
6627
7172
  /**
6628
7173
  * Defines whether the built-in references provider is enabled.
6629
7174
  */
6630
7175
  readonly references?: boolean;
6631
-
6632
7176
  /**
6633
7177
  * Defines whether the built-in references provider is enabled.
6634
7178
  */
6635
7179
  readonly documentHighlights?: boolean;
6636
-
6637
7180
  /**
6638
7181
  * Defines whether the built-in rename provider is enabled.
6639
7182
  */
6640
7183
  readonly rename?: boolean;
6641
-
6642
7184
  /**
6643
7185
  * Defines whether the built-in color provider is enabled.
6644
7186
  */
6645
7187
  readonly colors?: boolean;
6646
-
6647
7188
  /**
6648
7189
  * Defines whether the built-in foldingRange provider is enabled.
6649
7190
  */
6650
7191
  readonly foldingRanges?: boolean;
6651
-
6652
7192
  /**
6653
7193
  * Defines whether the built-in diagnostic provider is enabled.
6654
7194
  */
6655
7195
  readonly diagnostics?: boolean;
6656
-
6657
7196
  /**
6658
7197
  * Defines whether the built-in selection range provider is enabled.
6659
7198
  */
6660
7199
  readonly selectionRanges?: boolean;
6661
-
6662
7200
  }
6663
-
6664
7201
  export interface LanguageServiceDefaults {
7202
+ readonly languageId: string;
6665
7203
  readonly onDidChange: IEvent<LanguageServiceDefaults>;
6666
7204
  readonly diagnosticsOptions: DiagnosticsOptions;
6667
7205
  readonly modeConfiguration: ModeConfiguration;
6668
7206
  setDiagnosticsOptions(options: DiagnosticsOptions): void;
6669
7207
  setModeConfiguration(modeConfiguration: ModeConfiguration): void;
6670
7208
  }
6671
-
6672
- export var cssDefaults: LanguageServiceDefaults;
6673
- export var lessDefaults: LanguageServiceDefaults;
6674
- export var scssDefaults: LanguageServiceDefaults;
7209
+ export const cssDefaults: LanguageServiceDefaults;
7210
+ export const scssDefaults: LanguageServiceDefaults;
7211
+ export const lessDefaults: LanguageServiceDefaults;
6675
7212
  }
7213
+
6676
7214
  /*---------------------------------------------------------------------------------------------
6677
7215
  * Copyright (c) Microsoft Corporation. All rights reserved.
6678
7216
  * Licensed under the MIT License. See License.txt in the project root for license information.
6679
7217
  *--------------------------------------------------------------------------------------------*/
6680
7218
 
7219
+
6681
7220
  declare namespace monaco.languages.json {
6682
7221
  export interface DiagnosticsOptions {
6683
7222
  /**
6684
- * If set, the validator will be enabled and perform syntax validation as well as schema based validation.
7223
+ * If set, the validator will be enabled and perform syntax and schema based validation,
7224
+ * unless `DiagnosticsOptions.schemaValidation` is set to `ignore`.
6685
7225
  */
6686
7226
  readonly validate?: boolean;
6687
7227
  /**
6688
7228
  * If set, comments are tolerated. If set to false, syntax errors will be emitted for comments.
7229
+ * `DiagnosticsOptions.allowComments` will override this setting.
6689
7230
  */
6690
7231
  readonly allowComments?: boolean;
6691
7232
  /**
@@ -6697,7 +7238,10 @@ declare namespace monaco.languages.json {
6697
7238
  */
6698
7239
  readonly uri: string;
6699
7240
  /**
6700
- * A list of file names that are associated to the schema. The '*' wildcard can be used. For example '*.schema.json', 'package.json'
7241
+ * A list of glob patterns that describe for which file URIs the JSON schema will be used.
7242
+ * '*' and '**' wildcards are supported. Exclusion patterns start with '!'.
7243
+ * For example '*.schema.json', 'package.json', '!foo*.schema.json', 'foo/**\/BADRESP.json'.
7244
+ * A match succeeds when there is at least one pattern matching and last matching pattern does not start with '!'.
6701
7245
  */
6702
7246
  readonly fileMatch?: string[];
6703
7247
  /**
@@ -6709,70 +7253,75 @@ declare namespace monaco.languages.json {
6709
7253
  * If set, the schema service would load schema content on-demand with 'fetch' if available
6710
7254
  */
6711
7255
  readonly enableSchemaRequest?: boolean;
7256
+ /**
7257
+ * The severity of problems from schema validation. If set to 'ignore', schema validation will be skipped. If not set, 'warning' is used.
7258
+ */
7259
+ readonly schemaValidation?: SeverityLevel;
7260
+ /**
7261
+ * The severity of problems that occurred when resolving and loading schemas. If set to 'ignore', schema resolving problems are not reported. If not set, 'warning' is used.
7262
+ */
7263
+ readonly schemaRequest?: SeverityLevel;
7264
+ /**
7265
+ * The severity of reported trailing commas. If not set, trailing commas will be reported as errors.
7266
+ */
7267
+ readonly trailingCommas?: SeverityLevel;
7268
+ /**
7269
+ * The severity of reported comments. If not set, 'DiagnosticsOptions.allowComments' defines whether comments are ignored or reported as errors.
7270
+ */
7271
+ readonly comments?: SeverityLevel;
6712
7272
  }
6713
-
7273
+ export type SeverityLevel = 'error' | 'warning' | 'ignore';
6714
7274
  export interface ModeConfiguration {
6715
7275
  /**
6716
7276
  * Defines whether the built-in documentFormattingEdit provider is enabled.
6717
7277
  */
6718
7278
  readonly documentFormattingEdits?: boolean;
6719
-
6720
7279
  /**
6721
7280
  * Defines whether the built-in documentRangeFormattingEdit provider is enabled.
6722
7281
  */
6723
7282
  readonly documentRangeFormattingEdits?: boolean;
6724
-
6725
7283
  /**
6726
7284
  * Defines whether the built-in completionItemProvider is enabled.
6727
7285
  */
6728
7286
  readonly completionItems?: boolean;
6729
-
6730
7287
  /**
6731
7288
  * Defines whether the built-in hoverProvider is enabled.
6732
7289
  */
6733
7290
  readonly hovers?: boolean;
6734
-
6735
7291
  /**
6736
7292
  * Defines whether the built-in documentSymbolProvider is enabled.
6737
7293
  */
6738
7294
  readonly documentSymbols?: boolean;
6739
-
6740
7295
  /**
6741
7296
  * Defines whether the built-in tokens provider is enabled.
6742
7297
  */
6743
7298
  readonly tokens?: boolean;
6744
-
6745
7299
  /**
6746
7300
  * Defines whether the built-in color provider is enabled.
6747
7301
  */
6748
7302
  readonly colors?: boolean;
6749
-
6750
7303
  /**
6751
7304
  * Defines whether the built-in foldingRange provider is enabled.
6752
7305
  */
6753
7306
  readonly foldingRanges?: boolean;
6754
-
6755
7307
  /**
6756
7308
  * Defines whether the built-in diagnostic provider is enabled.
6757
7309
  */
6758
7310
  readonly diagnostics?: boolean;
6759
-
6760
7311
  /**
6761
7312
  * Defines whether the built-in selection range provider is enabled.
6762
7313
  */
6763
7314
  readonly selectionRanges?: boolean;
6764
-
6765
7315
  }
6766
-
6767
7316
  export interface LanguageServiceDefaults {
7317
+ readonly languageId: string;
6768
7318
  readonly onDidChange: IEvent<LanguageServiceDefaults>;
6769
7319
  readonly diagnosticsOptions: DiagnosticsOptions;
6770
7320
  readonly modeConfiguration: ModeConfiguration;
6771
7321
  setDiagnosticsOptions(options: DiagnosticsOptions): void;
6772
7322
  setModeConfiguration(modeConfiguration: ModeConfiguration): void;
6773
7323
  }
6774
-
6775
- export var jsonDefaults: LanguageServiceDefaults;
7324
+ export const jsonDefaults: LanguageServiceDefaults;
6776
7325
  }
6777
7326
 
6778
7327
  /*---------------------------------------------------------------------------------------------
@@ -6780,6 +7329,7 @@ declare namespace monaco.languages.json {
6780
7329
  * Licensed under the MIT License. See License.txt in the project root for license information.
6781
7330
  *--------------------------------------------------------------------------------------------*/
6782
7331
 
7332
+
6783
7333
  declare namespace monaco.languages.html {
6784
7334
  export interface HTMLFormatConfiguration {
6785
7335
  readonly tabSize: number;
@@ -6795,11 +7345,9 @@ declare namespace monaco.languages.html {
6795
7345
  readonly extraLiners: string;
6796
7346
  readonly wrapAttributes: 'auto' | 'force' | 'force-aligned' | 'force-expand-multiline';
6797
7347
  }
6798
-
6799
7348
  export interface CompletionConfiguration {
6800
7349
  [provider: string]: boolean;
6801
7350
  }
6802
-
6803
7351
  export interface Options {
6804
7352
  /**
6805
7353
  * If set, comments are tolerated. If set to false, syntax errors will be emitted for comments.
@@ -6810,77 +7358,64 @@ declare namespace monaco.languages.html {
6810
7358
  */
6811
7359
  readonly suggest?: CompletionConfiguration;
6812
7360
  }
6813
-
6814
7361
  export interface ModeConfiguration {
6815
7362
  /**
6816
7363
  * Defines whether the built-in completionItemProvider is enabled.
6817
7364
  */
6818
7365
  readonly completionItems?: boolean;
6819
-
6820
7366
  /**
6821
7367
  * Defines whether the built-in hoverProvider is enabled.
6822
7368
  */
6823
7369
  readonly hovers?: boolean;
6824
-
6825
7370
  /**
6826
7371
  * Defines whether the built-in documentSymbolProvider is enabled.
6827
7372
  */
6828
7373
  readonly documentSymbols?: boolean;
6829
-
6830
7374
  /**
6831
7375
  * Defines whether the built-in definitions provider is enabled.
6832
7376
  */
6833
7377
  readonly links?: boolean;
6834
-
6835
7378
  /**
6836
7379
  * Defines whether the built-in references provider is enabled.
6837
7380
  */
6838
7381
  readonly documentHighlights?: boolean;
6839
-
6840
7382
  /**
6841
7383
  * Defines whether the built-in rename provider is enabled.
6842
7384
  */
6843
7385
  readonly rename?: boolean;
6844
-
6845
7386
  /**
6846
7387
  * Defines whether the built-in color provider is enabled.
6847
7388
  */
6848
7389
  readonly colors?: boolean;
6849
-
6850
7390
  /**
6851
7391
  * Defines whether the built-in foldingRange provider is enabled.
6852
7392
  */
6853
7393
  readonly foldingRanges?: boolean;
6854
-
6855
7394
  /**
6856
7395
  * Defines whether the built-in diagnostic provider is enabled.
6857
7396
  */
6858
7397
  readonly diagnostics?: boolean;
6859
-
6860
7398
  /**
6861
7399
  * Defines whether the built-in selection range provider is enabled.
6862
7400
  */
6863
7401
  readonly selectionRanges?: boolean;
6864
-
6865
7402
  /**
6866
7403
  * Defines whether the built-in documentFormattingEdit provider is enabled.
6867
7404
  */
6868
7405
  readonly documentFormattingEdits?: boolean;
6869
-
6870
7406
  /**
6871
7407
  * Defines whether the built-in documentRangeFormattingEdit provider is enabled.
6872
7408
  */
6873
7409
  readonly documentRangeFormattingEdits?: boolean;
6874
-
6875
7410
  }
6876
-
6877
7411
  export interface LanguageServiceDefaults {
7412
+ readonly languageId: string;
7413
+ readonly modeConfiguration: ModeConfiguration;
6878
7414
  readonly onDidChange: IEvent<LanguageServiceDefaults>;
6879
7415
  readonly options: Options;
6880
7416
  setOptions(options: Options): void;
6881
7417
  }
6882
-
6883
- export var htmlDefaults: LanguageServiceDefaults;
6884
- export var handlebarDefaults: LanguageServiceDefaults;
6885
- export var razorDefaults: LanguageServiceDefaults;
6886
- }
7418
+ export const htmlDefaults: LanguageServiceDefaults;
7419
+ export const handlebarDefaults: LanguageServiceDefaults;
7420
+ export const razorDefaults: LanguageServiceDefaults;
7421
+ }