@ng-util/monaco-editor 17.0.1 → 18.0.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
@@ -626,6 +626,7 @@ declare namespace monaco {
626
626
  * Test if `obj` is an `IPosition`.
627
627
  */
628
628
  static isIPosition(obj: any): obj is IPosition;
629
+ toJSON(): IPosition;
629
630
  }
630
631
 
631
632
  /**
@@ -979,6 +980,8 @@ declare namespace monaco.editor {
979
980
  */
980
981
  export function createDiffEditor(domElement: HTMLElement, options?: IStandaloneDiffEditorConstructionOptions, override?: IEditorOverrideServices): IStandaloneDiffEditor;
981
982
 
983
+ export function createMultiFileDiffEditor(domElement: HTMLElement, override?: IEditorOverrideServices): any;
984
+
982
985
  /**
983
986
  * Description of a command contribution
984
987
  */
@@ -1253,7 +1256,7 @@ declare namespace monaco.editor {
1253
1256
  */
1254
1257
  label: string;
1255
1258
  /**
1256
- * Precondition rule.
1259
+ * Precondition rule. The value should be a [context key expression](https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts).
1257
1260
  */
1258
1261
  precondition?: string;
1259
1262
  /**
@@ -1320,7 +1323,7 @@ declare namespace monaco.editor {
1320
1323
  * Controls whether completions should be computed based on words in the document.
1321
1324
  * Defaults to true.
1322
1325
  */
1323
- wordBasedSuggestions?: boolean;
1326
+ wordBasedSuggestions?: 'off' | 'currentDocument' | 'matchingDocuments' | 'allDocuments';
1324
1327
  /**
1325
1328
  * Controls whether word based completions should be included from opened documents of the same language or any language.
1326
1329
  */
@@ -1439,6 +1442,13 @@ declare namespace monaco.editor {
1439
1442
  export interface ICommandHandler {
1440
1443
  (...args: any[]): void;
1441
1444
  }
1445
+ export interface ILocalizedString {
1446
+ original: string;
1447
+ value: string;
1448
+ }
1449
+ export interface ICommandMetadata {
1450
+ readonly description: ILocalizedString | string;
1451
+ }
1442
1452
 
1443
1453
  export interface IContextKey<T extends ContextKeyValue = ContextKeyValue> {
1444
1454
  set(value: T): void;
@@ -1575,7 +1585,29 @@ declare namespace monaco.editor {
1575
1585
  */
1576
1586
  export enum GlyphMarginLane {
1577
1587
  Left = 1,
1578
- Right = 2
1588
+ Center = 2,
1589
+ Right = 3
1590
+ }
1591
+
1592
+ export interface IGlyphMarginLanesModel {
1593
+ /**
1594
+ * The number of lanes that should be rendered in the editor.
1595
+ */
1596
+ readonly requiredLanes: number;
1597
+ /**
1598
+ * Gets the lanes that should be rendered starting at a given line number.
1599
+ */
1600
+ getLanesAtLine(lineNumber: number): GlyphMarginLane[];
1601
+ /**
1602
+ * Resets the model and ensures it can contain at least `maxLine` lines.
1603
+ */
1604
+ reset(maxLine: number): void;
1605
+ /**
1606
+ * Registers that a lane should be visible at the Range in the model.
1607
+ * @param persist - if true, notes that the lane should always be visible,
1608
+ * even on lines where there's no specific request for that lane.
1609
+ */
1610
+ push(lane: GlyphMarginLane, range: Range, persist?: boolean): void;
1579
1611
  }
1580
1612
 
1581
1613
  /**
@@ -1586,6 +1618,14 @@ declare namespace monaco.editor {
1586
1618
  Gutter = 2
1587
1619
  }
1588
1620
 
1621
+ /**
1622
+ * Section header style.
1623
+ */
1624
+ export enum MinimapSectionHeaderStyle {
1625
+ Normal = 1,
1626
+ Underlined = 2
1627
+ }
1628
+
1589
1629
  export interface IDecorationOptions {
1590
1630
  /**
1591
1631
  * CSS color to render.
@@ -1604,6 +1644,11 @@ declare namespace monaco.editor {
1604
1644
  * The position in the glyph margin.
1605
1645
  */
1606
1646
  position: GlyphMarginLane;
1647
+ /**
1648
+ * Whether the glyph margin lane in {@link position} should be rendered even
1649
+ * outside of this decoration's range.
1650
+ */
1651
+ persistLane?: boolean;
1607
1652
  }
1608
1653
 
1609
1654
  /**
@@ -1624,6 +1669,14 @@ declare namespace monaco.editor {
1624
1669
  * The position in the minimap.
1625
1670
  */
1626
1671
  position: MinimapPosition;
1672
+ /**
1673
+ * If the decoration is for a section header, which header style.
1674
+ */
1675
+ sectionHeaderStyle?: MinimapSectionHeaderStyle | null;
1676
+ /**
1677
+ * If the decoration is for a section header, the header text.
1678
+ */
1679
+ sectionHeaderText?: string | null;
1627
1680
  }
1628
1681
 
1629
1682
  /**
@@ -1659,6 +1712,10 @@ declare namespace monaco.editor {
1659
1712
  * Array of MarkdownString to render as the decoration message.
1660
1713
  */
1661
1714
  hoverMessage?: IMarkdownString | IMarkdownString[] | null;
1715
+ /**
1716
+ * Array of MarkdownString to render as the line number message.
1717
+ */
1718
+ lineNumberHoverMessage?: IMarkdownString | IMarkdownString[] | null;
1662
1719
  /**
1663
1720
  * Should the decoration expand to encompass a whole line.
1664
1721
  */
@@ -1694,6 +1751,14 @@ declare namespace monaco.editor {
1694
1751
  * If set, the decoration will be rendered in the lines decorations with this CSS class name.
1695
1752
  */
1696
1753
  linesDecorationsClassName?: string | null;
1754
+ /**
1755
+ * Controls the tooltip text of the line decoration.
1756
+ */
1757
+ linesDecorationsTooltip?: string | null;
1758
+ /**
1759
+ * If set, the decoration will be rendered on the line number.
1760
+ */
1761
+ lineNumberClassName?: string | null;
1697
1762
  /**
1698
1763
  * If set, the decoration will be rendered in the lines decorations with this CSS class name, but only for the first line in case of line wrapping.
1699
1764
  */
@@ -2439,7 +2504,7 @@ declare namespace monaco.editor {
2439
2504
  modified: ITextModel;
2440
2505
  }
2441
2506
 
2442
- export interface IDiffEditorViewModel {
2507
+ export interface IDiffEditorViewModel extends IDisposable {
2443
2508
  readonly model: IDiffEditorModel;
2444
2509
  waitForDiff(): Promise<void>;
2445
2510
  }
@@ -2474,6 +2539,7 @@ declare namespace monaco.editor {
2474
2539
  readonly id: string;
2475
2540
  readonly label: string;
2476
2541
  readonly alias: string;
2542
+ readonly metadata: ICommandMetadata | undefined;
2477
2543
  isSupported(): boolean;
2478
2544
  run(args?: unknown): Promise<void>;
2479
2545
  }
@@ -2563,8 +2629,11 @@ declare namespace monaco.editor {
2563
2629
  * be called when the container of the editor gets resized.
2564
2630
  *
2565
2631
  * If a dimension is passed in, the passed in value will be used.
2632
+ *
2633
+ * By default, this will also render the editor immediately.
2634
+ * If you prefer to delay rendering to the next animation frame, use postponeRendering == true.
2566
2635
  */
2567
- layout(dimension?: IDimension): void;
2636
+ layout(dimension?: IDimension, postponeRendering?: boolean): void;
2568
2637
  /**
2569
2638
  * Brings browser focus to the editor text
2570
2639
  */
@@ -2772,6 +2841,10 @@ declare namespace monaco.editor {
2772
2841
  * Replace all previous decorations with `newDecorations`.
2773
2842
  */
2774
2843
  set(newDecorations: readonly IModelDeltaDecoration[]): string[];
2844
+ /**
2845
+ * Append `newDecorations` to this collection.
2846
+ */
2847
+ append(newDecorations: readonly IModelDeltaDecoration[]): string[];
2775
2848
  /**
2776
2849
  * Remove all previous decorations.
2777
2850
  */
@@ -2886,6 +2959,7 @@ declare namespace monaco.editor {
2886
2959
  readonly affectsMinimap: boolean;
2887
2960
  readonly affectsOverviewRuler: boolean;
2888
2961
  readonly affectsGlyphMargin: boolean;
2962
+ readonly affectsLineNumber: boolean;
2889
2963
  }
2890
2964
 
2891
2965
  export interface IModelOptionsChangedEvent {
@@ -3049,6 +3123,13 @@ declare namespace monaco.editor {
3049
3123
  * Defaults to empty array.
3050
3124
  */
3051
3125
  rulers?: (number | IRulerOption)[];
3126
+ /**
3127
+ * Locales used for segmenting lines into words when doing word related navigations or operations.
3128
+ *
3129
+ * Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.).
3130
+ * Defaults to empty array
3131
+ */
3132
+ wordSegmenterLocales?: string | string[];
3052
3133
  /**
3053
3134
  * A string containing the word separators used when doing word navigation.
3054
3135
  * Defaults to `~!@#$%^&*()-=+[{]}\\|;:\'",.<>/?
@@ -3402,6 +3483,7 @@ declare namespace monaco.editor {
3402
3483
  */
3403
3484
  suggest?: ISuggestOptions;
3404
3485
  inlineSuggest?: IInlineSuggestOptions;
3486
+ experimentalInlineEdit?: IInlineEditOptions;
3405
3487
  /**
3406
3488
  * Smart select options.
3407
3489
  */
@@ -3533,9 +3615,12 @@ declare namespace monaco.editor {
3533
3615
  selectionHighlight?: boolean;
3534
3616
  /**
3535
3617
  * Enable semantic occurrences highlight.
3536
- * Defaults to true.
3618
+ * Defaults to 'singleFile'.
3619
+ * 'off' disables occurrence highlighting
3620
+ * 'singleFile' triggers occurrence highlighting in the current document
3621
+ * 'multiFile' triggers occurrence highlighting across valid open documents
3537
3622
  */
3538
- occurrencesHighlight?: boolean;
3623
+ occurrencesHighlight?: 'off' | 'singleFile' | 'multiFile';
3539
3624
  /**
3540
3625
  * Show code lens
3541
3626
  * Defaults to true.
@@ -3761,6 +3846,10 @@ declare namespace monaco.editor {
3761
3846
  * Default to true.
3762
3847
  */
3763
3848
  renderMarginRevertIcon?: boolean;
3849
+ /**
3850
+ * Indicates if the gutter menu should be rendered.
3851
+ */
3852
+ renderGutterMenu?: boolean;
3764
3853
  /**
3765
3854
  * Original model should be editable?
3766
3855
  * Defaults to false.
@@ -4115,15 +4204,24 @@ declare namespace monaco.editor {
4115
4204
  readonly minimapCanvasOuterHeight: number;
4116
4205
  }
4117
4206
 
4207
+ export enum ShowLightbulbIconMode {
4208
+ Off = 'off',
4209
+ OnCode = 'onCode',
4210
+ On = 'on'
4211
+ }
4212
+
4118
4213
  /**
4119
4214
  * Configuration options for editor lightbulb
4120
4215
  */
4121
4216
  export interface IEditorLightbulbOptions {
4122
4217
  /**
4123
4218
  * Enable the lightbulb code action.
4124
- * Defaults to true.
4219
+ * The three possible values are `off`, `on` and `onCode` and the default is `onCode`.
4220
+ * `off` disables the code action menu.
4221
+ * `on` shows the code action menu on code and on empty lines.
4222
+ * `onCode` shows the code action menu on code only.
4125
4223
  */
4126
- enabled?: boolean;
4224
+ enabled?: ShowLightbulbIconMode;
4127
4225
  }
4128
4226
 
4129
4227
  export interface IEditorStickyScrollOptions {
@@ -4213,6 +4311,18 @@ declare namespace monaco.editor {
4213
4311
  * Relative size of the font in the minimap. Defaults to 1.
4214
4312
  */
4215
4313
  scale?: number;
4314
+ /**
4315
+ * Whether to show named regions as section headers. Defaults to true.
4316
+ */
4317
+ showRegionSectionHeaders?: boolean;
4318
+ /**
4319
+ * Whether to show MARK: comments as section headers. Defaults to true.
4320
+ */
4321
+ showMarkSectionHeaders?: boolean;
4322
+ /**
4323
+ * Font size of section headers. Defaults to 9.
4324
+ */
4325
+ sectionHeaderFontSize?: number;
4216
4326
  }
4217
4327
 
4218
4328
  /**
@@ -4358,6 +4468,11 @@ declare namespace monaco.editor {
4358
4468
  * Defaults to false.
4359
4469
  */
4360
4470
  scrollByPage?: boolean;
4471
+ /**
4472
+ * When set, the horizontal scrollbar will not increase content height.
4473
+ * Defaults to false.
4474
+ */
4475
+ ignoreHorizontalScrollbarInContentHeight?: boolean;
4361
4476
  }
4362
4477
 
4363
4478
  export interface InternalEditorScrollbarOptions {
@@ -4374,6 +4489,7 @@ declare namespace monaco.editor {
4374
4489
  readonly verticalScrollbarSize: number;
4375
4490
  readonly verticalSliderSize: number;
4376
4491
  readonly scrollByPage: boolean;
4492
+ readonly ignoreHorizontalScrollbarInContentHeight: boolean;
4377
4493
  }
4378
4494
 
4379
4495
  export type InUntrustedWorkspace = 'inUntrustedWorkspace';
@@ -4425,12 +4541,33 @@ declare namespace monaco.editor {
4425
4541
  * Defaults to `prefix`.
4426
4542
  */
4427
4543
  mode?: 'prefix' | 'subword' | 'subwordSmart';
4428
- showToolbar?: 'always' | 'onHover';
4544
+ showToolbar?: 'always' | 'onHover' | 'never';
4429
4545
  suppressSuggestions?: boolean;
4430
4546
  /**
4431
4547
  * Does not clear active inline suggestions when the editor loses focus.
4432
4548
  */
4433
4549
  keepOnBlur?: boolean;
4550
+ /**
4551
+ * Font family for inline suggestions.
4552
+ */
4553
+ fontFamily?: string | 'default';
4554
+ }
4555
+
4556
+ export interface IInlineEditOptions {
4557
+ /**
4558
+ * Enable or disable the rendering of automatic inline edit.
4559
+ */
4560
+ enabled?: boolean;
4561
+ showToolbar?: 'always' | 'onHover' | 'never';
4562
+ /**
4563
+ * Font family for inline suggestions.
4564
+ */
4565
+ fontFamily?: string | 'default';
4566
+ /**
4567
+ * Does not clear active inline suggestions when the editor loses focus.
4568
+ */
4569
+ keepOnBlur?: boolean;
4570
+ backgroundColoring?: boolean;
4434
4571
  }
4435
4572
 
4436
4573
  export interface IBracketPairColorizationOptions {
@@ -4768,91 +4905,93 @@ declare namespace monaco.editor {
4768
4905
  hover = 60,
4769
4906
  inDiffEditor = 61,
4770
4907
  inlineSuggest = 62,
4771
- letterSpacing = 63,
4772
- lightbulb = 64,
4773
- lineDecorationsWidth = 65,
4774
- lineHeight = 66,
4775
- lineNumbers = 67,
4776
- lineNumbersMinChars = 68,
4777
- linkedEditing = 69,
4778
- links = 70,
4779
- matchBrackets = 71,
4780
- minimap = 72,
4781
- mouseStyle = 73,
4782
- mouseWheelScrollSensitivity = 74,
4783
- mouseWheelZoom = 75,
4784
- multiCursorMergeOverlapping = 76,
4785
- multiCursorModifier = 77,
4786
- multiCursorPaste = 78,
4787
- multiCursorLimit = 79,
4788
- occurrencesHighlight = 80,
4789
- overviewRulerBorder = 81,
4790
- overviewRulerLanes = 82,
4791
- padding = 83,
4792
- pasteAs = 84,
4793
- parameterHints = 85,
4794
- peekWidgetDefaultFocus = 86,
4795
- definitionLinkOpensInPeek = 87,
4796
- quickSuggestions = 88,
4797
- quickSuggestionsDelay = 89,
4798
- readOnly = 90,
4799
- readOnlyMessage = 91,
4800
- renameOnType = 92,
4801
- renderControlCharacters = 93,
4802
- renderFinalNewline = 94,
4803
- renderLineHighlight = 95,
4804
- renderLineHighlightOnlyWhenFocus = 96,
4805
- renderValidationDecorations = 97,
4806
- renderWhitespace = 98,
4807
- revealHorizontalRightPadding = 99,
4808
- roundedSelection = 100,
4809
- rulers = 101,
4810
- scrollbar = 102,
4811
- scrollBeyondLastColumn = 103,
4812
- scrollBeyondLastLine = 104,
4813
- scrollPredominantAxis = 105,
4814
- selectionClipboard = 106,
4815
- selectionHighlight = 107,
4816
- selectOnLineNumbers = 108,
4817
- showFoldingControls = 109,
4818
- showUnused = 110,
4819
- snippetSuggestions = 111,
4820
- smartSelect = 112,
4821
- smoothScrolling = 113,
4822
- stickyScroll = 114,
4823
- stickyTabStops = 115,
4824
- stopRenderingLineAfter = 116,
4825
- suggest = 117,
4826
- suggestFontSize = 118,
4827
- suggestLineHeight = 119,
4828
- suggestOnTriggerCharacters = 120,
4829
- suggestSelection = 121,
4830
- tabCompletion = 122,
4831
- tabIndex = 123,
4832
- unicodeHighlighting = 124,
4833
- unusualLineTerminators = 125,
4834
- useShadowDOM = 126,
4835
- useTabStops = 127,
4836
- wordBreak = 128,
4837
- wordSeparators = 129,
4838
- wordWrap = 130,
4839
- wordWrapBreakAfterCharacters = 131,
4840
- wordWrapBreakBeforeCharacters = 132,
4841
- wordWrapColumn = 133,
4842
- wordWrapOverride1 = 134,
4843
- wordWrapOverride2 = 135,
4844
- wrappingIndent = 136,
4845
- wrappingStrategy = 137,
4846
- showDeprecated = 138,
4847
- inlayHints = 139,
4848
- editorClassName = 140,
4849
- pixelRatio = 141,
4850
- tabFocusMode = 142,
4851
- layoutInfo = 143,
4852
- wrappingInfo = 144,
4853
- defaultColorDecorators = 145,
4854
- colorDecoratorsActivatedOn = 146,
4855
- inlineCompletionsAccessibilityVerbose = 147
4908
+ inlineEdit = 63,
4909
+ letterSpacing = 64,
4910
+ lightbulb = 65,
4911
+ lineDecorationsWidth = 66,
4912
+ lineHeight = 67,
4913
+ lineNumbers = 68,
4914
+ lineNumbersMinChars = 69,
4915
+ linkedEditing = 70,
4916
+ links = 71,
4917
+ matchBrackets = 72,
4918
+ minimap = 73,
4919
+ mouseStyle = 74,
4920
+ mouseWheelScrollSensitivity = 75,
4921
+ mouseWheelZoom = 76,
4922
+ multiCursorMergeOverlapping = 77,
4923
+ multiCursorModifier = 78,
4924
+ multiCursorPaste = 79,
4925
+ multiCursorLimit = 80,
4926
+ occurrencesHighlight = 81,
4927
+ overviewRulerBorder = 82,
4928
+ overviewRulerLanes = 83,
4929
+ padding = 84,
4930
+ pasteAs = 85,
4931
+ parameterHints = 86,
4932
+ peekWidgetDefaultFocus = 87,
4933
+ definitionLinkOpensInPeek = 88,
4934
+ quickSuggestions = 89,
4935
+ quickSuggestionsDelay = 90,
4936
+ readOnly = 91,
4937
+ readOnlyMessage = 92,
4938
+ renameOnType = 93,
4939
+ renderControlCharacters = 94,
4940
+ renderFinalNewline = 95,
4941
+ renderLineHighlight = 96,
4942
+ renderLineHighlightOnlyWhenFocus = 97,
4943
+ renderValidationDecorations = 98,
4944
+ renderWhitespace = 99,
4945
+ revealHorizontalRightPadding = 100,
4946
+ roundedSelection = 101,
4947
+ rulers = 102,
4948
+ scrollbar = 103,
4949
+ scrollBeyondLastColumn = 104,
4950
+ scrollBeyondLastLine = 105,
4951
+ scrollPredominantAxis = 106,
4952
+ selectionClipboard = 107,
4953
+ selectionHighlight = 108,
4954
+ selectOnLineNumbers = 109,
4955
+ showFoldingControls = 110,
4956
+ showUnused = 111,
4957
+ snippetSuggestions = 112,
4958
+ smartSelect = 113,
4959
+ smoothScrolling = 114,
4960
+ stickyScroll = 115,
4961
+ stickyTabStops = 116,
4962
+ stopRenderingLineAfter = 117,
4963
+ suggest = 118,
4964
+ suggestFontSize = 119,
4965
+ suggestLineHeight = 120,
4966
+ suggestOnTriggerCharacters = 121,
4967
+ suggestSelection = 122,
4968
+ tabCompletion = 123,
4969
+ tabIndex = 124,
4970
+ unicodeHighlighting = 125,
4971
+ unusualLineTerminators = 126,
4972
+ useShadowDOM = 127,
4973
+ useTabStops = 128,
4974
+ wordBreak = 129,
4975
+ wordSegmenterLocales = 130,
4976
+ wordSeparators = 131,
4977
+ wordWrap = 132,
4978
+ wordWrapBreakAfterCharacters = 133,
4979
+ wordWrapBreakBeforeCharacters = 134,
4980
+ wordWrapColumn = 135,
4981
+ wordWrapOverride1 = 136,
4982
+ wordWrapOverride2 = 137,
4983
+ wrappingIndent = 138,
4984
+ wrappingStrategy = 139,
4985
+ showDeprecated = 140,
4986
+ inlayHints = 141,
4987
+ editorClassName = 142,
4988
+ pixelRatio = 143,
4989
+ tabFocusMode = 144,
4990
+ layoutInfo = 145,
4991
+ wrappingInfo = 146,
4992
+ defaultColorDecorators = 147,
4993
+ colorDecoratorsActivatedOn = 148,
4994
+ inlineCompletionsAccessibilityVerbose = 149
4856
4995
  }
4857
4996
 
4858
4997
  export const EditorOptions: {
@@ -4938,7 +5077,7 @@ declare namespace monaco.editor {
4938
5077
  multiCursorModifier: IEditorOption<EditorOption.multiCursorModifier, 'altKey' | 'metaKey' | 'ctrlKey'>;
4939
5078
  multiCursorPaste: IEditorOption<EditorOption.multiCursorPaste, 'spread' | 'full'>;
4940
5079
  multiCursorLimit: IEditorOption<EditorOption.multiCursorLimit, number>;
4941
- occurrencesHighlight: IEditorOption<EditorOption.occurrencesHighlight, boolean>;
5080
+ occurrencesHighlight: IEditorOption<EditorOption.occurrencesHighlight, 'off' | 'singleFile' | 'multiFile'>;
4942
5081
  overviewRulerBorder: IEditorOption<EditorOption.overviewRulerBorder, boolean>;
4943
5082
  overviewRulerLanes: IEditorOption<EditorOption.overviewRulerLanes, number>;
4944
5083
  padding: IEditorOption<EditorOption.padding, Readonly<Required<IEditorPaddingOptions>>>;
@@ -4977,6 +5116,7 @@ declare namespace monaco.editor {
4977
5116
  stopRenderingLineAfter: IEditorOption<EditorOption.stopRenderingLineAfter, number>;
4978
5117
  suggest: IEditorOption<EditorOption.suggest, Readonly<Required<ISuggestOptions>>>;
4979
5118
  inlineSuggest: IEditorOption<EditorOption.inlineSuggest, Readonly<Required<IInlineSuggestOptions>>>;
5119
+ inlineEdit: IEditorOption<EditorOption.inlineEdit, Readonly<Required<IInlineEditOptions>>>;
4980
5120
  inlineCompletionsAccessibilityVerbose: IEditorOption<EditorOption.inlineCompletionsAccessibilityVerbose, boolean>;
4981
5121
  suggestFontSize: IEditorOption<EditorOption.suggestFontSize, number>;
4982
5122
  suggestLineHeight: IEditorOption<EditorOption.suggestLineHeight, number>;
@@ -4989,6 +5129,7 @@ declare namespace monaco.editor {
4989
5129
  useShadowDOM: IEditorOption<EditorOption.useShadowDOM, boolean>;
4990
5130
  useTabStops: IEditorOption<EditorOption.useTabStops, boolean>;
4991
5131
  wordBreak: IEditorOption<EditorOption.wordBreak, 'normal' | 'keepAll'>;
5132
+ wordSegmenterLocales: IEditorOption<EditorOption.wordSegmenterLocales, {}>;
4992
5133
  wordSeparators: IEditorOption<EditorOption.wordSeparators, string>;
4993
5134
  wordWrap: IEditorOption<EditorOption.wordWrap, 'on' | 'off' | 'wordWrapColumn' | 'bounded'>;
4994
5135
  wordWrapBreakAfterCharacters: IEditorOption<EditorOption.wordWrapBreakAfterCharacters, string>;
@@ -5229,6 +5370,20 @@ declare namespace monaco.editor {
5229
5370
  TOP_CENTER = 2
5230
5371
  }
5231
5372
 
5373
+ /**
5374
+ * Represents editor-relative coordinates of an overlay widget.
5375
+ */
5376
+ export interface IOverlayWidgetPositionCoordinates {
5377
+ /**
5378
+ * The top position for the overlay widget, relative to the editor.
5379
+ */
5380
+ top: number;
5381
+ /**
5382
+ * The left position for the overlay widget, relative to the editor.
5383
+ */
5384
+ left: number;
5385
+ }
5386
+
5232
5387
  /**
5233
5388
  * A position for rendering overlay widgets.
5234
5389
  */
@@ -5236,13 +5391,17 @@ declare namespace monaco.editor {
5236
5391
  /**
5237
5392
  * The position preference for the overlay widget.
5238
5393
  */
5239
- preference: OverlayWidgetPositionPreference | null;
5394
+ preference: OverlayWidgetPositionPreference | IOverlayWidgetPositionCoordinates | null;
5240
5395
  }
5241
5396
 
5242
5397
  /**
5243
5398
  * An overlay widgets renders on top of the text.
5244
5399
  */
5245
5400
  export interface IOverlayWidget {
5401
+ /**
5402
+ * Render this overlay widget in a location where it could overflow the editor's view dom node.
5403
+ */
5404
+ allowEditorOverflow?: boolean;
5246
5405
  /**
5247
5406
  * Get a unique identifier of the overlay widget.
5248
5407
  */
@@ -5394,6 +5553,7 @@ declare namespace monaco.editor {
5394
5553
  readonly isAfterLines: boolean;
5395
5554
  readonly glyphMarginLeft: number;
5396
5555
  readonly glyphMarginWidth: number;
5556
+ readonly glyphMarginLane?: GlyphMarginLane;
5397
5557
  readonly lineNumbersWidth: number;
5398
5558
  readonly offsetX: number;
5399
5559
  }
@@ -5497,6 +5657,7 @@ declare namespace monaco.editor {
5497
5657
  export interface IPasteEvent {
5498
5658
  readonly range: Range;
5499
5659
  readonly languageId: string | null;
5660
+ readonly clipboardEvent?: ClipboardEvent;
5500
5661
  }
5501
5662
 
5502
5663
  export interface IDiffEditorConstructionOptions extends IDiffEditorOptions, IEditorConstructionOptions {
@@ -5554,6 +5715,11 @@ declare namespace monaco.editor {
5554
5715
  * @event
5555
5716
  */
5556
5717
  readonly onDidChangeCursorSelection: IEvent<ICursorSelectionChangedEvent>;
5718
+ /**
5719
+ * An event emitted when the model of this editor is about to change (e.g. from `editor.setModel()`).
5720
+ * @event
5721
+ */
5722
+ readonly onWillChangeModel: IEvent<IModelChangedEvent>;
5557
5723
  /**
5558
5724
  * An event emitted when the model of this editor has changed (e.g. `editor.setModel()`).
5559
5725
  * @event
@@ -5981,8 +6147,18 @@ declare namespace monaco.editor {
5981
6147
  * Update the editor's options after the editor has been created.
5982
6148
  */
5983
6149
  updateOptions(newOptions: IDiffEditorOptions): void;
6150
+ /**
6151
+ * Jumps to the next or previous diff.
6152
+ */
6153
+ goToDiff(target: 'next' | 'previous'): void;
6154
+ /**
6155
+ * Scrolls to the first diff.
6156
+ * (Waits until the diff computation finished.)
6157
+ */
6158
+ revealFirstDiff(): unknown;
5984
6159
  accessibleDiffViewerNext(): void;
5985
6160
  accessibleDiffViewerPrev(): void;
6161
+ handleInitialized(): void;
5986
6162
  }
5987
6163
 
5988
6164
  export class FontInfo extends BareFontInfo {
@@ -6222,6 +6398,11 @@ declare namespace monaco.languages {
6222
6398
  */
6223
6399
  export function registerRenameProvider(languageSelector: LanguageSelector, provider: RenameProvider): IDisposable;
6224
6400
 
6401
+ /**
6402
+ * Register a new symbol-name provider (e.g., when a symbol is being renamed, show new possible symbol-names)
6403
+ */
6404
+ export function registerNewSymbolNameProvider(languageSelector: LanguageSelector, provider: NewSymbolNamesProvider): IDisposable;
6405
+
6225
6406
  /**
6226
6407
  * Register a signature help provider (used by e.g. parameter hints).
6227
6408
  */
@@ -6340,6 +6521,8 @@ declare namespace monaco.languages {
6340
6521
  */
6341
6522
  export function registerInlineCompletionsProvider(languageSelector: LanguageSelector, provider: InlineCompletionsProvider): IDisposable;
6342
6523
 
6524
+ export function registerInlineEditProvider(languageSelector: LanguageSelector, provider: InlineEditProvider): IDisposable;
6525
+
6343
6526
  /**
6344
6527
  * Register an inlay hints provider.
6345
6528
  */
@@ -6654,19 +6837,56 @@ declare namespace monaco.languages {
6654
6837
  * current position itself.
6655
6838
  */
6656
6839
  range?: IRange;
6840
+ /**
6841
+ * Can increase the verbosity of the hover
6842
+ */
6843
+ canIncreaseVerbosity?: boolean;
6844
+ /**
6845
+ * Can decrease the verbosity of the hover
6846
+ */
6847
+ canDecreaseVerbosity?: boolean;
6657
6848
  }
6658
6849
 
6659
6850
  /**
6660
6851
  * The hover provider interface defines the contract between extensions and
6661
6852
  * the [hover](https://code.visualstudio.com/docs/editor/intellisense)-feature.
6662
6853
  */
6663
- export interface HoverProvider {
6854
+ export interface HoverProvider<THover = Hover> {
6664
6855
  /**
6665
- * Provide a hover for the given position and document. Multiple hovers at the same
6856
+ * Provide a hover for the given position, context and document. Multiple hovers at the same
6666
6857
  * position will be merged by the editor. A hover can have a range which defaults
6667
6858
  * to the word range at the position when omitted.
6668
6859
  */
6669
- provideHover(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<Hover>;
6860
+ provideHover(model: editor.ITextModel, position: Position, token: CancellationToken, context?: HoverContext<THover>): ProviderResult<THover>;
6861
+ }
6862
+
6863
+ export interface HoverContext<THover = Hover> {
6864
+ /**
6865
+ * Hover verbosity request
6866
+ */
6867
+ verbosityRequest?: HoverVerbosityRequest<THover>;
6868
+ }
6869
+
6870
+ export interface HoverVerbosityRequest<THover = Hover> {
6871
+ /**
6872
+ * Whether to increase or decrease the hover's verbosity
6873
+ */
6874
+ action: HoverVerbosityAction;
6875
+ /**
6876
+ * The previous hover for the same position
6877
+ */
6878
+ previousHover: THover;
6879
+ }
6880
+
6881
+ export enum HoverVerbosityAction {
6882
+ /**
6883
+ * Increase the verbosity of the hover
6884
+ */
6885
+ Increase = 0,
6886
+ /**
6887
+ * Decrease the verbosity of the hover
6888
+ */
6889
+ Decrease = 1
6670
6890
  }
6671
6891
 
6672
6892
  export enum CompletionItemKind {
@@ -6820,6 +7040,22 @@ declare namespace monaco.languages {
6820
7040
  dispose?(): void;
6821
7041
  }
6822
7042
 
7043
+ /**
7044
+ * Info provided on partial acceptance.
7045
+ */
7046
+ export interface PartialAcceptInfo {
7047
+ kind: PartialAcceptTriggerKind;
7048
+ }
7049
+
7050
+ /**
7051
+ * How a partial acceptance was triggered.
7052
+ */
7053
+ export enum PartialAcceptTriggerKind {
7054
+ Word = 0,
7055
+ Line = 1,
7056
+ Suggest = 2
7057
+ }
7058
+
6823
7059
  /**
6824
7060
  * How a suggest provider was triggered.
6825
7061
  */
@@ -6966,7 +7202,7 @@ declare namespace monaco.languages {
6966
7202
  /**
6967
7203
  * Will be called when an item is partially accepted.
6968
7204
  */
6969
- handlePartialAccept?(completions: T, item: T['items'][number], acceptedCharacters: number): void;
7205
+ handlePartialAccept?(completions: T, item: T['items'][number], acceptedCharacters: number, info: PartialAcceptInfo): void;
6970
7206
  /**
6971
7207
  * Will be called when a completions list is no longer in use and can be garbage-collected.
6972
7208
  */
@@ -6991,7 +7227,9 @@ declare namespace monaco.languages {
6991
7227
  diagnostics?: editor.IMarkerData[];
6992
7228
  kind?: string;
6993
7229
  isPreferred?: boolean;
7230
+ isAI?: boolean;
6994
7231
  disabled?: string;
7232
+ ranges?: IRange[];
6995
7233
  }
6996
7234
 
6997
7235
  export enum CodeActionTriggerType {
@@ -7132,6 +7370,20 @@ declare namespace monaco.languages {
7132
7370
  kind?: DocumentHighlightKind;
7133
7371
  }
7134
7372
 
7373
+ /**
7374
+ * Represents a set of document highlights for a specific Uri.
7375
+ */
7376
+ export interface MultiDocumentHighlight {
7377
+ /**
7378
+ * The Uri of the document that the highlights belong to.
7379
+ */
7380
+ uri: Uri;
7381
+ /**
7382
+ * The set of highlights for the document.
7383
+ */
7384
+ highlights: DocumentHighlight[];
7385
+ }
7386
+
7135
7387
  /**
7136
7388
  * The document highlight provider interface defines the contract between extensions and
7137
7389
  * the word-highlight-feature.
@@ -7144,6 +7396,27 @@ declare namespace monaco.languages {
7144
7396
  provideDocumentHighlights(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<DocumentHighlight[]>;
7145
7397
  }
7146
7398
 
7399
+ /**
7400
+ * A provider that can provide document highlights across multiple documents.
7401
+ */
7402
+ export interface MultiDocumentHighlightProvider {
7403
+ selector: LanguageFilter;
7404
+ /**
7405
+ * Provide a Map of Uri --> document highlights, like all occurrences of a variable or
7406
+ * all exit-points of a function.
7407
+ *
7408
+ * Used in cases such as split view, notebooks, etc. where there can be multiple documents
7409
+ * with shared symbols.
7410
+ *
7411
+ * @param primaryModel The primary text model.
7412
+ * @param position The position at which to provide document highlights.
7413
+ * @param otherModels The other text models to search for document highlights.
7414
+ * @param token A cancellation token.
7415
+ * @returns A map of Uri to document highlights.
7416
+ */
7417
+ provideMultiDocumentHighlights(primaryModel: editor.ITextModel, position: Position, otherModels: editor.ITextModel[], token: CancellationToken): ProviderResult<Map<Uri, DocumentHighlight[]>>;
7418
+ }
7419
+
7147
7420
  /**
7148
7421
  * The linked editing range provider interface defines the contract between extensions and
7149
7422
  * the linked editing feature.
@@ -7620,6 +7893,25 @@ declare namespace monaco.languages {
7620
7893
  resolveRenameLocation?(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<RenameLocation & Rejection>;
7621
7894
  }
7622
7895
 
7896
+ export enum NewSymbolNameTag {
7897
+ AIGenerated = 1
7898
+ }
7899
+
7900
+ export enum NewSymbolNameTriggerKind {
7901
+ Invoke = 0,
7902
+ Automatic = 1
7903
+ }
7904
+
7905
+ export interface NewSymbolName {
7906
+ readonly newSymbolName: string;
7907
+ readonly tags?: readonly NewSymbolNameTag[];
7908
+ }
7909
+
7910
+ export interface NewSymbolNamesProvider {
7911
+ supportsAutomaticNewSymbolNamesTriggerKind?: Promise<boolean | undefined>;
7912
+ provideNewSymbolNames(model: editor.ITextModel, range: IRange, triggerKind: NewSymbolNameTriggerKind, token: CancellationToken): ProviderResult<NewSymbolName[]>;
7913
+ }
7914
+
7623
7915
  export interface Command {
7624
7916
  id: string;
7625
7917
  title: string;
@@ -7627,11 +7919,17 @@ declare namespace monaco.languages {
7627
7919
  arguments?: any[];
7628
7920
  }
7629
7921
 
7922
+ export interface CommentAuthorInformation {
7923
+ name: string;
7924
+ iconPath?: UriComponents;
7925
+ }
7926
+
7630
7927
  export interface PendingCommentThread {
7631
7928
  body: string;
7632
- range: IRange;
7929
+ range: IRange | undefined;
7633
7930
  uri: Uri;
7634
- owner: string;
7931
+ uniqueOwner: string;
7932
+ isReply: boolean;
7635
7933
  }
7636
7934
 
7637
7935
  export interface CodeLens {
@@ -7743,6 +8041,27 @@ declare namespace monaco.languages {
7743
8041
  provideMappedEdits(document: editor.ITextModel, codeBlocks: string[], context: MappedEditsContext, token: CancellationToken): Promise<WorkspaceEdit | null>;
7744
8042
  }
7745
8043
 
8044
+ export interface IInlineEdit {
8045
+ text: string;
8046
+ range: IRange;
8047
+ accepted?: Command;
8048
+ rejected?: Command;
8049
+ }
8050
+
8051
+ export interface IInlineEditContext {
8052
+ triggerKind: InlineEditTriggerKind;
8053
+ }
8054
+
8055
+ export enum InlineEditTriggerKind {
8056
+ Invoke = 0,
8057
+ Automatic = 1
8058
+ }
8059
+
8060
+ export interface InlineEditProvider<T extends IInlineEdit = IInlineEdit> {
8061
+ provideInlineEdit(model: editor.ITextModel, context: IInlineEditContext, token: CancellationToken): ProviderResult<T>;
8062
+ freeInlineEdit(edit: T): void;
8063
+ }
8064
+
7746
8065
  export interface ILanguageExtensionPoint {
7747
8066
  id: string;
7748
8067
  extensions?: string[];
@@ -8289,6 +8608,127 @@ declare namespace monaco.languages.html {
8289
8608
  *--------------------------------------------------------------------------------------------*/
8290
8609
 
8291
8610
  declare namespace monaco.languages.json {
8611
+ export interface BaseASTNode {
8612
+ readonly type: 'object' | 'array' | 'property' | 'string' | 'number' | 'boolean' | 'null';
8613
+ readonly parent?: ASTNode;
8614
+ readonly offset: number;
8615
+ readonly length: number;
8616
+ readonly children?: ASTNode[];
8617
+ readonly value?: string | boolean | number | null;
8618
+ }
8619
+ export interface ObjectASTNode extends BaseASTNode {
8620
+ readonly type: 'object';
8621
+ readonly properties: PropertyASTNode[];
8622
+ readonly children: ASTNode[];
8623
+ }
8624
+ export interface PropertyASTNode extends BaseASTNode {
8625
+ readonly type: 'property';
8626
+ readonly keyNode: StringASTNode;
8627
+ readonly valueNode?: ASTNode;
8628
+ readonly colonOffset?: number;
8629
+ readonly children: ASTNode[];
8630
+ }
8631
+ export interface ArrayASTNode extends BaseASTNode {
8632
+ readonly type: 'array';
8633
+ readonly items: ASTNode[];
8634
+ readonly children: ASTNode[];
8635
+ }
8636
+ export interface StringASTNode extends BaseASTNode {
8637
+ readonly type: 'string';
8638
+ readonly value: string;
8639
+ }
8640
+ export interface NumberASTNode extends BaseASTNode {
8641
+ readonly type: 'number';
8642
+ readonly value: number;
8643
+ readonly isInteger: boolean;
8644
+ }
8645
+ export interface BooleanASTNode extends BaseASTNode {
8646
+ readonly type: 'boolean';
8647
+ readonly value: boolean;
8648
+ }
8649
+ export interface NullASTNode extends BaseASTNode {
8650
+ readonly type: 'null';
8651
+ readonly value: null;
8652
+ }
8653
+ export type ASTNode = ObjectASTNode | PropertyASTNode | ArrayASTNode | StringASTNode | NumberASTNode | BooleanASTNode | NullASTNode;
8654
+ export type JSONDocument = {
8655
+ root: ASTNode | undefined;
8656
+ getNodeFromOffset(offset: number, includeRightBound?: boolean): ASTNode | undefined;
8657
+ };
8658
+ export type JSONSchemaRef = JSONSchema | boolean;
8659
+ export interface JSONSchemaMap {
8660
+ [name: string]: JSONSchemaRef;
8661
+ }
8662
+ export interface JSONSchema {
8663
+ id?: string;
8664
+ $id?: string;
8665
+ $schema?: string;
8666
+ type?: string | string[];
8667
+ title?: string;
8668
+ default?: any;
8669
+ definitions?: {
8670
+ [name: string]: JSONSchema;
8671
+ };
8672
+ description?: string;
8673
+ properties?: JSONSchemaMap;
8674
+ patternProperties?: JSONSchemaMap;
8675
+ additionalProperties?: boolean | JSONSchemaRef;
8676
+ minProperties?: number;
8677
+ maxProperties?: number;
8678
+ dependencies?: JSONSchemaMap | {
8679
+ [prop: string]: string[];
8680
+ };
8681
+ items?: JSONSchemaRef | JSONSchemaRef[];
8682
+ minItems?: number;
8683
+ maxItems?: number;
8684
+ uniqueItems?: boolean;
8685
+ additionalItems?: boolean | JSONSchemaRef;
8686
+ pattern?: string;
8687
+ minLength?: number;
8688
+ maxLength?: number;
8689
+ minimum?: number;
8690
+ maximum?: number;
8691
+ exclusiveMinimum?: boolean | number;
8692
+ exclusiveMaximum?: boolean | number;
8693
+ multipleOf?: number;
8694
+ required?: string[];
8695
+ $ref?: string;
8696
+ anyOf?: JSONSchemaRef[];
8697
+ allOf?: JSONSchemaRef[];
8698
+ oneOf?: JSONSchemaRef[];
8699
+ not?: JSONSchemaRef;
8700
+ enum?: any[];
8701
+ format?: string;
8702
+ const?: any;
8703
+ contains?: JSONSchemaRef;
8704
+ propertyNames?: JSONSchemaRef;
8705
+ examples?: any[];
8706
+ $comment?: string;
8707
+ if?: JSONSchemaRef;
8708
+ then?: JSONSchemaRef;
8709
+ else?: JSONSchemaRef;
8710
+ defaultSnippets?: {
8711
+ label?: string;
8712
+ description?: string;
8713
+ markdownDescription?: string;
8714
+ body?: any;
8715
+ bodyText?: string;
8716
+ }[];
8717
+ errorMessage?: string;
8718
+ patternErrorMessage?: string;
8719
+ deprecationMessage?: string;
8720
+ enumDescriptions?: string[];
8721
+ markdownEnumDescriptions?: string[];
8722
+ markdownDescription?: string;
8723
+ doNotSuggest?: boolean;
8724
+ suggestSortText?: string;
8725
+ allowComments?: boolean;
8726
+ allowTrailingCommas?: boolean;
8727
+ }
8728
+ export interface MatchingSchema {
8729
+ node: ASTNode;
8730
+ schema: JSONSchema;
8731
+ }
8292
8732
  export interface DiagnosticsOptions {
8293
8733
  /**
8294
8734
  * If set, the validator will be enabled and perform syntax and schema based validation,
@@ -8393,6 +8833,11 @@ declare namespace monaco.languages.json {
8393
8833
  setModeConfiguration(modeConfiguration: ModeConfiguration): void;
8394
8834
  }
8395
8835
  export const jsonDefaults: LanguageServiceDefaults;
8836
+ export interface IJSONWorker {
8837
+ parseJSONDocument(uri: string): Promise<JSONDocument | null>;
8838
+ getMatchingSchemas(uri: string): Promise<MatchingSchema[]>;
8839
+ }
8840
+ export const getWorker: () => Promise<(...uris: Uri[]) => Promise<IJSONWorker>>;
8396
8841
  }
8397
8842
 
8398
8843
  /*---------------------------------------------------------------------------------------------