From 474cd0d01c61ec110c90ba8f6849efeee4ea1921 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Sat, 19 Sep 2020 02:28:35 +0200 Subject: [PATCH] Prepare for 0.21.0 --- CHANGELOG.md | 69 +++ monaco.d.ts | 655 ++++++++++++++++++++--------- package-lock.json | 249 ++++++++--- package.json | 18 +- website/playground/monaco.d.ts.txt | 655 ++++++++++++++++++++--------- 5 files changed, 1190 insertions(+), 456 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe57399f..556cd098 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,74 @@ # Monaco Editor Changelog +## [0.21.0] (19.09.2020) + +### New & Noteworthy +* Added `Paste` in the context menu in browsers which support the clipboard API. +* Many improvements in `monaco-typescript`: support for "deprecated" tags, API to participate in the web worker, improved lib.d.ts resolving. +* New tokenization support for: Julia, Scala, Lexon, Terraform HCL, Dart, Systemverilog. +* New semantic tokens provider sample on the playground. +* New `overflowWidgetsDomNode` constructor option to pass in a parent for overflowing widgets. +* New `minimap.size` option: `proportional`, `fill`, `fit`. +* New `OnTypeRename` provider and option `renameOnType`. +* Fixed issue where cross-origin web workers were not working on Safari. +* Fixed many issues around embedding the editor in iframes or in shadow dom. +* Fixed issue with `automaticLayout`. +* Fixed issue with scrolling speed on Firefox. +* New options: `tabIndex`, `scrollPredominantAxis`, `columnSelection`, `padding`, `unfoldOnClickAfterEndOfLine`, `renderLineHighlightOnlyWhenFocus`, `definitionLinkOpensInPeek`, `showDeprecated`, `comments.ignoreEmptyLines`, `find.cursorMoveOnType`, `find.loop`. +* New diff editor options: `originalCodeLens`, `modifiedCodeLens`. +* Changed options: `rulers` can now define different colors, `renderWhitespace` can now be `trailing`. + +### Breaking changes +* `CompletionItemLabel.signature` has been renamed to `CompletionItemLabel.parameters`. +* The signature of `CompletionItemProvider.resolveCompletionItem` has changed. +* `IMarker.code.link` was renamed to `IMarker.code.target`. +* `IMarkerData.code.link` was renamed to `IMarkerData.code.target`. +* `EditorLayoutInfo` has been restructured. + +### Thank you + +Contributions to `monaco-editor`: + +* [Hugo Fonseca (@fonsecas72)](https://github.com/fonsecas72): Adding terraform / hcl samples [PR #2102](https://github.com/microsoft/monaco-editor/pull/2102) +* [@KapitanOczywisty](https://github.com/KapitanOczywisty) + * Update example: allow peek definition [PR #2112](https://github.com/microsoft/monaco-editor/pull/2112) + * Semantic tokens provider example [PR #2103](https://github.com/microsoft/monaco-editor/pull/2103) +* [Tuan Le Minh (@minhtuanchannhan)](https://github.com/minhtuanchannhan): Correct url of Microsoft logo [PR #2132](https://github.com/microsoft/monaco-editor/pull/2132) +* [Max Schmitt (@mxschmitt)](https://github.com/mxschmitt): ci: fixed smoke tests by increasing timeout [PR #1964](https://github.com/microsoft/monaco-editor/pull/1964) +* [Nicholas Rayburn (@nrayburn-tech)](https://github.com/nrayburn-tech): Monarch documentation changes [PR #1844](https://github.com/microsoft/monaco-editor/pull/1844) +* [ZHAO Jinxiang (@xiaoxiangmoe)](https://github.com/xiaoxiangmoe): fix: A 'declare' modifier cannot be used in an already ambient context [PR #2121](https://github.com/microsoft/monaco-editor/pull/2121) + +Contributions to `monaco-typescript`: + +* [Sebastian Pahnke (@spahnke)](https://github.com/spahnke) + * Adopt "deprecated" API [PR #67](https://github.com/microsoft/monaco-typescript/pull/67) + * Format signature and parameter documentation as Markdown [PR #66](https://github.com/microsoft/monaco-typescript/pull/66) +* [Spencer (@SpencerSharkey)](https://github.com/SpencerSharkey): Use typescript language for hover tooltip header [PR #70](https://github.com/microsoft/monaco-typescript/pull/70) + +Contributions to `monaco-languages`: + +* [theangryepicbanana (@ALANVF)](https://github.com/ALANVF) + * Add support for Julia [PR #82](https://github.com/microsoft/monaco-languages/pull/82) + * Add Scala support [PR #98](https://github.com/microsoft/monaco-languages/pull/98) +* [Arjan van Eersel (@arjanvaneersel)](https://github.com/arjanvaneersel): Implemented Lexon highlighting [PR #86](https://github.com/microsoft/monaco-languages/pull/86) +* [Basarat Ali Syed (@basarat)](https://github.com/basarat): add .mjs support :rose: [PR #92](https://github.com/microsoft/monaco-languages/pull/92) +* [@bolinfest](https://github.com/bolinfest): Update Python grammar to include keywords introduced in Python 3 [PR #91](https://github.com/microsoft/monaco-languages/pull/91) +* [Hugo Fonseca (@fonsecas72)](https://github.com/fonsecas72) + * Adding Gemfile to ruby filenames [PR #111](https://github.com/microsoft/monaco-languages/pull/111) + * Adding hcl / terraform language [PR #109](https://github.com/microsoft/monaco-languages/pull/109) + * Terraform HCL : Fixing, Improving, adding tests [PR #110](https://github.com/microsoft/monaco-languages/pull/110) +* [Lars Hvam (@larshp)](https://github.com/larshp) + * Mocha, fix deprecation warning regarding mocha.opts [PR #88](https://github.com/microsoft/monaco-languages/pull/88) + * [ABAP] Language fixes [PR #87](https://github.com/microsoft/monaco-languages/pull/87) +* [Kenny Lin (@LinKCoding)](https://github.com/LinKCoding): Added ".rmd" file extension to R's list of supported languages [PR #83](https://github.com/microsoft/monaco-languages/pull/83) +* [Justin Mancusi (@mancusi)](https://github.com/mancusi): Updates the comment tokenization for handlebars syntax. [PR #93](https://github.com/microsoft/monaco-languages/pull/93) +* [Mert Caliskan (@mulderbaba)](https://github.com/mulderbaba): introduce preliminary Scala support, highly inspired by src/java content [PR #97](https://github.com/microsoft/monaco-languages/pull/97) +* [Nicholas Rayburn (@nrayburn-tech)](https://github.com/nrayburn-tech): Add _ as a supported character for Python tags/keywords [PR #81](https://github.com/microsoft/monaco-languages/pull/81) +* [@skacurt](https://github.com/skacurt): [vb] fix string literals [PR #94](https://github.com/microsoft/monaco-languages/pull/94) +* [Taymon A. Beal (@taymonbeal)](https://github.com/taymonbeal): Add asserts, bigint, and unknown to TypeScript keywords [PR #96](https://github.com/microsoft/monaco-languages/pull/96) +* [Sabolch Varha (@VarghaSabee)](https://github.com/VarghaSabee): Feature - dart language support [PR #84](https://github.com/microsoft/monaco-languages/pull/84) +* [@xadegunt](https://github.com/xadegunt): Add Systemverilog language support [PR #108](https://github.com/microsoft/monaco-languages/pull/108) + ## [0.20.0] (11.02.2020) ### New & Noteworthy diff --git a/monaco.d.ts b/monaco.d.ts index d8897ec8..822da828 100644 --- a/monaco.d.ts +++ b/monaco.d.ts @@ -59,12 +59,19 @@ declare namespace monaco { } export interface CancellationToken { + /** + * A flag signalling is cancellation has been requested. + */ readonly isCancellationRequested: boolean; /** - * An event emitted when cancellation is requested + * An event which fires when cancellation is requested. This event + * only ever fires `once` as cancellation can only happen once. Listeners + * that are registered after cancellation will be called (next event loop run), + * but also only once. + * * @event */ - readonly onCancellationRequested: IEvent; + readonly onCancellationRequested: (listener: (e: any) => any, thisArgs?: any, disposables?: IDisposable[]) => IDisposable; } /** * Uniform Resource Identifier (Uri) http://tools.ietf.org/html/rfc3986. @@ -72,6 +79,7 @@ declare namespace monaco { * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation * and encoding. * + * ```txt * foo://example.com:8042/over/there?name=ferret#nose * \_/ \______________/\_________/ \_________/ \__/ * | | | | | @@ -79,6 +87,7 @@ declare namespace monaco { * | _____________________|__ * / \ / \ * urn:example:animal:ferret:nose + * ``` */ export class Uri implements UriComponents { static isUri(thing: any): thing is Uri; @@ -172,6 +181,14 @@ declare namespace monaco { query?: string; fragment?: string; }): Uri; + /** + * Join a Uri path with path fragments and normalizes the resulting path. + * + * @param uri The input Uri. + * @param pathFragment The path fragment to add to the Uri path. + * @returns The resulting Uri. + */ + static joinPath(uri: Uri, ...pathFragment: string[]): Uri; /** * Creates a string representation for this Uri. It's guaranteed that calling * `Uri.parse` with the result of this function creates an Uri which is equal @@ -379,7 +396,6 @@ declare namespace monaco { */ MAX_VALUE = 112 } - export class KeyMod { static readonly CtrlCmd: number; static readonly Shift: number; @@ -636,10 +652,18 @@ declare namespace monaco { * Return the end position (which will be after or equal to the start position) */ getEndPosition(): Position; + /** + * Return the end position (which will be after or equal to the start position) + */ + static getEndPosition(range: IRange): Position; /** * Return the start position (which will be before or equal to the end position) */ getStartPosition(): Position; + /** + * Return the start position (which will be before or equal to the end position) + */ + static getStartPosition(range: IRange): Position; /** * Transform to a user presentable string representation. */ @@ -1096,6 +1120,14 @@ declare namespace monaco.editor { * Defaults to true. */ wordBasedSuggestions?: boolean; + /** + * Controls whether the semanticHighlighting is shown for the languages that support it. + * true: semanticHighlighting is enabled for all themes + * false: semanticHighlighting is disabled for all themes + * 'configuredByTheme': semanticHighlighting is controlled by the current color theme's semanticHighlighting setting. + * Defaults to 'byTheme'. + */ + 'semanticHighlighting.enabled'?: true | false | 'configuredByTheme'; /** * Keep peek editors open even when double clicking their content or when hitting `Escape`. * Defaults to false. @@ -1106,6 +1138,13 @@ declare namespace monaco.editor { * Defaults to 20000. */ maxTokenizationLineLength?: number; + /** + * Theme to be used for rendering. + * The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black'. + * You can create custom themes via `monaco.editor.defineTheme`. + * To switch a theme, use `monaco.editor.setTheme` + */ + theme?: string; } /** @@ -1189,7 +1228,7 @@ declare namespace monaco.editor { severity: MarkerSeverity; code?: string | { value: string; - link: Uri; + target: Uri; }; message: string; source?: string; @@ -1207,7 +1246,7 @@ declare namespace monaco.editor { export interface IMarkerData { code?: string | { value: string; - link: Uri; + target: Uri; }; severity: MarkerSeverity; message: string; @@ -1348,6 +1387,10 @@ declare namespace monaco.editor { * If set, the decoration will be rendered in the lines decorations with this CSS class name. */ linesDecorationsClassName?: string | null; + /** + * 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. + */ + firstLineDecorationClassName?: string | null; /** * If set, the decoration will be rendered in the margin (covering its full width) with this CSS class name. */ @@ -1499,7 +1542,7 @@ declare namespace monaco.editor { /** * The range to replace. This can be empty to emulate a simple insert. */ - range: Range; + range: IRange; /** * The text to replace with. This can be null to emulate a simple delete. */ @@ -1511,6 +1554,17 @@ declare namespace monaco.editor { forceMoveMarkers?: boolean; } + export interface IValidEditOperation { + /** + * The range to replace. This can be empty to emulate a simple insert. + */ + range: Range; + /** + * The text to replace with. This can be empty to emulate a simple delete. + */ + text: string; + } + /** * A callback that can compute the cursor state after applying a series of edit operations. */ @@ -1518,7 +1572,7 @@ declare namespace monaco.editor { /** * A callback that can compute the resulting cursors state after some edit operations have been executed. */ - (inverseEditOperations: IIdentifiedSingleEditOperation[]): Selection[] | null; + (inverseEditOperations: IValidEditOperation[]): Selection[] | null; } export class TextModelResolvedOptions { @@ -1712,7 +1766,7 @@ declare namespace monaco.editor { /** * Search the model. * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true. - * @param searchScope Limit the searching to only search inside this range. + * @param searchScope Limit the searching to only search inside these ranges. * @param isRegex Used to indicate that `searchString` is a regular expression. * @param matchCase Force the matching to match lower/upper case exactly. * @param wordSeparators Force the matching to match entire words only. Pass null otherwise. @@ -1720,7 +1774,7 @@ declare namespace monaco.editor { * @param limitResultCount Limit the number of results * @return The ranges where the matches are. It is empty if no matches have been found. */ - findMatches(searchString: string, searchScope: IRange, isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean, limitResultCount?: number): FindMatch[]; + findMatches(searchString: string, searchScope: IRange | IRange[], isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean, limitResultCount?: number): FindMatch[]; /** * Search the model for the next match. Loops to the beginning of the model if needed. * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true. @@ -1846,7 +1900,7 @@ declare namespace monaco.editor { * @param cursorStateComputer A callback that can compute the resulting cursors state after the edit operations have been executed. * @return The cursor state returned by the `cursorStateComputer`. */ - pushEditOperations(beforeCursorState: Selection[], editOperations: IIdentifiedSingleEditOperation[], cursorStateComputer: ICursorStateComputer): Selection[] | null; + pushEditOperations(beforeCursorState: Selection[] | null, editOperations: IIdentifiedSingleEditOperation[], cursorStateComputer: ICursorStateComputer): Selection[] | null; /** * Change the end of line sequence. This is the preferred way of * changing the eol sequence. This will land on the undo stack. @@ -1856,9 +1910,11 @@ declare namespace monaco.editor { * Edit the model without adding the edits to the undo stack. * This can have dire consequences on the undo stack! See @pushEditOperations for the preferred way. * @param operations The edit operations. - * @return The inverse edit operations, that, when applied, will bring the model back to the previous state. + * @return If desired, the inverse edit operations, that, when applied, will bring the model back to the previous state. */ - applyEdits(operations: IIdentifiedSingleEditOperation[]): IIdentifiedSingleEditOperation[]; + applyEdits(operations: IIdentifiedSingleEditOperation[]): void; + applyEdits(operations: IIdentifiedSingleEditOperation[], computeUndoEdits: false): void; + applyEdits(operations: IIdentifiedSingleEditOperation[], computeUndoEdits: true): IValidEditOperation[]; /** * Change the end of line sequence without recording in the undo stack. * This can have dire consequences on the undo stack! See @pushEOL for the preferred way. @@ -1910,14 +1966,14 @@ declare namespace monaco.editor { * @param range The range to replace (delete). May be empty to represent a simple insert. * @param text The text to replace with. May be null to represent a simple delete. */ - addEditOperation(range: Range, text: string | null, forceMoveMarkers?: boolean): void; + addEditOperation(range: IRange, text: string | null, forceMoveMarkers?: boolean): void; /** * Add a new edit operation (a replace operation). * The inverse edits will be accessible in `ICursorStateComputerData.getInverseEditOperations()` * @param range The range to replace (delete). May be empty to represent a simple insert. * @param text The text to replace with. May be null to represent a simple delete. */ - addTrackedEditOperation(range: Range, text: string | null, forceMoveMarkers?: boolean): void; + addTrackedEditOperation(range: IRange, text: string | null, forceMoveMarkers?: boolean): void; /** * Track `selection` when applying edit operations. * A best effort will be made to not grow/expand the selection. @@ -1937,7 +1993,7 @@ declare namespace monaco.editor { /** * Get the inverse edit operations of the added edit operations. */ - getInverseEditOperations(): IIdentifiedSingleEditOperation[]; + getInverseEditOperations(): IValidEditOperation[]; /** * Get a previously tracked selection. * @param id The unique identifier returned by `trackSelection`. @@ -2176,6 +2232,11 @@ declare namespace monaco.editor { * Scroll vertically as necessary and reveal a line centered vertically only if it lies outside the viewport. */ revealLineInCenterIfOutsideViewport(lineNumber: number, scrollType?: ScrollType): void; + /** + * Scroll vertically as necessary and reveal a line close to the top of the viewport, + * optimized for viewing a code definition. + */ + revealLineNearTop(lineNumber: number, scrollType?: ScrollType): void; /** * Scroll vertically or horizontally as necessary and reveal a position. */ @@ -2188,6 +2249,11 @@ declare namespace monaco.editor { * Scroll vertically or horizontally as necessary and reveal a position centered vertically only if it lies outside the viewport. */ revealPositionInCenterIfOutsideViewport(position: IPosition, scrollType?: ScrollType): void; + /** + * Scroll vertically or horizontally as necessary and reveal a position close to the top of the viewport, + * optimized for viewing a code definition. + */ + revealPositionNearTop(position: IPosition, scrollType?: ScrollType): void; /** * Returns the primary selection of the editor. */ @@ -2233,6 +2299,11 @@ declare namespace monaco.editor { * Scroll vertically as necessary and reveal lines centered vertically only if it lies outside the viewport. */ revealLinesInCenterIfOutsideViewport(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void; + /** + * Scroll vertically as necessary and reveal lines close to the top of the viewport, + * optimized for viewing a code definition. + */ + revealLinesNearTop(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void; /** * Scroll vertically or horizontally as necessary and reveal a range. */ @@ -2249,13 +2320,23 @@ declare namespace monaco.editor { * Scroll vertically or horizontally as necessary and reveal a range centered vertically only if it lies outside the viewport. */ revealRangeInCenterIfOutsideViewport(range: IRange, scrollType?: ScrollType): void; + /** + * Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, + * optimized for viewing a code definition. + */ + revealRangeNearTop(range: IRange, scrollType?: ScrollType): void; + /** + * Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, + * optimized for viewing a code definition. Only if it lies outside the viewport. + */ + revealRangeNearTopIfOutsideViewport(range: IRange, scrollType?: ScrollType): void; /** * Directly trigger a handler or an editor action. * @param source The source of the call. * @param handlerId The id of the handler or the id of a contribution. * @param payload Extra data to be sent to the handler. */ - trigger(source: string, handlerId: string, payload: any): void; + trigger(source: string | null | undefined, handlerId: string, payload: any): void; /** * Gets the current model attached to this editor. */ @@ -2368,6 +2449,8 @@ declare namespace monaco.editor { * An event describing that model decorations have changed. */ export interface IModelDecorationsChangedEvent { + readonly affectsMinimap: boolean; + readonly affectsOverviewRuler: boolean; } export interface IModelOptionsChangedEvent { @@ -2514,11 +2597,15 @@ declare namespace monaco.editor { * The aria label for the editor's textarea (when it is focused). */ ariaLabel?: string; + /** + * The `tabindex` property of the editor's textarea + */ + tabIndex?: number; /** * Render vertical lines at the specified columns. * Defaults to empty array. */ - rulers?: number[]; + rulers?: (number | IRulerOption)[]; /** * A string containing the word separators used when doing word navigation. * Defaults to `~!@#$%^&*()-=+[{]}\\|;:\'",.<>/? @@ -2553,6 +2640,11 @@ declare namespace monaco.editor { * Defaults to true. */ renderFinalNewline?: boolean; + /** + * Remove unusual line terminators like LINE SEPARATOR (LS), PARAGRAPH SEPARATOR (PS). + * Defaults to 'prompt'. + */ + unusualLineTerminators?: 'off' | 'prompt' | 'auto'; /** * Should the corresponding line be selected when clicking on the line number? * Defaults to true. @@ -2595,6 +2687,11 @@ declare namespace monaco.editor { * Defaults to false. */ readOnly?: boolean; + /** + * Rename matching regions on type. + * Defaults to false. + */ + renameOnType?: boolean; /** * Should the editor render validation decorations. * Defaults to editable. @@ -2779,6 +2876,16 @@ declare namespace monaco.editor { * Defaults to 5. */ fastScrollSensitivity?: number; + /** + * Enable that the editor scrolls only the predominant axis. Prevents horizontal drift when scrolling vertically on a trackpad. + * Defaults to true. + */ + scrollPredominantAxis?: boolean; + /** + * Enable that the selection with the mouse and keys is doing column selection. + * Defaults to false. + */ + columnSelection?: boolean; /** * The modifier to be used to add multiple cursors with the mouse. * Defaults to 'alt' @@ -2821,6 +2928,10 @@ declare namespace monaco.editor { * Defaults to 10 (ms) */ quickSuggestionsDelay?: number; + /** + * Controls the spacing around the editor. + */ + padding?: IEditorPaddingOptions; /** * Parameter hint options. */ @@ -2952,6 +3063,11 @@ declare namespace monaco.editor { * Defaults to 'mouseover'. */ showFoldingControls?: 'always' | 'mouseover'; + /** + * Controls whether clicking on the empty content after a folded line will unfold the line. + * Defaults to false. + */ + unfoldOnClickAfterEndOfLine?: boolean; /** * Enable highlighting of matching brackets. * Defaults to 'always'. @@ -2961,7 +3077,7 @@ declare namespace monaco.editor { * Enable rendering of whitespace. * Defaults to none. */ - renderWhitespace?: 'none' | 'boundary' | 'selection' | 'all'; + renderWhitespace?: 'none' | 'boundary' | 'selection' | 'trailing' | 'all'; /** * Enable rendering of control characters. * Defaults to false. @@ -2982,6 +3098,11 @@ declare namespace monaco.editor { * Defaults to all. */ renderLineHighlight?: 'none' | 'gutter' | 'line' | 'all'; + /** + * Control if the current line highlight should be rendered only the editor is focused. + * Defaults to false. + */ + renderLineHighlightOnlyWhenFocus?: boolean; /** * Inserting and deleting whitespace follows tab stops. */ @@ -3015,13 +3136,15 @@ declare namespace monaco.editor { * Defaults to false. */ peekWidgetDefaultFocus?: 'tree' | 'editor'; - } - - export interface IEditorConstructionOptions extends IEditorOptions { /** - * The initial editor dimension (to avoid measuring the container). + * Controls whether the definition link opens element in the peek widget. + * Defaults to false. */ - dimension?: IDimension; + definitionLinkOpensInPeek?: boolean; + /** + * Controls strikethrough deprecated variables. + */ + showDeprecated?: boolean; } /** @@ -3058,6 +3181,16 @@ declare namespace monaco.editor { * Defaults to false. */ originalEditable?: boolean; + /** + * Original editor should be have code lens enabled? + * Defaults to false. + */ + originalCodeLens?: boolean; + /** + * Modified editor should be have code lens enabled? + * Defaults to false. + */ + modifiedCodeLens?: boolean; } /** @@ -3089,6 +3222,11 @@ declare namespace monaco.editor { * Defaults to true. */ insertSpace?: boolean; + /** + * Ignore empty lines when inserting line comments. + * Defaults to true. + */ + ignoreEmptyLines?: boolean; } export type EditorCommentsOptions = Readonly>; @@ -3157,6 +3295,10 @@ declare namespace monaco.editor { * Configuration options for editor find widget */ export interface IEditorFindOptions { + /** + * Controls whether the cursor should move to find matches while typing. + */ + cursorMoveOnType?: boolean; /** * Controls if we seed search string in the Find Widget with editor selection. */ @@ -3166,6 +3308,10 @@ declare namespace monaco.editor { */ autoFindInSelection?: 'never' | 'always' | 'multiline'; addExtraSpaceOnTop?: boolean; + /** + * Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found + */ + loop?: boolean; } export type EditorFindOptions = Readonly>; @@ -3287,21 +3433,16 @@ declare namespace monaco.editor { */ readonly contentWidth: number; /** - * The position for the minimap + * Layout information for the minimap */ - readonly minimapLeft: number; - /** - * The width of the minimap - */ - readonly minimapWidth: number; - /** - * Minimap render type - */ - readonly renderMinimap: RenderMinimap; + readonly minimap: EditorMinimapLayoutInfo; /** * The number of columns (of typical characters) fitting on a viewport line. */ readonly viewportColumn: number; + readonly isWordWrapMinified: boolean; + readonly isViewportWrapping: boolean; + readonly wrappingColumn: number; /** * The width of the vertical scrollbar. */ @@ -3316,6 +3457,23 @@ declare namespace monaco.editor { readonly overviewRuler: OverviewRulerPosition; } + /** + * The internal layout details of the editor. + */ + export interface EditorMinimapLayoutInfo { + readonly renderMinimap: RenderMinimap; + readonly minimapLeft: number; + readonly minimapWidth: number; + readonly minimapHeightIsEditorHeight: boolean; + readonly minimapIsSampling: boolean; + readonly minimapScale: number; + readonly minimapLineHeight: number; + readonly minimapCanvasInnerWidth: number; + readonly minimapCanvasInnerHeight: number; + readonly minimapCanvasOuterWidth: number; + readonly minimapCanvasOuterHeight: number; + } + /** * Configuration options for editor lightbulb */ @@ -3343,6 +3501,11 @@ declare namespace monaco.editor { * Defaults to 'right'. */ side?: 'right' | 'left'; + /** + * Control the minimap rendering mode. + * Defaults to 'actual'. + */ + size?: 'proportional' | 'fill' | 'fit'; /** * Control the rendering of the minimap slider. * Defaults to 'mouseover'. @@ -3366,6 +3529,25 @@ declare namespace monaco.editor { export type EditorMinimapOptions = Readonly>; + /** + * Configuration options for editor padding + */ + export interface IEditorPaddingOptions { + /** + * Spacing between top edge of editor and first line. + */ + top?: number; + /** + * Spacing between bottom edge of editor and last line. + */ + bottom?: number; + } + + export interface InternalEditorPaddingOptions { + readonly top: number; + readonly bottom: number; + } + /** * Configuration options for parameter hints */ @@ -3388,9 +3570,9 @@ declare namespace monaco.editor { * Configuration options for quick suggestions */ export interface IQuickSuggestionsOptions { - other: boolean; - comments: boolean; - strings: boolean; + other?: boolean; + comments?: boolean; + strings?: boolean; } export type ValidQuickSuggestionsOptions = boolean | Readonly>; @@ -3410,6 +3592,11 @@ declare namespace monaco.editor { readonly renderFn: ((lineNumber: number) => string) | null; } + export interface IRulerOption { + readonly column: number; + readonly color: string | null; + } + /** * Configuration options for editor scrollbars */ @@ -3499,10 +3686,6 @@ declare namespace monaco.editor { * Overwrite word ends on accept. Default to false. */ insertMode?: 'insert' | 'replace'; - /** - * Show a highlight when suggestion replaces or keep text after the cursor. Defaults to false. - */ - insertHighlight?: boolean; /** * Enable graceful matching. Defaults to true. */ @@ -3623,14 +3806,27 @@ declare namespace monaco.editor { * Show typeParameter-suggestions. */ showTypeParameters?: boolean; + /** + * Show issue-suggestions. + */ + showIssues?: boolean; + /** + * Show user-suggestions. + */ + showUsers?: boolean; /** * Show snippet-suggestions. */ showSnippets?: boolean; /** - * Controls the visibility of the status bar at the bottom of the suggest widget. + * Status bar related settings. */ - hideStatusBar?: boolean; + statusBar?: { + /** + * Controls the visibility of the status bar at the bottom of the suggest widget. + */ + visible?: boolean; + }; } export type InternalSuggestOptions = Readonly>; @@ -3678,102 +3874,112 @@ declare namespace monaco.editor { autoSurround = 10, codeLens = 11, colorDecorators = 12, - comments = 13, - contextmenu = 14, - copyWithSyntaxHighlighting = 15, - cursorBlinking = 16, - cursorSmoothCaretAnimation = 17, - cursorStyle = 18, - cursorSurroundingLines = 19, - cursorSurroundingLinesStyle = 20, - cursorWidth = 21, - disableLayerHinting = 22, - disableMonospaceOptimizations = 23, - dragAndDrop = 24, - emptySelectionClipboard = 25, - extraEditorClassName = 26, - fastScrollSensitivity = 27, - find = 28, - fixedOverflowWidgets = 29, - folding = 30, - foldingStrategy = 31, - foldingHighlight = 32, - fontFamily = 33, - fontInfo = 34, - fontLigatures = 35, - fontSize = 36, - fontWeight = 37, - formatOnPaste = 38, - formatOnType = 39, - glyphMargin = 40, - gotoLocation = 41, - hideCursorInOverviewRuler = 42, - highlightActiveIndentGuide = 43, - hover = 44, - inDiffEditor = 45, - letterSpacing = 46, - lightbulb = 47, - lineDecorationsWidth = 48, - lineHeight = 49, - lineNumbers = 50, - lineNumbersMinChars = 51, - links = 52, - matchBrackets = 53, - minimap = 54, - mouseStyle = 55, - mouseWheelScrollSensitivity = 56, - mouseWheelZoom = 57, - multiCursorMergeOverlapping = 58, - multiCursorModifier = 59, - multiCursorPaste = 60, - occurrencesHighlight = 61, - overviewRulerBorder = 62, - overviewRulerLanes = 63, - parameterHints = 64, - peekWidgetDefaultFocus = 65, - quickSuggestions = 66, - quickSuggestionsDelay = 67, - readOnly = 68, - renderControlCharacters = 69, - renderIndentGuides = 70, - renderFinalNewline = 71, - renderLineHighlight = 72, - renderValidationDecorations = 73, - renderWhitespace = 74, - revealHorizontalRightPadding = 75, - roundedSelection = 76, - rulers = 77, - scrollbar = 78, - scrollBeyondLastColumn = 79, - scrollBeyondLastLine = 80, - selectionClipboard = 81, - selectionHighlight = 82, - selectOnLineNumbers = 83, - showFoldingControls = 84, - showUnused = 85, - snippetSuggestions = 86, - smoothScrolling = 87, - stopRenderingLineAfter = 88, - suggest = 89, - suggestFontSize = 90, - suggestLineHeight = 91, - suggestOnTriggerCharacters = 92, - suggestSelection = 93, - tabCompletion = 94, - useTabStops = 95, - wordSeparators = 96, - wordWrap = 97, - wordWrapBreakAfterCharacters = 98, - wordWrapBreakBeforeCharacters = 99, - wordWrapColumn = 100, - wordWrapMinified = 101, - wrappingIndent = 102, - wrappingStrategy = 103, - editorClassName = 104, - pixelRatio = 105, - tabFocusMode = 106, - layoutInfo = 107, - wrappingInfo = 108 + columnSelection = 13, + comments = 14, + contextmenu = 15, + copyWithSyntaxHighlighting = 16, + cursorBlinking = 17, + cursorSmoothCaretAnimation = 18, + cursorStyle = 19, + cursorSurroundingLines = 20, + cursorSurroundingLinesStyle = 21, + cursorWidth = 22, + disableLayerHinting = 23, + disableMonospaceOptimizations = 24, + dragAndDrop = 25, + emptySelectionClipboard = 26, + extraEditorClassName = 27, + fastScrollSensitivity = 28, + find = 29, + fixedOverflowWidgets = 30, + folding = 31, + foldingStrategy = 32, + foldingHighlight = 33, + unfoldOnClickAfterEndOfLine = 34, + fontFamily = 35, + fontInfo = 36, + fontLigatures = 37, + fontSize = 38, + fontWeight = 39, + formatOnPaste = 40, + formatOnType = 41, + glyphMargin = 42, + gotoLocation = 43, + hideCursorInOverviewRuler = 44, + highlightActiveIndentGuide = 45, + hover = 46, + inDiffEditor = 47, + letterSpacing = 48, + lightbulb = 49, + lineDecorationsWidth = 50, + lineHeight = 51, + lineNumbers = 52, + lineNumbersMinChars = 53, + links = 54, + matchBrackets = 55, + minimap = 56, + mouseStyle = 57, + mouseWheelScrollSensitivity = 58, + mouseWheelZoom = 59, + multiCursorMergeOverlapping = 60, + multiCursorModifier = 61, + multiCursorPaste = 62, + occurrencesHighlight = 63, + overviewRulerBorder = 64, + overviewRulerLanes = 65, + padding = 66, + parameterHints = 67, + peekWidgetDefaultFocus = 68, + definitionLinkOpensInPeek = 69, + quickSuggestions = 70, + quickSuggestionsDelay = 71, + readOnly = 72, + renameOnType = 73, + renderControlCharacters = 74, + renderIndentGuides = 75, + renderFinalNewline = 76, + renderLineHighlight = 77, + renderLineHighlightOnlyWhenFocus = 78, + renderValidationDecorations = 79, + renderWhitespace = 80, + revealHorizontalRightPadding = 81, + roundedSelection = 82, + rulers = 83, + scrollbar = 84, + scrollBeyondLastColumn = 85, + scrollBeyondLastLine = 86, + scrollPredominantAxis = 87, + selectionClipboard = 88, + selectionHighlight = 89, + selectOnLineNumbers = 90, + showFoldingControls = 91, + showUnused = 92, + snippetSuggestions = 93, + smoothScrolling = 94, + stopRenderingLineAfter = 95, + suggest = 96, + suggestFontSize = 97, + suggestLineHeight = 98, + suggestOnTriggerCharacters = 99, + suggestSelection = 100, + tabCompletion = 101, + tabIndex = 102, + unusualLineTerminators = 103, + useTabStops = 104, + wordSeparators = 105, + wordWrap = 106, + wordWrapBreakAfterCharacters = 107, + wordWrapBreakBeforeCharacters = 108, + wordWrapColumn = 109, + wordWrapMinified = 110, + wrappingIndent = 111, + wrappingStrategy = 112, + showDeprecated = 113, + editorClassName = 114, + pixelRatio = 115, + tabFocusMode = 116, + layoutInfo = 117, + wrappingInfo = 118 } export const EditorOptions: { acceptSuggestionOnCommitCharacter: IEditorOption; @@ -3789,6 +3995,7 @@ declare namespace monaco.editor { autoSurround: IEditorOption; codeLens: IEditorOption; colorDecorators: IEditorOption; + columnSelection: IEditorOption; comments: IEditorOption; contextmenu: IEditorOption; copyWithSyntaxHighlighting: IEditorOption; @@ -3809,6 +4016,7 @@ declare namespace monaco.editor { folding: IEditorOption; foldingStrategy: IEditorOption; foldingHighlight: IEditorOption; + unfoldOnClickAfterEndOfLine: IEditorOption; fontFamily: IEditorOption; fontInfo: IEditorOption; fontLigatures2: IEditorOption; @@ -3840,28 +4048,34 @@ declare namespace monaco.editor { occurrencesHighlight: IEditorOption; overviewRulerBorder: IEditorOption; overviewRulerLanes: IEditorOption; + padding: IEditorOption; parameterHints: IEditorOption; peekWidgetDefaultFocus: IEditorOption; + definitionLinkOpensInPeek: IEditorOption; quickSuggestions: IEditorOption; quickSuggestionsDelay: IEditorOption; readOnly: IEditorOption; + renameOnType: IEditorOption; renderControlCharacters: IEditorOption; renderIndentGuides: IEditorOption; renderFinalNewline: IEditorOption; renderLineHighlight: IEditorOption; + renderLineHighlightOnlyWhenFocus: IEditorOption; renderValidationDecorations: IEditorOption; - renderWhitespace: IEditorOption; + renderWhitespace: IEditorOption; revealHorizontalRightPadding: IEditorOption; roundedSelection: IEditorOption; rulers: IEditorOption; scrollbar: IEditorOption; scrollBeyondLastColumn: IEditorOption; scrollBeyondLastLine: IEditorOption; + scrollPredominantAxis: IEditorOption; selectionClipboard: IEditorOption; selectionHighlight: IEditorOption; selectOnLineNumbers: IEditorOption; showFoldingControls: IEditorOption; showUnused: IEditorOption; + showDeprecated: IEditorOption; snippetSuggestions: IEditorOption; smoothScrolling: IEditorOption; stopRenderingLineAfter: IEditorOption; @@ -3871,6 +4085,8 @@ declare namespace monaco.editor { suggestOnTriggerCharacters: IEditorOption; suggestSelection: IEditorOption; tabCompletion: IEditorOption; + tabIndex: IEditorOption; + unusualLineTerminators: IEditorOption; useTabStops: IEditorOption; wordSeparators: IEditorOption; wordWrap: IEditorOption; @@ -4197,6 +4413,26 @@ declare namespace monaco.editor { readonly mode: string | null; } + export interface IEditorConstructionOptions extends IEditorOptions { + /** + * The initial editor dimension (to avoid measuring the container). + */ + dimension?: IDimension; + /** + * Place overflow widgets inside an external DOM node. + * Defaults to an internal DOM node. + */ + overflowWidgetsDomNode?: HTMLElement; + } + + export interface IDiffEditorConstructionOptions extends IDiffEditorOptions { + /** + * Place overflow widgets inside an external DOM node. + * Defaults to an internal DOM node. + */ + overflowWidgetsDomNode?: HTMLElement; + } + /** * A rich code editor. */ @@ -4274,6 +4510,11 @@ declare namespace monaco.editor { * An event emitted after composition has ended. */ onDidCompositionEnd(listener: () => void): IDisposable; + /** + * An event emitted when editing failed because the editor is read-only. + * @event + */ + onDidAttemptReadOnlyEdit(listener: () => void): IDisposable; /** * An event emitted when users paste text in the editor. * @event @@ -4414,15 +4655,15 @@ declare namespace monaco.editor { /** * Change the scrollLeft of the editor's viewport. */ - setScrollLeft(newScrollLeft: number): void; + setScrollLeft(newScrollLeft: number, scrollType?: ScrollType): void; /** * Change the scrollTop of the editor's viewport. */ - setScrollTop(newScrollTop: number): void; + setScrollTop(newScrollTop: number, scrollType?: ScrollType): void; /** * Change the scroll position of the editor's viewport. */ - setScrollPosition(position: INewScrollPosition): void; + setScrollPosition(position: INewScrollPosition, scrollType?: ScrollType): void; /** * Get an action that is a contribution to this editor. * @id Unique identifier of the contribution. @@ -4435,7 +4676,7 @@ declare namespace monaco.editor { * @param source The source of the call. * @param command The command to execute */ - executeCommand(source: string, command: ICommand): void; + executeCommand(source: string | null | undefined, command: ICommand): void; /** * Push an "undo stop" in the undo-redo stack. */ @@ -4447,13 +4688,13 @@ declare namespace monaco.editor { * @param edits The edits to execute. * @param endCursorState Cursor state after the edits were applied. */ - executeEdits(source: string, edits: IIdentifiedSingleEditOperation[], endCursorState?: ICursorStateComputer | Selection[]): boolean; + executeEdits(source: string | null | undefined, edits: IIdentifiedSingleEditOperation[], endCursorState?: ICursorStateComputer | Selection[]): boolean; /** * Execute multiple (concomitant) commands on the editor. * @param source The source of the call. * @param command The commands to execute */ - executeCommands(source: string, commands: (ICommand | null)[]): void; + executeCommands(source: string | null | undefined, commands: (ICommand | null)[]): void; /** * Get all the decorations on a line (filtering out decorations from other editors). */ @@ -4631,6 +4872,7 @@ declare namespace monaco.editor { readonly canUseHalfwidthRightwardsArrow: boolean; readonly spaceWidth: number; readonly middotWidth: number; + readonly wsmiddotWidth: number; readonly maxDigitWidth: number; } @@ -4799,6 +5041,11 @@ declare namespace monaco.languages { */ export function registerDocumentHighlightProvider(languageId: string, provider: DocumentHighlightProvider): IDisposable; + /** + * Register an on type rename provider. + */ + export function registerOnTypeRenameProvider(languageId: string, provider: OnTypeRenameProvider): IDisposable; + /** * Register a definition provider (used by e.g. go to definition). */ @@ -5171,6 +5418,31 @@ declare namespace monaco.languages { provideHover(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult; } + /** + * An evaluatable expression represents additional information for an expression in a document. Evaluatable expression are + * evaluated by a debugger or runtime and their result is rendered in a tooltip-like widget. + */ + export interface EvaluatableExpression { + /** + * The range to which this expression applies. + */ + range: IRange; + expression?: string; + } + + /** + * The hover provider interface defines the contract between extensions and + * the [hover](https://code.visualstudio.com/docs/editor/intellisense)-feature. + */ + export interface EvaluatableExpressionProvider { + /** + * Provide a hover for the given position and document. Multiple hovers at the same + * position will be merged by the editor. A hover can have a range which defaults + * to the word range at the position when omitted. + */ + provideEvaluatableExpression(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult; + } + export enum CompletionItemKind { Method = 0, Function = 1, @@ -5197,7 +5469,9 @@ declare namespace monaco.languages { Customcolor = 22, Folder = 23, TypeParameter = 24, - Snippet = 25 + User = 25, + Issue = 26, + Snippet = 27 } export interface CompletionItemLabel { @@ -5206,9 +5480,9 @@ declare namespace monaco.languages { */ name: string; /** - * The signature without the return type. Render after `name`. + * The parameters without the return type. Render after `name`. */ - signature?: string; + parameters?: string; /** * The fully qualified name, like package name or file path. Rendered after `signature`. */ @@ -5285,7 +5559,7 @@ declare namespace monaco.languages { preselect?: boolean; /** * A string or snippet that should be inserted in a document when selecting - * this completion. When `falsy` the [label](#CompletionItem.label) + * this completion. * is used. */ insertText: string; @@ -5380,7 +5654,7 @@ declare namespace monaco.languages { * * The editor will only resolve a completion item once. */ - resolveCompletionItem?(model: editor.ITextModel, position: Position, item: CompletionItem, token: CancellationToken): ProviderResult; + resolveCompletionItem?(item: CompletionItem, token: CancellationToken): ProviderResult; } export interface CodeAction { @@ -5434,6 +5708,12 @@ declare namespace monaco.languages { * The parameters of this signature. */ parameters: ParameterInformation[]; + /** + * Index of the active parameter. + * + * If provided, this is used in place of `SignatureHelp.activeSignature`. + */ + activeParameter?: number; } /** @@ -5532,6 +5812,21 @@ declare namespace monaco.languages { provideDocumentHighlights(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult; } + /** + * The rename provider interface defines the contract between extensions and + * the live-rename feature. + */ + export interface OnTypeRenameProvider { + wordPattern?: RegExp; + /** + * Provide a list of ranges that can be live-renamed together. + */ + provideOnTypeRenameRanges(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<{ + ranges: IRange[]; + wordPattern?: RegExp; + }>; + } + /** * Value-object that contains additional information when * requesting references. @@ -5869,11 +6164,11 @@ declare namespace monaco.languages { } /** - * A provider of colors for editor models. + * A provider of folding ranges for editor models. */ export interface FoldingRangeProvider { /** - * Provides the color ranges for a specific model. + * Provides the folding ranges for a specific model. */ provideFoldingRanges(model: editor.ITextModel, context: FoldingContext, token: CancellationToken): ProviderResult; } @@ -5925,7 +6220,7 @@ declare namespace monaco.languages { description?: string; iconPath?: { id: string; - } | { + } | Uri | { light: Uri; dark: Uri; }; @@ -6016,6 +6311,7 @@ declare namespace monaco.languages { } export interface DocumentSemanticTokensProvider { + onDidChange?: IEvent; getLegend(): SemanticTokensLegend; provideDocumentSemanticTokens(model: editor.ITextModel, lastResultId: string | null, token: CancellationToken): ProviderResult; releaseDocumentSemanticTokens(resultId: string | undefined): void; @@ -6050,6 +6346,10 @@ declare namespace monaco.languages { * is the language case insensitive? */ ignoreCase?: boolean; + /** + * is the language unicode-aware? (i.e., /\u{1D306}/) + */ + unicode?: boolean; /** * if no match in the tokenizer assign this token class (default 'source') */ @@ -6073,9 +6373,9 @@ declare namespace monaco.languages { * shorthands: [reg,act] == { regex: reg, action: act} * and : [reg,act,nxt] == { regex: reg, action: act{ next: nxt }} */ - export type IShortMonarchLanguageRule1 = [RegExp, IMonarchLanguageAction]; + export type IShortMonarchLanguageRule1 = [string | RegExp, IMonarchLanguageAction]; - export type IShortMonarchLanguageRule2 = [RegExp, IMonarchLanguageAction, string]; + export type IShortMonarchLanguageRule2 = [string | RegExp, IMonarchLanguageAction, string]; export interface IExpandedMonarchLanguageRule { /** @@ -6472,10 +6772,7 @@ declare namespace monaco.languages.typescript { * Get code completions for the given file and position. * @returns `Promise` */ - getCompletionsAtPosition( - fileName: string, - position: number - ): Promise; + getCompletionsAtPosition(fileName: string, position: number): Promise; /** * Get code completion details for the given file, position, and entry. * @returns `Promise` @@ -6489,18 +6786,12 @@ declare namespace monaco.languages.typescript { * Get signature help items for the item at the given file and position. * @returns `Promise` */ - getSignatureHelpItems( - fileName: string, - position: number - ): Promise; + getSignatureHelpItems(fileName: string, position: number): Promise; /** * Get quick info for the item at the given position in the file. * @returns `Promise` */ - getQuickInfoAtPosition( - fileName: string, - position: number - ): Promise; + getQuickInfoAtPosition(fileName: string, position: number): Promise; /** * Get other ranges which are related to the item at the given position in the file (often used for highlighting). * @returns `Promise | undefined>` @@ -6521,10 +6812,7 @@ declare namespace monaco.languages.typescript { * Get references to the item at the given position in the file. * @returns `Promise` */ - getReferencesAtPosition( - fileName: string, - position: number - ): Promise; + getReferencesAtPosition(fileName: string, position: number): Promise; /** * Get outline entries for the item at the given position in the file. * @returns `Promise` @@ -6535,10 +6823,7 @@ declare namespace monaco.languages.typescript { * @param options `typescript.FormatCodeOptions` * @returns `Promise` */ - getFormattingEditsForDocument( - fileName: string, - options: any - ): Promise; + getFormattingEditsForDocument(fileName: string, options: any): Promise; /** * Get changes which should be applied to format the given range in the file. * @param options `typescript.FormatCodeOptions` @@ -6577,11 +6862,7 @@ declare namespace monaco.languages.typescript { * @param options `typescript.RenameInfoOptions` * @returns `Promise` */ - getRenameInfo( - fileName: string, - positon: number, - options: any - ): Promise; + getRenameInfo(fileName: string, positon: number, options: any): Promise; /** * Get transpiled output for the given file. * @returns `typescript.EmitOutput` @@ -6603,12 +6884,8 @@ declare namespace monaco.languages.typescript { export const typescriptVersion: string; export const typescriptDefaults: LanguageServiceDefaults; export const javascriptDefaults: LanguageServiceDefaults; - export const getTypeScriptWorker: () => Promise< - (...uris: Uri[]) => Promise - >; - export const getJavaScriptWorker: () => Promise< - (...uris: Uri[]) => Promise - >; + export const getTypeScriptWorker: () => Promise<(...uris: Uri[]) => Promise>; + export const getJavaScriptWorker: () => Promise<(...uris: Uri[]) => Promise>; } /*--------------------------------------------------------------------------------------------- @@ -6810,11 +7087,7 @@ declare namespace monaco.languages.html { readonly indentHandlebars: boolean; readonly endWithNewline: boolean; readonly extraLiners: string; - readonly wrapAttributes: - | 'auto' - | 'force' - | 'force-aligned' - | 'force-expand-multiline'; + readonly wrapAttributes: 'auto' | 'force' | 'force-aligned' | 'force-expand-multiline'; } export interface CompletionConfiguration { [provider: string]: boolean; diff --git a/package-lock.json b/package-lock.json index ef8bd202..81ff3d5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,9 +29,9 @@ "dev": true }, "@types/node": { - "version": "14.6.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.6.4.tgz", - "integrity": "sha512-Wk7nG1JSaMfMpoMJDKUsWYugliB2Vy55pdjLpmLixeyMi7HizW2I/9QoxsPCkXl3dO+ZOVqPumKaDUv5zJu2uQ==", + "version": "14.11.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.1.tgz", + "integrity": "sha512-oTQgnd0hblfLsJ6BvJzzSL+Inogp3lq9fGgqRkMB/ziKMgEUaFl801OncOzUmalfzt14N0oPHMK47ipl+wbTIw==", "dev": true, "optional": true }, @@ -233,9 +233,9 @@ "dev": true }, "abab": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.4.tgz", - "integrity": "sha512-Eu9ELJWCz/c1e9gTiCY+FceWxcqzjYEbqMgtndnuSqZSUCOL73TWNK2mHfIj4Cw2E/ongOp+JISVNCmovt2KYQ==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", + "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", "dev": true }, "acorn": { @@ -287,9 +287,9 @@ } }, "ajv": { - "version": "6.12.4", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz", - "integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==", + "version": "6.12.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz", + "integrity": "sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -524,6 +524,27 @@ "es-abstract": "^1.17.0-next.1", "es-array-method-boxes-properly": "^1.0.0", "is-string": "^1.0.4" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } } }, "asn1": { @@ -1463,9 +1484,9 @@ } }, "css-loader": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-4.2.2.tgz", - "integrity": "sha512-omVGsTkZPVwVRpckeUnLshPp12KsmMSLqYxs12+RzM9jRR5Y+Idn/tBffjXRvOE+qW7if24cuceFJqYR5FmGBg==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-4.3.0.tgz", + "integrity": "sha512-rdezjCjScIrsL8BSYszgT4s476IcNKt6yX69t0pHjJVnPUTDpn4WfIpDQTN3wCJvUvfsz/mFjuGOekf3PY3NUg==", "dev": true, "requires": { "camelcase": "^6.0.0", @@ -1478,7 +1499,7 @@ "postcss-modules-scope": "^2.2.0", "postcss-modules-values": "^3.0.0", "postcss-value-parser": "^4.1.0", - "schema-utils": "^2.7.0", + "schema-utils": "^2.7.1", "semver": "^7.3.2" } }, @@ -1834,9 +1855,9 @@ } }, "es-abstract": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", - "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "version": "1.18.0-next.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.0.tgz", + "integrity": "sha512-elZXTZXKn51hUBdJjSZGYRujuzilgXo8vSPQzjGYXLvSlGiCo8VO8ZGV3kjo9a0WNJJ57hENagwbtlRuHuzkcQ==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", @@ -1844,8 +1865,9 @@ "has": "^1.0.3", "has-symbols": "^1.0.1", "is-callable": "^1.2.0", - "is-regex": "^1.1.0", - "object-inspect": "^1.7.0", + "is-negative-zero": "^2.0.0", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", "object-keys": "^1.1.1", "object.assign": "^4.1.0", "string.prototype.trimend": "^1.0.1", @@ -1873,6 +1895,25 @@ "isarray": "^2.0.5" }, "dependencies": { + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + }, "isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", @@ -3103,9 +3144,9 @@ "dev": true }, "is-callable": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", - "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.1.tgz", + "integrity": "sha512-wliAfSzx6V+6WfMOmus1xy0XvSgf/dlStkvTfq7F0g4bOIW0PSUbnyse3NhDwdyYS1ozfUtAAySqTws3z9Eqgg==", "dev": true }, "is-data-descriptor": { @@ -3204,6 +3245,12 @@ "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", "dev": true }, + "is-negative-zero": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", + "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=", + "dev": true + }, "is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", @@ -4131,6 +4178,18 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, "p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -4298,39 +4357,39 @@ } }, "monaco-css": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/monaco-css/-/monaco-css-3.0.0.tgz", - "integrity": "sha512-BTHbQh2a6HOHpcwK6Zg4i7+CR6C53LSyaC3XUdzcr4W8rsOom6kyIcbOgehFYSnB0Nf+kg0etZu7CEpIx3Kcqw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/monaco-css/-/monaco-css-3.1.0.tgz", + "integrity": "sha512-//0qqewilkw8S5H7lOV5rRF9ba2tKXVXKv3bYmZRJ+sT0gaVmWghoEt+F5CIx/m9GSFeDtn70JDtyD+ftl/+Hg==", "dev": true }, "monaco-editor-core": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.20.0.tgz", - "integrity": "sha512-4mdmfEejTvRZzrEIn70jqqNl3g15vnkRdTkJ8uMK4jiljntlwhiSc5vknZOLt1QM8za16C3tDrSl2mTL9ma2Sg==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.21.0.tgz", + "integrity": "sha512-buBxOxwexlb7pdQrIHjj7OGmtVmEe735NN7M8GbhN03eYAKQmaeIAs1AyneOOHvbvh1Ntm7PoHH8f196gd2p6w==", "dev": true }, "monaco-html": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/monaco-html/-/monaco-html-3.0.0.tgz", - "integrity": "sha512-WFXVnebb14LIfRGUfcowRUvuMLIrZPWZ2DkbmcALeyWzB8HsGjKWMIkF0JoJj6BqCd6gYkE/Zi9M4mSoNqCDBA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/monaco-html/-/monaco-html-3.1.0.tgz", + "integrity": "sha512-qbdKAnkPdKOMXIlhDiNLYozfcnoP2EPn4YqhxCsDm62RSOaqWeSvD6c7IuQ6/L43uIZenN8+354auVoBVQ6LfA==", "dev": true }, "monaco-json": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/monaco-json/-/monaco-json-3.0.2.tgz", - "integrity": "sha512-A6y8kDUE0S09jSU3uax8hw1m7uL/Orpd7fSMLeVWR8pouhhmUArkcV47ecI9nft4CKLPFegPEED7UHoCDj1yuw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/monaco-json/-/monaco-json-3.1.0.tgz", + "integrity": "sha512-DwsZtMkMrXcSUJA5Ndxe6RcnrkeXjq9fMjOwfF8Kve+kzPU0pxZdNEM9u2jS0xHsMV3Pd/VnBn3psP/DZx42bQ==", "dev": true }, "monaco-languages": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/monaco-languages/-/monaco-languages-2.0.0.tgz", - "integrity": "sha512-HAnsEriYHtOYfxokGtguc5NfJN+PNmrtelZg8CwM859M2W5iFBqOnNGhOQPF35YHAUrj/JUKs45+/m9prlyiDw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/monaco-languages/-/monaco-languages-2.1.0.tgz", + "integrity": "sha512-c2afUp3lbUCrvEdVrH8EThQYbj5tb2FpvXFnFN3gOJScDlFknWb5nbaxiaVqY9CSIqzJVZpNc5HXpP5FWOuS3g==", "dev": true }, "monaco-typescript": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/monaco-typescript/-/monaco-typescript-4.0.2.tgz", - "integrity": "sha512-Th3EjbKmEnQuCvGV09S/jm8x4RTjP7pvbI6cFCACl/IeSmwI9P69vzm68oI9pzMxZ0cLXjcye+bBKEHVayWi1Q==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/monaco-typescript/-/monaco-typescript-4.1.0.tgz", + "integrity": "sha512-fwEKFkQJwlDeYQw5R9CFAYbz9hUakUdfQzkl9h4ReKETV/GD6gVdGZp3jo2C5fghSIx6FJDi1vgkAbxaTcfKfg==", "dev": true }, "move-concurrently": { @@ -4565,15 +4624,15 @@ } }, "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz", + "integrity": "sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==", "dev": true, "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.0", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" } }, "object.defaults": { @@ -5022,9 +5081,9 @@ "dev": true }, "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.34", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.34.tgz", + "integrity": "sha512-H/7V2VeNScX9KE83GDrDZNiGT1m2H+UTnlinIzhjlLX9hfMUn1mHNnGeX81a1c8JSBdBvqk7c2ZOG6ZPn5itGw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -5137,6 +5196,27 @@ "es-abstract": "^1.17.0-next.1", "function-bind": "^1.1.1", "iterate-value": "^1.0.0" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } } }, "proxy-from-env": { @@ -5831,9 +5911,9 @@ } }, "spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz", + "integrity": "sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw==", "dev": true }, "split": { @@ -5993,6 +6073,27 @@ "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.17.5" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } } }, "string.prototype.trimstart": { @@ -6003,6 +6104,27 @@ "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.17.5" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } } }, "string_decoder": { @@ -6321,18 +6443,15 @@ } }, "typedoc-default-themes": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.11.1.tgz", - "integrity": "sha512-1yl8pbhjrLywqGJx9TfT+wzP+ntudPYjgJdpCj+s5ed2etBkqZPOCBMKwpaN9o6pdoFQF195PggqWTLVEkaRQQ==", - "dev": true, - "requires": { - "lunr": "^2.3.9" - } + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.11.3.tgz", + "integrity": "sha512-SwyN188QGNA2iFS5mdWYTGzohKqJ1PWAXVmGolKnVc2NnpX234FEPF2nUvEg+O9jjwAu7ZSVZ5UrZri0raJOjQ==", + "dev": true }, "typescript": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz", - "integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.3.tgz", + "integrity": "sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg==", "dev": true }, "uglify-js": { @@ -6828,9 +6947,9 @@ "dev": true }, "webpack": { - "version": "4.44.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.44.1.tgz", - "integrity": "sha512-4UOGAohv/VGUNQJstzEywwNxqX417FnjZgZJpJQegddzPmTvph37eBIRbRTfdySXzVtJXLJfbMN3mMYhM6GdmQ==", + "version": "4.44.2", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.44.2.tgz", + "integrity": "sha512-6KJVGlCxYdISyurpQ0IPTklv+DULv05rs2hseIXer6D7KrUicRDLFb4IUM1S6LUAKypPM/nSiVSuv8jHu1m3/Q==", "dev": true, "requires": { "@webassemblyjs/ast": "1.9.0", diff --git a/package.json b/package.json index 65847754..fad8a87a 100644 --- a/package.json +++ b/package.json @@ -26,26 +26,26 @@ "@types/mocha": "^8.0.3", "chai": "^4.2.0", "clean-css": "^4.2.3", - "css-loader": "^4.2.2", + "css-loader": "^4.3.0", "event-stream": "4.0.1", "file-loader": "^6.1.0", "gulp": "^4.0.2", "gulp-typedoc": "^2.2.5", "mocha": "^8.1.3", - "monaco-css": "3.0.0", - "monaco-editor-core": "0.20.0", - "monaco-html": "3.0.0", - "monaco-json": "3.0.2", - "monaco-languages": "2.0.0", - "monaco-typescript": "4.0.2", + "monaco-css": "3.1.0", + "monaco-editor-core": "0.21.0", + "monaco-html": "3.1.0", + "monaco-json": "3.1.0", + "monaco-languages": "2.1.0", + "monaco-typescript": "4.1.0", "playwright": "1.3.0", "rimraf": "^3.0.2", "style-loader": "^1.2.1", "typedoc": "^0.19.1", - "typescript": "^4.0.2", + "typescript": "^4.0.3", "uncss": "^0.17.3", "vinyl": "^2.2.0", - "webpack": "^4.44.1", + "webpack": "^4.44.2", "webpack-cli": "^3.3.12", "yaserver": "^0.3.0" } diff --git a/website/playground/monaco.d.ts.txt b/website/playground/monaco.d.ts.txt index d8897ec8..822da828 100644 --- a/website/playground/monaco.d.ts.txt +++ b/website/playground/monaco.d.ts.txt @@ -59,12 +59,19 @@ declare namespace monaco { } export interface CancellationToken { + /** + * A flag signalling is cancellation has been requested. + */ readonly isCancellationRequested: boolean; /** - * An event emitted when cancellation is requested + * An event which fires when cancellation is requested. This event + * only ever fires `once` as cancellation can only happen once. Listeners + * that are registered after cancellation will be called (next event loop run), + * but also only once. + * * @event */ - readonly onCancellationRequested: IEvent; + readonly onCancellationRequested: (listener: (e: any) => any, thisArgs?: any, disposables?: IDisposable[]) => IDisposable; } /** * Uniform Resource Identifier (Uri) http://tools.ietf.org/html/rfc3986. @@ -72,6 +79,7 @@ declare namespace monaco { * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation * and encoding. * + * ```txt * foo://example.com:8042/over/there?name=ferret#nose * \_/ \______________/\_________/ \_________/ \__/ * | | | | | @@ -79,6 +87,7 @@ declare namespace monaco { * | _____________________|__ * / \ / \ * urn:example:animal:ferret:nose + * ``` */ export class Uri implements UriComponents { static isUri(thing: any): thing is Uri; @@ -172,6 +181,14 @@ declare namespace monaco { query?: string; fragment?: string; }): Uri; + /** + * Join a Uri path with path fragments and normalizes the resulting path. + * + * @param uri The input Uri. + * @param pathFragment The path fragment to add to the Uri path. + * @returns The resulting Uri. + */ + static joinPath(uri: Uri, ...pathFragment: string[]): Uri; /** * Creates a string representation for this Uri. It's guaranteed that calling * `Uri.parse` with the result of this function creates an Uri which is equal @@ -379,7 +396,6 @@ declare namespace monaco { */ MAX_VALUE = 112 } - export class KeyMod { static readonly CtrlCmd: number; static readonly Shift: number; @@ -636,10 +652,18 @@ declare namespace monaco { * Return the end position (which will be after or equal to the start position) */ getEndPosition(): Position; + /** + * Return the end position (which will be after or equal to the start position) + */ + static getEndPosition(range: IRange): Position; /** * Return the start position (which will be before or equal to the end position) */ getStartPosition(): Position; + /** + * Return the start position (which will be before or equal to the end position) + */ + static getStartPosition(range: IRange): Position; /** * Transform to a user presentable string representation. */ @@ -1096,6 +1120,14 @@ declare namespace monaco.editor { * Defaults to true. */ wordBasedSuggestions?: boolean; + /** + * Controls whether the semanticHighlighting is shown for the languages that support it. + * true: semanticHighlighting is enabled for all themes + * false: semanticHighlighting is disabled for all themes + * 'configuredByTheme': semanticHighlighting is controlled by the current color theme's semanticHighlighting setting. + * Defaults to 'byTheme'. + */ + 'semanticHighlighting.enabled'?: true | false | 'configuredByTheme'; /** * Keep peek editors open even when double clicking their content or when hitting `Escape`. * Defaults to false. @@ -1106,6 +1138,13 @@ declare namespace monaco.editor { * Defaults to 20000. */ maxTokenizationLineLength?: number; + /** + * Theme to be used for rendering. + * The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black'. + * You can create custom themes via `monaco.editor.defineTheme`. + * To switch a theme, use `monaco.editor.setTheme` + */ + theme?: string; } /** @@ -1189,7 +1228,7 @@ declare namespace monaco.editor { severity: MarkerSeverity; code?: string | { value: string; - link: Uri; + target: Uri; }; message: string; source?: string; @@ -1207,7 +1246,7 @@ declare namespace monaco.editor { export interface IMarkerData { code?: string | { value: string; - link: Uri; + target: Uri; }; severity: MarkerSeverity; message: string; @@ -1348,6 +1387,10 @@ declare namespace monaco.editor { * If set, the decoration will be rendered in the lines decorations with this CSS class name. */ linesDecorationsClassName?: string | null; + /** + * 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. + */ + firstLineDecorationClassName?: string | null; /** * If set, the decoration will be rendered in the margin (covering its full width) with this CSS class name. */ @@ -1499,7 +1542,7 @@ declare namespace monaco.editor { /** * The range to replace. This can be empty to emulate a simple insert. */ - range: Range; + range: IRange; /** * The text to replace with. This can be null to emulate a simple delete. */ @@ -1511,6 +1554,17 @@ declare namespace monaco.editor { forceMoveMarkers?: boolean; } + export interface IValidEditOperation { + /** + * The range to replace. This can be empty to emulate a simple insert. + */ + range: Range; + /** + * The text to replace with. This can be empty to emulate a simple delete. + */ + text: string; + } + /** * A callback that can compute the cursor state after applying a series of edit operations. */ @@ -1518,7 +1572,7 @@ declare namespace monaco.editor { /** * A callback that can compute the resulting cursors state after some edit operations have been executed. */ - (inverseEditOperations: IIdentifiedSingleEditOperation[]): Selection[] | null; + (inverseEditOperations: IValidEditOperation[]): Selection[] | null; } export class TextModelResolvedOptions { @@ -1712,7 +1766,7 @@ declare namespace monaco.editor { /** * Search the model. * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true. - * @param searchScope Limit the searching to only search inside this range. + * @param searchScope Limit the searching to only search inside these ranges. * @param isRegex Used to indicate that `searchString` is a regular expression. * @param matchCase Force the matching to match lower/upper case exactly. * @param wordSeparators Force the matching to match entire words only. Pass null otherwise. @@ -1720,7 +1774,7 @@ declare namespace monaco.editor { * @param limitResultCount Limit the number of results * @return The ranges where the matches are. It is empty if no matches have been found. */ - findMatches(searchString: string, searchScope: IRange, isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean, limitResultCount?: number): FindMatch[]; + findMatches(searchString: string, searchScope: IRange | IRange[], isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean, limitResultCount?: number): FindMatch[]; /** * Search the model for the next match. Loops to the beginning of the model if needed. * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true. @@ -1846,7 +1900,7 @@ declare namespace monaco.editor { * @param cursorStateComputer A callback that can compute the resulting cursors state after the edit operations have been executed. * @return The cursor state returned by the `cursorStateComputer`. */ - pushEditOperations(beforeCursorState: Selection[], editOperations: IIdentifiedSingleEditOperation[], cursorStateComputer: ICursorStateComputer): Selection[] | null; + pushEditOperations(beforeCursorState: Selection[] | null, editOperations: IIdentifiedSingleEditOperation[], cursorStateComputer: ICursorStateComputer): Selection[] | null; /** * Change the end of line sequence. This is the preferred way of * changing the eol sequence. This will land on the undo stack. @@ -1856,9 +1910,11 @@ declare namespace monaco.editor { * Edit the model without adding the edits to the undo stack. * This can have dire consequences on the undo stack! See @pushEditOperations for the preferred way. * @param operations The edit operations. - * @return The inverse edit operations, that, when applied, will bring the model back to the previous state. + * @return If desired, the inverse edit operations, that, when applied, will bring the model back to the previous state. */ - applyEdits(operations: IIdentifiedSingleEditOperation[]): IIdentifiedSingleEditOperation[]; + applyEdits(operations: IIdentifiedSingleEditOperation[]): void; + applyEdits(operations: IIdentifiedSingleEditOperation[], computeUndoEdits: false): void; + applyEdits(operations: IIdentifiedSingleEditOperation[], computeUndoEdits: true): IValidEditOperation[]; /** * Change the end of line sequence without recording in the undo stack. * This can have dire consequences on the undo stack! See @pushEOL for the preferred way. @@ -1910,14 +1966,14 @@ declare namespace monaco.editor { * @param range The range to replace (delete). May be empty to represent a simple insert. * @param text The text to replace with. May be null to represent a simple delete. */ - addEditOperation(range: Range, text: string | null, forceMoveMarkers?: boolean): void; + addEditOperation(range: IRange, text: string | null, forceMoveMarkers?: boolean): void; /** * Add a new edit operation (a replace operation). * The inverse edits will be accessible in `ICursorStateComputerData.getInverseEditOperations()` * @param range The range to replace (delete). May be empty to represent a simple insert. * @param text The text to replace with. May be null to represent a simple delete. */ - addTrackedEditOperation(range: Range, text: string | null, forceMoveMarkers?: boolean): void; + addTrackedEditOperation(range: IRange, text: string | null, forceMoveMarkers?: boolean): void; /** * Track `selection` when applying edit operations. * A best effort will be made to not grow/expand the selection. @@ -1937,7 +1993,7 @@ declare namespace monaco.editor { /** * Get the inverse edit operations of the added edit operations. */ - getInverseEditOperations(): IIdentifiedSingleEditOperation[]; + getInverseEditOperations(): IValidEditOperation[]; /** * Get a previously tracked selection. * @param id The unique identifier returned by `trackSelection`. @@ -2176,6 +2232,11 @@ declare namespace monaco.editor { * Scroll vertically as necessary and reveal a line centered vertically only if it lies outside the viewport. */ revealLineInCenterIfOutsideViewport(lineNumber: number, scrollType?: ScrollType): void; + /** + * Scroll vertically as necessary and reveal a line close to the top of the viewport, + * optimized for viewing a code definition. + */ + revealLineNearTop(lineNumber: number, scrollType?: ScrollType): void; /** * Scroll vertically or horizontally as necessary and reveal a position. */ @@ -2188,6 +2249,11 @@ declare namespace monaco.editor { * Scroll vertically or horizontally as necessary and reveal a position centered vertically only if it lies outside the viewport. */ revealPositionInCenterIfOutsideViewport(position: IPosition, scrollType?: ScrollType): void; + /** + * Scroll vertically or horizontally as necessary and reveal a position close to the top of the viewport, + * optimized for viewing a code definition. + */ + revealPositionNearTop(position: IPosition, scrollType?: ScrollType): void; /** * Returns the primary selection of the editor. */ @@ -2233,6 +2299,11 @@ declare namespace monaco.editor { * Scroll vertically as necessary and reveal lines centered vertically only if it lies outside the viewport. */ revealLinesInCenterIfOutsideViewport(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void; + /** + * Scroll vertically as necessary and reveal lines close to the top of the viewport, + * optimized for viewing a code definition. + */ + revealLinesNearTop(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void; /** * Scroll vertically or horizontally as necessary and reveal a range. */ @@ -2249,13 +2320,23 @@ declare namespace monaco.editor { * Scroll vertically or horizontally as necessary and reveal a range centered vertically only if it lies outside the viewport. */ revealRangeInCenterIfOutsideViewport(range: IRange, scrollType?: ScrollType): void; + /** + * Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, + * optimized for viewing a code definition. + */ + revealRangeNearTop(range: IRange, scrollType?: ScrollType): void; + /** + * Scroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, + * optimized for viewing a code definition. Only if it lies outside the viewport. + */ + revealRangeNearTopIfOutsideViewport(range: IRange, scrollType?: ScrollType): void; /** * Directly trigger a handler or an editor action. * @param source The source of the call. * @param handlerId The id of the handler or the id of a contribution. * @param payload Extra data to be sent to the handler. */ - trigger(source: string, handlerId: string, payload: any): void; + trigger(source: string | null | undefined, handlerId: string, payload: any): void; /** * Gets the current model attached to this editor. */ @@ -2368,6 +2449,8 @@ declare namespace monaco.editor { * An event describing that model decorations have changed. */ export interface IModelDecorationsChangedEvent { + readonly affectsMinimap: boolean; + readonly affectsOverviewRuler: boolean; } export interface IModelOptionsChangedEvent { @@ -2514,11 +2597,15 @@ declare namespace monaco.editor { * The aria label for the editor's textarea (when it is focused). */ ariaLabel?: string; + /** + * The `tabindex` property of the editor's textarea + */ + tabIndex?: number; /** * Render vertical lines at the specified columns. * Defaults to empty array. */ - rulers?: number[]; + rulers?: (number | IRulerOption)[]; /** * A string containing the word separators used when doing word navigation. * Defaults to `~!@#$%^&*()-=+[{]}\\|;:\'",.<>/? @@ -2553,6 +2640,11 @@ declare namespace monaco.editor { * Defaults to true. */ renderFinalNewline?: boolean; + /** + * Remove unusual line terminators like LINE SEPARATOR (LS), PARAGRAPH SEPARATOR (PS). + * Defaults to 'prompt'. + */ + unusualLineTerminators?: 'off' | 'prompt' | 'auto'; /** * Should the corresponding line be selected when clicking on the line number? * Defaults to true. @@ -2595,6 +2687,11 @@ declare namespace monaco.editor { * Defaults to false. */ readOnly?: boolean; + /** + * Rename matching regions on type. + * Defaults to false. + */ + renameOnType?: boolean; /** * Should the editor render validation decorations. * Defaults to editable. @@ -2779,6 +2876,16 @@ declare namespace monaco.editor { * Defaults to 5. */ fastScrollSensitivity?: number; + /** + * Enable that the editor scrolls only the predominant axis. Prevents horizontal drift when scrolling vertically on a trackpad. + * Defaults to true. + */ + scrollPredominantAxis?: boolean; + /** + * Enable that the selection with the mouse and keys is doing column selection. + * Defaults to false. + */ + columnSelection?: boolean; /** * The modifier to be used to add multiple cursors with the mouse. * Defaults to 'alt' @@ -2821,6 +2928,10 @@ declare namespace monaco.editor { * Defaults to 10 (ms) */ quickSuggestionsDelay?: number; + /** + * Controls the spacing around the editor. + */ + padding?: IEditorPaddingOptions; /** * Parameter hint options. */ @@ -2952,6 +3063,11 @@ declare namespace monaco.editor { * Defaults to 'mouseover'. */ showFoldingControls?: 'always' | 'mouseover'; + /** + * Controls whether clicking on the empty content after a folded line will unfold the line. + * Defaults to false. + */ + unfoldOnClickAfterEndOfLine?: boolean; /** * Enable highlighting of matching brackets. * Defaults to 'always'. @@ -2961,7 +3077,7 @@ declare namespace monaco.editor { * Enable rendering of whitespace. * Defaults to none. */ - renderWhitespace?: 'none' | 'boundary' | 'selection' | 'all'; + renderWhitespace?: 'none' | 'boundary' | 'selection' | 'trailing' | 'all'; /** * Enable rendering of control characters. * Defaults to false. @@ -2982,6 +3098,11 @@ declare namespace monaco.editor { * Defaults to all. */ renderLineHighlight?: 'none' | 'gutter' | 'line' | 'all'; + /** + * Control if the current line highlight should be rendered only the editor is focused. + * Defaults to false. + */ + renderLineHighlightOnlyWhenFocus?: boolean; /** * Inserting and deleting whitespace follows tab stops. */ @@ -3015,13 +3136,15 @@ declare namespace monaco.editor { * Defaults to false. */ peekWidgetDefaultFocus?: 'tree' | 'editor'; - } - - export interface IEditorConstructionOptions extends IEditorOptions { /** - * The initial editor dimension (to avoid measuring the container). + * Controls whether the definition link opens element in the peek widget. + * Defaults to false. */ - dimension?: IDimension; + definitionLinkOpensInPeek?: boolean; + /** + * Controls strikethrough deprecated variables. + */ + showDeprecated?: boolean; } /** @@ -3058,6 +3181,16 @@ declare namespace monaco.editor { * Defaults to false. */ originalEditable?: boolean; + /** + * Original editor should be have code lens enabled? + * Defaults to false. + */ + originalCodeLens?: boolean; + /** + * Modified editor should be have code lens enabled? + * Defaults to false. + */ + modifiedCodeLens?: boolean; } /** @@ -3089,6 +3222,11 @@ declare namespace monaco.editor { * Defaults to true. */ insertSpace?: boolean; + /** + * Ignore empty lines when inserting line comments. + * Defaults to true. + */ + ignoreEmptyLines?: boolean; } export type EditorCommentsOptions = Readonly>; @@ -3157,6 +3295,10 @@ declare namespace monaco.editor { * Configuration options for editor find widget */ export interface IEditorFindOptions { + /** + * Controls whether the cursor should move to find matches while typing. + */ + cursorMoveOnType?: boolean; /** * Controls if we seed search string in the Find Widget with editor selection. */ @@ -3166,6 +3308,10 @@ declare namespace monaco.editor { */ autoFindInSelection?: 'never' | 'always' | 'multiline'; addExtraSpaceOnTop?: boolean; + /** + * Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found + */ + loop?: boolean; } export type EditorFindOptions = Readonly>; @@ -3287,21 +3433,16 @@ declare namespace monaco.editor { */ readonly contentWidth: number; /** - * The position for the minimap + * Layout information for the minimap */ - readonly minimapLeft: number; - /** - * The width of the minimap - */ - readonly minimapWidth: number; - /** - * Minimap render type - */ - readonly renderMinimap: RenderMinimap; + readonly minimap: EditorMinimapLayoutInfo; /** * The number of columns (of typical characters) fitting on a viewport line. */ readonly viewportColumn: number; + readonly isWordWrapMinified: boolean; + readonly isViewportWrapping: boolean; + readonly wrappingColumn: number; /** * The width of the vertical scrollbar. */ @@ -3316,6 +3457,23 @@ declare namespace monaco.editor { readonly overviewRuler: OverviewRulerPosition; } + /** + * The internal layout details of the editor. + */ + export interface EditorMinimapLayoutInfo { + readonly renderMinimap: RenderMinimap; + readonly minimapLeft: number; + readonly minimapWidth: number; + readonly minimapHeightIsEditorHeight: boolean; + readonly minimapIsSampling: boolean; + readonly minimapScale: number; + readonly minimapLineHeight: number; + readonly minimapCanvasInnerWidth: number; + readonly minimapCanvasInnerHeight: number; + readonly minimapCanvasOuterWidth: number; + readonly minimapCanvasOuterHeight: number; + } + /** * Configuration options for editor lightbulb */ @@ -3343,6 +3501,11 @@ declare namespace monaco.editor { * Defaults to 'right'. */ side?: 'right' | 'left'; + /** + * Control the minimap rendering mode. + * Defaults to 'actual'. + */ + size?: 'proportional' | 'fill' | 'fit'; /** * Control the rendering of the minimap slider. * Defaults to 'mouseover'. @@ -3366,6 +3529,25 @@ declare namespace monaco.editor { export type EditorMinimapOptions = Readonly>; + /** + * Configuration options for editor padding + */ + export interface IEditorPaddingOptions { + /** + * Spacing between top edge of editor and first line. + */ + top?: number; + /** + * Spacing between bottom edge of editor and last line. + */ + bottom?: number; + } + + export interface InternalEditorPaddingOptions { + readonly top: number; + readonly bottom: number; + } + /** * Configuration options for parameter hints */ @@ -3388,9 +3570,9 @@ declare namespace monaco.editor { * Configuration options for quick suggestions */ export interface IQuickSuggestionsOptions { - other: boolean; - comments: boolean; - strings: boolean; + other?: boolean; + comments?: boolean; + strings?: boolean; } export type ValidQuickSuggestionsOptions = boolean | Readonly>; @@ -3410,6 +3592,11 @@ declare namespace monaco.editor { readonly renderFn: ((lineNumber: number) => string) | null; } + export interface IRulerOption { + readonly column: number; + readonly color: string | null; + } + /** * Configuration options for editor scrollbars */ @@ -3499,10 +3686,6 @@ declare namespace monaco.editor { * Overwrite word ends on accept. Default to false. */ insertMode?: 'insert' | 'replace'; - /** - * Show a highlight when suggestion replaces or keep text after the cursor. Defaults to false. - */ - insertHighlight?: boolean; /** * Enable graceful matching. Defaults to true. */ @@ -3623,14 +3806,27 @@ declare namespace monaco.editor { * Show typeParameter-suggestions. */ showTypeParameters?: boolean; + /** + * Show issue-suggestions. + */ + showIssues?: boolean; + /** + * Show user-suggestions. + */ + showUsers?: boolean; /** * Show snippet-suggestions. */ showSnippets?: boolean; /** - * Controls the visibility of the status bar at the bottom of the suggest widget. + * Status bar related settings. */ - hideStatusBar?: boolean; + statusBar?: { + /** + * Controls the visibility of the status bar at the bottom of the suggest widget. + */ + visible?: boolean; + }; } export type InternalSuggestOptions = Readonly>; @@ -3678,102 +3874,112 @@ declare namespace monaco.editor { autoSurround = 10, codeLens = 11, colorDecorators = 12, - comments = 13, - contextmenu = 14, - copyWithSyntaxHighlighting = 15, - cursorBlinking = 16, - cursorSmoothCaretAnimation = 17, - cursorStyle = 18, - cursorSurroundingLines = 19, - cursorSurroundingLinesStyle = 20, - cursorWidth = 21, - disableLayerHinting = 22, - disableMonospaceOptimizations = 23, - dragAndDrop = 24, - emptySelectionClipboard = 25, - extraEditorClassName = 26, - fastScrollSensitivity = 27, - find = 28, - fixedOverflowWidgets = 29, - folding = 30, - foldingStrategy = 31, - foldingHighlight = 32, - fontFamily = 33, - fontInfo = 34, - fontLigatures = 35, - fontSize = 36, - fontWeight = 37, - formatOnPaste = 38, - formatOnType = 39, - glyphMargin = 40, - gotoLocation = 41, - hideCursorInOverviewRuler = 42, - highlightActiveIndentGuide = 43, - hover = 44, - inDiffEditor = 45, - letterSpacing = 46, - lightbulb = 47, - lineDecorationsWidth = 48, - lineHeight = 49, - lineNumbers = 50, - lineNumbersMinChars = 51, - links = 52, - matchBrackets = 53, - minimap = 54, - mouseStyle = 55, - mouseWheelScrollSensitivity = 56, - mouseWheelZoom = 57, - multiCursorMergeOverlapping = 58, - multiCursorModifier = 59, - multiCursorPaste = 60, - occurrencesHighlight = 61, - overviewRulerBorder = 62, - overviewRulerLanes = 63, - parameterHints = 64, - peekWidgetDefaultFocus = 65, - quickSuggestions = 66, - quickSuggestionsDelay = 67, - readOnly = 68, - renderControlCharacters = 69, - renderIndentGuides = 70, - renderFinalNewline = 71, - renderLineHighlight = 72, - renderValidationDecorations = 73, - renderWhitespace = 74, - revealHorizontalRightPadding = 75, - roundedSelection = 76, - rulers = 77, - scrollbar = 78, - scrollBeyondLastColumn = 79, - scrollBeyondLastLine = 80, - selectionClipboard = 81, - selectionHighlight = 82, - selectOnLineNumbers = 83, - showFoldingControls = 84, - showUnused = 85, - snippetSuggestions = 86, - smoothScrolling = 87, - stopRenderingLineAfter = 88, - suggest = 89, - suggestFontSize = 90, - suggestLineHeight = 91, - suggestOnTriggerCharacters = 92, - suggestSelection = 93, - tabCompletion = 94, - useTabStops = 95, - wordSeparators = 96, - wordWrap = 97, - wordWrapBreakAfterCharacters = 98, - wordWrapBreakBeforeCharacters = 99, - wordWrapColumn = 100, - wordWrapMinified = 101, - wrappingIndent = 102, - wrappingStrategy = 103, - editorClassName = 104, - pixelRatio = 105, - tabFocusMode = 106, - layoutInfo = 107, - wrappingInfo = 108 + columnSelection = 13, + comments = 14, + contextmenu = 15, + copyWithSyntaxHighlighting = 16, + cursorBlinking = 17, + cursorSmoothCaretAnimation = 18, + cursorStyle = 19, + cursorSurroundingLines = 20, + cursorSurroundingLinesStyle = 21, + cursorWidth = 22, + disableLayerHinting = 23, + disableMonospaceOptimizations = 24, + dragAndDrop = 25, + emptySelectionClipboard = 26, + extraEditorClassName = 27, + fastScrollSensitivity = 28, + find = 29, + fixedOverflowWidgets = 30, + folding = 31, + foldingStrategy = 32, + foldingHighlight = 33, + unfoldOnClickAfterEndOfLine = 34, + fontFamily = 35, + fontInfo = 36, + fontLigatures = 37, + fontSize = 38, + fontWeight = 39, + formatOnPaste = 40, + formatOnType = 41, + glyphMargin = 42, + gotoLocation = 43, + hideCursorInOverviewRuler = 44, + highlightActiveIndentGuide = 45, + hover = 46, + inDiffEditor = 47, + letterSpacing = 48, + lightbulb = 49, + lineDecorationsWidth = 50, + lineHeight = 51, + lineNumbers = 52, + lineNumbersMinChars = 53, + links = 54, + matchBrackets = 55, + minimap = 56, + mouseStyle = 57, + mouseWheelScrollSensitivity = 58, + mouseWheelZoom = 59, + multiCursorMergeOverlapping = 60, + multiCursorModifier = 61, + multiCursorPaste = 62, + occurrencesHighlight = 63, + overviewRulerBorder = 64, + overviewRulerLanes = 65, + padding = 66, + parameterHints = 67, + peekWidgetDefaultFocus = 68, + definitionLinkOpensInPeek = 69, + quickSuggestions = 70, + quickSuggestionsDelay = 71, + readOnly = 72, + renameOnType = 73, + renderControlCharacters = 74, + renderIndentGuides = 75, + renderFinalNewline = 76, + renderLineHighlight = 77, + renderLineHighlightOnlyWhenFocus = 78, + renderValidationDecorations = 79, + renderWhitespace = 80, + revealHorizontalRightPadding = 81, + roundedSelection = 82, + rulers = 83, + scrollbar = 84, + scrollBeyondLastColumn = 85, + scrollBeyondLastLine = 86, + scrollPredominantAxis = 87, + selectionClipboard = 88, + selectionHighlight = 89, + selectOnLineNumbers = 90, + showFoldingControls = 91, + showUnused = 92, + snippetSuggestions = 93, + smoothScrolling = 94, + stopRenderingLineAfter = 95, + suggest = 96, + suggestFontSize = 97, + suggestLineHeight = 98, + suggestOnTriggerCharacters = 99, + suggestSelection = 100, + tabCompletion = 101, + tabIndex = 102, + unusualLineTerminators = 103, + useTabStops = 104, + wordSeparators = 105, + wordWrap = 106, + wordWrapBreakAfterCharacters = 107, + wordWrapBreakBeforeCharacters = 108, + wordWrapColumn = 109, + wordWrapMinified = 110, + wrappingIndent = 111, + wrappingStrategy = 112, + showDeprecated = 113, + editorClassName = 114, + pixelRatio = 115, + tabFocusMode = 116, + layoutInfo = 117, + wrappingInfo = 118 } export const EditorOptions: { acceptSuggestionOnCommitCharacter: IEditorOption; @@ -3789,6 +3995,7 @@ declare namespace monaco.editor { autoSurround: IEditorOption; codeLens: IEditorOption; colorDecorators: IEditorOption; + columnSelection: IEditorOption; comments: IEditorOption; contextmenu: IEditorOption; copyWithSyntaxHighlighting: IEditorOption; @@ -3809,6 +4016,7 @@ declare namespace monaco.editor { folding: IEditorOption; foldingStrategy: IEditorOption; foldingHighlight: IEditorOption; + unfoldOnClickAfterEndOfLine: IEditorOption; fontFamily: IEditorOption; fontInfo: IEditorOption; fontLigatures2: IEditorOption; @@ -3840,28 +4048,34 @@ declare namespace monaco.editor { occurrencesHighlight: IEditorOption; overviewRulerBorder: IEditorOption; overviewRulerLanes: IEditorOption; + padding: IEditorOption; parameterHints: IEditorOption; peekWidgetDefaultFocus: IEditorOption; + definitionLinkOpensInPeek: IEditorOption; quickSuggestions: IEditorOption; quickSuggestionsDelay: IEditorOption; readOnly: IEditorOption; + renameOnType: IEditorOption; renderControlCharacters: IEditorOption; renderIndentGuides: IEditorOption; renderFinalNewline: IEditorOption; renderLineHighlight: IEditorOption; + renderLineHighlightOnlyWhenFocus: IEditorOption; renderValidationDecorations: IEditorOption; - renderWhitespace: IEditorOption; + renderWhitespace: IEditorOption; revealHorizontalRightPadding: IEditorOption; roundedSelection: IEditorOption; rulers: IEditorOption; scrollbar: IEditorOption; scrollBeyondLastColumn: IEditorOption; scrollBeyondLastLine: IEditorOption; + scrollPredominantAxis: IEditorOption; selectionClipboard: IEditorOption; selectionHighlight: IEditorOption; selectOnLineNumbers: IEditorOption; showFoldingControls: IEditorOption; showUnused: IEditorOption; + showDeprecated: IEditorOption; snippetSuggestions: IEditorOption; smoothScrolling: IEditorOption; stopRenderingLineAfter: IEditorOption; @@ -3871,6 +4085,8 @@ declare namespace monaco.editor { suggestOnTriggerCharacters: IEditorOption; suggestSelection: IEditorOption; tabCompletion: IEditorOption; + tabIndex: IEditorOption; + unusualLineTerminators: IEditorOption; useTabStops: IEditorOption; wordSeparators: IEditorOption; wordWrap: IEditorOption; @@ -4197,6 +4413,26 @@ declare namespace monaco.editor { readonly mode: string | null; } + export interface IEditorConstructionOptions extends IEditorOptions { + /** + * The initial editor dimension (to avoid measuring the container). + */ + dimension?: IDimension; + /** + * Place overflow widgets inside an external DOM node. + * Defaults to an internal DOM node. + */ + overflowWidgetsDomNode?: HTMLElement; + } + + export interface IDiffEditorConstructionOptions extends IDiffEditorOptions { + /** + * Place overflow widgets inside an external DOM node. + * Defaults to an internal DOM node. + */ + overflowWidgetsDomNode?: HTMLElement; + } + /** * A rich code editor. */ @@ -4274,6 +4510,11 @@ declare namespace monaco.editor { * An event emitted after composition has ended. */ onDidCompositionEnd(listener: () => void): IDisposable; + /** + * An event emitted when editing failed because the editor is read-only. + * @event + */ + onDidAttemptReadOnlyEdit(listener: () => void): IDisposable; /** * An event emitted when users paste text in the editor. * @event @@ -4414,15 +4655,15 @@ declare namespace monaco.editor { /** * Change the scrollLeft of the editor's viewport. */ - setScrollLeft(newScrollLeft: number): void; + setScrollLeft(newScrollLeft: number, scrollType?: ScrollType): void; /** * Change the scrollTop of the editor's viewport. */ - setScrollTop(newScrollTop: number): void; + setScrollTop(newScrollTop: number, scrollType?: ScrollType): void; /** * Change the scroll position of the editor's viewport. */ - setScrollPosition(position: INewScrollPosition): void; + setScrollPosition(position: INewScrollPosition, scrollType?: ScrollType): void; /** * Get an action that is a contribution to this editor. * @id Unique identifier of the contribution. @@ -4435,7 +4676,7 @@ declare namespace monaco.editor { * @param source The source of the call. * @param command The command to execute */ - executeCommand(source: string, command: ICommand): void; + executeCommand(source: string | null | undefined, command: ICommand): void; /** * Push an "undo stop" in the undo-redo stack. */ @@ -4447,13 +4688,13 @@ declare namespace monaco.editor { * @param edits The edits to execute. * @param endCursorState Cursor state after the edits were applied. */ - executeEdits(source: string, edits: IIdentifiedSingleEditOperation[], endCursorState?: ICursorStateComputer | Selection[]): boolean; + executeEdits(source: string | null | undefined, edits: IIdentifiedSingleEditOperation[], endCursorState?: ICursorStateComputer | Selection[]): boolean; /** * Execute multiple (concomitant) commands on the editor. * @param source The source of the call. * @param command The commands to execute */ - executeCommands(source: string, commands: (ICommand | null)[]): void; + executeCommands(source: string | null | undefined, commands: (ICommand | null)[]): void; /** * Get all the decorations on a line (filtering out decorations from other editors). */ @@ -4631,6 +4872,7 @@ declare namespace monaco.editor { readonly canUseHalfwidthRightwardsArrow: boolean; readonly spaceWidth: number; readonly middotWidth: number; + readonly wsmiddotWidth: number; readonly maxDigitWidth: number; } @@ -4799,6 +5041,11 @@ declare namespace monaco.languages { */ export function registerDocumentHighlightProvider(languageId: string, provider: DocumentHighlightProvider): IDisposable; + /** + * Register an on type rename provider. + */ + export function registerOnTypeRenameProvider(languageId: string, provider: OnTypeRenameProvider): IDisposable; + /** * Register a definition provider (used by e.g. go to definition). */ @@ -5171,6 +5418,31 @@ declare namespace monaco.languages { provideHover(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult; } + /** + * An evaluatable expression represents additional information for an expression in a document. Evaluatable expression are + * evaluated by a debugger or runtime and their result is rendered in a tooltip-like widget. + */ + export interface EvaluatableExpression { + /** + * The range to which this expression applies. + */ + range: IRange; + expression?: string; + } + + /** + * The hover provider interface defines the contract between extensions and + * the [hover](https://code.visualstudio.com/docs/editor/intellisense)-feature. + */ + export interface EvaluatableExpressionProvider { + /** + * Provide a hover for the given position and document. Multiple hovers at the same + * position will be merged by the editor. A hover can have a range which defaults + * to the word range at the position when omitted. + */ + provideEvaluatableExpression(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult; + } + export enum CompletionItemKind { Method = 0, Function = 1, @@ -5197,7 +5469,9 @@ declare namespace monaco.languages { Customcolor = 22, Folder = 23, TypeParameter = 24, - Snippet = 25 + User = 25, + Issue = 26, + Snippet = 27 } export interface CompletionItemLabel { @@ -5206,9 +5480,9 @@ declare namespace monaco.languages { */ name: string; /** - * The signature without the return type. Render after `name`. + * The parameters without the return type. Render after `name`. */ - signature?: string; + parameters?: string; /** * The fully qualified name, like package name or file path. Rendered after `signature`. */ @@ -5285,7 +5559,7 @@ declare namespace monaco.languages { preselect?: boolean; /** * A string or snippet that should be inserted in a document when selecting - * this completion. When `falsy` the [label](#CompletionItem.label) + * this completion. * is used. */ insertText: string; @@ -5380,7 +5654,7 @@ declare namespace monaco.languages { * * The editor will only resolve a completion item once. */ - resolveCompletionItem?(model: editor.ITextModel, position: Position, item: CompletionItem, token: CancellationToken): ProviderResult; + resolveCompletionItem?(item: CompletionItem, token: CancellationToken): ProviderResult; } export interface CodeAction { @@ -5434,6 +5708,12 @@ declare namespace monaco.languages { * The parameters of this signature. */ parameters: ParameterInformation[]; + /** + * Index of the active parameter. + * + * If provided, this is used in place of `SignatureHelp.activeSignature`. + */ + activeParameter?: number; } /** @@ -5532,6 +5812,21 @@ declare namespace monaco.languages { provideDocumentHighlights(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult; } + /** + * The rename provider interface defines the contract between extensions and + * the live-rename feature. + */ + export interface OnTypeRenameProvider { + wordPattern?: RegExp; + /** + * Provide a list of ranges that can be live-renamed together. + */ + provideOnTypeRenameRanges(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<{ + ranges: IRange[]; + wordPattern?: RegExp; + }>; + } + /** * Value-object that contains additional information when * requesting references. @@ -5869,11 +6164,11 @@ declare namespace monaco.languages { } /** - * A provider of colors for editor models. + * A provider of folding ranges for editor models. */ export interface FoldingRangeProvider { /** - * Provides the color ranges for a specific model. + * Provides the folding ranges for a specific model. */ provideFoldingRanges(model: editor.ITextModel, context: FoldingContext, token: CancellationToken): ProviderResult; } @@ -5925,7 +6220,7 @@ declare namespace monaco.languages { description?: string; iconPath?: { id: string; - } | { + } | Uri | { light: Uri; dark: Uri; }; @@ -6016,6 +6311,7 @@ declare namespace monaco.languages { } export interface DocumentSemanticTokensProvider { + onDidChange?: IEvent; getLegend(): SemanticTokensLegend; provideDocumentSemanticTokens(model: editor.ITextModel, lastResultId: string | null, token: CancellationToken): ProviderResult; releaseDocumentSemanticTokens(resultId: string | undefined): void; @@ -6050,6 +6346,10 @@ declare namespace monaco.languages { * is the language case insensitive? */ ignoreCase?: boolean; + /** + * is the language unicode-aware? (i.e., /\u{1D306}/) + */ + unicode?: boolean; /** * if no match in the tokenizer assign this token class (default 'source') */ @@ -6073,9 +6373,9 @@ declare namespace monaco.languages { * shorthands: [reg,act] == { regex: reg, action: act} * and : [reg,act,nxt] == { regex: reg, action: act{ next: nxt }} */ - export type IShortMonarchLanguageRule1 = [RegExp, IMonarchLanguageAction]; + export type IShortMonarchLanguageRule1 = [string | RegExp, IMonarchLanguageAction]; - export type IShortMonarchLanguageRule2 = [RegExp, IMonarchLanguageAction, string]; + export type IShortMonarchLanguageRule2 = [string | RegExp, IMonarchLanguageAction, string]; export interface IExpandedMonarchLanguageRule { /** @@ -6472,10 +6772,7 @@ declare namespace monaco.languages.typescript { * Get code completions for the given file and position. * @returns `Promise` */ - getCompletionsAtPosition( - fileName: string, - position: number - ): Promise; + getCompletionsAtPosition(fileName: string, position: number): Promise; /** * Get code completion details for the given file, position, and entry. * @returns `Promise` @@ -6489,18 +6786,12 @@ declare namespace monaco.languages.typescript { * Get signature help items for the item at the given file and position. * @returns `Promise` */ - getSignatureHelpItems( - fileName: string, - position: number - ): Promise; + getSignatureHelpItems(fileName: string, position: number): Promise; /** * Get quick info for the item at the given position in the file. * @returns `Promise` */ - getQuickInfoAtPosition( - fileName: string, - position: number - ): Promise; + getQuickInfoAtPosition(fileName: string, position: number): Promise; /** * Get other ranges which are related to the item at the given position in the file (often used for highlighting). * @returns `Promise | undefined>` @@ -6521,10 +6812,7 @@ declare namespace monaco.languages.typescript { * Get references to the item at the given position in the file. * @returns `Promise` */ - getReferencesAtPosition( - fileName: string, - position: number - ): Promise; + getReferencesAtPosition(fileName: string, position: number): Promise; /** * Get outline entries for the item at the given position in the file. * @returns `Promise` @@ -6535,10 +6823,7 @@ declare namespace monaco.languages.typescript { * @param options `typescript.FormatCodeOptions` * @returns `Promise` */ - getFormattingEditsForDocument( - fileName: string, - options: any - ): Promise; + getFormattingEditsForDocument(fileName: string, options: any): Promise; /** * Get changes which should be applied to format the given range in the file. * @param options `typescript.FormatCodeOptions` @@ -6577,11 +6862,7 @@ declare namespace monaco.languages.typescript { * @param options `typescript.RenameInfoOptions` * @returns `Promise` */ - getRenameInfo( - fileName: string, - positon: number, - options: any - ): Promise; + getRenameInfo(fileName: string, positon: number, options: any): Promise; /** * Get transpiled output for the given file. * @returns `typescript.EmitOutput` @@ -6603,12 +6884,8 @@ declare namespace monaco.languages.typescript { export const typescriptVersion: string; export const typescriptDefaults: LanguageServiceDefaults; export const javascriptDefaults: LanguageServiceDefaults; - export const getTypeScriptWorker: () => Promise< - (...uris: Uri[]) => Promise - >; - export const getJavaScriptWorker: () => Promise< - (...uris: Uri[]) => Promise - >; + export const getTypeScriptWorker: () => Promise<(...uris: Uri[]) => Promise>; + export const getJavaScriptWorker: () => Promise<(...uris: Uri[]) => Promise>; } /*--------------------------------------------------------------------------------------------- @@ -6810,11 +7087,7 @@ declare namespace monaco.languages.html { readonly indentHandlebars: boolean; readonly endWithNewline: boolean; readonly extraLiners: string; - readonly wrapAttributes: - | 'auto' - | 'force' - | 'force-aligned' - | 'force-expand-multiline'; + readonly wrapAttributes: 'auto' | 'force' | 'force-aligned' | 'force-expand-multiline'; } export interface CompletionConfiguration { [provider: string]: boolean;