@ng-util/monaco-editor 13.0.0 → 13.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/monaco.d.ts CHANGED
@@ -21,7 +21,7 @@ declare namespace monaco {
21
21
  export interface Environment {
22
22
  globalAPI?: boolean;
23
23
  baseUrl?: string;
24
- getWorker?(workerId: string, label: string): Worker;
24
+ getWorker?(workerId: string, label: string): Promise<Worker> | Worker;
25
25
  getWorkerUrl?(workerId: string, label: string): string;
26
26
  }
27
27
 
@@ -97,25 +97,25 @@ declare namespace monaco {
97
97
  export class Uri implements UriComponents {
98
98
  static isUri(thing: any): thing is Uri;
99
99
  /**
100
- * scheme is the 'http' part of 'http://www.msft.com/some/path?query#fragment'.
100
+ * scheme is the 'http' part of 'http://www.example.com/some/path?query#fragment'.
101
101
  * The part before the first colon.
102
102
  */
103
103
  readonly scheme: string;
104
104
  /**
105
- * authority is the 'www.msft.com' part of 'http://www.msft.com/some/path?query#fragment'.
105
+ * authority is the 'www.example.com' part of 'http://www.example.com/some/path?query#fragment'.
106
106
  * The part between the first double slashes and the next slash.
107
107
  */
108
108
  readonly authority: string;
109
109
  /**
110
- * path is the '/some/path' part of 'http://www.msft.com/some/path?query#fragment'.
110
+ * path is the '/some/path' part of 'http://www.example.com/some/path?query#fragment'.
111
111
  */
112
112
  readonly path: string;
113
113
  /**
114
- * query is the 'query' part of 'http://www.msft.com/some/path?query#fragment'.
114
+ * query is the 'query' part of 'http://www.example.com/some/path?query#fragment'.
115
115
  */
116
116
  readonly query: string;
117
117
  /**
118
- * fragment is the 'fragment' part of 'http://www.msft.com/some/path?query#fragment'.
118
+ * fragment is the 'fragment' part of 'http://www.example.com/some/path?query#fragment'.
119
119
  */
120
120
  readonly fragment: string;
121
121
  /**
@@ -151,7 +151,7 @@ declare namespace monaco {
151
151
  fragment?: string | null;
152
152
  }): Uri;
153
153
  /**
154
- * Creates a new Uri from a string, e.g. `http://www.msft.com/some/path`,
154
+ * Creates a new Uri from a string, e.g. `http://www.example.com/some/path`,
155
155
  * `file:///usr/home`, or `scheme:with/path`.
156
156
  *
157
157
  * @param value A string which represents an Uri (see `Uri#toString`).
@@ -409,11 +409,15 @@ declare namespace monaco {
409
409
  LaunchMediaPlayer = 123,
410
410
  LaunchMail = 124,
411
411
  LaunchApp2 = 125,
412
+ /**
413
+ * VK_CLEAR, 0x0C, CLEAR key
414
+ */
415
+ Clear = 126,
412
416
  /**
413
417
  * Placed last to cover the length of the enum.
414
418
  * Please do not depend on this value!
415
419
  */
416
- MAX_VALUE = 126
420
+ MAX_VALUE = 127
417
421
  }
418
422
  export class KeyMod {
419
423
  static readonly CtrlCmd: number;
@@ -428,6 +432,7 @@ declare namespace monaco {
428
432
  readonly isTrusted?: boolean;
429
433
  readonly supportThemeIcons?: boolean;
430
434
  readonly supportHtml?: boolean;
435
+ readonly baseUri?: UriComponents;
431
436
  uris?: {
432
437
  [href: string]: UriComponents;
433
438
  };
@@ -710,6 +715,7 @@ declare namespace monaco {
710
715
  */
711
716
  static lift(range: undefined | null): null;
712
717
  static lift(range: IRange): Range;
718
+ static lift(range: IRange | undefined | null): Range | null;
713
719
  /**
714
720
  * Test if `obj` is an `IRange`.
715
721
  */
@@ -736,6 +742,7 @@ declare namespace monaco {
736
742
  * Test if the range spans multiple lines.
737
743
  */
738
744
  static spansMultipleLines(range: IRange): boolean;
745
+ toJSON(): IRange;
739
746
  }
740
747
 
741
748
  /**
@@ -1356,6 +1363,44 @@ declare namespace monaco.editor {
1356
1363
  id: string;
1357
1364
  }
1358
1365
 
1366
+ /**
1367
+ * A single edit operation, that acts as a simple replace.
1368
+ * i.e. Replace text at `range` with `text` in model.
1369
+ */
1370
+ export interface ISingleEditOperation {
1371
+ /**
1372
+ * The range to replace. This can be empty to emulate a simple insert.
1373
+ */
1374
+ range: IRange;
1375
+ /**
1376
+ * The text to replace with. This can be null to emulate a simple delete.
1377
+ */
1378
+ text: string | null;
1379
+ /**
1380
+ * This indicates that this operation has "insert" semantics.
1381
+ * i.e. forceMoveMarkers = true => if `range` is collapsed, all markers at the position will be moved.
1382
+ */
1383
+ forceMoveMarkers?: boolean;
1384
+ }
1385
+
1386
+ /**
1387
+ * Word inside a model.
1388
+ */
1389
+ export interface IWordAtPosition {
1390
+ /**
1391
+ * The word.
1392
+ */
1393
+ readonly word: string;
1394
+ /**
1395
+ * The column where the word starts.
1396
+ */
1397
+ readonly startColumn: number;
1398
+ /**
1399
+ * The column where the word ends.
1400
+ */
1401
+ readonly endColumn: number;
1402
+ }
1403
+
1359
1404
  /**
1360
1405
  * Vertical Lane in the overview ruler of the editor.
1361
1406
  */
@@ -1506,6 +1551,23 @@ declare namespace monaco.editor {
1506
1551
  * If there is an `inlineClassName` which affects letter spacing.
1507
1552
  */
1508
1553
  readonly inlineClassNameAffectsLetterSpacing?: boolean;
1554
+ /**
1555
+ * This field allows to attach data to this injected text.
1556
+ * The data can be read when injected texts at a given position are queried.
1557
+ */
1558
+ readonly attachedData?: unknown;
1559
+ /**
1560
+ * Configures cursor stops around injected text.
1561
+ * Defaults to {@link InjectedTextCursorStops.Both}.
1562
+ */
1563
+ readonly cursorStops?: InjectedTextCursorStops | null;
1564
+ }
1565
+
1566
+ export enum InjectedTextCursorStops {
1567
+ Both = 0,
1568
+ Right = 1,
1569
+ Left = 2,
1570
+ None = 3
1509
1571
  }
1510
1572
 
1511
1573
  /**
@@ -1544,24 +1606,6 @@ declare namespace monaco.editor {
1544
1606
  readonly options: IModelDecorationOptions;
1545
1607
  }
1546
1608
 
1547
- /**
1548
- * Word inside a model.
1549
- */
1550
- export interface IWordAtPosition {
1551
- /**
1552
- * The word.
1553
- */
1554
- readonly word: string;
1555
- /**
1556
- * The column where the word starts.
1557
- */
1558
- readonly startColumn: number;
1559
- /**
1560
- * The column where the word ends.
1561
- */
1562
- readonly endColumn: number;
1563
- }
1564
-
1565
1609
  /**
1566
1610
  * End of line character preference.
1567
1611
  */
@@ -1608,43 +1652,10 @@ declare namespace monaco.editor {
1608
1652
  CRLF = 1
1609
1653
  }
1610
1654
 
1611
- /**
1612
- * A single edit operation, that acts as a simple replace.
1613
- * i.e. Replace text at `range` with `text` in model.
1614
- */
1615
- export interface ISingleEditOperation {
1616
- /**
1617
- * The range to replace. This can be empty to emulate a simple insert.
1618
- */
1619
- range: IRange;
1620
- /**
1621
- * The text to replace with. This can be null to emulate a simple delete.
1622
- */
1623
- text: string | null;
1624
- /**
1625
- * This indicates that this operation has "insert" semantics.
1626
- * i.e. forceMoveMarkers = true => if `range` is collapsed, all markers at the position will be moved.
1627
- */
1628
- forceMoveMarkers?: boolean;
1629
- }
1630
-
1631
1655
  /**
1632
1656
  * A single edit operation, that has an identifier.
1633
1657
  */
1634
- export interface IIdentifiedSingleEditOperation {
1635
- /**
1636
- * The range to replace. This can be empty to emulate a simple insert.
1637
- */
1638
- range: IRange;
1639
- /**
1640
- * The text to replace with. This can be null to emulate a simple delete.
1641
- */
1642
- text: string | null;
1643
- /**
1644
- * This indicates that this operation has "insert" semantics.
1645
- * i.e. forceMoveMarkers = true => if `range` is collapsed, all markers at the position will be moved.
1646
- */
1647
- forceMoveMarkers?: boolean;
1658
+ export interface IIdentifiedSingleEditOperation extends ISingleEditOperation {
1648
1659
  }
1649
1660
 
1650
1661
  export interface IValidEditOperation {
@@ -2041,32 +2052,32 @@ declare namespace monaco.editor {
2041
2052
  * An event emitted when decorations of the model have changed.
2042
2053
  * @event
2043
2054
  */
2044
- onDidChangeDecorations(listener: (e: IModelDecorationsChangedEvent) => void): IDisposable;
2055
+ readonly onDidChangeDecorations: IEvent<IModelDecorationsChangedEvent>;
2045
2056
  /**
2046
2057
  * An event emitted when the model options have changed.
2047
2058
  * @event
2048
2059
  */
2049
- onDidChangeOptions(listener: (e: IModelOptionsChangedEvent) => void): IDisposable;
2060
+ readonly onDidChangeOptions: IEvent<IModelOptionsChangedEvent>;
2050
2061
  /**
2051
2062
  * An event emitted when the language associated with the model has changed.
2052
2063
  * @event
2053
2064
  */
2054
- onDidChangeLanguage(listener: (e: IModelLanguageChangedEvent) => void): IDisposable;
2065
+ readonly onDidChangeLanguage: IEvent<IModelLanguageChangedEvent>;
2055
2066
  /**
2056
2067
  * An event emitted when the language configuration associated with the model has changed.
2057
2068
  * @event
2058
2069
  */
2059
- onDidChangeLanguageConfiguration(listener: (e: IModelLanguageConfigurationChangedEvent) => void): IDisposable;
2070
+ readonly onDidChangeLanguageConfiguration: IEvent<IModelLanguageConfigurationChangedEvent>;
2060
2071
  /**
2061
2072
  * An event emitted when the model has been attached to the first editor or detached from the last editor.
2062
2073
  * @event
2063
2074
  */
2064
- onDidChangeAttached(listener: () => void): IDisposable;
2075
+ readonly onDidChangeAttached: IEvent<void>;
2065
2076
  /**
2066
2077
  * An event emitted right before disposing the model.
2067
2078
  * @event
2068
2079
  */
2069
- onWillDispose(listener: () => void): IDisposable;
2080
+ readonly onWillDispose: IEvent<void>;
2070
2081
  /**
2071
2082
  * Destroy this model.
2072
2083
  */
@@ -2077,6 +2088,52 @@ declare namespace monaco.editor {
2077
2088
  isAttachedToEditor(): boolean;
2078
2089
  }
2079
2090
 
2091
+ export enum PositionAffinity {
2092
+ /**
2093
+ * Prefers the left most position.
2094
+ */
2095
+ Left = 0,
2096
+ /**
2097
+ * Prefers the right most position.
2098
+ */
2099
+ Right = 1,
2100
+ /**
2101
+ * No preference.
2102
+ */
2103
+ None = 2
2104
+ }
2105
+
2106
+ /**
2107
+ * A change
2108
+ */
2109
+ export interface IChange {
2110
+ readonly originalStartLineNumber: number;
2111
+ readonly originalEndLineNumber: number;
2112
+ readonly modifiedStartLineNumber: number;
2113
+ readonly modifiedEndLineNumber: number;
2114
+ }
2115
+
2116
+ /**
2117
+ * A character level change.
2118
+ */
2119
+ export interface ICharChange extends IChange {
2120
+ readonly originalStartColumn: number;
2121
+ readonly originalEndColumn: number;
2122
+ readonly modifiedStartColumn: number;
2123
+ readonly modifiedEndColumn: number;
2124
+ }
2125
+
2126
+ /**
2127
+ * A line change
2128
+ */
2129
+ export interface ILineChange extends IChange {
2130
+ readonly charChanges: ICharChange[] | undefined;
2131
+ }
2132
+ export interface IDimension {
2133
+ width: number;
2134
+ height: number;
2135
+ }
2136
+
2080
2137
  /**
2081
2138
  * A builder and helper for edit operations for a command.
2082
2139
  */
@@ -2169,38 +2226,6 @@ declare namespace monaco.editor {
2169
2226
  readonly newModelUrl: Uri | null;
2170
2227
  }
2171
2228
 
2172
- export interface IDimension {
2173
- width: number;
2174
- height: number;
2175
- }
2176
-
2177
- /**
2178
- * A change
2179
- */
2180
- export interface IChange {
2181
- readonly originalStartLineNumber: number;
2182
- readonly originalEndLineNumber: number;
2183
- readonly modifiedStartLineNumber: number;
2184
- readonly modifiedEndLineNumber: number;
2185
- }
2186
-
2187
- /**
2188
- * A character level change.
2189
- */
2190
- export interface ICharChange extends IChange {
2191
- readonly originalStartColumn: number;
2192
- readonly originalEndColumn: number;
2193
- readonly modifiedStartColumn: number;
2194
- readonly modifiedEndColumn: number;
2195
- }
2196
-
2197
- /**
2198
- * A line change
2199
- */
2200
- export interface ILineChange extends IChange {
2201
- readonly charChanges: ICharChange[] | undefined;
2202
- }
2203
-
2204
2229
  export interface IContentSizeChangedEvent {
2205
2230
  readonly contentWidth: number;
2206
2231
  readonly contentHeight: number;
@@ -2338,8 +2363,9 @@ declare namespace monaco.editor {
2338
2363
  /**
2339
2364
  * Set the primary position of the cursor. This will remove any secondary cursors.
2340
2365
  * @param position New primary cursor's position
2366
+ * @param source Source of the call that caused the position
2341
2367
  */
2342
- setPosition(position: IPosition): void;
2368
+ setPosition(position: IPosition, source?: string): void;
2343
2369
  /**
2344
2370
  * Scroll vertically as necessary and reveal a line.
2345
2371
  */
@@ -2385,28 +2411,34 @@ declare namespace monaco.editor {
2385
2411
  /**
2386
2412
  * Set the primary selection of the editor. This will remove any secondary cursors.
2387
2413
  * @param selection The new selection
2414
+ * @param source Source of the call that caused the selection
2388
2415
  */
2389
- setSelection(selection: IRange): void;
2416
+ setSelection(selection: IRange, source?: string): void;
2390
2417
  /**
2391
2418
  * Set the primary selection of the editor. This will remove any secondary cursors.
2392
2419
  * @param selection The new selection
2420
+ * @param source Source of the call that caused the selection
2393
2421
  */
2394
- setSelection(selection: Range): void;
2422
+ setSelection(selection: Range, source?: string): void;
2395
2423
  /**
2396
2424
  * Set the primary selection of the editor. This will remove any secondary cursors.
2397
2425
  * @param selection The new selection
2426
+ * @param source Source of the call that caused the selection
2398
2427
  */
2399
- setSelection(selection: ISelection): void;
2428
+ setSelection(selection: ISelection, source?: string): void;
2400
2429
  /**
2401
2430
  * Set the primary selection of the editor. This will remove any secondary cursors.
2402
2431
  * @param selection The new selection
2432
+ * @param source Source of the call that caused the selection
2403
2433
  */
2404
- setSelection(selection: Selection): void;
2434
+ setSelection(selection: Selection, source?: string): void;
2405
2435
  /**
2406
2436
  * Set the selections for all the cursors of the editor.
2407
2437
  * Cursors will be removed or added, as necessary.
2438
+ * @param selections The new selection
2439
+ * @param source Source of the call that caused the selection
2408
2440
  */
2409
- setSelections(selections: readonly ISelection[]): void;
2441
+ setSelections(selections: readonly ISelection[], source?: string): void;
2410
2442
  /**
2411
2443
  * Scroll vertically as necessary and reveal lines.
2412
2444
  */
@@ -3215,6 +3247,11 @@ declare namespace monaco.editor {
3215
3247
  * Defaults to true.
3216
3248
  */
3217
3249
  foldingImportsByDefault?: boolean;
3250
+ /**
3251
+ * Maximum number of foldable regions.
3252
+ * Defaults to 5000.
3253
+ */
3254
+ foldingMaximumRegions?: number;
3218
3255
  /**
3219
3256
  * Controls whether the fold actions in the gutter stay always visible or hide unless the mouse is over the gutter.
3220
3257
  * Defaults to 'mouseover'.
@@ -3304,7 +3341,15 @@ declare namespace monaco.editor {
3304
3341
  * Controls the behavior of editor guides.
3305
3342
  */
3306
3343
  guides?: IGuidesOptions;
3344
+ /**
3345
+ * Controls the behavior of the unicode highlight feature
3346
+ * (by default, ambiguous and invisible characters are highlighted).
3347
+ */
3307
3348
  unicodeHighlight?: IUnicodeHighlightOptions;
3349
+ /**
3350
+ * Configures bracket pair colorization (disabled by default).
3351
+ */
3352
+ bracketPairColorization?: IBracketPairColorizationOptions;
3308
3353
  }
3309
3354
 
3310
3355
  export interface IDiffEditorBaseOptions {
@@ -3379,8 +3424,8 @@ declare namespace monaco.editor {
3379
3424
  get<T extends EditorOption>(id: T): FindComputedEditorOptionValueById<T>;
3380
3425
  }
3381
3426
 
3382
- export interface IEditorOption<K1 extends EditorOption, V> {
3383
- readonly id: K1;
3427
+ export interface IEditorOption<K extends EditorOption, V> {
3428
+ readonly id: K;
3384
3429
  readonly name: string;
3385
3430
  defaultValue: V;
3386
3431
  /**
@@ -3884,14 +3929,34 @@ declare namespace monaco.editor {
3884
3929
  * Configuration options for unicode highlighting.
3885
3930
  */
3886
3931
  export interface IUnicodeHighlightOptions {
3932
+ /**
3933
+ * Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.
3934
+ */
3887
3935
  nonBasicASCII?: boolean | InUntrustedWorkspace;
3936
+ /**
3937
+ * Controls whether characters that just reserve space or have no width at all are highlighted.
3938
+ */
3888
3939
  invisibleCharacters?: boolean;
3940
+ /**
3941
+ * Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.
3942
+ */
3889
3943
  ambiguousCharacters?: boolean;
3944
+ /**
3945
+ * Controls whether characters in comments should also be subject to unicode highlighting.
3946
+ */
3890
3947
  includeComments?: boolean | InUntrustedWorkspace;
3891
3948
  /**
3892
- * A map of allowed characters (true: allowed).
3893
- */
3949
+ * Controls whether characters in strings should also be subject to unicode highlighting.
3950
+ */
3951
+ includeStrings?: boolean | InUntrustedWorkspace;
3952
+ /**
3953
+ * Defines allowed characters that are not being highlighted.
3954
+ */
3894
3955
  allowedCharacters?: Record<string, true>;
3956
+ /**
3957
+ * Unicode characters that are common in allowed locales are not being highlighted.
3958
+ */
3959
+ allowedLocales?: Record<string | '_os' | '_vscode', true>;
3895
3960
  }
3896
3961
 
3897
3962
  export interface IInlineSuggestOptions {
@@ -4177,97 +4242,98 @@ declare namespace monaco.editor {
4177
4242
  foldingStrategy = 38,
4178
4243
  foldingHighlight = 39,
4179
4244
  foldingImportsByDefault = 40,
4180
- unfoldOnClickAfterEndOfLine = 41,
4181
- fontFamily = 42,
4182
- fontInfo = 43,
4183
- fontLigatures = 44,
4184
- fontSize = 45,
4185
- fontWeight = 46,
4186
- formatOnPaste = 47,
4187
- formatOnType = 48,
4188
- glyphMargin = 49,
4189
- gotoLocation = 50,
4190
- hideCursorInOverviewRuler = 51,
4191
- hover = 52,
4192
- inDiffEditor = 53,
4193
- inlineSuggest = 54,
4194
- letterSpacing = 55,
4195
- lightbulb = 56,
4196
- lineDecorationsWidth = 57,
4197
- lineHeight = 58,
4198
- lineNumbers = 59,
4199
- lineNumbersMinChars = 60,
4200
- linkedEditing = 61,
4201
- links = 62,
4202
- matchBrackets = 63,
4203
- minimap = 64,
4204
- mouseStyle = 65,
4205
- mouseWheelScrollSensitivity = 66,
4206
- mouseWheelZoom = 67,
4207
- multiCursorMergeOverlapping = 68,
4208
- multiCursorModifier = 69,
4209
- multiCursorPaste = 70,
4210
- occurrencesHighlight = 71,
4211
- overviewRulerBorder = 72,
4212
- overviewRulerLanes = 73,
4213
- padding = 74,
4214
- parameterHints = 75,
4215
- peekWidgetDefaultFocus = 76,
4216
- definitionLinkOpensInPeek = 77,
4217
- quickSuggestions = 78,
4218
- quickSuggestionsDelay = 79,
4219
- readOnly = 80,
4220
- renameOnType = 81,
4221
- renderControlCharacters = 82,
4222
- renderFinalNewline = 83,
4223
- renderLineHighlight = 84,
4224
- renderLineHighlightOnlyWhenFocus = 85,
4225
- renderValidationDecorations = 86,
4226
- renderWhitespace = 87,
4227
- revealHorizontalRightPadding = 88,
4228
- roundedSelection = 89,
4229
- rulers = 90,
4230
- scrollbar = 91,
4231
- scrollBeyondLastColumn = 92,
4232
- scrollBeyondLastLine = 93,
4233
- scrollPredominantAxis = 94,
4234
- selectionClipboard = 95,
4235
- selectionHighlight = 96,
4236
- selectOnLineNumbers = 97,
4237
- showFoldingControls = 98,
4238
- showUnused = 99,
4239
- snippetSuggestions = 100,
4240
- smartSelect = 101,
4241
- smoothScrolling = 102,
4242
- stickyTabStops = 103,
4243
- stopRenderingLineAfter = 104,
4244
- suggest = 105,
4245
- suggestFontSize = 106,
4246
- suggestLineHeight = 107,
4247
- suggestOnTriggerCharacters = 108,
4248
- suggestSelection = 109,
4249
- tabCompletion = 110,
4250
- tabIndex = 111,
4251
- unicodeHighlighting = 112,
4252
- unusualLineTerminators = 113,
4253
- useShadowDOM = 114,
4254
- useTabStops = 115,
4255
- wordSeparators = 116,
4256
- wordWrap = 117,
4257
- wordWrapBreakAfterCharacters = 118,
4258
- wordWrapBreakBeforeCharacters = 119,
4259
- wordWrapColumn = 120,
4260
- wordWrapOverride1 = 121,
4261
- wordWrapOverride2 = 122,
4262
- wrappingIndent = 123,
4263
- wrappingStrategy = 124,
4264
- showDeprecated = 125,
4265
- inlayHints = 126,
4266
- editorClassName = 127,
4267
- pixelRatio = 128,
4268
- tabFocusMode = 129,
4269
- layoutInfo = 130,
4270
- wrappingInfo = 131
4245
+ foldingMaximumRegions = 41,
4246
+ unfoldOnClickAfterEndOfLine = 42,
4247
+ fontFamily = 43,
4248
+ fontInfo = 44,
4249
+ fontLigatures = 45,
4250
+ fontSize = 46,
4251
+ fontWeight = 47,
4252
+ formatOnPaste = 48,
4253
+ formatOnType = 49,
4254
+ glyphMargin = 50,
4255
+ gotoLocation = 51,
4256
+ hideCursorInOverviewRuler = 52,
4257
+ hover = 53,
4258
+ inDiffEditor = 54,
4259
+ inlineSuggest = 55,
4260
+ letterSpacing = 56,
4261
+ lightbulb = 57,
4262
+ lineDecorationsWidth = 58,
4263
+ lineHeight = 59,
4264
+ lineNumbers = 60,
4265
+ lineNumbersMinChars = 61,
4266
+ linkedEditing = 62,
4267
+ links = 63,
4268
+ matchBrackets = 64,
4269
+ minimap = 65,
4270
+ mouseStyle = 66,
4271
+ mouseWheelScrollSensitivity = 67,
4272
+ mouseWheelZoom = 68,
4273
+ multiCursorMergeOverlapping = 69,
4274
+ multiCursorModifier = 70,
4275
+ multiCursorPaste = 71,
4276
+ occurrencesHighlight = 72,
4277
+ overviewRulerBorder = 73,
4278
+ overviewRulerLanes = 74,
4279
+ padding = 75,
4280
+ parameterHints = 76,
4281
+ peekWidgetDefaultFocus = 77,
4282
+ definitionLinkOpensInPeek = 78,
4283
+ quickSuggestions = 79,
4284
+ quickSuggestionsDelay = 80,
4285
+ readOnly = 81,
4286
+ renameOnType = 82,
4287
+ renderControlCharacters = 83,
4288
+ renderFinalNewline = 84,
4289
+ renderLineHighlight = 85,
4290
+ renderLineHighlightOnlyWhenFocus = 86,
4291
+ renderValidationDecorations = 87,
4292
+ renderWhitespace = 88,
4293
+ revealHorizontalRightPadding = 89,
4294
+ roundedSelection = 90,
4295
+ rulers = 91,
4296
+ scrollbar = 92,
4297
+ scrollBeyondLastColumn = 93,
4298
+ scrollBeyondLastLine = 94,
4299
+ scrollPredominantAxis = 95,
4300
+ selectionClipboard = 96,
4301
+ selectionHighlight = 97,
4302
+ selectOnLineNumbers = 98,
4303
+ showFoldingControls = 99,
4304
+ showUnused = 100,
4305
+ snippetSuggestions = 101,
4306
+ smartSelect = 102,
4307
+ smoothScrolling = 103,
4308
+ stickyTabStops = 104,
4309
+ stopRenderingLineAfter = 105,
4310
+ suggest = 106,
4311
+ suggestFontSize = 107,
4312
+ suggestLineHeight = 108,
4313
+ suggestOnTriggerCharacters = 109,
4314
+ suggestSelection = 110,
4315
+ tabCompletion = 111,
4316
+ tabIndex = 112,
4317
+ unicodeHighlighting = 113,
4318
+ unusualLineTerminators = 114,
4319
+ useShadowDOM = 115,
4320
+ useTabStops = 116,
4321
+ wordSeparators = 117,
4322
+ wordWrap = 118,
4323
+ wordWrapBreakAfterCharacters = 119,
4324
+ wordWrapBreakBeforeCharacters = 120,
4325
+ wordWrapColumn = 121,
4326
+ wordWrapOverride1 = 122,
4327
+ wordWrapOverride2 = 123,
4328
+ wrappingIndent = 124,
4329
+ wrappingStrategy = 125,
4330
+ showDeprecated = 126,
4331
+ inlayHints = 127,
4332
+ editorClassName = 128,
4333
+ pixelRatio = 129,
4334
+ tabFocusMode = 130,
4335
+ layoutInfo = 131,
4336
+ wrappingInfo = 132
4271
4337
  }
4272
4338
 
4273
4339
  export const EditorOptions: {
@@ -4313,6 +4379,7 @@ declare namespace monaco.editor {
4313
4379
  foldingStrategy: IEditorOption<EditorOption.foldingStrategy, 'auto' | 'indentation'>;
4314
4380
  foldingHighlight: IEditorOption<EditorOption.foldingHighlight, boolean>;
4315
4381
  foldingImportsByDefault: IEditorOption<EditorOption.foldingImportsByDefault, boolean>;
4382
+ foldingMaximumRegions: IEditorOption<EditorOption.foldingMaximumRegions, number>;
4316
4383
  unfoldOnClickAfterEndOfLine: IEditorOption<EditorOption.unfoldOnClickAfterEndOfLine, boolean>;
4317
4384
  fontFamily: IEditorOption<EditorOption.fontFamily, string>;
4318
4385
  fontInfo: IEditorOption<EditorOption.fontInfo, FontInfo>;
@@ -4415,6 +4482,18 @@ declare namespace monaco.editor {
4415
4482
 
4416
4483
  export type FindComputedEditorOptionValueById<T extends EditorOption> = NonNullable<ComputedEditorOptionValue<EditorOptionsType[FindEditorOptionsKeyById<T>]>>;
4417
4484
 
4485
+ export interface IEditorConstructionOptions extends IEditorOptions {
4486
+ /**
4487
+ * The initial editor dimension (to avoid measuring the container).
4488
+ */
4489
+ dimension?: IDimension;
4490
+ /**
4491
+ * Place overflow widgets inside an external DOM node.
4492
+ * Defaults to an internal DOM node.
4493
+ */
4494
+ overflowWidgetsDomNode?: HTMLElement;
4495
+ }
4496
+
4418
4497
  /**
4419
4498
  * A view zone is a full horizontal rectangle that 'pushes' text down.
4420
4499
  * The editor reserves space for view zones when rendering.
@@ -4428,8 +4507,13 @@ declare namespace monaco.editor {
4428
4507
  /**
4429
4508
  * The column after which this zone should appear.
4430
4509
  * If not set, the maxLineColumn of `afterLineNumber` will be used.
4510
+ * This is relevant for wrapped lines.
4431
4511
  */
4432
4512
  afterColumn?: number;
4513
+ /**
4514
+ * If the `afterColumn` has multiple view columns, the affinity specifies which one to use. Defaults to `none`.
4515
+ */
4516
+ afterColumnAffinity?: PositionAffinity;
4433
4517
  /**
4434
4518
  * Suppress mouse down events.
4435
4519
  * If set, the editor will attach a mouse down listener to the view zone and .preventDefault on it.
@@ -4539,6 +4623,9 @@ declare namespace monaco.editor {
4539
4623
  * Render this content widget in a location where it could overflow the editor's view dom node.
4540
4624
  */
4541
4625
  allowEditorOverflow?: boolean;
4626
+ /**
4627
+ * Call preventDefault() on mousedown events that target the content widget.
4628
+ */
4542
4629
  suppressMouseDown?: boolean;
4543
4630
  /**
4544
4631
  * Get a unique identifier of the content widget.
@@ -4676,18 +4763,11 @@ declare namespace monaco.editor {
4676
4763
  OUTSIDE_EDITOR = 13
4677
4764
  }
4678
4765
 
4679
- /**
4680
- * Target hit with the mouse in the editor.
4681
- */
4682
- export interface IMouseTarget {
4766
+ export interface IBaseMouseTarget {
4683
4767
  /**
4684
4768
  * The target element
4685
4769
  */
4686
4770
  readonly element: Element | null;
4687
- /**
4688
- * The target type
4689
- */
4690
- readonly type: MouseTargetType;
4691
4771
  /**
4692
4772
  * The 'approximate' editor position
4693
4773
  */
@@ -4700,58 +4780,138 @@ declare namespace monaco.editor {
4700
4780
  * The 'approximate' editor range
4701
4781
  */
4702
4782
  readonly range: Range | null;
4703
- /**
4704
- * Some extra detail.
4705
- */
4706
- readonly detail: any;
4707
4783
  }
4708
4784
 
4709
- /**
4710
- * A mouse event originating from the editor.
4711
- */
4712
- export interface IEditorMouseEvent {
4713
- readonly event: IMouseEvent;
4714
- readonly target: IMouseTarget;
4785
+ export interface IMouseTargetUnknown extends IBaseMouseTarget {
4786
+ readonly type: MouseTargetType.UNKNOWN;
4715
4787
  }
4716
4788
 
4717
- export interface IPartialEditorMouseEvent {
4718
- readonly event: IMouseEvent;
4719
- readonly target: IMouseTarget | null;
4789
+ export interface IMouseTargetTextarea extends IBaseMouseTarget {
4790
+ readonly type: MouseTargetType.TEXTAREA;
4791
+ readonly position: null;
4792
+ readonly range: null;
4720
4793
  }
4721
4794
 
4722
- /**
4723
- * A paste event originating from the editor.
4724
- */
4725
- export interface IPasteEvent {
4795
+ export interface IMouseTargetMarginData {
4796
+ readonly isAfterLines: boolean;
4797
+ readonly glyphMarginLeft: number;
4798
+ readonly glyphMarginWidth: number;
4799
+ readonly lineNumbersWidth: number;
4800
+ readonly offsetX: number;
4801
+ }
4802
+
4803
+ export interface IMouseTargetMargin extends IBaseMouseTarget {
4804
+ readonly type: MouseTargetType.GUTTER_GLYPH_MARGIN | MouseTargetType.GUTTER_LINE_NUMBERS | MouseTargetType.GUTTER_LINE_DECORATIONS;
4805
+ readonly position: Position;
4726
4806
  readonly range: Range;
4727
- readonly languageId: string | null;
4807
+ readonly detail: IMouseTargetMarginData;
4728
4808
  }
4729
4809
 
4730
- export interface IEditorConstructionOptions extends IEditorOptions {
4731
- /**
4732
- * The initial editor dimension (to avoid measuring the container).
4733
- */
4734
- dimension?: IDimension;
4735
- /**
4736
- * Place overflow widgets inside an external DOM node.
4737
- * Defaults to an internal DOM node.
4738
- */
4739
- overflowWidgetsDomNode?: HTMLElement;
4810
+ export interface IMouseTargetViewZoneData {
4811
+ readonly viewZoneId: string;
4812
+ readonly positionBefore: Position | null;
4813
+ readonly positionAfter: Position | null;
4814
+ readonly position: Position;
4815
+ readonly afterLineNumber: number;
4740
4816
  }
4741
4817
 
4742
- export interface IDiffEditorConstructionOptions extends IDiffEditorOptions {
4743
- /**
4744
- * The initial editor dimension (to avoid measuring the container).
4745
- */
4746
- dimension?: IDimension;
4747
- /**
4748
- * Place overflow widgets inside an external DOM node.
4749
- * Defaults to an internal DOM node.
4750
- */
4751
- overflowWidgetsDomNode?: HTMLElement;
4752
- /**
4753
- * Aria label for original editor.
4754
- */
4818
+ export interface IMouseTargetViewZone extends IBaseMouseTarget {
4819
+ readonly type: MouseTargetType.GUTTER_VIEW_ZONE | MouseTargetType.CONTENT_VIEW_ZONE;
4820
+ readonly position: Position;
4821
+ readonly range: Range;
4822
+ readonly detail: IMouseTargetViewZoneData;
4823
+ }
4824
+
4825
+ export interface IMouseTargetContentTextData {
4826
+ readonly mightBeForeignElement: boolean;
4827
+ }
4828
+
4829
+ export interface IMouseTargetContentText extends IBaseMouseTarget {
4830
+ readonly type: MouseTargetType.CONTENT_TEXT;
4831
+ readonly position: Position;
4832
+ readonly range: Range;
4833
+ readonly detail: IMouseTargetContentTextData;
4834
+ }
4835
+
4836
+ export interface IMouseTargetContentEmptyData {
4837
+ readonly isAfterLines: boolean;
4838
+ readonly horizontalDistanceToText?: number;
4839
+ }
4840
+
4841
+ export interface IMouseTargetContentEmpty extends IBaseMouseTarget {
4842
+ readonly type: MouseTargetType.CONTENT_EMPTY;
4843
+ readonly position: Position;
4844
+ readonly range: Range;
4845
+ readonly detail: IMouseTargetContentEmptyData;
4846
+ }
4847
+
4848
+ export interface IMouseTargetContentWidget extends IBaseMouseTarget {
4849
+ readonly type: MouseTargetType.CONTENT_WIDGET;
4850
+ readonly position: null;
4851
+ readonly range: null;
4852
+ readonly detail: string;
4853
+ }
4854
+
4855
+ export interface IMouseTargetOverlayWidget extends IBaseMouseTarget {
4856
+ readonly type: MouseTargetType.OVERLAY_WIDGET;
4857
+ readonly position: null;
4858
+ readonly range: null;
4859
+ readonly detail: string;
4860
+ }
4861
+
4862
+ export interface IMouseTargetScrollbar extends IBaseMouseTarget {
4863
+ readonly type: MouseTargetType.SCROLLBAR;
4864
+ readonly position: Position;
4865
+ readonly range: Range;
4866
+ }
4867
+
4868
+ export interface IMouseTargetOverviewRuler extends IBaseMouseTarget {
4869
+ readonly type: MouseTargetType.OVERVIEW_RULER;
4870
+ }
4871
+
4872
+ export interface IMouseTargetOutsideEditor extends IBaseMouseTarget {
4873
+ readonly type: MouseTargetType.OUTSIDE_EDITOR;
4874
+ }
4875
+
4876
+ /**
4877
+ * Target hit with the mouse in the editor.
4878
+ */
4879
+ export type IMouseTarget = (IMouseTargetUnknown | IMouseTargetTextarea | IMouseTargetMargin | IMouseTargetViewZone | IMouseTargetContentText | IMouseTargetContentEmpty | IMouseTargetContentWidget | IMouseTargetOverlayWidget | IMouseTargetScrollbar | IMouseTargetOverviewRuler | IMouseTargetOutsideEditor);
4880
+
4881
+ /**
4882
+ * A mouse event originating from the editor.
4883
+ */
4884
+ export interface IEditorMouseEvent {
4885
+ readonly event: IMouseEvent;
4886
+ readonly target: IMouseTarget;
4887
+ }
4888
+
4889
+ export interface IPartialEditorMouseEvent {
4890
+ readonly event: IMouseEvent;
4891
+ readonly target: IMouseTarget | null;
4892
+ }
4893
+
4894
+ /**
4895
+ * A paste event originating from the editor.
4896
+ */
4897
+ export interface IPasteEvent {
4898
+ readonly range: Range;
4899
+ readonly languageId: string | null;
4900
+ }
4901
+
4902
+ export interface IDiffEditorConstructionOptions extends IDiffEditorOptions {
4903
+ /**
4904
+ * The initial editor dimension (to avoid measuring the container).
4905
+ */
4906
+ dimension?: IDimension;
4907
+ /**
4908
+ * Place overflow widgets inside an external DOM node.
4909
+ * Defaults to an internal DOM node.
4910
+ */
4911
+ overflowWidgetsDomNode?: HTMLElement;
4912
+ /**
4913
+ * Aria label for original editor.
4914
+ */
4755
4915
  originalAriaLabel?: string;
4756
4916
  /**
4757
4917
  * Aria label for modified editor.
@@ -4772,140 +4932,140 @@ declare namespace monaco.editor {
4772
4932
  * An event emitted when the content of the current model has changed.
4773
4933
  * @event
4774
4934
  */
4775
- onDidChangeModelContent: IEvent<IModelContentChangedEvent>;
4935
+ readonly onDidChangeModelContent: IEvent<IModelContentChangedEvent>;
4776
4936
  /**
4777
4937
  * An event emitted when the language of the current model has changed.
4778
4938
  * @event
4779
4939
  */
4780
- onDidChangeModelLanguage: IEvent<IModelLanguageChangedEvent>;
4940
+ readonly onDidChangeModelLanguage: IEvent<IModelLanguageChangedEvent>;
4781
4941
  /**
4782
4942
  * An event emitted when the language configuration of the current model has changed.
4783
4943
  * @event
4784
4944
  */
4785
- onDidChangeModelLanguageConfiguration: IEvent<IModelLanguageConfigurationChangedEvent>;
4945
+ readonly onDidChangeModelLanguageConfiguration: IEvent<IModelLanguageConfigurationChangedEvent>;
4786
4946
  /**
4787
4947
  * An event emitted when the options of the current model has changed.
4788
4948
  * @event
4789
4949
  */
4790
- onDidChangeModelOptions: IEvent<IModelOptionsChangedEvent>;
4950
+ readonly onDidChangeModelOptions: IEvent<IModelOptionsChangedEvent>;
4791
4951
  /**
4792
4952
  * An event emitted when the configuration of the editor has changed. (e.g. `editor.updateOptions()`)
4793
4953
  * @event
4794
4954
  */
4795
- onDidChangeConfiguration: IEvent<ConfigurationChangedEvent>;
4955
+ readonly onDidChangeConfiguration: IEvent<ConfigurationChangedEvent>;
4796
4956
  /**
4797
4957
  * An event emitted when the cursor position has changed.
4798
4958
  * @event
4799
4959
  */
4800
- onDidChangeCursorPosition: IEvent<ICursorPositionChangedEvent>;
4960
+ readonly onDidChangeCursorPosition: IEvent<ICursorPositionChangedEvent>;
4801
4961
  /**
4802
4962
  * An event emitted when the cursor selection has changed.
4803
4963
  * @event
4804
4964
  */
4805
- onDidChangeCursorSelection: IEvent<ICursorSelectionChangedEvent>;
4965
+ readonly onDidChangeCursorSelection: IEvent<ICursorSelectionChangedEvent>;
4806
4966
  /**
4807
4967
  * An event emitted when the model of this editor has changed (e.g. `editor.setModel()`).
4808
4968
  * @event
4809
4969
  */
4810
- onDidChangeModel: IEvent<IModelChangedEvent>;
4970
+ readonly onDidChangeModel: IEvent<IModelChangedEvent>;
4811
4971
  /**
4812
4972
  * An event emitted when the decorations of the current model have changed.
4813
4973
  * @event
4814
4974
  */
4815
- onDidChangeModelDecorations: IEvent<IModelDecorationsChangedEvent>;
4975
+ readonly onDidChangeModelDecorations: IEvent<IModelDecorationsChangedEvent>;
4816
4976
  /**
4817
4977
  * An event emitted when the text inside this editor gained focus (i.e. cursor starts blinking).
4818
4978
  * @event
4819
4979
  */
4820
- onDidFocusEditorText(listener: () => void): IDisposable;
4980
+ readonly onDidFocusEditorText: IEvent<void>;
4821
4981
  /**
4822
4982
  * An event emitted when the text inside this editor lost focus (i.e. cursor stops blinking).
4823
4983
  * @event
4824
4984
  */
4825
- onDidBlurEditorText(listener: () => void): IDisposable;
4985
+ readonly onDidBlurEditorText: IEvent<void>;
4826
4986
  /**
4827
4987
  * An event emitted when the text inside this editor or an editor widget gained focus.
4828
4988
  * @event
4829
4989
  */
4830
- onDidFocusEditorWidget(listener: () => void): IDisposable;
4990
+ readonly onDidFocusEditorWidget: IEvent<void>;
4831
4991
  /**
4832
4992
  * An event emitted when the text inside this editor or an editor widget lost focus.
4833
4993
  * @event
4834
4994
  */
4835
- onDidBlurEditorWidget(listener: () => void): IDisposable;
4995
+ readonly onDidBlurEditorWidget: IEvent<void>;
4836
4996
  /**
4837
4997
  * An event emitted after composition has started.
4838
4998
  */
4839
- onDidCompositionStart(listener: () => void): IDisposable;
4999
+ readonly onDidCompositionStart: IEvent<void>;
4840
5000
  /**
4841
5001
  * An event emitted after composition has ended.
4842
5002
  */
4843
- onDidCompositionEnd(listener: () => void): IDisposable;
5003
+ readonly onDidCompositionEnd: IEvent<void>;
4844
5004
  /**
4845
5005
  * An event emitted when editing failed because the editor is read-only.
4846
5006
  * @event
4847
5007
  */
4848
- onDidAttemptReadOnlyEdit(listener: () => void): IDisposable;
5008
+ readonly onDidAttemptReadOnlyEdit: IEvent<void>;
4849
5009
  /**
4850
5010
  * An event emitted when users paste text in the editor.
4851
5011
  * @event
4852
5012
  */
4853
- onDidPaste: IEvent<IPasteEvent>;
5013
+ readonly onDidPaste: IEvent<IPasteEvent>;
4854
5014
  /**
4855
5015
  * An event emitted on a "mouseup".
4856
5016
  * @event
4857
5017
  */
4858
- onMouseUp: IEvent<IEditorMouseEvent>;
5018
+ readonly onMouseUp: IEvent<IEditorMouseEvent>;
4859
5019
  /**
4860
5020
  * An event emitted on a "mousedown".
4861
5021
  * @event
4862
5022
  */
4863
- onMouseDown: IEvent<IEditorMouseEvent>;
5023
+ readonly onMouseDown: IEvent<IEditorMouseEvent>;
4864
5024
  /**
4865
5025
  * An event emitted on a "contextmenu".
4866
5026
  * @event
4867
5027
  */
4868
- onContextMenu: IEvent<IEditorMouseEvent>;
5028
+ readonly onContextMenu: IEvent<IEditorMouseEvent>;
4869
5029
  /**
4870
5030
  * An event emitted on a "mousemove".
4871
5031
  * @event
4872
5032
  */
4873
- onMouseMove: IEvent<IEditorMouseEvent>;
5033
+ readonly onMouseMove: IEvent<IEditorMouseEvent>;
4874
5034
  /**
4875
5035
  * An event emitted on a "mouseleave".
4876
5036
  * @event
4877
5037
  */
4878
- onMouseLeave: IEvent<IPartialEditorMouseEvent>;
5038
+ readonly onMouseLeave: IEvent<IPartialEditorMouseEvent>;
4879
5039
  /**
4880
5040
  * An event emitted on a "keyup".
4881
5041
  * @event
4882
5042
  */
4883
- onKeyUp: IEvent<IKeyboardEvent>;
5043
+ readonly onKeyUp: IEvent<IKeyboardEvent>;
4884
5044
  /**
4885
5045
  * An event emitted on a "keydown".
4886
5046
  * @event
4887
5047
  */
4888
- onKeyDown: IEvent<IKeyboardEvent>;
5048
+ readonly onKeyDown: IEvent<IKeyboardEvent>;
4889
5049
  /**
4890
5050
  * An event emitted when the layout of the editor has changed.
4891
5051
  * @event
4892
5052
  */
4893
- onDidLayoutChange: IEvent<EditorLayoutInfo>;
5053
+ readonly onDidLayoutChange: IEvent<EditorLayoutInfo>;
4894
5054
  /**
4895
5055
  * An event emitted when the content width or content height in the editor has changed.
4896
5056
  * @event
4897
5057
  */
4898
- onDidContentSizeChange: IEvent<IContentSizeChangedEvent>;
5058
+ readonly onDidContentSizeChange: IEvent<IContentSizeChangedEvent>;
4899
5059
  /**
4900
5060
  * An event emitted when the scroll in the editor has changed.
4901
5061
  * @event
4902
5062
  */
4903
- onDidScrollChange: IEvent<IScrollEvent>;
5063
+ readonly onDidScrollChange: IEvent<IScrollEvent>;
4904
5064
  /**
4905
5065
  * An event emitted when hidden areas change in the editor (e.g. due to folding).
4906
5066
  * @event
4907
5067
  */
4908
- onDidChangeHiddenAreas: IEvent<void>;
5068
+ readonly onDidChangeHiddenAreas: IEvent<void>;
4909
5069
  /**
4910
5070
  * Saves current view state of the editor in a serializable object.
4911
5071
  */
@@ -4923,7 +5083,7 @@ declare namespace monaco.editor {
4923
5083
  * @id Unique identifier of the contribution.
4924
5084
  * @return The contribution or null if contribution not found.
4925
5085
  */
4926
- getContribution<T extends IEditorContribution>(id: string): T;
5086
+ getContribution<T extends IEditorContribution>(id: string): T | null;
4927
5087
  /**
4928
5088
  * Type the getModel() of IEditor.
4929
5089
  */
@@ -5039,6 +5199,10 @@ declare namespace monaco.editor {
5039
5199
  * Get all the decorations on a line (filtering out decorations from other editors).
5040
5200
  */
5041
5201
  getLineDecorations(lineNumber: number): IModelDecoration[] | null;
5202
+ /**
5203
+ * Get all the decorations for a range (filtering out decorations from other editors).
5204
+ */
5205
+ getDecorationsInRange(range: Range): IModelDecoration[] | null;
5042
5206
  /**
5043
5207
  * All decorations added through this call will get the ownerId of this editor.
5044
5208
  * @see {@link ITextModel.deltaDecorations}
@@ -5147,14 +5311,14 @@ declare namespace monaco.editor {
5147
5311
  */
5148
5312
  export interface IDiffEditor extends IEditor {
5149
5313
  /**
5150
- * @see {@link ICodeEditor.getDomNode}
5314
+ * @see {@link ICodeEditor.getContainerDomNode}
5151
5315
  */
5152
- getDomNode(): HTMLElement;
5316
+ getContainerDomNode(): HTMLElement;
5153
5317
  /**
5154
5318
  * An event emitted when the diff information computed by this diff editor has been updated.
5155
5319
  * @event
5156
5320
  */
5157
- onDidUpdateDiff(listener: () => void): IDisposable;
5321
+ readonly onDidUpdateDiff: IEvent<void>;
5158
5322
  /**
5159
5323
  * Saves current view state of the editor in a serializable object.
5160
5324
  */
@@ -5220,7 +5384,6 @@ declare namespace monaco.editor {
5220
5384
 
5221
5385
  export class BareFontInfo {
5222
5386
  readonly _bareFontInfoBrand: void;
5223
- readonly zoomLevel: number;
5224
5387
  readonly pixelRatio: number;
5225
5388
  readonly fontFamily: string;
5226
5389
  readonly fontWeight: string;
@@ -5238,6 +5401,35 @@ declare namespace monaco.editor {
5238
5401
  declare namespace monaco.languages {
5239
5402
 
5240
5403
 
5404
+ export interface IRelativePattern {
5405
+ /**
5406
+ * A base file path to which this pattern will be matched against relatively.
5407
+ */
5408
+ readonly base: string;
5409
+ /**
5410
+ * A file glob pattern like `*.{ts,js}` that will be matched on file paths
5411
+ * relative to the base path.
5412
+ *
5413
+ * Example: Given a base of `/home/work/folder` and a file path of `/home/work/folder/index.js`,
5414
+ * the file glob pattern will match on `index.js`.
5415
+ */
5416
+ readonly pattern: string;
5417
+ }
5418
+
5419
+ export type LanguageSelector = string | LanguageFilter | ReadonlyArray<string | LanguageFilter>;
5420
+
5421
+ export interface LanguageFilter {
5422
+ readonly language?: string;
5423
+ readonly scheme?: string;
5424
+ readonly pattern?: string | IRelativePattern;
5425
+ readonly notebookType?: string;
5426
+ /**
5427
+ * This provider is implemented in the UI thread.
5428
+ */
5429
+ readonly hasAccessToAllModels?: boolean;
5430
+ readonly exclusive?: boolean;
5431
+ }
5432
+
5241
5433
  /**
5242
5434
  * Register information about a new language.
5243
5435
  */
@@ -5251,7 +5443,7 @@ declare namespace monaco.languages {
5251
5443
  export function getEncodedLanguageId(languageId: string): number;
5252
5444
 
5253
5445
  /**
5254
- * An event emitted when a language is first time needed (e.g. a model has it set).
5446
+ * An event emitted when a language is needed for the first time (e.g. a model has it set).
5255
5447
  * @event
5256
5448
  */
5257
5449
  export function onLanguage(languageId: string, callback: () => void): IDisposable;
@@ -5297,11 +5489,11 @@ declare namespace monaco.languages {
5297
5489
  * 3322 2222 2222 1111 1111 1100 0000 0000
5298
5490
  * 1098 7654 3210 9876 5432 1098 7654 3210
5299
5491
  * - -------------------------------------------
5300
- * bbbb bbbb bfff ffff ffFF FTTT LLLL LLLL
5492
+ * bbbb bbbb bfff ffff ffFF FFTT LLLL LLLL
5301
5493
  * - -------------------------------------------
5302
5494
  * - L = EncodedLanguageId (8 bits): Use `getEncodedLanguageId` to get the encoded ID of a language.
5303
- * - T = StandardTokenType (3 bits): Other = 0, Comment = 1, String = 2, RegEx = 4.
5304
- * - F = FontStyle (3 bits): None = 0, Italic = 1, Bold = 2, Underline = 4.
5495
+ * - T = StandardTokenType (2 bits): Other = 0, Comment = 1, String = 2, RegEx = 3.
5496
+ * - F = FontStyle (4 bits): None = 0, Italic = 1, Bold = 2, Underline = 4, Strikethrough = 8.
5305
5497
  * - f = foreground ColorId (9 bits)
5306
5498
  * - b = background ColorId (9 bits)
5307
5499
  * - The color value for each colorId is defined in IStandaloneThemeData.customTokenColors:
@@ -5316,6 +5508,13 @@ declare namespace monaco.languages {
5316
5508
  endState: IState;
5317
5509
  }
5318
5510
 
5511
+ /**
5512
+ * A factory for token providers.
5513
+ */
5514
+ export interface TokensProviderFactory {
5515
+ create(): ProviderResult<TokensProvider | EncodedTokensProvider | IMonarchLanguage>;
5516
+ }
5517
+
5319
5518
  /**
5320
5519
  * A "manual" provider of tokens.
5321
5520
  */
@@ -5355,139 +5554,160 @@ declare namespace monaco.languages {
5355
5554
  export function setColorMap(colorMap: string[] | null): void;
5356
5555
 
5357
5556
  /**
5358
- * Set the tokens provider for a language (manual implementation).
5557
+ * Register a tokens provider factory for a language. This tokenizer will be exclusive with a tokenizer
5558
+ * set using `setTokensProvider` or one created using `setMonarchTokensProvider`, but will work together
5559
+ * with a tokens provider set using `registerDocumentSemanticTokensProvider` or `registerDocumentRangeSemanticTokensProvider`.
5560
+ */
5561
+ export function registerTokensProviderFactory(languageId: string, factory: TokensProviderFactory): IDisposable;
5562
+
5563
+ /**
5564
+ * Set the tokens provider for a language (manual implementation). This tokenizer will be exclusive
5565
+ * with a tokenizer created using `setMonarchTokensProvider`, or with `registerTokensProviderFactory`,
5566
+ * but will work together with a tokens provider set using `registerDocumentSemanticTokensProvider`
5567
+ * or `registerDocumentRangeSemanticTokensProvider`.
5359
5568
  */
5360
5569
  export function setTokensProvider(languageId: string, provider: TokensProvider | EncodedTokensProvider | Thenable<TokensProvider | EncodedTokensProvider>): IDisposable;
5361
5570
 
5362
5571
  /**
5363
- * Set the tokens provider for a language (monarch implementation).
5572
+ * Set the tokens provider for a language (monarch implementation). This tokenizer will be exclusive
5573
+ * with a tokenizer set using `setTokensProvider`, or with `registerTokensProviderFactory`, but will
5574
+ * work together with a tokens provider set using `registerDocumentSemanticTokensProvider` or
5575
+ * `registerDocumentRangeSemanticTokensProvider`.
5364
5576
  */
5365
5577
  export function setMonarchTokensProvider(languageId: string, languageDef: IMonarchLanguage | Thenable<IMonarchLanguage>): IDisposable;
5366
5578
 
5367
5579
  /**
5368
5580
  * Register a reference provider (used by e.g. reference search).
5369
5581
  */
5370
- export function registerReferenceProvider(languageId: string, provider: ReferenceProvider): IDisposable;
5582
+ export function registerReferenceProvider(languageSelector: LanguageSelector, provider: ReferenceProvider): IDisposable;
5371
5583
 
5372
5584
  /**
5373
5585
  * Register a rename provider (used by e.g. rename symbol).
5374
5586
  */
5375
- export function registerRenameProvider(languageId: string, provider: RenameProvider): IDisposable;
5587
+ export function registerRenameProvider(languageSelector: LanguageSelector, provider: RenameProvider): IDisposable;
5376
5588
 
5377
5589
  /**
5378
5590
  * Register a signature help provider (used by e.g. parameter hints).
5379
5591
  */
5380
- export function registerSignatureHelpProvider(languageId: string, provider: SignatureHelpProvider): IDisposable;
5592
+ export function registerSignatureHelpProvider(languageSelector: LanguageSelector, provider: SignatureHelpProvider): IDisposable;
5381
5593
 
5382
5594
  /**
5383
5595
  * Register a hover provider (used by e.g. editor hover).
5384
5596
  */
5385
- export function registerHoverProvider(languageId: string, provider: HoverProvider): IDisposable;
5597
+ export function registerHoverProvider(languageSelector: LanguageSelector, provider: HoverProvider): IDisposable;
5386
5598
 
5387
5599
  /**
5388
5600
  * Register a document symbol provider (used by e.g. outline).
5389
5601
  */
5390
- export function registerDocumentSymbolProvider(languageId: string, provider: DocumentSymbolProvider): IDisposable;
5602
+ export function registerDocumentSymbolProvider(languageSelector: LanguageSelector, provider: DocumentSymbolProvider): IDisposable;
5391
5603
 
5392
5604
  /**
5393
5605
  * Register a document highlight provider (used by e.g. highlight occurrences).
5394
5606
  */
5395
- export function registerDocumentHighlightProvider(languageId: string, provider: DocumentHighlightProvider): IDisposable;
5607
+ export function registerDocumentHighlightProvider(languageSelector: LanguageSelector, provider: DocumentHighlightProvider): IDisposable;
5396
5608
 
5397
5609
  /**
5398
5610
  * Register an linked editing range provider.
5399
5611
  */
5400
- export function registerLinkedEditingRangeProvider(languageId: string, provider: LinkedEditingRangeProvider): IDisposable;
5612
+ export function registerLinkedEditingRangeProvider(languageSelector: LanguageSelector, provider: LinkedEditingRangeProvider): IDisposable;
5401
5613
 
5402
5614
  /**
5403
5615
  * Register a definition provider (used by e.g. go to definition).
5404
5616
  */
5405
- export function registerDefinitionProvider(languageId: string, provider: DefinitionProvider): IDisposable;
5617
+ export function registerDefinitionProvider(languageSelector: LanguageSelector, provider: DefinitionProvider): IDisposable;
5406
5618
 
5407
5619
  /**
5408
5620
  * Register a implementation provider (used by e.g. go to implementation).
5409
5621
  */
5410
- export function registerImplementationProvider(languageId: string, provider: ImplementationProvider): IDisposable;
5622
+ export function registerImplementationProvider(languageSelector: LanguageSelector, provider: ImplementationProvider): IDisposable;
5411
5623
 
5412
5624
  /**
5413
5625
  * Register a type definition provider (used by e.g. go to type definition).
5414
5626
  */
5415
- export function registerTypeDefinitionProvider(languageId: string, provider: TypeDefinitionProvider): IDisposable;
5627
+ export function registerTypeDefinitionProvider(languageSelector: LanguageSelector, provider: TypeDefinitionProvider): IDisposable;
5416
5628
 
5417
5629
  /**
5418
5630
  * Register a code lens provider (used by e.g. inline code lenses).
5419
5631
  */
5420
- export function registerCodeLensProvider(languageId: string, provider: CodeLensProvider): IDisposable;
5632
+ export function registerCodeLensProvider(languageSelector: LanguageSelector, provider: CodeLensProvider): IDisposable;
5421
5633
 
5422
5634
  /**
5423
5635
  * Register a code action provider (used by e.g. quick fix).
5424
5636
  */
5425
- export function registerCodeActionProvider(languageId: string, provider: CodeActionProvider, metadata?: CodeActionProviderMetadata): IDisposable;
5637
+ export function registerCodeActionProvider(languageSelector: LanguageSelector, provider: CodeActionProvider, metadata?: CodeActionProviderMetadata): IDisposable;
5426
5638
 
5427
5639
  /**
5428
5640
  * Register a formatter that can handle only entire models.
5429
5641
  */
5430
- export function registerDocumentFormattingEditProvider(languageId: string, provider: DocumentFormattingEditProvider): IDisposable;
5642
+ export function registerDocumentFormattingEditProvider(languageSelector: LanguageSelector, provider: DocumentFormattingEditProvider): IDisposable;
5431
5643
 
5432
5644
  /**
5433
5645
  * Register a formatter that can handle a range inside a model.
5434
5646
  */
5435
- export function registerDocumentRangeFormattingEditProvider(languageId: string, provider: DocumentRangeFormattingEditProvider): IDisposable;
5647
+ export function registerDocumentRangeFormattingEditProvider(languageSelector: LanguageSelector, provider: DocumentRangeFormattingEditProvider): IDisposable;
5436
5648
 
5437
5649
  /**
5438
5650
  * Register a formatter than can do formatting as the user types.
5439
5651
  */
5440
- export function registerOnTypeFormattingEditProvider(languageId: string, provider: OnTypeFormattingEditProvider): IDisposable;
5652
+ export function registerOnTypeFormattingEditProvider(languageSelector: LanguageSelector, provider: OnTypeFormattingEditProvider): IDisposable;
5441
5653
 
5442
5654
  /**
5443
5655
  * Register a link provider that can find links in text.
5444
5656
  */
5445
- export function registerLinkProvider(languageId: string, provider: LinkProvider): IDisposable;
5657
+ export function registerLinkProvider(languageSelector: LanguageSelector, provider: LinkProvider): IDisposable;
5446
5658
 
5447
5659
  /**
5448
5660
  * Register a completion item provider (use by e.g. suggestions).
5449
5661
  */
5450
- export function registerCompletionItemProvider(languageId: string, provider: CompletionItemProvider): IDisposable;
5662
+ export function registerCompletionItemProvider(languageSelector: LanguageSelector, provider: CompletionItemProvider): IDisposable;
5451
5663
 
5452
5664
  /**
5453
5665
  * Register a document color provider (used by Color Picker, Color Decorator).
5454
5666
  */
5455
- export function registerColorProvider(languageId: string, provider: DocumentColorProvider): IDisposable;
5667
+ export function registerColorProvider(languageSelector: LanguageSelector, provider: DocumentColorProvider): IDisposable;
5456
5668
 
5457
5669
  /**
5458
5670
  * Register a folding range provider
5459
5671
  */
5460
- export function registerFoldingRangeProvider(languageId: string, provider: FoldingRangeProvider): IDisposable;
5672
+ export function registerFoldingRangeProvider(languageSelector: LanguageSelector, provider: FoldingRangeProvider): IDisposable;
5461
5673
 
5462
5674
  /**
5463
5675
  * Register a declaration provider
5464
5676
  */
5465
- export function registerDeclarationProvider(languageId: string, provider: DeclarationProvider): IDisposable;
5677
+ export function registerDeclarationProvider(languageSelector: LanguageSelector, provider: DeclarationProvider): IDisposable;
5466
5678
 
5467
5679
  /**
5468
5680
  * Register a selection range provider
5469
5681
  */
5470
- export function registerSelectionRangeProvider(languageId: string, provider: SelectionRangeProvider): IDisposable;
5682
+ export function registerSelectionRangeProvider(languageSelector: LanguageSelector, provider: SelectionRangeProvider): IDisposable;
5471
5683
 
5472
5684
  /**
5473
- * Register a document semantic tokens provider
5685
+ * Register a document semantic tokens provider. A semantic tokens provider will complement and enhance a
5686
+ * simple top-down tokenizer. Simple top-down tokenizers can be set either via `setMonarchTokensProvider`
5687
+ * or `setTokensProvider`.
5688
+ *
5689
+ * For the best user experience, register both a semantic tokens provider and a top-down tokenizer.
5474
5690
  */
5475
- export function registerDocumentSemanticTokensProvider(languageId: string, provider: DocumentSemanticTokensProvider): IDisposable;
5691
+ export function registerDocumentSemanticTokensProvider(languageSelector: LanguageSelector, provider: DocumentSemanticTokensProvider): IDisposable;
5476
5692
 
5477
5693
  /**
5478
- * Register a document range semantic tokens provider
5694
+ * Register a document range semantic tokens provider. A semantic tokens provider will complement and enhance a
5695
+ * simple top-down tokenizer. Simple top-down tokenizers can be set either via `setMonarchTokensProvider`
5696
+ * or `setTokensProvider`.
5697
+ *
5698
+ * For the best user experience, register both a semantic tokens provider and a top-down tokenizer.
5479
5699
  */
5480
- export function registerDocumentRangeSemanticTokensProvider(languageId: string, provider: DocumentRangeSemanticTokensProvider): IDisposable;
5700
+ export function registerDocumentRangeSemanticTokensProvider(languageSelector: LanguageSelector, provider: DocumentRangeSemanticTokensProvider): IDisposable;
5481
5701
 
5482
5702
  /**
5483
5703
  * Register an inline completions provider.
5484
5704
  */
5485
- export function registerInlineCompletionsProvider(languageId: string, provider: InlineCompletionsProvider): IDisposable;
5705
+ export function registerInlineCompletionsProvider(languageSelector: LanguageSelector, provider: InlineCompletionsProvider): IDisposable;
5486
5706
 
5487
5707
  /**
5488
5708
  * Register an inlay hints provider.
5489
5709
  */
5490
- export function registerInlayHintsProvider(languageId: string, provider: InlayHintsProvider): IDisposable;
5710
+ export function registerInlayHintsProvider(languageSelector: LanguageSelector, provider: InlayHintsProvider): IDisposable;
5491
5711
 
5492
5712
  /**
5493
5713
  * Contains additional diagnostic information about the context in which
@@ -6051,6 +6271,11 @@ declare namespace monaco.languages {
6051
6271
  */
6052
6272
  readonly range?: IRange;
6053
6273
  readonly command?: Command;
6274
+ /**
6275
+ * If set to `true`, unopened closing brackets are removed and unclosed opening brackets are closed.
6276
+ * Defaults to `false`.
6277
+ */
6278
+ readonly completeBracketPairs?: boolean;
6054
6279
  }
6055
6280
 
6056
6281
  export interface InlineCompletions<TItem extends InlineCompletion = InlineCompletion> {
@@ -6716,22 +6941,37 @@ declare namespace monaco.languages {
6716
6941
  }
6717
6942
 
6718
6943
  export enum InlayHintKind {
6719
- Other = 0,
6720
6944
  Type = 1,
6721
6945
  Parameter = 2
6722
6946
  }
6723
6947
 
6948
+ export interface InlayHintLabelPart {
6949
+ label: string;
6950
+ tooltip?: string | IMarkdownString;
6951
+ command?: Command;
6952
+ location?: Location;
6953
+ }
6954
+
6724
6955
  export interface InlayHint {
6725
- text: string;
6956
+ label: string | InlayHintLabelPart[];
6957
+ tooltip?: string | IMarkdownString;
6958
+ command?: Command;
6726
6959
  position: IPosition;
6727
- kind: InlayHintKind;
6728
- whitespaceBefore?: boolean;
6729
- whitespaceAfter?: boolean;
6960
+ kind?: InlayHintKind;
6961
+ paddingLeft?: boolean;
6962
+ paddingRight?: boolean;
6963
+ }
6964
+
6965
+ export interface InlayHintList {
6966
+ hints: InlayHint[];
6967
+ dispose(): void;
6730
6968
  }
6731
6969
 
6732
6970
  export interface InlayHintsProvider {
6971
+ displayName?: string;
6733
6972
  onDidChangeInlayHints?: IEvent<void>;
6734
- provideInlayHints(model: editor.ITextModel, range: Range, token: CancellationToken): ProviderResult<InlayHint[]>;
6973
+ provideInlayHints(model: editor.ITextModel, range: Range, token: CancellationToken): ProviderResult<InlayHintList>;
6974
+ resolveInlayHint?(hint: InlayHint, token: CancellationToken): ProviderResult<InlayHint>;
6735
6975
  }
6736
6976
 
6737
6977
  export interface SemanticTokensLegend {
@@ -6949,392 +7189,448 @@ declare namespace monaco.worker {
6949
7189
  * Licensed under the MIT License. See License.txt in the project root for license information.
6950
7190
  *--------------------------------------------------------------------------------------------*/
6951
7191
 
6952
- declare namespace monaco.languages.typescript {
6953
- export enum ModuleKind {
6954
- None = 0,
6955
- CommonJS = 1,
6956
- AMD = 2,
6957
- UMD = 3,
6958
- System = 4,
6959
- ES2015 = 5,
6960
- ESNext = 99
7192
+ declare namespace monaco.languages.css {
7193
+ export interface Options {
7194
+ readonly validate?: boolean;
7195
+ readonly lint?: {
7196
+ readonly compatibleVendorPrefixes?: 'ignore' | 'warning' | 'error';
7197
+ readonly vendorPrefix?: 'ignore' | 'warning' | 'error';
7198
+ readonly duplicateProperties?: 'ignore' | 'warning' | 'error';
7199
+ readonly emptyRules?: 'ignore' | 'warning' | 'error';
7200
+ readonly importStatement?: 'ignore' | 'warning' | 'error';
7201
+ readonly boxModel?: 'ignore' | 'warning' | 'error';
7202
+ readonly universalSelector?: 'ignore' | 'warning' | 'error';
7203
+ readonly zeroUnits?: 'ignore' | 'warning' | 'error';
7204
+ readonly fontFaceProperties?: 'ignore' | 'warning' | 'error';
7205
+ readonly hexColorLength?: 'ignore' | 'warning' | 'error';
7206
+ readonly argumentsInColorFunction?: 'ignore' | 'warning' | 'error';
7207
+ readonly unknownProperties?: 'ignore' | 'warning' | 'error';
7208
+ readonly ieHack?: 'ignore' | 'warning' | 'error';
7209
+ readonly unknownVendorSpecificProperties?: 'ignore' | 'warning' | 'error';
7210
+ readonly propertyIgnoredDueToDisplay?: 'ignore' | 'warning' | 'error';
7211
+ readonly important?: 'ignore' | 'warning' | 'error';
7212
+ readonly float?: 'ignore' | 'warning' | 'error';
7213
+ readonly idSelector?: 'ignore' | 'warning' | 'error';
7214
+ };
7215
+ /**
7216
+ * Configures the CSS data types known by the langauge service.
7217
+ */
7218
+ readonly data?: CSSDataConfiguration;
6961
7219
  }
6962
- export enum JsxEmit {
6963
- None = 0,
6964
- Preserve = 1,
6965
- React = 2,
6966
- ReactNative = 3,
6967
- ReactJSX = 4,
6968
- ReactJSXDev = 5
7220
+ export interface ModeConfiguration {
7221
+ /**
7222
+ * Defines whether the built-in completionItemProvider is enabled.
7223
+ */
7224
+ readonly completionItems?: boolean;
7225
+ /**
7226
+ * Defines whether the built-in hoverProvider is enabled.
7227
+ */
7228
+ readonly hovers?: boolean;
7229
+ /**
7230
+ * Defines whether the built-in documentSymbolProvider is enabled.
7231
+ */
7232
+ readonly documentSymbols?: boolean;
7233
+ /**
7234
+ * Defines whether the built-in definitions provider is enabled.
7235
+ */
7236
+ readonly definitions?: boolean;
7237
+ /**
7238
+ * Defines whether the built-in references provider is enabled.
7239
+ */
7240
+ readonly references?: boolean;
7241
+ /**
7242
+ * Defines whether the built-in references provider is enabled.
7243
+ */
7244
+ readonly documentHighlights?: boolean;
7245
+ /**
7246
+ * Defines whether the built-in rename provider is enabled.
7247
+ */
7248
+ readonly rename?: boolean;
7249
+ /**
7250
+ * Defines whether the built-in color provider is enabled.
7251
+ */
7252
+ readonly colors?: boolean;
7253
+ /**
7254
+ * Defines whether the built-in foldingRange provider is enabled.
7255
+ */
7256
+ readonly foldingRanges?: boolean;
7257
+ /**
7258
+ * Defines whether the built-in diagnostic provider is enabled.
7259
+ */
7260
+ readonly diagnostics?: boolean;
7261
+ /**
7262
+ * Defines whether the built-in selection range provider is enabled.
7263
+ */
7264
+ readonly selectionRanges?: boolean;
6969
7265
  }
6970
- export enum NewLineKind {
6971
- CarriageReturnLineFeed = 0,
6972
- LineFeed = 1
7266
+ export interface LanguageServiceDefaults {
7267
+ readonly languageId: string;
7268
+ readonly onDidChange: IEvent<LanguageServiceDefaults>;
7269
+ readonly modeConfiguration: ModeConfiguration;
7270
+ readonly options: Options;
7271
+ setOptions(options: Options): void;
7272
+ setModeConfiguration(modeConfiguration: ModeConfiguration): void;
7273
+ /** @deprecated Use options instead */
7274
+ readonly diagnosticsOptions: DiagnosticsOptions;
7275
+ /** @deprecated Use setOptions instead */
7276
+ setDiagnosticsOptions(options: DiagnosticsOptions): void;
6973
7277
  }
6974
- export enum ScriptTarget {
6975
- ES3 = 0,
6976
- ES5 = 1,
6977
- ES2015 = 2,
6978
- ES2016 = 3,
6979
- ES2017 = 4,
6980
- ES2018 = 5,
6981
- ES2019 = 6,
6982
- ES2020 = 7,
6983
- ESNext = 99,
6984
- JSON = 100,
6985
- Latest = 99
7278
+ /** @deprecated Use Options instead */
7279
+ export type DiagnosticsOptions = Options;
7280
+ export const cssDefaults: LanguageServiceDefaults;
7281
+ export const scssDefaults: LanguageServiceDefaults;
7282
+ export const lessDefaults: LanguageServiceDefaults;
7283
+ export interface CSSDataConfiguration {
7284
+ /**
7285
+ * Defines whether the standard CSS properties, at-directives, pseudoClasses and pseudoElements are shown.
7286
+ */
7287
+ useDefaultDataProvider?: boolean;
7288
+ /**
7289
+ * Provides a set of custom data providers.
7290
+ */
7291
+ dataProviders?: {
7292
+ [providerId: string]: CSSDataV1;
7293
+ };
6986
7294
  }
6987
- export enum ModuleResolutionKind {
6988
- Classic = 1,
6989
- NodeJs = 2
7295
+ /**
7296
+ * Custom CSS properties, at-directives, pseudoClasses and pseudoElements
7297
+ * https://github.com/microsoft/vscode-css-languageservice/blob/main/docs/customData.md
7298
+ */
7299
+ export interface CSSDataV1 {
7300
+ version: 1 | 1.1;
7301
+ properties?: IPropertyData[];
7302
+ atDirectives?: IAtDirectiveData[];
7303
+ pseudoClasses?: IPseudoClassData[];
7304
+ pseudoElements?: IPseudoElementData[];
6990
7305
  }
6991
- interface MapLike<T> {
6992
- [index: string]: T;
7306
+ export type EntryStatus = 'standard' | 'experimental' | 'nonstandard' | 'obsolete';
7307
+ export interface IReference {
7308
+ name: string;
7309
+ url: string;
6993
7310
  }
6994
- type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string[]> | null | undefined;
6995
- interface CompilerOptions {
6996
- allowJs?: boolean;
6997
- allowSyntheticDefaultImports?: boolean;
6998
- allowUmdGlobalAccess?: boolean;
6999
- allowUnreachableCode?: boolean;
7000
- allowUnusedLabels?: boolean;
7001
- alwaysStrict?: boolean;
7002
- baseUrl?: string;
7003
- charset?: string;
7004
- checkJs?: boolean;
7005
- declaration?: boolean;
7006
- declarationMap?: boolean;
7007
- emitDeclarationOnly?: boolean;
7008
- declarationDir?: string;
7009
- disableSizeLimit?: boolean;
7010
- disableSourceOfProjectReferenceRedirect?: boolean;
7011
- downlevelIteration?: boolean;
7012
- emitBOM?: boolean;
7013
- emitDecoratorMetadata?: boolean;
7014
- experimentalDecorators?: boolean;
7015
- forceConsistentCasingInFileNames?: boolean;
7016
- importHelpers?: boolean;
7017
- inlineSourceMap?: boolean;
7018
- inlineSources?: boolean;
7019
- isolatedModules?: boolean;
7020
- jsx?: JsxEmit;
7021
- keyofStringsOnly?: boolean;
7022
- lib?: string[];
7023
- locale?: string;
7024
- mapRoot?: string;
7025
- maxNodeModuleJsDepth?: number;
7026
- module?: ModuleKind;
7027
- moduleResolution?: ModuleResolutionKind;
7028
- newLine?: NewLineKind;
7029
- noEmit?: boolean;
7030
- noEmitHelpers?: boolean;
7031
- noEmitOnError?: boolean;
7032
- noErrorTruncation?: boolean;
7033
- noFallthroughCasesInSwitch?: boolean;
7034
- noImplicitAny?: boolean;
7035
- noImplicitReturns?: boolean;
7036
- noImplicitThis?: boolean;
7037
- noStrictGenericChecks?: boolean;
7038
- noUnusedLocals?: boolean;
7039
- noUnusedParameters?: boolean;
7040
- noImplicitUseStrict?: boolean;
7041
- noLib?: boolean;
7042
- noResolve?: boolean;
7043
- out?: string;
7044
- outDir?: string;
7045
- outFile?: string;
7046
- paths?: MapLike<string[]>;
7047
- preserveConstEnums?: boolean;
7048
- preserveSymlinks?: boolean;
7049
- project?: string;
7050
- reactNamespace?: string;
7051
- jsxFactory?: string;
7052
- composite?: boolean;
7053
- removeComments?: boolean;
7054
- rootDir?: string;
7055
- rootDirs?: string[];
7056
- skipLibCheck?: boolean;
7057
- skipDefaultLibCheck?: boolean;
7058
- sourceMap?: boolean;
7059
- sourceRoot?: string;
7060
- strict?: boolean;
7061
- strictFunctionTypes?: boolean;
7062
- strictBindCallApply?: boolean;
7063
- strictNullChecks?: boolean;
7064
- strictPropertyInitialization?: boolean;
7065
- stripInternal?: boolean;
7066
- suppressExcessPropertyErrors?: boolean;
7067
- suppressImplicitAnyIndexErrors?: boolean;
7068
- target?: ScriptTarget;
7069
- traceResolution?: boolean;
7070
- resolveJsonModule?: boolean;
7071
- types?: string[];
7072
- /** Paths used to compute primary types search locations */
7073
- typeRoots?: string[];
7074
- esModuleInterop?: boolean;
7075
- useDefineForClassFields?: boolean;
7076
- [option: string]: CompilerOptionsValue | undefined;
7077
- }
7078
- export interface DiagnosticsOptions {
7079
- noSemanticValidation?: boolean;
7080
- noSyntaxValidation?: boolean;
7081
- noSuggestionDiagnostics?: boolean;
7082
- /**
7083
- * Limit diagnostic computation to only visible files.
7084
- * Defaults to false.
7085
- */
7086
- onlyVisible?: boolean;
7087
- diagnosticCodesToIgnore?: number[];
7088
- }
7089
- export interface WorkerOptions {
7090
- /** A full HTTP path to a JavaScript file which adds a function `customTSWorkerFactory` to the self inside a web-worker */
7091
- customWorkerPath?: string;
7092
- }
7093
- interface InlayHintsOptions {
7094
- readonly includeInlayParameterNameHints?: 'none' | 'literals' | 'all';
7095
- readonly includeInlayParameterNameHintsWhenArgumentMatchesName?: boolean;
7096
- readonly includeInlayFunctionParameterTypeHints?: boolean;
7097
- readonly includeInlayVariableTypeHints?: boolean;
7098
- readonly includeInlayPropertyDeclarationTypeHints?: boolean;
7099
- readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
7100
- readonly includeInlayEnumMemberValueHints?: boolean;
7311
+ export interface IPropertyData {
7312
+ name: string;
7313
+ description?: string | MarkupContent;
7314
+ browsers?: string[];
7315
+ restrictions?: string[];
7316
+ status?: EntryStatus;
7317
+ syntax?: string;
7318
+ values?: IValueData[];
7319
+ references?: IReference[];
7320
+ relevance?: number;
7101
7321
  }
7102
- interface IExtraLib {
7103
- content: string;
7104
- version: number;
7322
+ export interface IAtDirectiveData {
7323
+ name: string;
7324
+ description?: string | MarkupContent;
7325
+ browsers?: string[];
7326
+ status?: EntryStatus;
7327
+ references?: IReference[];
7105
7328
  }
7106
- export interface IExtraLibs {
7107
- [path: string]: IExtraLib;
7329
+ export interface IPseudoClassData {
7330
+ name: string;
7331
+ description?: string | MarkupContent;
7332
+ browsers?: string[];
7333
+ status?: EntryStatus;
7334
+ references?: IReference[];
7108
7335
  }
7109
- /**
7110
- * A linked list of formatted diagnostic messages to be used as part of a multiline message.
7111
- * It is built from the bottom up, leaving the head to be the "main" diagnostic.
7112
- */
7113
- interface DiagnosticMessageChain {
7114
- messageText: string;
7115
- /** Diagnostic category: warning = 0, error = 1, suggestion = 2, message = 3 */
7116
- category: 0 | 1 | 2 | 3;
7117
- code: number;
7118
- next?: DiagnosticMessageChain[];
7336
+ export interface IPseudoElementData {
7337
+ name: string;
7338
+ description?: string | MarkupContent;
7339
+ browsers?: string[];
7340
+ status?: EntryStatus;
7341
+ references?: IReference[];
7119
7342
  }
7120
- export interface Diagnostic extends DiagnosticRelatedInformation {
7121
- /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
7122
- reportsUnnecessary?: {};
7123
- reportsDeprecated?: {};
7124
- source?: string;
7125
- relatedInformation?: DiagnosticRelatedInformation[];
7343
+ export interface IValueData {
7344
+ name: string;
7345
+ description?: string | MarkupContent;
7346
+ browsers?: string[];
7347
+ status?: EntryStatus;
7348
+ references?: IReference[];
7126
7349
  }
7127
- export interface DiagnosticRelatedInformation {
7128
- /** Diagnostic category: warning = 0, error = 1, suggestion = 2, message = 3 */
7129
- category: 0 | 1 | 2 | 3;
7130
- code: number;
7131
- /** TypeScriptWorker removes all but the `fileName` property to avoid serializing circular JSON structures. */
7132
- file: {
7133
- fileName: string;
7134
- } | undefined;
7135
- start: number | undefined;
7136
- length: number | undefined;
7137
- messageText: string | DiagnosticMessageChain;
7350
+ export interface MarkupContent {
7351
+ kind: MarkupKind;
7352
+ value: string;
7138
7353
  }
7139
- interface EmitOutput {
7140
- outputFiles: OutputFile[];
7141
- emitSkipped: boolean;
7354
+ export type MarkupKind = 'plaintext' | 'markdown';
7355
+ }
7356
+
7357
+ /*---------------------------------------------------------------------------------------------
7358
+ * Copyright (c) Microsoft Corporation. All rights reserved.
7359
+ * Licensed under the MIT License. See License.txt in the project root for license information.
7360
+ *--------------------------------------------------------------------------------------------*/
7361
+
7362
+ declare namespace monaco.languages.html {
7363
+ export interface HTMLFormatConfiguration {
7364
+ readonly tabSize: number;
7365
+ readonly insertSpaces: boolean;
7366
+ readonly wrapLineLength: number;
7367
+ readonly unformatted: string;
7368
+ readonly contentUnformatted: string;
7369
+ readonly indentInnerHtml: boolean;
7370
+ readonly preserveNewLines: boolean;
7371
+ readonly maxPreserveNewLines: number | undefined;
7372
+ readonly indentHandlebars: boolean;
7373
+ readonly endWithNewline: boolean;
7374
+ readonly extraLiners: string;
7375
+ readonly wrapAttributes: 'auto' | 'force' | 'force-aligned' | 'force-expand-multiline';
7142
7376
  }
7143
- interface OutputFile {
7144
- name: string;
7145
- writeByteOrderMark: boolean;
7146
- text: string;
7377
+ export interface CompletionConfiguration {
7378
+ readonly [providerId: string]: boolean;
7147
7379
  }
7148
- export interface LanguageServiceDefaults {
7380
+ export interface Options {
7149
7381
  /**
7150
- * Event fired when compiler options or diagnostics options are changed.
7382
+ * If set, comments are tolerated. If set to false, syntax errors will be emitted for comments.
7151
7383
  */
7152
- readonly onDidChange: IEvent<void>;
7384
+ readonly format?: HTMLFormatConfiguration;
7153
7385
  /**
7154
- * Event fired when extra libraries registered with the language service change.
7386
+ * A list of known schemas and/or associations of schemas to file names.
7155
7387
  */
7156
- readonly onDidExtraLibsChange: IEvent<void>;
7157
- readonly workerOptions: WorkerOptions;
7158
- readonly inlayHintsOptions: InlayHintsOptions;
7388
+ readonly suggest?: CompletionConfiguration;
7159
7389
  /**
7160
- * Get the current extra libs registered with the language service.
7390
+ * Configures the HTML data types known by the HTML langauge service.
7161
7391
  */
7162
- getExtraLibs(): IExtraLibs;
7392
+ readonly data?: HTMLDataConfiguration;
7393
+ }
7394
+ export interface ModeConfiguration {
7163
7395
  /**
7164
- * Add an additional source file to the language service. Use this
7165
- * for typescript (definition) files that won't be loaded as editor
7166
- * documents, like `jquery.d.ts`.
7167
- *
7168
- * @param content The file content
7169
- * @param filePath An optional file path
7170
- * @returns A disposable which will remove the file from the
7171
- * language service upon disposal.
7396
+ * Defines whether the built-in completionItemProvider is enabled.
7172
7397
  */
7173
- addExtraLib(content: string, filePath?: string): IDisposable;
7398
+ readonly completionItems?: boolean;
7174
7399
  /**
7175
- * Remove all existing extra libs and set the additional source
7176
- * files to the language service. Use this for typescript definition
7177
- * files that won't be loaded as editor documents, like `jquery.d.ts`.
7178
- * @param libs An array of entries to register.
7400
+ * Defines whether the built-in hoverProvider is enabled.
7179
7401
  */
7180
- setExtraLibs(libs: {
7181
- content: string;
7182
- filePath?: string;
7183
- }[]): void;
7402
+ readonly hovers?: boolean;
7184
7403
  /**
7185
- * Get current TypeScript compiler options for the language service.
7404
+ * Defines whether the built-in documentSymbolProvider is enabled.
7186
7405
  */
7187
- getCompilerOptions(): CompilerOptions;
7406
+ readonly documentSymbols?: boolean;
7188
7407
  /**
7189
- * Set TypeScript compiler options.
7408
+ * Defines whether the built-in definitions provider is enabled.
7190
7409
  */
7191
- setCompilerOptions(options: CompilerOptions): void;
7410
+ readonly links?: boolean;
7192
7411
  /**
7193
- * Get the current diagnostics options for the language service.
7412
+ * Defines whether the built-in references provider is enabled.
7194
7413
  */
7195
- getDiagnosticsOptions(): DiagnosticsOptions;
7414
+ readonly documentHighlights?: boolean;
7196
7415
  /**
7197
- * Configure whether syntactic and/or semantic validation should
7198
- * be performed
7416
+ * Defines whether the built-in rename provider is enabled.
7199
7417
  */
7200
- setDiagnosticsOptions(options: DiagnosticsOptions): void;
7418
+ readonly rename?: boolean;
7201
7419
  /**
7202
- * Configure webworker options
7420
+ * Defines whether the built-in color provider is enabled.
7203
7421
  */
7204
- setWorkerOptions(options: WorkerOptions): void;
7422
+ readonly colors?: boolean;
7205
7423
  /**
7206
- * No-op.
7424
+ * Defines whether the built-in foldingRange provider is enabled.
7207
7425
  */
7208
- setMaximumWorkerIdleTime(value: number): void;
7426
+ readonly foldingRanges?: boolean;
7209
7427
  /**
7210
- * Configure if all existing models should be eagerly sync'd
7211
- * to the worker on start or restart.
7428
+ * Defines whether the built-in diagnostic provider is enabled.
7212
7429
  */
7213
- setEagerModelSync(value: boolean): void;
7430
+ readonly diagnostics?: boolean;
7214
7431
  /**
7215
- * Get the current setting for whether all existing models should be eagerly sync'd
7216
- * to the worker on start or restart.
7432
+ * Defines whether the built-in selection range provider is enabled.
7217
7433
  */
7218
- getEagerModelSync(): boolean;
7434
+ readonly selectionRanges?: boolean;
7219
7435
  /**
7220
- * Configure inlay hints options.
7436
+ * Defines whether the built-in documentFormattingEdit provider is enabled.
7221
7437
  */
7222
- setInlayHintsOptions(options: InlayHintsOptions): void;
7223
- }
7224
- export interface TypeScriptWorker {
7438
+ readonly documentFormattingEdits?: boolean;
7225
7439
  /**
7226
- * Get diagnostic messages for any syntax issues in the given file.
7440
+ * Defines whether the built-in documentRangeFormattingEdit provider is enabled.
7227
7441
  */
7228
- getSyntacticDiagnostics(fileName: string): Promise<Diagnostic[]>;
7442
+ readonly documentRangeFormattingEdits?: boolean;
7443
+ }
7444
+ export interface LanguageServiceDefaults {
7445
+ readonly languageId: string;
7446
+ readonly modeConfiguration: ModeConfiguration;
7447
+ readonly onDidChange: IEvent<LanguageServiceDefaults>;
7448
+ readonly options: Options;
7449
+ setOptions(options: Options): void;
7450
+ setModeConfiguration(modeConfiguration: ModeConfiguration): void;
7451
+ }
7452
+ export const htmlLanguageService: LanguageServiceRegistration;
7453
+ export const htmlDefaults: LanguageServiceDefaults;
7454
+ export const handlebarLanguageService: LanguageServiceRegistration;
7455
+ export const handlebarDefaults: LanguageServiceDefaults;
7456
+ export const razorLanguageService: LanguageServiceRegistration;
7457
+ export const razorDefaults: LanguageServiceDefaults;
7458
+ export interface LanguageServiceRegistration extends IDisposable {
7459
+ readonly defaults: LanguageServiceDefaults;
7460
+ }
7461
+ /**
7462
+ * Registers a new HTML language service for the languageId.
7463
+ * Note: 'html', 'handlebar' and 'razor' are registered by default.
7464
+ *
7465
+ * Use this method to register additional language ids with a HTML service.
7466
+ * The language server has to be registered before an editor model is opened.
7467
+ */
7468
+ export function registerHTMLLanguageService(languageId: string, options?: Options, modeConfiguration?: ModeConfiguration): LanguageServiceRegistration;
7469
+ export interface HTMLDataConfiguration {
7229
7470
  /**
7230
- * Get diagnostic messages for any semantic issues in the given file.
7471
+ * Defines whether the standard HTML tags and attributes are shown
7231
7472
  */
7232
- getSemanticDiagnostics(fileName: string): Promise<Diagnostic[]>;
7473
+ readonly useDefaultDataProvider?: boolean;
7233
7474
  /**
7234
- * Get diagnostic messages for any suggestions related to the given file.
7475
+ * Provides a set of custom data providers.
7235
7476
  */
7236
- getSuggestionDiagnostics(fileName: string): Promise<Diagnostic[]>;
7477
+ readonly dataProviders?: {
7478
+ [providerId: string]: HTMLDataV1;
7479
+ };
7480
+ }
7481
+ /**
7482
+ * Custom HTML tags attributes and attribute values
7483
+ * https://github.com/microsoft/vscode-html-languageservice/blob/main/docs/customData.md
7484
+ */
7485
+ export interface HTMLDataV1 {
7486
+ readonly version: 1 | 1.1;
7487
+ readonly tags?: ITagData[];
7488
+ readonly globalAttributes?: IAttributeData[];
7489
+ readonly valueSets?: IValueSet[];
7490
+ }
7491
+ export interface IReference {
7492
+ readonly name: string;
7493
+ readonly url: string;
7494
+ }
7495
+ export interface ITagData {
7496
+ readonly name: string;
7497
+ readonly description?: string | MarkupContent;
7498
+ readonly attributes: IAttributeData[];
7499
+ readonly references?: IReference[];
7500
+ }
7501
+ export interface IAttributeData {
7502
+ readonly name: string;
7503
+ readonly description?: string | MarkupContent;
7504
+ readonly valueSet?: string;
7505
+ readonly values?: IValueData[];
7506
+ readonly references?: IReference[];
7507
+ }
7508
+ export interface IValueData {
7509
+ readonly name: string;
7510
+ readonly description?: string | MarkupContent;
7511
+ readonly references?: IReference[];
7512
+ }
7513
+ export interface IValueSet {
7514
+ readonly name: string;
7515
+ readonly values: IValueData[];
7516
+ }
7517
+ export interface MarkupContent {
7518
+ readonly kind: MarkupKind;
7519
+ readonly value: string;
7520
+ }
7521
+ export type MarkupKind = 'plaintext' | 'markdown';
7522
+ }
7523
+
7524
+ /*---------------------------------------------------------------------------------------------
7525
+ * Copyright (c) Microsoft Corporation. All rights reserved.
7526
+ * Licensed under the MIT License. See License.txt in the project root for license information.
7527
+ *--------------------------------------------------------------------------------------------*/
7528
+
7529
+ declare namespace monaco.languages.json {
7530
+ export interface DiagnosticsOptions {
7237
7531
  /**
7238
- * Get the content of a given file.
7532
+ * If set, the validator will be enabled and perform syntax and schema based validation,
7533
+ * unless `DiagnosticsOptions.schemaValidation` is set to `ignore`.
7239
7534
  */
7240
- getScriptText(fileName: string): Promise<string | undefined>;
7535
+ readonly validate?: boolean;
7241
7536
  /**
7242
- * Get diagnostic messages related to the current compiler options.
7243
- * @param fileName Not used
7537
+ * If set, comments are tolerated. If set to false, syntax errors will be emitted for comments.
7538
+ * `DiagnosticsOptions.allowComments` will override this setting.
7244
7539
  */
7245
- getCompilerOptionsDiagnostics(fileName: string): Promise<Diagnostic[]>;
7540
+ readonly allowComments?: boolean;
7246
7541
  /**
7247
- * Get code completions for the given file and position.
7248
- * @returns `Promise<typescript.CompletionInfo | undefined>`
7542
+ * A list of known schemas and/or associations of schemas to file names.
7249
7543
  */
7250
- getCompletionsAtPosition(fileName: string, position: number): Promise<any | undefined>;
7544
+ readonly schemas?: {
7545
+ /**
7546
+ * The URI of the schema, which is also the identifier of the schema.
7547
+ */
7548
+ readonly uri: string;
7549
+ /**
7550
+ * A list of glob patterns that describe for which file URIs the JSON schema will be used.
7551
+ * '*' and '**' wildcards are supported. Exclusion patterns start with '!'.
7552
+ * For example '*.schema.json', 'package.json', '!foo*.schema.json', 'foo/**\/BADRESP.json'.
7553
+ * A match succeeds when there is at least one pattern matching and last matching pattern does not start with '!'.
7554
+ */
7555
+ readonly fileMatch?: string[];
7556
+ /**
7557
+ * The schema for the given URI.
7558
+ */
7559
+ readonly schema?: any;
7560
+ }[];
7251
7561
  /**
7252
- * Get code completion details for the given file, position, and entry.
7253
- * @returns `Promise<typescript.CompletionEntryDetails | undefined>`
7562
+ * If set, the schema service would load schema content on-demand with 'fetch' if available
7254
7563
  */
7255
- getCompletionEntryDetails(fileName: string, position: number, entry: string): Promise<any | undefined>;
7564
+ readonly enableSchemaRequest?: boolean;
7256
7565
  /**
7257
- * Get signature help items for the item at the given file and position.
7258
- * @returns `Promise<typescript.SignatureHelpItems | undefined>`
7566
+ * The severity of problems from schema validation. If set to 'ignore', schema validation will be skipped. If not set, 'warning' is used.
7259
7567
  */
7260
- getSignatureHelpItems(fileName: string, position: number, options: any): Promise<any | undefined>;
7568
+ readonly schemaValidation?: SeverityLevel;
7261
7569
  /**
7262
- * Get quick info for the item at the given position in the file.
7263
- * @returns `Promise<typescript.QuickInfo | undefined>`
7570
+ * 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.
7264
7571
  */
7265
- getQuickInfoAtPosition(fileName: string, position: number): Promise<any | undefined>;
7572
+ readonly schemaRequest?: SeverityLevel;
7266
7573
  /**
7267
- * Get other ranges which are related to the item at the given position in the file (often used for highlighting).
7268
- * @returns `Promise<ReadonlyArray<typescript.ReferenceEntry> | undefined>`
7574
+ * The severity of reported trailing commas. If not set, trailing commas will be reported as errors.
7269
7575
  */
7270
- getOccurrencesAtPosition(fileName: string, position: number): Promise<ReadonlyArray<any> | undefined>;
7576
+ readonly trailingCommas?: SeverityLevel;
7271
7577
  /**
7272
- * Get the definition of the item at the given position in the file.
7273
- * @returns `Promise<ReadonlyArray<typescript.DefinitionInfo> | undefined>`
7578
+ * The severity of reported comments. If not set, 'DiagnosticsOptions.allowComments' defines whether comments are ignored or reported as errors.
7274
7579
  */
7275
- getDefinitionAtPosition(fileName: string, position: number): Promise<ReadonlyArray<any> | undefined>;
7580
+ readonly comments?: SeverityLevel;
7581
+ }
7582
+ export type SeverityLevel = 'error' | 'warning' | 'ignore';
7583
+ export interface ModeConfiguration {
7276
7584
  /**
7277
- * Get references to the item at the given position in the file.
7278
- * @returns `Promise<typescript.ReferenceEntry[] | undefined>`
7585
+ * Defines whether the built-in documentFormattingEdit provider is enabled.
7279
7586
  */
7280
- getReferencesAtPosition(fileName: string, position: number): Promise<any[] | undefined>;
7587
+ readonly documentFormattingEdits?: boolean;
7281
7588
  /**
7282
- * Get outline entries for the item at the given position in the file.
7283
- * @returns `Promise<typescript.NavigationBarItem[]>`
7589
+ * Defines whether the built-in documentRangeFormattingEdit provider is enabled.
7284
7590
  */
7285
- getNavigationBarItems(fileName: string): Promise<any[]>;
7591
+ readonly documentRangeFormattingEdits?: boolean;
7286
7592
  /**
7287
- * Get changes which should be applied to format the given file.
7288
- * @param options `typescript.FormatCodeOptions`
7289
- * @returns `Promise<typescript.TextChange[]>`
7593
+ * Defines whether the built-in completionItemProvider is enabled.
7290
7594
  */
7291
- getFormattingEditsForDocument(fileName: string, options: any): Promise<any[]>;
7595
+ readonly completionItems?: boolean;
7292
7596
  /**
7293
- * Get changes which should be applied to format the given range in the file.
7294
- * @param options `typescript.FormatCodeOptions`
7295
- * @returns `Promise<typescript.TextChange[]>`
7597
+ * Defines whether the built-in hoverProvider is enabled.
7296
7598
  */
7297
- getFormattingEditsForRange(fileName: string, start: number, end: number, options: any): Promise<any[]>;
7599
+ readonly hovers?: boolean;
7298
7600
  /**
7299
- * Get formatting changes which should be applied after the given keystroke.
7300
- * @param options `typescript.FormatCodeOptions`
7301
- * @returns `Promise<typescript.TextChange[]>`
7601
+ * Defines whether the built-in documentSymbolProvider is enabled.
7302
7602
  */
7303
- getFormattingEditsAfterKeystroke(fileName: string, postion: number, ch: string, options: any): Promise<any[]>;
7603
+ readonly documentSymbols?: boolean;
7304
7604
  /**
7305
- * Get other occurrences which should be updated when renaming the item at the given file and position.
7306
- * @returns `Promise<readonly typescript.RenameLocation[] | undefined>`
7605
+ * Defines whether the built-in tokens provider is enabled.
7307
7606
  */
7308
- findRenameLocations(fileName: string, positon: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename: boolean): Promise<readonly any[] | undefined>;
7607
+ readonly tokens?: boolean;
7309
7608
  /**
7310
- * Get edits which should be applied to rename the item at the given file and position (or a failure reason).
7311
- * @param options `typescript.RenameInfoOptions`
7312
- * @returns `Promise<typescript.RenameInfo>`
7609
+ * Defines whether the built-in color provider is enabled.
7313
7610
  */
7314
- getRenameInfo(fileName: string, positon: number, options: any): Promise<any>;
7611
+ readonly colors?: boolean;
7315
7612
  /**
7316
- * Get transpiled output for the given file.
7317
- * @returns `typescript.EmitOutput`
7613
+ * Defines whether the built-in foldingRange provider is enabled.
7318
7614
  */
7319
- getEmitOutput(fileName: string): Promise<EmitOutput>;
7615
+ readonly foldingRanges?: boolean;
7320
7616
  /**
7321
- * Get possible code fixes at the given position in the file.
7322
- * @param formatOptions `typescript.FormatCodeOptions`
7323
- * @returns `Promise<ReadonlyArray<typescript.CodeFixAction>>`
7617
+ * Defines whether the built-in diagnostic provider is enabled.
7324
7618
  */
7325
- getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: any): Promise<ReadonlyArray<any>>;
7619
+ readonly diagnostics?: boolean;
7326
7620
  /**
7327
- * Get inlay hints in the range of the file.
7328
- * @param fileName
7329
- * @returns `Promise<typescript.InlayHint[]>`
7621
+ * Defines whether the built-in selection range provider is enabled.
7330
7622
  */
7331
- provideInlayHints(fileName: string, start: number, end: number): Promise<ReadonlyArray<any>>;
7623
+ readonly selectionRanges?: boolean;
7332
7624
  }
7333
- export const typescriptVersion: string;
7334
- export const typescriptDefaults: LanguageServiceDefaults;
7335
- export const javascriptDefaults: LanguageServiceDefaults;
7336
- export const getTypeScriptWorker: () => Promise<(...uris: Uri[]) => Promise<TypeScriptWorker>>;
7337
- export const getJavaScriptWorker: () => Promise<(...uris: Uri[]) => Promise<TypeScriptWorker>>;
7625
+ export interface LanguageServiceDefaults {
7626
+ readonly languageId: string;
7627
+ readonly onDidChange: IEvent<LanguageServiceDefaults>;
7628
+ readonly diagnosticsOptions: DiagnosticsOptions;
7629
+ readonly modeConfiguration: ModeConfiguration;
7630
+ setDiagnosticsOptions(options: DiagnosticsOptions): void;
7631
+ setModeConfiguration(modeConfiguration: ModeConfiguration): void;
7632
+ }
7633
+ export const jsonDefaults: LanguageServiceDefaults;
7338
7634
  }
7339
7635
 
7340
7636
  /*---------------------------------------------------------------------------------------------
@@ -7342,446 +7638,390 @@ declare namespace monaco.languages.typescript {
7342
7638
  * Licensed under the MIT License. See License.txt in the project root for license information.
7343
7639
  *--------------------------------------------------------------------------------------------*/
7344
7640
 
7345
- declare namespace monaco.languages.css {
7346
- export interface Options {
7347
- readonly validate?: boolean;
7348
- readonly lint?: {
7349
- readonly compatibleVendorPrefixes?: 'ignore' | 'warning' | 'error';
7350
- readonly vendorPrefix?: 'ignore' | 'warning' | 'error';
7351
- readonly duplicateProperties?: 'ignore' | 'warning' | 'error';
7352
- readonly emptyRules?: 'ignore' | 'warning' | 'error';
7353
- readonly importStatement?: 'ignore' | 'warning' | 'error';
7354
- readonly boxModel?: 'ignore' | 'warning' | 'error';
7355
- readonly universalSelector?: 'ignore' | 'warning' | 'error';
7356
- readonly zeroUnits?: 'ignore' | 'warning' | 'error';
7357
- readonly fontFaceProperties?: 'ignore' | 'warning' | 'error';
7358
- readonly hexColorLength?: 'ignore' | 'warning' | 'error';
7359
- readonly argumentsInColorFunction?: 'ignore' | 'warning' | 'error';
7360
- readonly unknownProperties?: 'ignore' | 'warning' | 'error';
7361
- readonly ieHack?: 'ignore' | 'warning' | 'error';
7362
- readonly unknownVendorSpecificProperties?: 'ignore' | 'warning' | 'error';
7363
- readonly propertyIgnoredDueToDisplay?: 'ignore' | 'warning' | 'error';
7364
- readonly important?: 'ignore' | 'warning' | 'error';
7365
- readonly float?: 'ignore' | 'warning' | 'error';
7366
- readonly idSelector?: 'ignore' | 'warning' | 'error';
7367
- };
7368
- /**
7369
- * Configures the CSS data types known by the langauge service.
7370
- */
7371
- readonly data?: CSSDataConfiguration;
7641
+ declare namespace monaco.languages.typescript {
7642
+ export enum ModuleKind {
7643
+ None = 0,
7644
+ CommonJS = 1,
7645
+ AMD = 2,
7646
+ UMD = 3,
7647
+ System = 4,
7648
+ ES2015 = 5,
7649
+ ESNext = 99
7650
+ }
7651
+ export enum JsxEmit {
7652
+ None = 0,
7653
+ Preserve = 1,
7654
+ React = 2,
7655
+ ReactNative = 3,
7656
+ ReactJSX = 4,
7657
+ ReactJSXDev = 5
7658
+ }
7659
+ export enum NewLineKind {
7660
+ CarriageReturnLineFeed = 0,
7661
+ LineFeed = 1
7662
+ }
7663
+ export enum ScriptTarget {
7664
+ ES3 = 0,
7665
+ ES5 = 1,
7666
+ ES2015 = 2,
7667
+ ES2016 = 3,
7668
+ ES2017 = 4,
7669
+ ES2018 = 5,
7670
+ ES2019 = 6,
7671
+ ES2020 = 7,
7672
+ ESNext = 99,
7673
+ JSON = 100,
7674
+ Latest = 99
7675
+ }
7676
+ export enum ModuleResolutionKind {
7677
+ Classic = 1,
7678
+ NodeJs = 2
7679
+ }
7680
+ interface MapLike<T> {
7681
+ [index: string]: T;
7682
+ }
7683
+ type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string[]> | null | undefined;
7684
+ interface CompilerOptions {
7685
+ allowJs?: boolean;
7686
+ allowSyntheticDefaultImports?: boolean;
7687
+ allowUmdGlobalAccess?: boolean;
7688
+ allowUnreachableCode?: boolean;
7689
+ allowUnusedLabels?: boolean;
7690
+ alwaysStrict?: boolean;
7691
+ baseUrl?: string;
7692
+ charset?: string;
7693
+ checkJs?: boolean;
7694
+ declaration?: boolean;
7695
+ declarationMap?: boolean;
7696
+ emitDeclarationOnly?: boolean;
7697
+ declarationDir?: string;
7698
+ disableSizeLimit?: boolean;
7699
+ disableSourceOfProjectReferenceRedirect?: boolean;
7700
+ downlevelIteration?: boolean;
7701
+ emitBOM?: boolean;
7702
+ emitDecoratorMetadata?: boolean;
7703
+ experimentalDecorators?: boolean;
7704
+ forceConsistentCasingInFileNames?: boolean;
7705
+ importHelpers?: boolean;
7706
+ inlineSourceMap?: boolean;
7707
+ inlineSources?: boolean;
7708
+ isolatedModules?: boolean;
7709
+ jsx?: JsxEmit;
7710
+ keyofStringsOnly?: boolean;
7711
+ lib?: string[];
7712
+ locale?: string;
7713
+ mapRoot?: string;
7714
+ maxNodeModuleJsDepth?: number;
7715
+ module?: ModuleKind;
7716
+ moduleResolution?: ModuleResolutionKind;
7717
+ newLine?: NewLineKind;
7718
+ noEmit?: boolean;
7719
+ noEmitHelpers?: boolean;
7720
+ noEmitOnError?: boolean;
7721
+ noErrorTruncation?: boolean;
7722
+ noFallthroughCasesInSwitch?: boolean;
7723
+ noImplicitAny?: boolean;
7724
+ noImplicitReturns?: boolean;
7725
+ noImplicitThis?: boolean;
7726
+ noStrictGenericChecks?: boolean;
7727
+ noUnusedLocals?: boolean;
7728
+ noUnusedParameters?: boolean;
7729
+ noImplicitUseStrict?: boolean;
7730
+ noLib?: boolean;
7731
+ noResolve?: boolean;
7732
+ out?: string;
7733
+ outDir?: string;
7734
+ outFile?: string;
7735
+ paths?: MapLike<string[]>;
7736
+ preserveConstEnums?: boolean;
7737
+ preserveSymlinks?: boolean;
7738
+ project?: string;
7739
+ reactNamespace?: string;
7740
+ jsxFactory?: string;
7741
+ composite?: boolean;
7742
+ removeComments?: boolean;
7743
+ rootDir?: string;
7744
+ rootDirs?: string[];
7745
+ skipLibCheck?: boolean;
7746
+ skipDefaultLibCheck?: boolean;
7747
+ sourceMap?: boolean;
7748
+ sourceRoot?: string;
7749
+ strict?: boolean;
7750
+ strictFunctionTypes?: boolean;
7751
+ strictBindCallApply?: boolean;
7752
+ strictNullChecks?: boolean;
7753
+ strictPropertyInitialization?: boolean;
7754
+ stripInternal?: boolean;
7755
+ suppressExcessPropertyErrors?: boolean;
7756
+ suppressImplicitAnyIndexErrors?: boolean;
7757
+ target?: ScriptTarget;
7758
+ traceResolution?: boolean;
7759
+ resolveJsonModule?: boolean;
7760
+ types?: string[];
7761
+ /** Paths used to compute primary types search locations */
7762
+ typeRoots?: string[];
7763
+ esModuleInterop?: boolean;
7764
+ useDefineForClassFields?: boolean;
7765
+ [option: string]: CompilerOptionsValue | undefined;
7372
7766
  }
7373
- export interface ModeConfiguration {
7374
- /**
7375
- * Defines whether the built-in completionItemProvider is enabled.
7376
- */
7377
- readonly completionItems?: boolean;
7378
- /**
7379
- * Defines whether the built-in hoverProvider is enabled.
7380
- */
7381
- readonly hovers?: boolean;
7382
- /**
7383
- * Defines whether the built-in documentSymbolProvider is enabled.
7384
- */
7385
- readonly documentSymbols?: boolean;
7386
- /**
7387
- * Defines whether the built-in definitions provider is enabled.
7388
- */
7389
- readonly definitions?: boolean;
7390
- /**
7391
- * Defines whether the built-in references provider is enabled.
7392
- */
7393
- readonly references?: boolean;
7394
- /**
7395
- * Defines whether the built-in references provider is enabled.
7396
- */
7397
- readonly documentHighlights?: boolean;
7398
- /**
7399
- * Defines whether the built-in rename provider is enabled.
7400
- */
7401
- readonly rename?: boolean;
7402
- /**
7403
- * Defines whether the built-in color provider is enabled.
7404
- */
7405
- readonly colors?: boolean;
7406
- /**
7407
- * Defines whether the built-in foldingRange provider is enabled.
7408
- */
7409
- readonly foldingRanges?: boolean;
7410
- /**
7411
- * Defines whether the built-in diagnostic provider is enabled.
7412
- */
7413
- readonly diagnostics?: boolean;
7767
+ export interface DiagnosticsOptions {
7768
+ noSemanticValidation?: boolean;
7769
+ noSyntaxValidation?: boolean;
7770
+ noSuggestionDiagnostics?: boolean;
7414
7771
  /**
7415
- * Defines whether the built-in selection range provider is enabled.
7772
+ * Limit diagnostic computation to only visible files.
7773
+ * Defaults to false.
7416
7774
  */
7417
- readonly selectionRanges?: boolean;
7775
+ onlyVisible?: boolean;
7776
+ diagnosticCodesToIgnore?: number[];
7418
7777
  }
7419
- export interface LanguageServiceDefaults {
7420
- readonly languageId: string;
7421
- readonly onDidChange: IEvent<LanguageServiceDefaults>;
7422
- readonly modeConfiguration: ModeConfiguration;
7423
- readonly options: Options;
7424
- setOptions(options: Options): void;
7425
- setModeConfiguration(modeConfiguration: ModeConfiguration): void;
7426
- /** @deprecated Use options instead */
7427
- readonly diagnosticsOptions: DiagnosticsOptions;
7428
- /** @deprecated Use setOptions instead */
7429
- setDiagnosticsOptions(options: DiagnosticsOptions): void;
7778
+ export interface WorkerOptions {
7779
+ /** A full HTTP path to a JavaScript file which adds a function `customTSWorkerFactory` to the self inside a web-worker */
7780
+ customWorkerPath?: string;
7430
7781
  }
7431
- /** @deprecated Use Options instead */
7432
- export type DiagnosticsOptions = Options;
7433
- export const cssDefaults: LanguageServiceDefaults;
7434
- export const scssDefaults: LanguageServiceDefaults;
7435
- export const lessDefaults: LanguageServiceDefaults;
7436
- export interface CSSDataConfiguration {
7437
- /**
7438
- * Defines whether the standard CSS properties, at-directives, pseudoClasses and pseudoElements are shown.
7439
- */
7440
- useDefaultDataProvider?: boolean;
7441
- /**
7442
- * Provides a set of custom data providers.
7443
- */
7444
- dataProviders?: {
7445
- [providerId: string]: CSSDataV1;
7446
- };
7782
+ interface InlayHintsOptions {
7783
+ readonly includeInlayParameterNameHints?: 'none' | 'literals' | 'all';
7784
+ readonly includeInlayParameterNameHintsWhenArgumentMatchesName?: boolean;
7785
+ readonly includeInlayFunctionParameterTypeHints?: boolean;
7786
+ readonly includeInlayVariableTypeHints?: boolean;
7787
+ readonly includeInlayPropertyDeclarationTypeHints?: boolean;
7788
+ readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
7789
+ readonly includeInlayEnumMemberValueHints?: boolean;
7447
7790
  }
7448
- /**
7449
- * Custom CSS properties, at-directives, pseudoClasses and pseudoElements
7450
- * https://github.com/microsoft/vscode-css-languageservice/blob/main/docs/customData.md
7451
- */
7452
- export interface CSSDataV1 {
7453
- version: 1 | 1.1;
7454
- properties?: IPropertyData[];
7455
- atDirectives?: IAtDirectiveData[];
7456
- pseudoClasses?: IPseudoClassData[];
7457
- pseudoElements?: IPseudoElementData[];
7791
+ interface IExtraLib {
7792
+ content: string;
7793
+ version: number;
7458
7794
  }
7459
- export type EntryStatus = 'standard' | 'experimental' | 'nonstandard' | 'obsolete';
7460
- export interface IReference {
7461
- name: string;
7462
- url: string;
7795
+ export interface IExtraLibs {
7796
+ [path: string]: IExtraLib;
7463
7797
  }
7464
- export interface IPropertyData {
7465
- name: string;
7466
- description?: string | MarkupContent;
7467
- browsers?: string[];
7468
- restrictions?: string[];
7469
- status?: EntryStatus;
7470
- syntax?: string;
7471
- values?: IValueData[];
7472
- references?: IReference[];
7473
- relevance?: number;
7798
+ /**
7799
+ * A linked list of formatted diagnostic messages to be used as part of a multiline message.
7800
+ * It is built from the bottom up, leaving the head to be the "main" diagnostic.
7801
+ */
7802
+ interface DiagnosticMessageChain {
7803
+ messageText: string;
7804
+ /** Diagnostic category: warning = 0, error = 1, suggestion = 2, message = 3 */
7805
+ category: 0 | 1 | 2 | 3;
7806
+ code: number;
7807
+ next?: DiagnosticMessageChain[];
7474
7808
  }
7475
- export interface IAtDirectiveData {
7476
- name: string;
7477
- description?: string | MarkupContent;
7478
- browsers?: string[];
7479
- status?: EntryStatus;
7480
- references?: IReference[];
7809
+ export interface Diagnostic extends DiagnosticRelatedInformation {
7810
+ /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
7811
+ reportsUnnecessary?: {};
7812
+ reportsDeprecated?: {};
7813
+ source?: string;
7814
+ relatedInformation?: DiagnosticRelatedInformation[];
7481
7815
  }
7482
- export interface IPseudoClassData {
7483
- name: string;
7484
- description?: string | MarkupContent;
7485
- browsers?: string[];
7486
- status?: EntryStatus;
7487
- references?: IReference[];
7816
+ export interface DiagnosticRelatedInformation {
7817
+ /** Diagnostic category: warning = 0, error = 1, suggestion = 2, message = 3 */
7818
+ category: 0 | 1 | 2 | 3;
7819
+ code: number;
7820
+ /** TypeScriptWorker removes all but the `fileName` property to avoid serializing circular JSON structures. */
7821
+ file: {
7822
+ fileName: string;
7823
+ } | undefined;
7824
+ start: number | undefined;
7825
+ length: number | undefined;
7826
+ messageText: string | DiagnosticMessageChain;
7488
7827
  }
7489
- export interface IPseudoElementData {
7490
- name: string;
7491
- description?: string | MarkupContent;
7492
- browsers?: string[];
7493
- status?: EntryStatus;
7494
- references?: IReference[];
7828
+ interface EmitOutput {
7829
+ outputFiles: OutputFile[];
7830
+ emitSkipped: boolean;
7495
7831
  }
7496
- export interface IValueData {
7832
+ interface OutputFile {
7497
7833
  name: string;
7498
- description?: string | MarkupContent;
7499
- browsers?: string[];
7500
- status?: EntryStatus;
7501
- references?: IReference[];
7502
- }
7503
- export interface MarkupContent {
7504
- kind: MarkupKind;
7505
- value: string;
7834
+ writeByteOrderMark: boolean;
7835
+ text: string;
7506
7836
  }
7507
- export type MarkupKind = 'plaintext' | 'markdown';
7508
- }
7509
-
7510
- /*---------------------------------------------------------------------------------------------
7511
- * Copyright (c) Microsoft Corporation. All rights reserved.
7512
- * Licensed under the MIT License. See License.txt in the project root for license information.
7513
- *--------------------------------------------------------------------------------------------*/
7514
-
7515
- declare namespace monaco.languages.json {
7516
- export interface DiagnosticsOptions {
7837
+ export interface LanguageServiceDefaults {
7517
7838
  /**
7518
- * If set, the validator will be enabled and perform syntax and schema based validation,
7519
- * unless `DiagnosticsOptions.schemaValidation` is set to `ignore`.
7839
+ * Event fired when compiler options or diagnostics options are changed.
7520
7840
  */
7521
- readonly validate?: boolean;
7841
+ readonly onDidChange: IEvent<void>;
7522
7842
  /**
7523
- * If set, comments are tolerated. If set to false, syntax errors will be emitted for comments.
7524
- * `DiagnosticsOptions.allowComments` will override this setting.
7843
+ * Event fired when extra libraries registered with the language service change.
7525
7844
  */
7526
- readonly allowComments?: boolean;
7845
+ readonly onDidExtraLibsChange: IEvent<void>;
7846
+ readonly workerOptions: WorkerOptions;
7847
+ readonly inlayHintsOptions: InlayHintsOptions;
7527
7848
  /**
7528
- * A list of known schemas and/or associations of schemas to file names.
7849
+ * Get the current extra libs registered with the language service.
7529
7850
  */
7530
- readonly schemas?: {
7531
- /**
7532
- * The URI of the schema, which is also the identifier of the schema.
7533
- */
7534
- readonly uri: string;
7535
- /**
7536
- * A list of glob patterns that describe for which file URIs the JSON schema will be used.
7537
- * '*' and '**' wildcards are supported. Exclusion patterns start with '!'.
7538
- * For example '*.schema.json', 'package.json', '!foo*.schema.json', 'foo/**\/BADRESP.json'.
7539
- * A match succeeds when there is at least one pattern matching and last matching pattern does not start with '!'.
7540
- */
7541
- readonly fileMatch?: string[];
7542
- /**
7543
- * The schema for the given URI.
7544
- */
7545
- readonly schema?: any;
7546
- }[];
7851
+ getExtraLibs(): IExtraLibs;
7547
7852
  /**
7548
- * If set, the schema service would load schema content on-demand with 'fetch' if available
7853
+ * Add an additional source file to the language service. Use this
7854
+ * for typescript (definition) files that won't be loaded as editor
7855
+ * documents, like `jquery.d.ts`.
7856
+ *
7857
+ * @param content The file content
7858
+ * @param filePath An optional file path
7859
+ * @returns A disposable which will remove the file from the
7860
+ * language service upon disposal.
7549
7861
  */
7550
- readonly enableSchemaRequest?: boolean;
7862
+ addExtraLib(content: string, filePath?: string): IDisposable;
7551
7863
  /**
7552
- * The severity of problems from schema validation. If set to 'ignore', schema validation will be skipped. If not set, 'warning' is used.
7864
+ * Remove all existing extra libs and set the additional source
7865
+ * files to the language service. Use this for typescript definition
7866
+ * files that won't be loaded as editor documents, like `jquery.d.ts`.
7867
+ * @param libs An array of entries to register.
7553
7868
  */
7554
- readonly schemaValidation?: SeverityLevel;
7869
+ setExtraLibs(libs: {
7870
+ content: string;
7871
+ filePath?: string;
7872
+ }[]): void;
7555
7873
  /**
7556
- * 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.
7874
+ * Get current TypeScript compiler options for the language service.
7557
7875
  */
7558
- readonly schemaRequest?: SeverityLevel;
7876
+ getCompilerOptions(): CompilerOptions;
7559
7877
  /**
7560
- * The severity of reported trailing commas. If not set, trailing commas will be reported as errors.
7878
+ * Set TypeScript compiler options.
7561
7879
  */
7562
- readonly trailingCommas?: SeverityLevel;
7880
+ setCompilerOptions(options: CompilerOptions): void;
7563
7881
  /**
7564
- * The severity of reported comments. If not set, 'DiagnosticsOptions.allowComments' defines whether comments are ignored or reported as errors.
7882
+ * Get the current diagnostics options for the language service.
7565
7883
  */
7566
- readonly comments?: SeverityLevel;
7567
- }
7568
- export type SeverityLevel = 'error' | 'warning' | 'ignore';
7569
- export interface ModeConfiguration {
7884
+ getDiagnosticsOptions(): DiagnosticsOptions;
7570
7885
  /**
7571
- * Defines whether the built-in documentFormattingEdit provider is enabled.
7886
+ * Configure whether syntactic and/or semantic validation should
7887
+ * be performed
7572
7888
  */
7573
- readonly documentFormattingEdits?: boolean;
7889
+ setDiagnosticsOptions(options: DiagnosticsOptions): void;
7574
7890
  /**
7575
- * Defines whether the built-in documentRangeFormattingEdit provider is enabled.
7891
+ * Configure webworker options
7576
7892
  */
7577
- readonly documentRangeFormattingEdits?: boolean;
7893
+ setWorkerOptions(options: WorkerOptions): void;
7578
7894
  /**
7579
- * Defines whether the built-in completionItemProvider is enabled.
7895
+ * No-op.
7580
7896
  */
7581
- readonly completionItems?: boolean;
7897
+ setMaximumWorkerIdleTime(value: number): void;
7582
7898
  /**
7583
- * Defines whether the built-in hoverProvider is enabled.
7899
+ * Configure if all existing models should be eagerly sync'd
7900
+ * to the worker on start or restart.
7584
7901
  */
7585
- readonly hovers?: boolean;
7902
+ setEagerModelSync(value: boolean): void;
7586
7903
  /**
7587
- * Defines whether the built-in documentSymbolProvider is enabled.
7904
+ * Get the current setting for whether all existing models should be eagerly sync'd
7905
+ * to the worker on start or restart.
7588
7906
  */
7589
- readonly documentSymbols?: boolean;
7907
+ getEagerModelSync(): boolean;
7590
7908
  /**
7591
- * Defines whether the built-in tokens provider is enabled.
7909
+ * Configure inlay hints options.
7592
7910
  */
7593
- readonly tokens?: boolean;
7911
+ setInlayHintsOptions(options: InlayHintsOptions): void;
7912
+ }
7913
+ export interface TypeScriptWorker {
7594
7914
  /**
7595
- * Defines whether the built-in color provider is enabled.
7915
+ * Get diagnostic messages for any syntax issues in the given file.
7596
7916
  */
7597
- readonly colors?: boolean;
7917
+ getSyntacticDiagnostics(fileName: string): Promise<Diagnostic[]>;
7598
7918
  /**
7599
- * Defines whether the built-in foldingRange provider is enabled.
7919
+ * Get diagnostic messages for any semantic issues in the given file.
7600
7920
  */
7601
- readonly foldingRanges?: boolean;
7921
+ getSemanticDiagnostics(fileName: string): Promise<Diagnostic[]>;
7602
7922
  /**
7603
- * Defines whether the built-in diagnostic provider is enabled.
7923
+ * Get diagnostic messages for any suggestions related to the given file.
7604
7924
  */
7605
- readonly diagnostics?: boolean;
7925
+ getSuggestionDiagnostics(fileName: string): Promise<Diagnostic[]>;
7606
7926
  /**
7607
- * Defines whether the built-in selection range provider is enabled.
7927
+ * Get the content of a given file.
7608
7928
  */
7609
- readonly selectionRanges?: boolean;
7610
- }
7611
- export interface LanguageServiceDefaults {
7612
- readonly languageId: string;
7613
- readonly onDidChange: IEvent<LanguageServiceDefaults>;
7614
- readonly diagnosticsOptions: DiagnosticsOptions;
7615
- readonly modeConfiguration: ModeConfiguration;
7616
- setDiagnosticsOptions(options: DiagnosticsOptions): void;
7617
- setModeConfiguration(modeConfiguration: ModeConfiguration): void;
7618
- }
7619
- export const jsonDefaults: LanguageServiceDefaults;
7620
- }
7621
-
7622
- /*---------------------------------------------------------------------------------------------
7623
- * Copyright (c) Microsoft Corporation. All rights reserved.
7624
- * Licensed under the MIT License. See License.txt in the project root for license information.
7625
- *--------------------------------------------------------------------------------------------*/
7626
-
7627
- declare namespace monaco.languages.html {
7628
- export interface HTMLFormatConfiguration {
7629
- readonly tabSize: number;
7630
- readonly insertSpaces: boolean;
7631
- readonly wrapLineLength: number;
7632
- readonly unformatted: string;
7633
- readonly contentUnformatted: string;
7634
- readonly indentInnerHtml: boolean;
7635
- readonly preserveNewLines: boolean;
7636
- readonly maxPreserveNewLines: number | undefined;
7637
- readonly indentHandlebars: boolean;
7638
- readonly endWithNewline: boolean;
7639
- readonly extraLiners: string;
7640
- readonly wrapAttributes: 'auto' | 'force' | 'force-aligned' | 'force-expand-multiline';
7641
- }
7642
- export interface CompletionConfiguration {
7643
- readonly [providerId: string]: boolean;
7644
- }
7645
- export interface Options {
7929
+ getScriptText(fileName: string): Promise<string | undefined>;
7646
7930
  /**
7647
- * If set, comments are tolerated. If set to false, syntax errors will be emitted for comments.
7931
+ * Get diagnostic messages related to the current compiler options.
7932
+ * @param fileName Not used
7648
7933
  */
7649
- readonly format?: HTMLFormatConfiguration;
7934
+ getCompilerOptionsDiagnostics(fileName: string): Promise<Diagnostic[]>;
7650
7935
  /**
7651
- * A list of known schemas and/or associations of schemas to file names.
7936
+ * Get code completions for the given file and position.
7937
+ * @returns `Promise<typescript.CompletionInfo | undefined>`
7652
7938
  */
7653
- readonly suggest?: CompletionConfiguration;
7939
+ getCompletionsAtPosition(fileName: string, position: number): Promise<any | undefined>;
7654
7940
  /**
7655
- * Configures the HTML data types known by the HTML langauge service.
7941
+ * Get code completion details for the given file, position, and entry.
7942
+ * @returns `Promise<typescript.CompletionEntryDetails | undefined>`
7656
7943
  */
7657
- readonly data?: HTMLDataConfiguration;
7658
- }
7659
- export interface ModeConfiguration {
7944
+ getCompletionEntryDetails(fileName: string, position: number, entry: string): Promise<any | undefined>;
7660
7945
  /**
7661
- * Defines whether the built-in completionItemProvider is enabled.
7946
+ * Get signature help items for the item at the given file and position.
7947
+ * @returns `Promise<typescript.SignatureHelpItems | undefined>`
7662
7948
  */
7663
- readonly completionItems?: boolean;
7949
+ getSignatureHelpItems(fileName: string, position: number, options: any): Promise<any | undefined>;
7664
7950
  /**
7665
- * Defines whether the built-in hoverProvider is enabled.
7951
+ * Get quick info for the item at the given position in the file.
7952
+ * @returns `Promise<typescript.QuickInfo | undefined>`
7666
7953
  */
7667
- readonly hovers?: boolean;
7954
+ getQuickInfoAtPosition(fileName: string, position: number): Promise<any | undefined>;
7668
7955
  /**
7669
- * Defines whether the built-in documentSymbolProvider is enabled.
7956
+ * Get other ranges which are related to the item at the given position in the file (often used for highlighting).
7957
+ * @returns `Promise<ReadonlyArray<typescript.ReferenceEntry> | undefined>`
7670
7958
  */
7671
- readonly documentSymbols?: boolean;
7959
+ getOccurrencesAtPosition(fileName: string, position: number): Promise<ReadonlyArray<any> | undefined>;
7672
7960
  /**
7673
- * Defines whether the built-in definitions provider is enabled.
7961
+ * Get the definition of the item at the given position in the file.
7962
+ * @returns `Promise<ReadonlyArray<typescript.DefinitionInfo> | undefined>`
7674
7963
  */
7675
- readonly links?: boolean;
7964
+ getDefinitionAtPosition(fileName: string, position: number): Promise<ReadonlyArray<any> | undefined>;
7676
7965
  /**
7677
- * Defines whether the built-in references provider is enabled.
7966
+ * Get references to the item at the given position in the file.
7967
+ * @returns `Promise<typescript.ReferenceEntry[] | undefined>`
7678
7968
  */
7679
- readonly documentHighlights?: boolean;
7969
+ getReferencesAtPosition(fileName: string, position: number): Promise<any[] | undefined>;
7680
7970
  /**
7681
- * Defines whether the built-in rename provider is enabled.
7971
+ * Get outline entries for the item at the given position in the file.
7972
+ * @returns `Promise<typescript.NavigationBarItem[]>`
7682
7973
  */
7683
- readonly rename?: boolean;
7974
+ getNavigationBarItems(fileName: string): Promise<any[]>;
7684
7975
  /**
7685
- * Defines whether the built-in color provider is enabled.
7976
+ * Get changes which should be applied to format the given file.
7977
+ * @param options `typescript.FormatCodeOptions`
7978
+ * @returns `Promise<typescript.TextChange[]>`
7686
7979
  */
7687
- readonly colors?: boolean;
7980
+ getFormattingEditsForDocument(fileName: string, options: any): Promise<any[]>;
7688
7981
  /**
7689
- * Defines whether the built-in foldingRange provider is enabled.
7982
+ * Get changes which should be applied to format the given range in the file.
7983
+ * @param options `typescript.FormatCodeOptions`
7984
+ * @returns `Promise<typescript.TextChange[]>`
7690
7985
  */
7691
- readonly foldingRanges?: boolean;
7986
+ getFormattingEditsForRange(fileName: string, start: number, end: number, options: any): Promise<any[]>;
7692
7987
  /**
7693
- * Defines whether the built-in diagnostic provider is enabled.
7988
+ * Get formatting changes which should be applied after the given keystroke.
7989
+ * @param options `typescript.FormatCodeOptions`
7990
+ * @returns `Promise<typescript.TextChange[]>`
7694
7991
  */
7695
- readonly diagnostics?: boolean;
7992
+ getFormattingEditsAfterKeystroke(fileName: string, postion: number, ch: string, options: any): Promise<any[]>;
7696
7993
  /**
7697
- * Defines whether the built-in selection range provider is enabled.
7994
+ * Get other occurrences which should be updated when renaming the item at the given file and position.
7995
+ * @returns `Promise<readonly typescript.RenameLocation[] | undefined>`
7698
7996
  */
7699
- readonly selectionRanges?: boolean;
7997
+ findRenameLocations(fileName: string, positon: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename: boolean): Promise<readonly any[] | undefined>;
7700
7998
  /**
7701
- * Defines whether the built-in documentFormattingEdit provider is enabled.
7999
+ * Get edits which should be applied to rename the item at the given file and position (or a failure reason).
8000
+ * @param options `typescript.RenameInfoOptions`
8001
+ * @returns `Promise<typescript.RenameInfo>`
7702
8002
  */
7703
- readonly documentFormattingEdits?: boolean;
8003
+ getRenameInfo(fileName: string, positon: number, options: any): Promise<any>;
7704
8004
  /**
7705
- * Defines whether the built-in documentRangeFormattingEdit provider is enabled.
8005
+ * Get transpiled output for the given file.
8006
+ * @returns `typescript.EmitOutput`
7706
8007
  */
7707
- readonly documentRangeFormattingEdits?: boolean;
7708
- }
7709
- export interface LanguageServiceDefaults {
7710
- readonly languageId: string;
7711
- readonly modeConfiguration: ModeConfiguration;
7712
- readonly onDidChange: IEvent<LanguageServiceDefaults>;
7713
- readonly options: Options;
7714
- setOptions(options: Options): void;
7715
- setModeConfiguration(modeConfiguration: ModeConfiguration): void;
7716
- }
7717
- export const htmlLanguageService: LanguageServiceRegistration;
7718
- export const htmlDefaults: LanguageServiceDefaults;
7719
- export const handlebarLanguageService: LanguageServiceRegistration;
7720
- export const handlebarDefaults: LanguageServiceDefaults;
7721
- export const razorLanguageService: LanguageServiceRegistration;
7722
- export const razorDefaults: LanguageServiceDefaults;
7723
- export interface LanguageServiceRegistration extends IDisposable {
7724
- readonly defaults: LanguageServiceDefaults;
7725
- }
7726
- /**
7727
- * Registers a new HTML language service for the languageId.
7728
- * Note: 'html', 'handlebar' and 'razor' are registered by default.
7729
- *
7730
- * Use this method to register additional language ids with a HTML service.
7731
- * The language server has to be registered before an editor model is opened.
7732
- */
7733
- export function registerHTMLLanguageService(languageId: string, options?: Options, modeConfiguration?: ModeConfiguration): LanguageServiceRegistration;
7734
- export interface HTMLDataConfiguration {
8008
+ getEmitOutput(fileName: string): Promise<EmitOutput>;
7735
8009
  /**
7736
- * Defines whether the standard HTML tags and attributes are shown
8010
+ * Get possible code fixes at the given position in the file.
8011
+ * @param formatOptions `typescript.FormatCodeOptions`
8012
+ * @returns `Promise<ReadonlyArray<typescript.CodeFixAction>>`
7737
8013
  */
7738
- readonly useDefaultDataProvider?: boolean;
8014
+ getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: any): Promise<ReadonlyArray<any>>;
7739
8015
  /**
7740
- * Provides a set of custom data providers.
8016
+ * Get inlay hints in the range of the file.
8017
+ * @param fileName
8018
+ * @returns `Promise<typescript.InlayHint[]>`
7741
8019
  */
7742
- readonly dataProviders?: {
7743
- [providerId: string]: HTMLDataV1;
7744
- };
7745
- }
7746
- /**
7747
- * Custom HTML tags attributes and attribute values
7748
- * https://github.com/microsoft/vscode-html-languageservice/blob/main/docs/customData.md
7749
- */
7750
- export interface HTMLDataV1 {
7751
- readonly version: 1 | 1.1;
7752
- readonly tags?: ITagData[];
7753
- readonly globalAttributes?: IAttributeData[];
7754
- readonly valueSets?: IValueSet[];
7755
- }
7756
- export interface IReference {
7757
- readonly name: string;
7758
- readonly url: string;
7759
- }
7760
- export interface ITagData {
7761
- readonly name: string;
7762
- readonly description?: string | MarkupContent;
7763
- readonly attributes: IAttributeData[];
7764
- readonly references?: IReference[];
7765
- }
7766
- export interface IAttributeData {
7767
- readonly name: string;
7768
- readonly description?: string | MarkupContent;
7769
- readonly valueSet?: string;
7770
- readonly values?: IValueData[];
7771
- readonly references?: IReference[];
7772
- }
7773
- export interface IValueData {
7774
- readonly name: string;
7775
- readonly description?: string | MarkupContent;
7776
- readonly references?: IReference[];
7777
- }
7778
- export interface IValueSet {
7779
- readonly name: string;
7780
- readonly values: IValueData[];
7781
- }
7782
- export interface MarkupContent {
7783
- readonly kind: MarkupKind;
7784
- readonly value: string;
8020
+ provideInlayHints(fileName: string, start: number, end: number): Promise<ReadonlyArray<any>>;
7785
8021
  }
7786
- export type MarkupKind = 'plaintext' | 'markdown';
8022
+ export const typescriptVersion: string;
8023
+ export const typescriptDefaults: LanguageServiceDefaults;
8024
+ export const javascriptDefaults: LanguageServiceDefaults;
8025
+ export const getTypeScriptWorker: () => Promise<(...uris: Uri[]) => Promise<TypeScriptWorker>>;
8026
+ export const getJavaScriptWorker: () => Promise<(...uris: Uri[]) => Promise<TypeScriptWorker>>;
7787
8027
  }