From ccfa5557585f81bd81f291ded7bbd0ab12fdee1b Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Fri, 20 Dec 2019 21:38:35 +0100 Subject: [PATCH] Prepare for 0.19.0 --- CHANGELOG.md | 54 ++ gulpfile.js | 2 +- monaco.d.ts | 1148 +++++++++++++++------------- package-lock.json | 46 +- package.json | 14 +- website/playground/monaco.d.ts.txt | 1148 +++++++++++++++------------- 6 files changed, 1295 insertions(+), 1117 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1edc9c2..b7243686 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,59 @@ # Monaco Editor Changelog +## [0.19.0] (20.12.2019) + +### New & Noteworthy + +* It is now possible to pass in a `dimension` in the editor construction options in order to avoid a synchronous layout. +* There is new API to provide semantic tokens. +* New options: + * `multiCursorPaste`: define how to distribute paste in case of multi-cursor + * `matchBrackets`: control if enclosing brackets should be highlighted +* Fixes for tokenization in: TypeScript, JavaScript, Handlebars, Kotlin and VB. + +### Breaking changes + +* `getConfiguration()` is replaced by `getRawOptions()`, which returns the passed in editor options. + +### Thank you + +Contributions to `monaco-editor`: + +* [Lars Hvam (@larshp)](https://github.com/larshp) + * contributing: add details for running website locally [PR #1617](https://github.com/microsoft/monaco-editor/pull/1617) + * playground: update symbols-provider-example [PR #1616](https://github.com/microsoft/monaco-editor/pull/1616) +* [Remy Suen (@rcjsuen)](https://github.com/rcjsuen): Add CompletionItem with snippet support to the example [PR #1703](https://github.com/microsoft/monaco-editor/pull/1703) + +Contributions to `monaco-editor-webpack-plugin`: +* [Dominik Moritz (@domoritz)](https://github.com/domoritz): Bump to 0.16 [PR #62](https://github.com/microsoft/monaco-editor-webpack-plugin/pull/62) +* [Mike Greiling (@mikegreiling)](https://github.com/mikegreiling): Fix __webpack_public_path__ within getWorkerUrl method [PR #63](https://github.com/microsoft/monaco-editor-webpack-plugin/pull/63) +* [Roman Krasiuk (@rkrasiuk)](https://github.com/rkrasiuk): Bump to 0.17.0 and Add graphql support [PR #67](https://github.com/microsoft/monaco-editor-webpack-plugin/pull/67) +* [Niklas Mollenhauer (@nikeee)](https://github.com/nikeee): Add loader-utils and make @types/webpack a dev dependency [PR #74](https://github.com/microsoft/monaco-editor-webpack-plugin/pull/74) +* [James Diefenderfer (@jimmydief)](https://github.com/jimmydief) + * Add support for plugin-specific public path [PR #81](https://github.com/microsoft/monaco-editor-webpack-plugin/pull/81) + * Add support for dynamic filenames [PR #83](https://github.com/microsoft/monaco-editor-webpack-plugin/pull/83) + +Contributions to `monaco-languages`: + +* [Maksym Bykovskyy (@mbykovskyy)](https://github.com/mbykovskyy): Adds cameligo language support [PR #75](https://github.com/microsoft/monaco-languages/pull/75) +* [Steven Degutis (@sdegutis)](https://github.com/sdegutis): Adds Markdown Table syntax highlighting [PR #73](https://github.com/microsoft/monaco-languages/pull/73) +* [Sergey Romanov (@Serhioromano)](https://github.com/Serhioromano): Improvements to ST language [PR #76](https://github.com/microsoft/monaco-languages/pull/76) +* [Sebastian Pahnke (@spahnke)](https://github.com/spahnke): [JS/TS] Add support for the nullish-coalesce operator [PR #74](https://github.com/microsoft/monaco-languages/pull/74) + +Contributions to `monaco-typescript`: + +* [Denys Vuika (@DenysVuika)](https://github.com/DenysVuika): register multiple extra libs at once [PR #24](https://github.com/microsoft/monaco-typescript/pull/24) +* [Elizabeth Craig (@ecraig12345)](https://github.com/ecraig12345) + * Generate and publish typings for package [PR #50](https://github.com/microsoft/monaco-typescript/pull/50) + * Remove another require call [PR #49](https://github.com/microsoft/monaco-typescript/pull/49) +* [@katis](https://github.com/katis): Update TypeScript to 3.7.2 [PR #51](https://github.com/microsoft/monaco-typescript/pull/51) +* [Tamas Kiss (@kisstkondoros)](https://github.com/kisstkondoros): Add documentation to signature help [PR #52](https://github.com/microsoft/monaco-typescript/pull/52) +* [Lars Hvam (@larshp)](https://github.com/larshp): fix typo [PR #45](https://github.com/microsoft/monaco-typescript/pull/45) +* [Sebastian Pahnke (@spahnke)](https://github.com/spahnke) + * Provide related information to diagnostics [PR #48](https://github.com/microsoft/monaco-typescript/pull/48) + * Adopt monaco.MarkerTag API [PR #47](https://github.com/microsoft/monaco-typescript/pull/47) + * Add support to ignore certain diagnostics [PR #46](https://github.com/microsoft/monaco-typescript/pull/46) + ## [0.18.1] (19.09.2019) * fixes 2 issues with the ESM distribution - [#1572](https://github.com/microsoft/monaco-editor/issues/1572) and [#1574](https://github.com/microsoft/monaco-editor/issues/1574) diff --git a/gulpfile.js b/gulpfile.js index 85165e00..f0367061 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -453,7 +453,7 @@ function addPluginDTS() { contents = [ '/*!-----------------------------------------------------------', ' * Copyright (c) Microsoft Corporation. All rights reserved.', - ' * Type definitions for monaco-editor v'+MONACO_EDITOR_VERSION, + ' * Type definitions for monaco-editor', ' * Released under the MIT license', '*-----------------------------------------------------------*/', ].join('\n') + '\n' + contents + '\n' + extraContent.join('\n'); diff --git a/monaco.d.ts b/monaco.d.ts index 948aba9d..40eb8a1c 100644 --- a/monaco.d.ts +++ b/monaco.d.ts @@ -1,6 +1,6 @@ /*!----------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. - * Type definitions for monaco-editor v0.18.1 + * Type definitions for monaco-editor * Released under the MIT license *-----------------------------------------------------------*/ /*--------------------------------------------------------------------------------------------- @@ -47,9 +47,9 @@ declare namespace monaco { export class CancellationTokenSource { constructor(parent?: CancellationToken); - readonly token: CancellationToken; + get token(): CancellationToken; cancel(): void; - dispose(): void; + dispose(cancel?: boolean): void; } export interface CancellationToken { @@ -60,7 +60,6 @@ declare namespace monaco { */ readonly onCancellationRequested: IEvent; } - /** * Uniform Resource Identifier (Uri) http://tools.ietf.org/html/rfc3986. * This class is a simple parser which creates the basic component parts @@ -123,7 +122,7 @@ declare namespace monaco { * namely the server name, would be missing. Therefore `Uri#fsPath` exists - it's sugar to ease working * with URIs that represent files on disk (`file` scheme). */ - readonly fsPath: string; + get fsPath(): string; with(change: { scheme?: string; authority?: string | null; @@ -384,8 +383,8 @@ declare namespace monaco { } export interface IMarkdownString { - value: string; - isTrusted?: boolean; + readonly value: string; + readonly isTrusted?: boolean; uris?: { [href: string]: UriComponents; }; @@ -732,10 +731,6 @@ declare namespace monaco { */ readonly positionColumn: number; constructor(selectionStartLineNumber: number, selectionStartColumn: number, positionLineNumber: number, positionColumn: number); - /** - * Clone this selection. - */ - clone(): Selection; /** * Transform to a human-readable representation. */ @@ -812,13 +807,19 @@ declare namespace monaco { declare namespace monaco.editor { + export interface IDiffNavigator { + canNavigate(): boolean; + next(): void; + previous(): void; + dispose(): void; + } /** * Create a new editor under `domElement`. * `domElement` should be empty (not contain other dom nodes). * The editor will read the size of `domElement`. */ - export function create(domElement: HTMLElement, options?: IEditorConstructionOptions, override?: IEditorOverrideServices): IStandaloneCodeEditor; + export function create(domElement: HTMLElement, options?: IStandaloneEditorConstructionOptions, override?: IEditorOverrideServices): IStandaloneCodeEditor; /** * Emitted when an editor is created. @@ -834,13 +835,6 @@ declare namespace monaco.editor { */ export function createDiffEditor(domElement: HTMLElement, options?: IDiffEditorConstructionOptions, override?: IEditorOverrideServices): IStandaloneDiffEditor; - export interface IDiffNavigator { - canNavigate(): boolean; - next(): void; - previous(): void; - dispose(): void; - } - export interface IDiffNavigatorOptions { readonly followsCaret?: boolean; readonly ignoreCharChanges?: boolean; @@ -1006,6 +1000,11 @@ declare namespace monaco.editor { * An object that can be used by the web worker to make calls back to the main thread. */ host?: any; + /** + * Keep idle models. + * Defaults to false, which means that idle models will stop syncing after a while. + */ + keepIdleModels?: boolean; } /** @@ -1056,7 +1055,7 @@ declare namespace monaco.editor { /** * The options to create an editor. */ - export interface IEditorConstructionOptions extends IEditorOptions { + export interface IStandaloneEditorConstructionOptions extends IEditorConstructionOptions { /** * The initial model associated with this code editor. */ @@ -1203,7 +1202,8 @@ declare namespace monaco.editor { * Position in the minimap to render the decoration. */ export enum MinimapPosition { - Inline = 1 + Inline = 1, + Gutter = 2 } export interface IDecorationOptions { @@ -1561,6 +1561,11 @@ declare namespace monaco.editor { * @return The text length. */ getValueLengthInRange(range: IRange): number; + /** + * Get the character count of text in a certain range. + * @param range The range describing what text length to get. + */ + getCharacterCountInRange(range: IRange): number; /** * Get the number of lines in the model. */ @@ -2066,6 +2071,8 @@ declare namespace monaco.editor { /** * Instructs the editor to remeasure its container. This method should * be called when the container of the editor gets resized. + * + * If a dimension is passed in, the passed in value will be used. */ layout(dimension?: IDimension): void; /** @@ -2157,7 +2164,7 @@ declare namespace monaco.editor { * Set the selections for all the cursors of the editor. * Cursors will be removed or added, as necessary. */ - setSelections(selections: ISelection[]): void; + setSelections(selections: readonly ISelection[]): void; /** * Scroll vertically as necessary and reveal lines. */ @@ -2212,10 +2219,6 @@ declare namespace monaco.editor { * An editor contribution that gets created every time a new editor gets created and gets disposed when the editor gets disposed. */ export interface IEditorContribution { - /** - * Get a unique identifier for this contribution. - */ - getId(): string; /** * Dispose this contribution. */ @@ -2404,89 +2407,25 @@ declare namespace monaco.editor { */ readonly secondarySelections: Selection[]; /** - * Source of the call that caused the event. - */ - readonly source: string; - /** - * Reason. - */ - readonly reason: CursorChangeReason; - } - - /** - * Configuration options for editor scrollbars - */ - export interface IEditorScrollbarOptions { - /** - * The size of arrows (if displayed). - * Defaults to 11. - */ - arrowSize?: number; - /** - * Render vertical scrollbar. - * Defaults to 'auto'. - */ - vertical?: 'auto' | 'visible' | 'hidden'; - /** - * Render horizontal scrollbar. - * Defaults to 'auto'. - */ - horizontal?: 'auto' | 'visible' | 'hidden'; - /** - * Cast horizontal and vertical shadows when the content is scrolled. - * Defaults to true. - */ - useShadows?: boolean; - /** - * Render arrows at the top and bottom of the vertical scrollbar. - * Defaults to false. - */ - verticalHasArrows?: boolean; - /** - * Render arrows at the left and right of the horizontal scrollbar. - * Defaults to false. - */ - horizontalHasArrows?: boolean; - /** - * Listen to mouse wheel events and react to them by scrolling. - * Defaults to true. - */ - handleMouseWheel?: boolean; - /** - * Height in pixels for the horizontal scrollbar. - * Defaults to 10 (px). - */ - horizontalScrollbarSize?: number; - /** - * Width in pixels for the vertical scrollbar. - * Defaults to 10 (px). + * The model version id. */ - verticalScrollbarSize?: number; + readonly modelVersionId: number; /** - * Width in pixels for the vertical slider. - * Defaults to `verticalScrollbarSize`. + * The old selections. */ - verticalSliderSize?: number; + readonly oldSelections: Selection[] | null; /** - * Height in pixels for the horizontal slider. - * Defaults to `horizontalScrollbarSize`. + * The model version id the that `oldSelections` refer to. */ - horizontalSliderSize?: number; - } - - /** - * Configuration options for editor find widget - */ - export interface IEditorFindOptions { + readonly oldModelVersionId: number; /** - * Controls if we seed search string in the Find Widget with editor selection. + * Source of the call that caused the event. */ - seedSearchStringFromSelection?: boolean; + readonly source: string; /** - * Controls if Find in Selection flag is turned on when multiple lines of text are selected in the editor. + * Reason. */ - autoFindInSelection: boolean; - addExtraSpaceOnTop?: boolean; + readonly reason: CursorChangeReason; } /** @@ -2504,134 +2443,14 @@ declare namespace monaco.editor { */ export type EditorAutoClosingOvertypeStrategy = 'always' | 'auto' | 'never'; - /** - * Configuration options for editor minimap - */ - export interface IEditorMinimapOptions { - /** - * Enable the rendering of the minimap. - * Defaults to true. - */ - enabled?: boolean; - /** - * Control the side of the minimap in editor. - * Defaults to 'right'. - */ - side?: 'right' | 'left'; - /** - * Control the rendering of the minimap slider. - * Defaults to 'mouseover'. - */ - showSlider?: 'always' | 'mouseover'; - /** - * Render the actual text on a line (as opposed to color blocks). - * Defaults to true. - */ - renderCharacters?: boolean; - /** - * Limit the width of the minimap to render at most a certain number of columns. - * Defaults to 120. - */ - maxColumn?: number; - } - - /** - * Configuration options for editor minimap - */ - export interface IEditorLightbulbOptions { - /** - * Enable the lightbulb code action. - * Defaults to true. - */ - enabled?: boolean; - } - - /** - * Configuration options for editor hover - */ - export interface IEditorHoverOptions { - /** - * Enable the hover. - * Defaults to true. - */ - enabled?: boolean; - /** - * Delay for showing the hover. - * Defaults to 300. - */ - delay?: number; - /** - * Is the hover sticky such that it can be clicked and its contents selected? - * Defaults to true. - */ - sticky?: boolean; - } - - /** - * Configuration options for parameter hints - */ - export interface IEditorParameterHintOptions { - /** - * Enable parameter hints. - * Defaults to true. - */ - enabled?: boolean; - /** - * Enable cycling of parameter hints. - * Defaults to false. - */ - cycle?: boolean; - } - - export interface ISuggestOptions { - /** - * Enable graceful matching. Defaults to true. - */ - filterGraceful?: boolean; - /** - * Prevent quick suggestions when a snippet is active. Defaults to true. - */ - snippetsPreventQuickSuggestions?: boolean; - /** - * Favours words that appear close to the cursor. - */ - localityBonus?: boolean; - /** - * Enable using global storage for remembering suggestions. - */ - shareSuggestSelections?: boolean; - /** - * Enable or disable icons in suggestions. Defaults to true. - */ - showIcons?: boolean; - /** - * Max suggestions to show in suggestions. Defaults to 12. - */ - maxVisibleSuggestions?: boolean; - /** - * Names of suggestion types to filter. - */ - filteredTypes?: Record; - } - - export interface IGotoLocationOptions { - /** - * Control how goto-command work when having multiple results. - */ - multiple?: 'peek' | 'gotoAndPeek' | 'goto'; - } - - /** - * Configuration map for codeActionsOnSave - */ - export interface ICodeActionsOnSaveOptions { - [kind: string]: boolean; - } - /** * Configuration options for the editor. */ export interface IEditorOptions { + /** + * This editor is used inside a diff editor. + */ + inDiffEditor?: boolean; /** * The aria label for the editor's textarea (when it is focused). */ @@ -2658,12 +2477,18 @@ declare namespace monaco.editor { * Otherwise, line numbers will not be rendered. * Defaults to true. */ - lineNumbers?: 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string); + lineNumbers?: LineNumbersType; /** * Controls the minimal number of visible leading and trailing lines surrounding the cursor. * Defaults to 0. */ cursorSurroundingLines?: number; + /** + * Controls when `cursorSurroundingLines` should be enforced + * Defaults to `default`, `cursorSurroundingLines` is not enforced when cursor position is changed + * by mouse. + */ + cursorSurroundingLinesStyle?: 'default' | 'all'; /** * Render last line number when the file ends with a newline. * Defaults to true. @@ -2730,7 +2555,7 @@ declare namespace monaco.editor { fixedOverflowWidgets?: boolean; /** * The number of vertical lanes the overview ruler should render. - * Defaults to 2. + * Defaults to 3. */ overviewRulerLanes?: number; /** @@ -2742,12 +2567,17 @@ declare namespace monaco.editor { * Control the cursor animation style, possible values are 'blink', 'smooth', 'phase', 'expand' and 'solid'. * Defaults to 'blink'. */ - cursorBlinking?: string; + cursorBlinking?: 'blink' | 'smooth' | 'phase' | 'expand' | 'solid'; /** * Zoom the font in the editor when using the mouse wheel in combination with holding Ctrl. * Defaults to false. */ mouseWheelZoom?: boolean; + /** + * Control the mouse pointer style, either 'text' or 'default' or 'copy' + * Defaults to 'text' + */ + mouseStyle?: 'text' | 'default' | 'copy'; /** * Enable smooth caret animation. * Defaults to false. @@ -2757,7 +2587,7 @@ declare namespace monaco.editor { * Control the cursor style, either 'block' or 'line'. * Defaults to 'line'. */ - cursorStyle?: string; + cursorStyle?: 'line' | 'block' | 'underline' | 'line-thin' | 'block-outline' | 'underline-thin'; /** * Control the width of the cursor when cursorStyle is set to 'line' */ @@ -2766,10 +2596,10 @@ declare namespace monaco.editor { * Enable font ligatures. * Defaults to false. */ - fontLigatures?: boolean; + fontLigatures?: boolean | string; /** - * Disable the use of `will-change` for the editor margin and lines layers. - * The usage of `will-change` acts as a hint for browsers to create an extra layer. + * Disable the use of `transform: translate3d(0px, 0px, 0px)` for the editor margin and lines layers. + * The usage of `transform: translate3d(0px, 0px, 0px)` acts as a hint for browsers to create an extra layer. * Defaults to false. */ disableLayerHinting?: boolean; @@ -2831,7 +2661,7 @@ declare namespace monaco.editor { * Control indentation of wrapped lines. Can be: 'none', 'same', 'indent' or 'deepIndent'. * Defaults to 'same' in vscode and to 'none' in monaco-editor. */ - wrappingIndent?: string; + wrappingIndent?: 'none' | 'same' | 'indent' | 'deepIndent'; /** * Configure word wrapping characters. A break will be introduced before these characters. * Defaults to '{([+'. @@ -2891,11 +2721,20 @@ declare namespace monaco.editor { * Defaults to true */ multiCursorMergeOverlapping?: boolean; + /** + * Configure the behaviour when pasting a text with the line count equal to the cursor count. + * Defaults to 'spread'. + */ + multiCursorPaste?: 'spread' | 'full'; /** * Configure the editor's accessibility support. * Defaults to 'auto'. It is best to leave this to 'auto'. */ accessibilitySupport?: 'auto' | 'off' | 'on'; + /** + * Controls the number of lines in the editor that can be read out by a screen reader + */ + accessibilityPageSize?: number; /** * Suggest options. */ @@ -2908,14 +2747,10 @@ declare namespace monaco.editor { * Enable quick suggestions (shadow suggestions) * Defaults to true. */ - quickSuggestions?: boolean | { - other: boolean; - comments: boolean; - strings: boolean; - }; + quickSuggestions?: boolean | IQuickSuggestionsOptions; /** * Quick suggestions show delay (in ms) - * Defaults to 500 (ms) + * Defaults to 10 (ms) */ quickSuggestionsDelay?: number; /** @@ -2945,7 +2780,7 @@ declare namespace monaco.editor { * Enable auto indentation adjustment. * Defaults to false. */ - autoIndent?: boolean; + autoIndent?: 'none' | 'keep' | 'brackets' | 'advanced' | 'full'; /** * Enable format on type. * Defaults to false. @@ -2970,7 +2805,7 @@ declare namespace monaco.editor { * Accept suggestions on ENTER. * Defaults to 'on'. */ - acceptSuggestionOnEnter?: boolean | 'on' | 'smart' | 'off'; + acceptSuggestionOnEnter?: 'on' | 'smart' | 'off'; /** * Accept suggestions on provider defined characters. * Defaults to true. @@ -2988,10 +2823,6 @@ declare namespace monaco.editor { * Syntax highlighting is copied. */ copyWithSyntaxHighlighting?: boolean; - /** - * Enable word based suggestions. Defaults to 'true' - */ - wordBasedSuggestions?: boolean; /** * The history mode for suggestions. */ @@ -3009,7 +2840,7 @@ declare namespace monaco.editor { /** * Enable tab completion. */ - tabCompletion?: boolean | 'on' | 'off' | 'onlySnippets'; + tabCompletion?: 'on' | 'off' | 'onlySnippets'; /** * Enable selection highlight. * Defaults to true. @@ -3029,10 +2860,6 @@ declare namespace monaco.editor { * Control the behavior and rendering of the code action lightbulb. */ lightbulb?: IEditorLightbulbOptions; - /** - * Code action kinds to be run on save. - */ - codeActionsOnSave?: ICodeActionsOnSaveOptions; /** * Timeout for running code actions on save. */ @@ -3054,9 +2881,9 @@ declare namespace monaco.editor { showFoldingControls?: 'always' | 'mouseover'; /** * Enable highlighting of matching brackets. - * Defaults to true. + * Defaults to 'always'. */ - matchBrackets?: boolean; + matchBrackets?: 'never' | 'near' | 'always'; /** * Enable rendering of whitespace. * Defaults to none. @@ -3093,7 +2920,7 @@ declare namespace monaco.editor { /** * The font weight */ - fontWeight?: 'normal' | 'bold' | 'bolder' | 'lighter' | 'initial' | 'inherit' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900'; + fontWeight?: string; /** * The font size */ @@ -3112,6 +2939,13 @@ declare namespace monaco.editor { showUnused?: boolean; } + export interface IEditorConstructionOptions extends IEditorOptions { + /** + * The initial editor dimension (to avoid measuring the container). + */ + dimension?: IDimension; + } + /** * Configuration options for the diff editor. */ @@ -3126,6 +2960,11 @@ declare namespace monaco.editor { * Defaults to true. */ renderSideBySide?: boolean; + /** + * Timeout in milliseconds after which diff computation is cancelled. + * Defaults to 5000. + */ + maxComputationTime?: number; /** * Compute the diff by ignoring leading/trailing whitespace * Defaults to true. @@ -3143,275 +2982,65 @@ declare namespace monaco.editor { originalEditable?: boolean; } - export enum RenderMinimap { - None = 0, - Small = 1, - Large = 2, - SmallBlocks = 3, - LargeBlocks = 4 + /** + * An event describing that the configuration of the editor has changed. + */ + export class ConfigurationChangedEvent { } /** - * Describes how to indent wrapped lines. + * Configuration options for editor find widget */ - export enum WrappingIndent { - /** - * No indentation => wrapped lines begin at column 1. - */ - None = 0, + export interface IEditorFindOptions { /** - * Same => wrapped lines get the same indentation as the parent. + * Controls if we seed search string in the Find Widget with editor selection. */ - Same = 1, + seedSearchStringFromSelection?: boolean; /** - * Indent => wrapped lines get +1 indentation toward the parent. + * Controls if Find in Selection flag is turned on in the editor. */ - Indent = 2, - /** - * DeepIndent => wrapped lines get +2 indentation toward the parent. - */ - DeepIndent = 3 + autoFindInSelection?: 'never' | 'always' | 'multiline'; + addExtraSpaceOnTop?: boolean; } + export type GoToLocationValues = 'peek' | 'gotoAndPeek' | 'goto'; + /** - * The kind of animation in which the editor's cursor should be rendered. + * Configuration options for go to location */ - export enum TextEditorCursorBlinkingStyle { - /** - * Hidden - */ - Hidden = 0, - /** - * Blinking - */ - Blink = 1, - /** - * Blinking with smooth fading - */ - Smooth = 2, - /** - * Blinking with prolonged filled state and smooth fading - */ - Phase = 3, - /** - * Expand collapse animation on the y axis - */ - Expand = 4, - /** - * No-Blinking - */ - Solid = 5 + export interface IGotoLocationOptions { + multiple?: GoToLocationValues; + multipleDefinitions?: GoToLocationValues; + multipleTypeDefinitions?: GoToLocationValues; + multipleDeclarations?: GoToLocationValues; + multipleImplementations?: GoToLocationValues; + multipleReferences?: GoToLocationValues; + alternativeDefinitionCommand?: string; + alternativeTypeDefinitionCommand?: string; + alternativeDeclarationCommand?: string; + alternativeImplementationCommand?: string; + alternativeReferenceCommand?: string; } /** - * The style in which the editor's cursor should be rendered. + * Configuration options for editor hover */ - export enum TextEditorCursorStyle { - /** - * As a vertical line (sitting between two characters). - */ - Line = 1, - /** - * As a block (sitting on top of a character). - */ - Block = 2, - /** - * As a horizontal line (sitting under a character). - */ - Underline = 3, + export interface IEditorHoverOptions { /** - * As a thin vertical line (sitting between two characters). + * Enable the hover. + * Defaults to true. */ - LineThin = 4, + enabled?: boolean; /** - * As an outlined block (sitting on top of a character). + * Delay for showing the hover. + * Defaults to 300. */ - BlockOutline = 5, + delay?: number; /** - * As a thin horizontal line (sitting under a character). + * Is the hover sticky such that it can be clicked and its contents selected? + * Defaults to true. */ - UnderlineThin = 6 - } - - export interface InternalEditorScrollbarOptions { - readonly arrowSize: number; - readonly vertical: ScrollbarVisibility; - readonly horizontal: ScrollbarVisibility; - readonly useShadows: boolean; - readonly verticalHasArrows: boolean; - readonly horizontalHasArrows: boolean; - readonly handleMouseWheel: boolean; - readonly horizontalScrollbarSize: number; - readonly horizontalSliderSize: number; - readonly verticalScrollbarSize: number; - readonly verticalSliderSize: number; - readonly mouseWheelScrollSensitivity: number; - readonly fastScrollSensitivity: number; - } - - export interface InternalEditorMinimapOptions { - readonly enabled: boolean; - readonly side: 'right' | 'left'; - readonly showSlider: 'always' | 'mouseover'; - readonly renderCharacters: boolean; - readonly maxColumn: number; - } - - export interface InternalEditorFindOptions { - readonly seedSearchStringFromSelection: boolean; - readonly autoFindInSelection: boolean; - readonly addExtraSpaceOnTop: boolean; - } - - export interface InternalEditorHoverOptions { - readonly enabled: boolean; - readonly delay: number; - readonly sticky: boolean; - } - - export interface InternalGoToLocationOptions { - readonly multiple: 'peek' | 'gotoAndPeek' | 'goto'; - } - - export interface InternalSuggestOptions { - readonly filterGraceful: boolean; - readonly snippets: 'top' | 'bottom' | 'inline' | 'none'; - readonly snippetsPreventQuickSuggestions: boolean; - readonly localityBonus: boolean; - readonly shareSuggestSelections: boolean; - readonly showIcons: boolean; - readonly maxVisibleSuggestions: number; - readonly filteredTypes: Record; - } - - export interface InternalParameterHintOptions { - readonly enabled: boolean; - readonly cycle: boolean; - } - - export interface EditorWrappingInfo { - readonly inDiffEditor: boolean; - readonly isDominatedByLongLines: boolean; - readonly isWordWrapMinified: boolean; - readonly isViewportWrapping: boolean; - readonly wrappingColumn: number; - readonly wrappingIndent: WrappingIndent; - readonly wordWrapBreakBeforeCharacters: string; - readonly wordWrapBreakAfterCharacters: string; - readonly wordWrapBreakObtrusiveCharacters: string; - } - - export enum RenderLineNumbersType { - Off = 0, - On = 1, - Relative = 2, - Interval = 3, - Custom = 4 - } - - export interface InternalEditorViewOptions { - readonly extraEditorClassName: string; - readonly disableMonospaceOptimizations: boolean; - readonly rulers: number[]; - readonly ariaLabel: string; - readonly renderLineNumbers: RenderLineNumbersType; - readonly renderCustomLineNumbers: ((lineNumber: number) => string) | null; - readonly cursorSurroundingLines: number; - readonly renderFinalNewline: boolean; - readonly selectOnLineNumbers: boolean; - readonly glyphMargin: boolean; - readonly revealHorizontalRightPadding: number; - readonly roundedSelection: boolean; - readonly overviewRulerLanes: number; - readonly overviewRulerBorder: boolean; - readonly cursorBlinking: TextEditorCursorBlinkingStyle; - readonly mouseWheelZoom: boolean; - readonly cursorSmoothCaretAnimation: boolean; - readonly cursorStyle: TextEditorCursorStyle; - readonly cursorWidth: number; - readonly hideCursorInOverviewRuler: boolean; - readonly scrollBeyondLastLine: boolean; - readonly scrollBeyondLastColumn: number; - readonly smoothScrolling: boolean; - readonly stopRenderingLineAfter: number; - readonly renderWhitespace: 'none' | 'boundary' | 'selection' | 'all'; - readonly renderControlCharacters: boolean; - readonly fontLigatures: boolean; - readonly renderIndentGuides: boolean; - readonly highlightActiveIndentGuide: boolean; - readonly renderLineHighlight: 'none' | 'gutter' | 'line' | 'all'; - readonly scrollbar: InternalEditorScrollbarOptions; - readonly minimap: InternalEditorMinimapOptions; - readonly fixedOverflowWidgets: boolean; - } - - export interface EditorContribOptions { - readonly selectionClipboard: boolean; - readonly hover: InternalEditorHoverOptions; - readonly links: boolean; - readonly contextmenu: boolean; - readonly quickSuggestions: boolean | { - other: boolean; - comments: boolean; - strings: boolean; - }; - readonly quickSuggestionsDelay: number; - readonly parameterHints: InternalParameterHintOptions; - readonly formatOnType: boolean; - readonly formatOnPaste: boolean; - readonly suggestOnTriggerCharacters: boolean; - readonly acceptSuggestionOnEnter: 'on' | 'smart' | 'off'; - readonly acceptSuggestionOnCommitCharacter: boolean; - readonly wordBasedSuggestions: boolean; - readonly suggestSelection: 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix'; - readonly suggestFontSize: number; - readonly suggestLineHeight: number; - readonly tabCompletion: 'on' | 'off' | 'onlySnippets'; - readonly suggest: InternalSuggestOptions; - readonly gotoLocation: InternalGoToLocationOptions; - readonly selectionHighlight: boolean; - readonly occurrencesHighlight: boolean; - readonly codeLens: boolean; - readonly folding: boolean; - readonly foldingStrategy: 'auto' | 'indentation'; - readonly showFoldingControls: 'always' | 'mouseover'; - readonly matchBrackets: boolean; - readonly find: InternalEditorFindOptions; - readonly colorDecorators: boolean; - readonly lightbulbEnabled: boolean; - readonly codeActionsOnSave: ICodeActionsOnSaveOptions; - readonly codeActionsOnSaveTimeout: number; - } - - /** - * Internal configuration options (transformed or computed) for the editor. - */ - export class InternalEditorOptions { - readonly _internalEditorOptionsBrand: void; - readonly canUseLayerHinting: boolean; - readonly pixelRatio: number; - readonly editorClassName: string; - readonly lineHeight: number; - readonly readOnly: boolean; - readonly multiCursorModifier: 'altKey' | 'ctrlKey' | 'metaKey'; - readonly multiCursorMergeOverlapping: boolean; - readonly showUnused: boolean; - readonly wordSeparators: string; - readonly autoClosingBrackets: EditorAutoClosingStrategy; - readonly autoClosingQuotes: EditorAutoClosingStrategy; - readonly autoClosingOvertype: EditorAutoClosingOvertypeStrategy; - readonly autoSurround: EditorAutoSurroundStrategy; - readonly autoIndent: boolean; - readonly useTabStops: boolean; - readonly tabFocusMode: boolean; - readonly dragAndDrop: boolean; - readonly emptySelectionClipboard: boolean; - readonly copyWithSyntaxHighlighting: boolean; - readonly layoutInfo: EditorLayoutInfo; - readonly fontInfo: FontInfo; - readonly viewInfo: InternalEditorViewOptions; - readonly wrappingInfo: EditorWrappingInfo; - readonly contribInfo: EditorContribOptions; + sticky?: boolean; } /** @@ -3436,6 +3065,12 @@ declare namespace monaco.editor { readonly right: number; } + export enum RenderMinimap { + None = 0, + Text = 1, + Blocks = 2 + } + /** * The internal layout details of the editor. */ @@ -3527,33 +3162,280 @@ declare namespace monaco.editor { } /** - * An event describing that the configuration of the editor has changed. + * Configuration options for editor lightbulb */ - export interface IConfigurationChangedEvent { - readonly canUseLayerHinting: boolean; - readonly pixelRatio: boolean; - readonly editorClassName: boolean; - readonly lineHeight: boolean; - readonly readOnly: boolean; - readonly accessibilitySupport: boolean; - readonly multiCursorModifier: boolean; - readonly multiCursorMergeOverlapping: boolean; - readonly wordSeparators: boolean; - readonly autoClosingBrackets: boolean; - readonly autoClosingQuotes: boolean; - readonly autoClosingOvertype: boolean; - readonly autoSurround: boolean; - readonly autoIndent: boolean; - readonly useTabStops: boolean; - readonly tabFocusMode: boolean; - readonly dragAndDrop: boolean; - readonly emptySelectionClipboard: boolean; - readonly copyWithSyntaxHighlighting: boolean; - readonly layoutInfo: boolean; - readonly fontInfo: boolean; - readonly viewInfo: boolean; - readonly wrappingInfo: boolean; - readonly contribInfo: boolean; + export interface IEditorLightbulbOptions { + /** + * Enable the lightbulb code action. + * Defaults to true. + */ + enabled?: boolean; + } + + /** + * Configuration options for editor minimap + */ + export interface IEditorMinimapOptions { + /** + * Enable the rendering of the minimap. + * Defaults to true. + */ + enabled?: boolean; + /** + * Control the side of the minimap in editor. + * Defaults to 'right'. + */ + side?: 'right' | 'left'; + /** + * Control the rendering of the minimap slider. + * Defaults to 'mouseover'. + */ + showSlider?: 'always' | 'mouseover'; + /** + * Render the actual text on a line (as opposed to color blocks). + * Defaults to true. + */ + renderCharacters?: boolean; + /** + * Limit the width of the minimap to render at most a certain number of columns. + * Defaults to 120. + */ + maxColumn?: number; + /** + * Relative size of the font in the minimap. Defaults to 1. + */ + scale?: number; + } + + /** + * Configuration options for parameter hints + */ + export interface IEditorParameterHintOptions { + /** + * Enable parameter hints. + * Defaults to true. + */ + enabled?: boolean; + /** + * Enable cycling of parameter hints. + * Defaults to false. + */ + cycle?: boolean; + } + + /** + * Configuration options for quick suggestions + */ + export interface IQuickSuggestionsOptions { + other: boolean; + comments: boolean; + strings: boolean; + } + + export type LineNumbersType = 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string); + + /** + * Configuration options for editor scrollbars + */ + export interface IEditorScrollbarOptions { + /** + * The size of arrows (if displayed). + * Defaults to 11. + */ + arrowSize?: number; + /** + * Render vertical scrollbar. + * Defaults to 'auto'. + */ + vertical?: 'auto' | 'visible' | 'hidden'; + /** + * Render horizontal scrollbar. + * Defaults to 'auto'. + */ + horizontal?: 'auto' | 'visible' | 'hidden'; + /** + * Cast horizontal and vertical shadows when the content is scrolled. + * Defaults to true. + */ + useShadows?: boolean; + /** + * Render arrows at the top and bottom of the vertical scrollbar. + * Defaults to false. + */ + verticalHasArrows?: boolean; + /** + * Render arrows at the left and right of the horizontal scrollbar. + * Defaults to false. + */ + horizontalHasArrows?: boolean; + /** + * Listen to mouse wheel events and react to them by scrolling. + * Defaults to true. + */ + handleMouseWheel?: boolean; + /** + * Always consume mouse wheel events (always call preventDefault() and stopPropagation() on the browser events). + * Defaults to true. + */ + alwaysConsumeMouseWheel?: boolean; + /** + * Height in pixels for the horizontal scrollbar. + * Defaults to 10 (px). + */ + horizontalScrollbarSize?: number; + /** + * Width in pixels for the vertical scrollbar. + * Defaults to 10 (px). + */ + verticalScrollbarSize?: number; + /** + * Width in pixels for the vertical slider. + * Defaults to `verticalScrollbarSize`. + */ + verticalSliderSize?: number; + /** + * Height in pixels for the horizontal slider. + * Defaults to `horizontalScrollbarSize`. + */ + horizontalSliderSize?: number; + } + + /** + * Configuration options for editor suggest widget + */ + export interface ISuggestOptions { + /** + * 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. + */ + filterGraceful?: boolean; + /** + * Prevent quick suggestions when a snippet is active. Defaults to true. + */ + snippetsPreventQuickSuggestions?: boolean; + /** + * Favours words that appear close to the cursor. + */ + localityBonus?: boolean; + /** + * Enable using global storage for remembering suggestions. + */ + shareSuggestSelections?: boolean; + /** + * Enable or disable icons in suggestions. Defaults to true. + */ + showIcons?: boolean; + /** + * Max suggestions to show in suggestions. Defaults to 12. + */ + maxVisibleSuggestions?: number; + /** + * Show method-suggestions. + */ + showMethods?: boolean; + /** + * Show function-suggestions. + */ + showFunctions?: boolean; + /** + * Show constructor-suggestions. + */ + showConstructors?: boolean; + /** + * Show field-suggestions. + */ + showFields?: boolean; + /** + * Show variable-suggestions. + */ + showVariables?: boolean; + /** + * Show class-suggestions. + */ + showClasses?: boolean; + /** + * Show struct-suggestions. + */ + showStructs?: boolean; + /** + * Show interface-suggestions. + */ + showInterfaces?: boolean; + /** + * Show module-suggestions. + */ + showModules?: boolean; + /** + * Show property-suggestions. + */ + showProperties?: boolean; + /** + * Show event-suggestions. + */ + showEvents?: boolean; + /** + * Show operator-suggestions. + */ + showOperators?: boolean; + /** + * Show unit-suggestions. + */ + showUnits?: boolean; + /** + * Show value-suggestions. + */ + showValues?: boolean; + /** + * Show constant-suggestions. + */ + showConstants?: boolean; + /** + * Show enum-suggestions. + */ + showEnums?: boolean; + /** + * Show enumMember-suggestions. + */ + showEnumMembers?: boolean; + /** + * Show keyword-suggestions. + */ + showKeywords?: boolean; + /** + * Show text-suggestions. + */ + showWords?: boolean; + /** + * Show color-suggestions. + */ + showColors?: boolean; + /** + * Show file-suggestions. + */ + showFiles?: boolean; + /** + * Show reference-suggestions. + */ + showReferences?: boolean; + /** + * Show folder-suggestions. + */ + showFolders?: boolean; + /** + * Show typeParameter-suggestions. + */ + showTypeParameters?: boolean; + /** + * Show snippet-suggestions. + */ + showSnippets?: boolean; } /** @@ -3876,7 +3758,7 @@ declare namespace monaco.editor { * An event emitted when the configuration of the editor has changed. (e.g. `editor.updateOptions()`) * @event */ - onDidChangeConfiguration(listener: (e: IConfigurationChangedEvent) => void): IDisposable; + onDidChangeConfiguration(listener: (e: ConfigurationChangedEvent) => void): IDisposable; /** * An event emitted when the cursor position has changed. * @event @@ -3925,6 +3807,11 @@ declare namespace monaco.editor { * An event emitted after composition has ended. */ onCompositionEnd(listener: () => void): IDisposable; + /** + * An event emitted when users paste text in the editor. + * @event + */ + onDidPaste(listener: (range: Range) => void): IDisposable; /** * An event emitted on a "mouseup". * @event @@ -4002,9 +3889,9 @@ declare namespace monaco.editor { */ setModel(model: ITextModel | null): void; /** - * Returns the current editor's configuration + * Returns the editor's configuration (without any validation or defaults). */ - getConfiguration(): InternalEditorOptions; + getRawOptions(): IEditorOptions; /** * Get value of the current model attached to this editor. * @see `ITextModel.getValue` @@ -4235,6 +4122,10 @@ declare namespace monaco.editor { * If the diff computation is not finished or the model is missing, will return null. */ getDiffLineInformationForModified(lineNumber: number): IDiffLineInformation | null; + /** + * Update the editor's options after the editor has been created. + */ + updateOptions(newOptions: IDiffEditorOptions): void; } export class FontInfo extends BareFontInfo { @@ -4247,12 +4138,14 @@ declare namespace monaco.editor { readonly spaceWidth: number; readonly maxDigitWidth: number; } + export class BareFontInfo { readonly _bareFontInfoBrand: void; readonly zoomLevel: number; readonly fontFamily: string; readonly fontWeight: string; readonly fontSize: number; + readonly fontFeatureSettings: string; readonly lineHeight: number; readonly letterSpacing: number; } @@ -4504,7 +4397,7 @@ declare namespace monaco.languages { /** * Provide commands for the given document and range. */ - provideCodeActions(model: editor.ITextModel, range: Range, context: CodeActionContext, token: CancellationToken): CodeActionList | Promise; + provideCodeActions(model: editor.ITextModel, range: Range, context: CodeActionContext, token: CancellationToken): ProviderResult; } /** @@ -4886,7 +4779,10 @@ declare namespace monaco.languages { * *Note:* The range must be a [single line](#Range.isSingleLine) and it must * [contain](#Range.contains) the position at which completion has been [requested](#CompletionItemProvider.provideCompletionItems). */ - range: IRange; + range: IRange | { + insert: IRange; + replace: IRange; + }; /** * An optional set of characters that when pressed while this completion is active will accept it first and * then type that character. *Note* that all commit characters should have `length=1` and that superfluous @@ -4970,6 +4866,7 @@ declare namespace monaco.languages { diagnostics?: editor.IMarkerData[]; kind?: string; isPreferred?: boolean; + disabled?: string; } export interface CodeActionList extends IDisposable { @@ -5265,7 +5162,7 @@ declare namespace monaco.languages { /** * The document symbol provider interface defines the contract between extensions and - * the [go to symbol](https://code.visualstudio.com/docs/editor/editingevolved#_goto-symbol)-feature. + * the [go to symbol](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-symbol)-feature. */ export interface DocumentSymbolProvider { displayName?: string; @@ -5499,9 +5396,9 @@ declare namespace monaco.languages { } export interface ResourceFileEdit { - oldUri: Uri; - newUri: Uri; - options: { + oldUri?: Uri; + newUri?: Uri; + options?: { overwrite?: boolean; ignoreIfNotExists?: boolean; ignoreIfExists?: boolean; @@ -5557,6 +5454,33 @@ declare namespace monaco.languages { resolveCodeLens?(model: editor.ITextModel, codeLens: CodeLens, token: CancellationToken): ProviderResult; } + export interface SemanticTokensLegend { + readonly tokenTypes: string[]; + readonly tokenModifiers: string[]; + } + + export interface SemanticTokens { + readonly resultId?: string; + readonly data: Uint32Array; + } + + export interface SemanticTokensEdit { + readonly start: number; + readonly deleteCount: number; + readonly data?: Uint32Array; + } + + export interface SemanticTokensEdits { + readonly resultId?: string; + readonly edits: SemanticTokensEdit[]; + } + + export interface SemanticTokensProvider { + getLegend(): SemanticTokensLegend; + provideSemanticTokens(model: editor.ITextModel, lastResultId: string | null, ranges: Range[] | null, token: CancellationToken): ProviderResult; + releaseSemanticTokens(resultId: string | undefined): void; + } + export interface ILanguageExtensionPoint { id: string; extensions?: string[]; @@ -5847,13 +5771,15 @@ declare namespace monaco.languages.typescript { export interface DiagnosticsOptions { noSemanticValidation?: boolean; noSyntaxValidation?: boolean; + noSuggestionDiagnostics?: boolean; + diagnosticCodesToIgnore?: number[]; } export interface LanguageServiceDefaults { /** * Add an additional source file to the language service. Use this * for typescript (definition) files that won't be loaded as editor - * document, like `jquery.d.ts`. + * documents, like `jquery.d.ts`. * * @param content The file content * @param filePath An optional file path @@ -5862,6 +5788,14 @@ declare namespace monaco.languages.typescript { */ addExtraLib(content: string, filePath?: string): IDisposable; + /** + * Remove all existing extra libs and set the additional source + * files to the language service. Use this for typescript definition + * files that won't be loaded as editor documents, like `jquery.d.ts`. + * @param libs An array of entries to register. + */ + setExtraLibs(libs: { content: string; filePath?: string }[]): void; + /** * Set TypeScript compiler options. */ @@ -5926,10 +5860,70 @@ declare namespace monaco.languages.css { } } + export interface ModeConfiguration { + /** + * Defines whether the built-in completionItemProvider is enabled. + */ + readonly completionItems?: boolean; + + /** + * Defines whether the built-in hoverProvider is enabled. + */ + readonly hovers?: boolean; + + /** + * Defines whether the built-in documentSymbolProvider is enabled. + */ + readonly documentSymbols?: boolean; + + /** + * Defines whether the built-in definitions provider is enabled. + */ + readonly definitions?: boolean; + + /** + * Defines whether the built-in references provider is enabled. + */ + readonly references?: boolean; + + /** + * Defines whether the built-in references provider is enabled. + */ + readonly documentHighlights?: boolean; + + /** + * Defines whether the built-in rename provider is enabled. + */ + readonly rename?: boolean; + + /** + * Defines whether the built-in color provider is enabled. + */ + readonly colors?: boolean; + + /** + * Defines whether the built-in foldingRange provider is enabled. + */ + readonly foldingRanges?: boolean; + + /** + * Defines whether the built-in diagnostic provider is enabled. + */ + readonly diagnostics?: boolean; + + /** + * Defines whether the built-in selection range provider is enabled. + */ + readonly selectionRanges?: boolean; + + } + export interface LanguageServiceDefaults { readonly onDidChange: IEvent; readonly diagnosticsOptions: DiagnosticsOptions; + readonly modeConfiguration: ModeConfiguration; setDiagnosticsOptions(options: DiagnosticsOptions): void; + setModeConfiguration(modeConfiguration: ModeConfiguration): void; } export var cssDefaults: LanguageServiceDefaults; @@ -6006,19 +6000,24 @@ declare namespace monaco.languages.json { readonly tokens?: boolean; /** - * Defines whether the built-in color provider is enabled. - */ + * Defines whether the built-in color provider is enabled. + */ readonly colors?: boolean; /** - * Defines whether the built-in foldingRange provider is enabled. - */ - readonly foldingRanges?: boolean; + * Defines whether the built-in foldingRange provider is enabled. + */ + readonly foldingRanges?: boolean; /** - * Defines whether the built-in diagnostic provider is enabled. - */ - readonly diagnostics?: boolean; + * Defines whether the built-in diagnostic provider is enabled. + */ + readonly diagnostics?: boolean; + + /** + * Defines whether the built-in selection range provider is enabled. + */ + readonly selectionRanges?: boolean; } @@ -6069,6 +6068,69 @@ declare namespace monaco.languages.html { readonly suggest?: CompletionConfiguration; } + export interface ModeConfiguration { + /** + * Defines whether the built-in completionItemProvider is enabled. + */ + readonly completionItems?: boolean; + + /** + * Defines whether the built-in hoverProvider is enabled. + */ + readonly hovers?: boolean; + + /** + * Defines whether the built-in documentSymbolProvider is enabled. + */ + readonly documentSymbols?: boolean; + + /** + * Defines whether the built-in definitions provider is enabled. + */ + readonly links?: boolean; + + /** + * Defines whether the built-in references provider is enabled. + */ + readonly documentHighlights?: boolean; + + /** + * Defines whether the built-in rename provider is enabled. + */ + readonly rename?: boolean; + + /** + * Defines whether the built-in color provider is enabled. + */ + readonly colors?: boolean; + + /** + * Defines whether the built-in foldingRange provider is enabled. + */ + readonly foldingRanges?: boolean; + + /** + * Defines whether the built-in diagnostic provider is enabled. + */ + readonly diagnostics?: boolean; + + /** + * Defines whether the built-in selection range provider is enabled. + */ + readonly selectionRanges?: boolean; + + /** + * Defines whether the built-in documentFormattingEdit provider is enabled. + */ + readonly documentFormattingEdits?: boolean; + + /** + * Defines whether the built-in documentRangeFormattingEdit provider is enabled. + */ + readonly documentRangeFormattingEdits?: boolean; + + } + export interface LanguageServiceDefaults { readonly onDidChange: IEvent; readonly options: Options; diff --git a/package-lock.json b/package-lock.json index c5ae3709..4558634c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3637,7 +3637,7 @@ }, "is-obj": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", "dev": true }, @@ -4520,39 +4520,39 @@ } }, "monaco-css": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/monaco-css/-/monaco-css-2.5.1.tgz", - "integrity": "sha512-oIQGRFs+eqT8Zq7edPmfFkyxTi6hcN691e3xzGuPtMH6pW5vGW2+1krtLMdh6MlqNMQ5EnF5GCny/t65MyhXLQ==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/monaco-css/-/monaco-css-2.6.0.tgz", + "integrity": "sha512-p+qZxteFlSkWx2pXnK9k11FKvC8q3qt1gL2yH4F3bLjKs1ngD65XncVxC5fuKdMhH23im9dv/ZF6rKP93+04tg==", "dev": true }, "monaco-editor-core": { - "version": "0.18.1", - "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.18.1.tgz", - "integrity": "sha512-euzXzmwjZFG0oAPGjICMwINcZBzQDyfGDYlAR5YNMBJZO9Bmkqq1xpTTze/qQ0KKbVmawFXiwgUbg7WVgebP9Q==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.19.0.tgz", + "integrity": "sha512-wD60zpYDhsuJbzzLQigAteK2cA5fkuaDn+4c7NLwm/526OX5eL6MMvLhfvRgrDvLO00SYhFf6vz1y1C8M1hTpQ==", "dev": true }, "monaco-html": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/monaco-html/-/monaco-html-2.5.3.tgz", - "integrity": "sha512-q6t7xi8iK3o81GxZVXChoN8NPsJOQ0Dm2vZjpOAEIWpeOVdxELcTDnkcvQBahhVMRoJjhj+jSn1+F4HZBO6kvQ==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/monaco-html/-/monaco-html-2.6.0.tgz", + "integrity": "sha512-UVvgqFFuzCjwsfINKmc2nm4qvQhBsu1luw4lUz+YF3CxAcVQBmscWiz5fb6/MFRG77K0h+7uADseNmc9APzEgA==", "dev": true }, "monaco-json": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/monaco-json/-/monaco-json-2.7.0.tgz", - "integrity": "sha512-MKMA+XRnWxxB0q694FJwlKFaMmaEagyfLFDPQ7TYHHQxznAuAU7VxKdL6cicdtEsDgB8mEbOhnKbB+bQMTfDDA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/monaco-json/-/monaco-json-2.8.0.tgz", + "integrity": "sha512-Qnu4zt6yQ68nq6OP5f9Nt+Kt+kf8uJK2tw+4JE8BpmBkA3Gy+H2QHYtikp2K6k7x3yrDfr4cw1xRAPxmS1hatA==", "dev": true }, "monaco-languages": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/monaco-languages/-/monaco-languages-1.8.0.tgz", - "integrity": "sha512-vC/lqNgSslQT3vSlNOpyT34ELK0eoNbA/rHUvTUjQemIiR1GpRMKhuwB21BqzWk+0MjZuJydGSCQMCebBge7jg==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/monaco-languages/-/monaco-languages-1.9.0.tgz", + "integrity": "sha512-FAP2tF4Kwz5xYEBO3iSoyYAFjnk6IpW9YSMjnkNIR8bqb21uT7pZFSRu3j1MdoG0c+P/LdQH/VSHSXBTI5wdbw==", "dev": true }, "monaco-typescript": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/monaco-typescript/-/monaco-typescript-3.5.1.tgz", - "integrity": "sha512-MRnGTwN4elJ9bZPxvtdl735le9zLsoDkOEbXNlUE2fhz5RNqAX+Fuc6xLzfCLM3WF2nr4ExKsHHg2K61jQnWxA==", + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/monaco-typescript/-/monaco-typescript-3.6.1.tgz", + "integrity": "sha512-VXzS/s/YoQlolf7zRsM7PGVhY+HUTTHcLzFCx1QxuyOpoY1uFlUaMeTIV/AMYzMjSqHIiJ58kNiWjoP1YNsaAQ==", "dev": true }, "move-concurrently": { @@ -4870,7 +4870,7 @@ "dependencies": { "minimist": { "version": "0.0.10", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", "dev": true } @@ -7502,9 +7502,9 @@ } }, "yaserver": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/yaserver/-/yaserver-0.1.2.tgz", - "integrity": "sha512-g+tGCFT5L5byArdXUvBSiMtYIt0QbjFZXvM0wcWKoKqkc3sv430rvflRpvNSVmM0g7hfkVI7c+o264yJ68G9lQ==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/yaserver/-/yaserver-0.2.0.tgz", + "integrity": "sha512-onsELrl7Y42M4P3T9R0N/ZJNJRu4cGwzhDyOWIFRMJvPUIrGKInYGh+DJBefrbr1qoyDu7DSCLl9BL5hSSVfDA==", "dev": true }, "yauzl": { diff --git a/package.json b/package.json index fb1ee9d6..a76787a3 100644 --- a/package.json +++ b/package.json @@ -33,12 +33,12 @@ "gulp": "^4.0.0", "gulp-typedoc": "^2.2.2", "mocha": "^6.2.2", - "monaco-css": "2.5.1", - "monaco-editor-core": "0.18.1", - "monaco-html": "2.5.3", - "monaco-json": "2.7.0", - "monaco-languages": "1.8.0", - "monaco-typescript": "3.5.1", + "monaco-css": "2.6.0", + "monaco-editor-core": "0.19.0", + "monaco-html": "2.6.0", + "monaco-json": "2.8.0", + "monaco-languages": "1.9.0", + "monaco-typescript": "3.6.1", "puppeteer": "^1.15.0", "rimraf": "^2.6.3", "style-loader": "^1.0.1", @@ -48,6 +48,6 @@ "vinyl": "^2.2.0", "webpack": "^4.41.2", "webpack-cli": "^3.3.10", - "yaserver": "^0.1.2" + "yaserver": "^0.2.0" } } diff --git a/website/playground/monaco.d.ts.txt b/website/playground/monaco.d.ts.txt index 948aba9d..40eb8a1c 100644 --- a/website/playground/monaco.d.ts.txt +++ b/website/playground/monaco.d.ts.txt @@ -1,6 +1,6 @@ /*!----------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. - * Type definitions for monaco-editor v0.18.1 + * Type definitions for monaco-editor * Released under the MIT license *-----------------------------------------------------------*/ /*--------------------------------------------------------------------------------------------- @@ -47,9 +47,9 @@ declare namespace monaco { export class CancellationTokenSource { constructor(parent?: CancellationToken); - readonly token: CancellationToken; + get token(): CancellationToken; cancel(): void; - dispose(): void; + dispose(cancel?: boolean): void; } export interface CancellationToken { @@ -60,7 +60,6 @@ declare namespace monaco { */ readonly onCancellationRequested: IEvent; } - /** * Uniform Resource Identifier (Uri) http://tools.ietf.org/html/rfc3986. * This class is a simple parser which creates the basic component parts @@ -123,7 +122,7 @@ declare namespace monaco { * namely the server name, would be missing. Therefore `Uri#fsPath` exists - it's sugar to ease working * with URIs that represent files on disk (`file` scheme). */ - readonly fsPath: string; + get fsPath(): string; with(change: { scheme?: string; authority?: string | null; @@ -384,8 +383,8 @@ declare namespace monaco { } export interface IMarkdownString { - value: string; - isTrusted?: boolean; + readonly value: string; + readonly isTrusted?: boolean; uris?: { [href: string]: UriComponents; }; @@ -732,10 +731,6 @@ declare namespace monaco { */ readonly positionColumn: number; constructor(selectionStartLineNumber: number, selectionStartColumn: number, positionLineNumber: number, positionColumn: number); - /** - * Clone this selection. - */ - clone(): Selection; /** * Transform to a human-readable representation. */ @@ -812,13 +807,19 @@ declare namespace monaco { declare namespace monaco.editor { + export interface IDiffNavigator { + canNavigate(): boolean; + next(): void; + previous(): void; + dispose(): void; + } /** * Create a new editor under `domElement`. * `domElement` should be empty (not contain other dom nodes). * The editor will read the size of `domElement`. */ - export function create(domElement: HTMLElement, options?: IEditorConstructionOptions, override?: IEditorOverrideServices): IStandaloneCodeEditor; + export function create(domElement: HTMLElement, options?: IStandaloneEditorConstructionOptions, override?: IEditorOverrideServices): IStandaloneCodeEditor; /** * Emitted when an editor is created. @@ -834,13 +835,6 @@ declare namespace monaco.editor { */ export function createDiffEditor(domElement: HTMLElement, options?: IDiffEditorConstructionOptions, override?: IEditorOverrideServices): IStandaloneDiffEditor; - export interface IDiffNavigator { - canNavigate(): boolean; - next(): void; - previous(): void; - dispose(): void; - } - export interface IDiffNavigatorOptions { readonly followsCaret?: boolean; readonly ignoreCharChanges?: boolean; @@ -1006,6 +1000,11 @@ declare namespace monaco.editor { * An object that can be used by the web worker to make calls back to the main thread. */ host?: any; + /** + * Keep idle models. + * Defaults to false, which means that idle models will stop syncing after a while. + */ + keepIdleModels?: boolean; } /** @@ -1056,7 +1055,7 @@ declare namespace monaco.editor { /** * The options to create an editor. */ - export interface IEditorConstructionOptions extends IEditorOptions { + export interface IStandaloneEditorConstructionOptions extends IEditorConstructionOptions { /** * The initial model associated with this code editor. */ @@ -1203,7 +1202,8 @@ declare namespace monaco.editor { * Position in the minimap to render the decoration. */ export enum MinimapPosition { - Inline = 1 + Inline = 1, + Gutter = 2 } export interface IDecorationOptions { @@ -1561,6 +1561,11 @@ declare namespace monaco.editor { * @return The text length. */ getValueLengthInRange(range: IRange): number; + /** + * Get the character count of text in a certain range. + * @param range The range describing what text length to get. + */ + getCharacterCountInRange(range: IRange): number; /** * Get the number of lines in the model. */ @@ -2066,6 +2071,8 @@ declare namespace monaco.editor { /** * Instructs the editor to remeasure its container. This method should * be called when the container of the editor gets resized. + * + * If a dimension is passed in, the passed in value will be used. */ layout(dimension?: IDimension): void; /** @@ -2157,7 +2164,7 @@ declare namespace monaco.editor { * Set the selections for all the cursors of the editor. * Cursors will be removed or added, as necessary. */ - setSelections(selections: ISelection[]): void; + setSelections(selections: readonly ISelection[]): void; /** * Scroll vertically as necessary and reveal lines. */ @@ -2212,10 +2219,6 @@ declare namespace monaco.editor { * An editor contribution that gets created every time a new editor gets created and gets disposed when the editor gets disposed. */ export interface IEditorContribution { - /** - * Get a unique identifier for this contribution. - */ - getId(): string; /** * Dispose this contribution. */ @@ -2404,89 +2407,25 @@ declare namespace monaco.editor { */ readonly secondarySelections: Selection[]; /** - * Source of the call that caused the event. - */ - readonly source: string; - /** - * Reason. - */ - readonly reason: CursorChangeReason; - } - - /** - * Configuration options for editor scrollbars - */ - export interface IEditorScrollbarOptions { - /** - * The size of arrows (if displayed). - * Defaults to 11. - */ - arrowSize?: number; - /** - * Render vertical scrollbar. - * Defaults to 'auto'. - */ - vertical?: 'auto' | 'visible' | 'hidden'; - /** - * Render horizontal scrollbar. - * Defaults to 'auto'. - */ - horizontal?: 'auto' | 'visible' | 'hidden'; - /** - * Cast horizontal and vertical shadows when the content is scrolled. - * Defaults to true. - */ - useShadows?: boolean; - /** - * Render arrows at the top and bottom of the vertical scrollbar. - * Defaults to false. - */ - verticalHasArrows?: boolean; - /** - * Render arrows at the left and right of the horizontal scrollbar. - * Defaults to false. - */ - horizontalHasArrows?: boolean; - /** - * Listen to mouse wheel events and react to them by scrolling. - * Defaults to true. - */ - handleMouseWheel?: boolean; - /** - * Height in pixels for the horizontal scrollbar. - * Defaults to 10 (px). - */ - horizontalScrollbarSize?: number; - /** - * Width in pixels for the vertical scrollbar. - * Defaults to 10 (px). + * The model version id. */ - verticalScrollbarSize?: number; + readonly modelVersionId: number; /** - * Width in pixels for the vertical slider. - * Defaults to `verticalScrollbarSize`. + * The old selections. */ - verticalSliderSize?: number; + readonly oldSelections: Selection[] | null; /** - * Height in pixels for the horizontal slider. - * Defaults to `horizontalScrollbarSize`. + * The model version id the that `oldSelections` refer to. */ - horizontalSliderSize?: number; - } - - /** - * Configuration options for editor find widget - */ - export interface IEditorFindOptions { + readonly oldModelVersionId: number; /** - * Controls if we seed search string in the Find Widget with editor selection. + * Source of the call that caused the event. */ - seedSearchStringFromSelection?: boolean; + readonly source: string; /** - * Controls if Find in Selection flag is turned on when multiple lines of text are selected in the editor. + * Reason. */ - autoFindInSelection: boolean; - addExtraSpaceOnTop?: boolean; + readonly reason: CursorChangeReason; } /** @@ -2504,134 +2443,14 @@ declare namespace monaco.editor { */ export type EditorAutoClosingOvertypeStrategy = 'always' | 'auto' | 'never'; - /** - * Configuration options for editor minimap - */ - export interface IEditorMinimapOptions { - /** - * Enable the rendering of the minimap. - * Defaults to true. - */ - enabled?: boolean; - /** - * Control the side of the minimap in editor. - * Defaults to 'right'. - */ - side?: 'right' | 'left'; - /** - * Control the rendering of the minimap slider. - * Defaults to 'mouseover'. - */ - showSlider?: 'always' | 'mouseover'; - /** - * Render the actual text on a line (as opposed to color blocks). - * Defaults to true. - */ - renderCharacters?: boolean; - /** - * Limit the width of the minimap to render at most a certain number of columns. - * Defaults to 120. - */ - maxColumn?: number; - } - - /** - * Configuration options for editor minimap - */ - export interface IEditorLightbulbOptions { - /** - * Enable the lightbulb code action. - * Defaults to true. - */ - enabled?: boolean; - } - - /** - * Configuration options for editor hover - */ - export interface IEditorHoverOptions { - /** - * Enable the hover. - * Defaults to true. - */ - enabled?: boolean; - /** - * Delay for showing the hover. - * Defaults to 300. - */ - delay?: number; - /** - * Is the hover sticky such that it can be clicked and its contents selected? - * Defaults to true. - */ - sticky?: boolean; - } - - /** - * Configuration options for parameter hints - */ - export interface IEditorParameterHintOptions { - /** - * Enable parameter hints. - * Defaults to true. - */ - enabled?: boolean; - /** - * Enable cycling of parameter hints. - * Defaults to false. - */ - cycle?: boolean; - } - - export interface ISuggestOptions { - /** - * Enable graceful matching. Defaults to true. - */ - filterGraceful?: boolean; - /** - * Prevent quick suggestions when a snippet is active. Defaults to true. - */ - snippetsPreventQuickSuggestions?: boolean; - /** - * Favours words that appear close to the cursor. - */ - localityBonus?: boolean; - /** - * Enable using global storage for remembering suggestions. - */ - shareSuggestSelections?: boolean; - /** - * Enable or disable icons in suggestions. Defaults to true. - */ - showIcons?: boolean; - /** - * Max suggestions to show in suggestions. Defaults to 12. - */ - maxVisibleSuggestions?: boolean; - /** - * Names of suggestion types to filter. - */ - filteredTypes?: Record; - } - - export interface IGotoLocationOptions { - /** - * Control how goto-command work when having multiple results. - */ - multiple?: 'peek' | 'gotoAndPeek' | 'goto'; - } - - /** - * Configuration map for codeActionsOnSave - */ - export interface ICodeActionsOnSaveOptions { - [kind: string]: boolean; - } - /** * Configuration options for the editor. */ export interface IEditorOptions { + /** + * This editor is used inside a diff editor. + */ + inDiffEditor?: boolean; /** * The aria label for the editor's textarea (when it is focused). */ @@ -2658,12 +2477,18 @@ declare namespace monaco.editor { * Otherwise, line numbers will not be rendered. * Defaults to true. */ - lineNumbers?: 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string); + lineNumbers?: LineNumbersType; /** * Controls the minimal number of visible leading and trailing lines surrounding the cursor. * Defaults to 0. */ cursorSurroundingLines?: number; + /** + * Controls when `cursorSurroundingLines` should be enforced + * Defaults to `default`, `cursorSurroundingLines` is not enforced when cursor position is changed + * by mouse. + */ + cursorSurroundingLinesStyle?: 'default' | 'all'; /** * Render last line number when the file ends with a newline. * Defaults to true. @@ -2730,7 +2555,7 @@ declare namespace monaco.editor { fixedOverflowWidgets?: boolean; /** * The number of vertical lanes the overview ruler should render. - * Defaults to 2. + * Defaults to 3. */ overviewRulerLanes?: number; /** @@ -2742,12 +2567,17 @@ declare namespace monaco.editor { * Control the cursor animation style, possible values are 'blink', 'smooth', 'phase', 'expand' and 'solid'. * Defaults to 'blink'. */ - cursorBlinking?: string; + cursorBlinking?: 'blink' | 'smooth' | 'phase' | 'expand' | 'solid'; /** * Zoom the font in the editor when using the mouse wheel in combination with holding Ctrl. * Defaults to false. */ mouseWheelZoom?: boolean; + /** + * Control the mouse pointer style, either 'text' or 'default' or 'copy' + * Defaults to 'text' + */ + mouseStyle?: 'text' | 'default' | 'copy'; /** * Enable smooth caret animation. * Defaults to false. @@ -2757,7 +2587,7 @@ declare namespace monaco.editor { * Control the cursor style, either 'block' or 'line'. * Defaults to 'line'. */ - cursorStyle?: string; + cursorStyle?: 'line' | 'block' | 'underline' | 'line-thin' | 'block-outline' | 'underline-thin'; /** * Control the width of the cursor when cursorStyle is set to 'line' */ @@ -2766,10 +2596,10 @@ declare namespace monaco.editor { * Enable font ligatures. * Defaults to false. */ - fontLigatures?: boolean; + fontLigatures?: boolean | string; /** - * Disable the use of `will-change` for the editor margin and lines layers. - * The usage of `will-change` acts as a hint for browsers to create an extra layer. + * Disable the use of `transform: translate3d(0px, 0px, 0px)` for the editor margin and lines layers. + * The usage of `transform: translate3d(0px, 0px, 0px)` acts as a hint for browsers to create an extra layer. * Defaults to false. */ disableLayerHinting?: boolean; @@ -2831,7 +2661,7 @@ declare namespace monaco.editor { * Control indentation of wrapped lines. Can be: 'none', 'same', 'indent' or 'deepIndent'. * Defaults to 'same' in vscode and to 'none' in monaco-editor. */ - wrappingIndent?: string; + wrappingIndent?: 'none' | 'same' | 'indent' | 'deepIndent'; /** * Configure word wrapping characters. A break will be introduced before these characters. * Defaults to '{([+'. @@ -2891,11 +2721,20 @@ declare namespace monaco.editor { * Defaults to true */ multiCursorMergeOverlapping?: boolean; + /** + * Configure the behaviour when pasting a text with the line count equal to the cursor count. + * Defaults to 'spread'. + */ + multiCursorPaste?: 'spread' | 'full'; /** * Configure the editor's accessibility support. * Defaults to 'auto'. It is best to leave this to 'auto'. */ accessibilitySupport?: 'auto' | 'off' | 'on'; + /** + * Controls the number of lines in the editor that can be read out by a screen reader + */ + accessibilityPageSize?: number; /** * Suggest options. */ @@ -2908,14 +2747,10 @@ declare namespace monaco.editor { * Enable quick suggestions (shadow suggestions) * Defaults to true. */ - quickSuggestions?: boolean | { - other: boolean; - comments: boolean; - strings: boolean; - }; + quickSuggestions?: boolean | IQuickSuggestionsOptions; /** * Quick suggestions show delay (in ms) - * Defaults to 500 (ms) + * Defaults to 10 (ms) */ quickSuggestionsDelay?: number; /** @@ -2945,7 +2780,7 @@ declare namespace monaco.editor { * Enable auto indentation adjustment. * Defaults to false. */ - autoIndent?: boolean; + autoIndent?: 'none' | 'keep' | 'brackets' | 'advanced' | 'full'; /** * Enable format on type. * Defaults to false. @@ -2970,7 +2805,7 @@ declare namespace monaco.editor { * Accept suggestions on ENTER. * Defaults to 'on'. */ - acceptSuggestionOnEnter?: boolean | 'on' | 'smart' | 'off'; + acceptSuggestionOnEnter?: 'on' | 'smart' | 'off'; /** * Accept suggestions on provider defined characters. * Defaults to true. @@ -2988,10 +2823,6 @@ declare namespace monaco.editor { * Syntax highlighting is copied. */ copyWithSyntaxHighlighting?: boolean; - /** - * Enable word based suggestions. Defaults to 'true' - */ - wordBasedSuggestions?: boolean; /** * The history mode for suggestions. */ @@ -3009,7 +2840,7 @@ declare namespace monaco.editor { /** * Enable tab completion. */ - tabCompletion?: boolean | 'on' | 'off' | 'onlySnippets'; + tabCompletion?: 'on' | 'off' | 'onlySnippets'; /** * Enable selection highlight. * Defaults to true. @@ -3029,10 +2860,6 @@ declare namespace monaco.editor { * Control the behavior and rendering of the code action lightbulb. */ lightbulb?: IEditorLightbulbOptions; - /** - * Code action kinds to be run on save. - */ - codeActionsOnSave?: ICodeActionsOnSaveOptions; /** * Timeout for running code actions on save. */ @@ -3054,9 +2881,9 @@ declare namespace monaco.editor { showFoldingControls?: 'always' | 'mouseover'; /** * Enable highlighting of matching brackets. - * Defaults to true. + * Defaults to 'always'. */ - matchBrackets?: boolean; + matchBrackets?: 'never' | 'near' | 'always'; /** * Enable rendering of whitespace. * Defaults to none. @@ -3093,7 +2920,7 @@ declare namespace monaco.editor { /** * The font weight */ - fontWeight?: 'normal' | 'bold' | 'bolder' | 'lighter' | 'initial' | 'inherit' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900'; + fontWeight?: string; /** * The font size */ @@ -3112,6 +2939,13 @@ declare namespace monaco.editor { showUnused?: boolean; } + export interface IEditorConstructionOptions extends IEditorOptions { + /** + * The initial editor dimension (to avoid measuring the container). + */ + dimension?: IDimension; + } + /** * Configuration options for the diff editor. */ @@ -3126,6 +2960,11 @@ declare namespace monaco.editor { * Defaults to true. */ renderSideBySide?: boolean; + /** + * Timeout in milliseconds after which diff computation is cancelled. + * Defaults to 5000. + */ + maxComputationTime?: number; /** * Compute the diff by ignoring leading/trailing whitespace * Defaults to true. @@ -3143,275 +2982,65 @@ declare namespace monaco.editor { originalEditable?: boolean; } - export enum RenderMinimap { - None = 0, - Small = 1, - Large = 2, - SmallBlocks = 3, - LargeBlocks = 4 + /** + * An event describing that the configuration of the editor has changed. + */ + export class ConfigurationChangedEvent { } /** - * Describes how to indent wrapped lines. + * Configuration options for editor find widget */ - export enum WrappingIndent { - /** - * No indentation => wrapped lines begin at column 1. - */ - None = 0, + export interface IEditorFindOptions { /** - * Same => wrapped lines get the same indentation as the parent. + * Controls if we seed search string in the Find Widget with editor selection. */ - Same = 1, + seedSearchStringFromSelection?: boolean; /** - * Indent => wrapped lines get +1 indentation toward the parent. + * Controls if Find in Selection flag is turned on in the editor. */ - Indent = 2, - /** - * DeepIndent => wrapped lines get +2 indentation toward the parent. - */ - DeepIndent = 3 + autoFindInSelection?: 'never' | 'always' | 'multiline'; + addExtraSpaceOnTop?: boolean; } + export type GoToLocationValues = 'peek' | 'gotoAndPeek' | 'goto'; + /** - * The kind of animation in which the editor's cursor should be rendered. + * Configuration options for go to location */ - export enum TextEditorCursorBlinkingStyle { - /** - * Hidden - */ - Hidden = 0, - /** - * Blinking - */ - Blink = 1, - /** - * Blinking with smooth fading - */ - Smooth = 2, - /** - * Blinking with prolonged filled state and smooth fading - */ - Phase = 3, - /** - * Expand collapse animation on the y axis - */ - Expand = 4, - /** - * No-Blinking - */ - Solid = 5 + export interface IGotoLocationOptions { + multiple?: GoToLocationValues; + multipleDefinitions?: GoToLocationValues; + multipleTypeDefinitions?: GoToLocationValues; + multipleDeclarations?: GoToLocationValues; + multipleImplementations?: GoToLocationValues; + multipleReferences?: GoToLocationValues; + alternativeDefinitionCommand?: string; + alternativeTypeDefinitionCommand?: string; + alternativeDeclarationCommand?: string; + alternativeImplementationCommand?: string; + alternativeReferenceCommand?: string; } /** - * The style in which the editor's cursor should be rendered. + * Configuration options for editor hover */ - export enum TextEditorCursorStyle { - /** - * As a vertical line (sitting between two characters). - */ - Line = 1, - /** - * As a block (sitting on top of a character). - */ - Block = 2, - /** - * As a horizontal line (sitting under a character). - */ - Underline = 3, + export interface IEditorHoverOptions { /** - * As a thin vertical line (sitting between two characters). + * Enable the hover. + * Defaults to true. */ - LineThin = 4, + enabled?: boolean; /** - * As an outlined block (sitting on top of a character). + * Delay for showing the hover. + * Defaults to 300. */ - BlockOutline = 5, + delay?: number; /** - * As a thin horizontal line (sitting under a character). + * Is the hover sticky such that it can be clicked and its contents selected? + * Defaults to true. */ - UnderlineThin = 6 - } - - export interface InternalEditorScrollbarOptions { - readonly arrowSize: number; - readonly vertical: ScrollbarVisibility; - readonly horizontal: ScrollbarVisibility; - readonly useShadows: boolean; - readonly verticalHasArrows: boolean; - readonly horizontalHasArrows: boolean; - readonly handleMouseWheel: boolean; - readonly horizontalScrollbarSize: number; - readonly horizontalSliderSize: number; - readonly verticalScrollbarSize: number; - readonly verticalSliderSize: number; - readonly mouseWheelScrollSensitivity: number; - readonly fastScrollSensitivity: number; - } - - export interface InternalEditorMinimapOptions { - readonly enabled: boolean; - readonly side: 'right' | 'left'; - readonly showSlider: 'always' | 'mouseover'; - readonly renderCharacters: boolean; - readonly maxColumn: number; - } - - export interface InternalEditorFindOptions { - readonly seedSearchStringFromSelection: boolean; - readonly autoFindInSelection: boolean; - readonly addExtraSpaceOnTop: boolean; - } - - export interface InternalEditorHoverOptions { - readonly enabled: boolean; - readonly delay: number; - readonly sticky: boolean; - } - - export interface InternalGoToLocationOptions { - readonly multiple: 'peek' | 'gotoAndPeek' | 'goto'; - } - - export interface InternalSuggestOptions { - readonly filterGraceful: boolean; - readonly snippets: 'top' | 'bottom' | 'inline' | 'none'; - readonly snippetsPreventQuickSuggestions: boolean; - readonly localityBonus: boolean; - readonly shareSuggestSelections: boolean; - readonly showIcons: boolean; - readonly maxVisibleSuggestions: number; - readonly filteredTypes: Record; - } - - export interface InternalParameterHintOptions { - readonly enabled: boolean; - readonly cycle: boolean; - } - - export interface EditorWrappingInfo { - readonly inDiffEditor: boolean; - readonly isDominatedByLongLines: boolean; - readonly isWordWrapMinified: boolean; - readonly isViewportWrapping: boolean; - readonly wrappingColumn: number; - readonly wrappingIndent: WrappingIndent; - readonly wordWrapBreakBeforeCharacters: string; - readonly wordWrapBreakAfterCharacters: string; - readonly wordWrapBreakObtrusiveCharacters: string; - } - - export enum RenderLineNumbersType { - Off = 0, - On = 1, - Relative = 2, - Interval = 3, - Custom = 4 - } - - export interface InternalEditorViewOptions { - readonly extraEditorClassName: string; - readonly disableMonospaceOptimizations: boolean; - readonly rulers: number[]; - readonly ariaLabel: string; - readonly renderLineNumbers: RenderLineNumbersType; - readonly renderCustomLineNumbers: ((lineNumber: number) => string) | null; - readonly cursorSurroundingLines: number; - readonly renderFinalNewline: boolean; - readonly selectOnLineNumbers: boolean; - readonly glyphMargin: boolean; - readonly revealHorizontalRightPadding: number; - readonly roundedSelection: boolean; - readonly overviewRulerLanes: number; - readonly overviewRulerBorder: boolean; - readonly cursorBlinking: TextEditorCursorBlinkingStyle; - readonly mouseWheelZoom: boolean; - readonly cursorSmoothCaretAnimation: boolean; - readonly cursorStyle: TextEditorCursorStyle; - readonly cursorWidth: number; - readonly hideCursorInOverviewRuler: boolean; - readonly scrollBeyondLastLine: boolean; - readonly scrollBeyondLastColumn: number; - readonly smoothScrolling: boolean; - readonly stopRenderingLineAfter: number; - readonly renderWhitespace: 'none' | 'boundary' | 'selection' | 'all'; - readonly renderControlCharacters: boolean; - readonly fontLigatures: boolean; - readonly renderIndentGuides: boolean; - readonly highlightActiveIndentGuide: boolean; - readonly renderLineHighlight: 'none' | 'gutter' | 'line' | 'all'; - readonly scrollbar: InternalEditorScrollbarOptions; - readonly minimap: InternalEditorMinimapOptions; - readonly fixedOverflowWidgets: boolean; - } - - export interface EditorContribOptions { - readonly selectionClipboard: boolean; - readonly hover: InternalEditorHoverOptions; - readonly links: boolean; - readonly contextmenu: boolean; - readonly quickSuggestions: boolean | { - other: boolean; - comments: boolean; - strings: boolean; - }; - readonly quickSuggestionsDelay: number; - readonly parameterHints: InternalParameterHintOptions; - readonly formatOnType: boolean; - readonly formatOnPaste: boolean; - readonly suggestOnTriggerCharacters: boolean; - readonly acceptSuggestionOnEnter: 'on' | 'smart' | 'off'; - readonly acceptSuggestionOnCommitCharacter: boolean; - readonly wordBasedSuggestions: boolean; - readonly suggestSelection: 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix'; - readonly suggestFontSize: number; - readonly suggestLineHeight: number; - readonly tabCompletion: 'on' | 'off' | 'onlySnippets'; - readonly suggest: InternalSuggestOptions; - readonly gotoLocation: InternalGoToLocationOptions; - readonly selectionHighlight: boolean; - readonly occurrencesHighlight: boolean; - readonly codeLens: boolean; - readonly folding: boolean; - readonly foldingStrategy: 'auto' | 'indentation'; - readonly showFoldingControls: 'always' | 'mouseover'; - readonly matchBrackets: boolean; - readonly find: InternalEditorFindOptions; - readonly colorDecorators: boolean; - readonly lightbulbEnabled: boolean; - readonly codeActionsOnSave: ICodeActionsOnSaveOptions; - readonly codeActionsOnSaveTimeout: number; - } - - /** - * Internal configuration options (transformed or computed) for the editor. - */ - export class InternalEditorOptions { - readonly _internalEditorOptionsBrand: void; - readonly canUseLayerHinting: boolean; - readonly pixelRatio: number; - readonly editorClassName: string; - readonly lineHeight: number; - readonly readOnly: boolean; - readonly multiCursorModifier: 'altKey' | 'ctrlKey' | 'metaKey'; - readonly multiCursorMergeOverlapping: boolean; - readonly showUnused: boolean; - readonly wordSeparators: string; - readonly autoClosingBrackets: EditorAutoClosingStrategy; - readonly autoClosingQuotes: EditorAutoClosingStrategy; - readonly autoClosingOvertype: EditorAutoClosingOvertypeStrategy; - readonly autoSurround: EditorAutoSurroundStrategy; - readonly autoIndent: boolean; - readonly useTabStops: boolean; - readonly tabFocusMode: boolean; - readonly dragAndDrop: boolean; - readonly emptySelectionClipboard: boolean; - readonly copyWithSyntaxHighlighting: boolean; - readonly layoutInfo: EditorLayoutInfo; - readonly fontInfo: FontInfo; - readonly viewInfo: InternalEditorViewOptions; - readonly wrappingInfo: EditorWrappingInfo; - readonly contribInfo: EditorContribOptions; + sticky?: boolean; } /** @@ -3436,6 +3065,12 @@ declare namespace monaco.editor { readonly right: number; } + export enum RenderMinimap { + None = 0, + Text = 1, + Blocks = 2 + } + /** * The internal layout details of the editor. */ @@ -3527,33 +3162,280 @@ declare namespace monaco.editor { } /** - * An event describing that the configuration of the editor has changed. + * Configuration options for editor lightbulb */ - export interface IConfigurationChangedEvent { - readonly canUseLayerHinting: boolean; - readonly pixelRatio: boolean; - readonly editorClassName: boolean; - readonly lineHeight: boolean; - readonly readOnly: boolean; - readonly accessibilitySupport: boolean; - readonly multiCursorModifier: boolean; - readonly multiCursorMergeOverlapping: boolean; - readonly wordSeparators: boolean; - readonly autoClosingBrackets: boolean; - readonly autoClosingQuotes: boolean; - readonly autoClosingOvertype: boolean; - readonly autoSurround: boolean; - readonly autoIndent: boolean; - readonly useTabStops: boolean; - readonly tabFocusMode: boolean; - readonly dragAndDrop: boolean; - readonly emptySelectionClipboard: boolean; - readonly copyWithSyntaxHighlighting: boolean; - readonly layoutInfo: boolean; - readonly fontInfo: boolean; - readonly viewInfo: boolean; - readonly wrappingInfo: boolean; - readonly contribInfo: boolean; + export interface IEditorLightbulbOptions { + /** + * Enable the lightbulb code action. + * Defaults to true. + */ + enabled?: boolean; + } + + /** + * Configuration options for editor minimap + */ + export interface IEditorMinimapOptions { + /** + * Enable the rendering of the minimap. + * Defaults to true. + */ + enabled?: boolean; + /** + * Control the side of the minimap in editor. + * Defaults to 'right'. + */ + side?: 'right' | 'left'; + /** + * Control the rendering of the minimap slider. + * Defaults to 'mouseover'. + */ + showSlider?: 'always' | 'mouseover'; + /** + * Render the actual text on a line (as opposed to color blocks). + * Defaults to true. + */ + renderCharacters?: boolean; + /** + * Limit the width of the minimap to render at most a certain number of columns. + * Defaults to 120. + */ + maxColumn?: number; + /** + * Relative size of the font in the minimap. Defaults to 1. + */ + scale?: number; + } + + /** + * Configuration options for parameter hints + */ + export interface IEditorParameterHintOptions { + /** + * Enable parameter hints. + * Defaults to true. + */ + enabled?: boolean; + /** + * Enable cycling of parameter hints. + * Defaults to false. + */ + cycle?: boolean; + } + + /** + * Configuration options for quick suggestions + */ + export interface IQuickSuggestionsOptions { + other: boolean; + comments: boolean; + strings: boolean; + } + + export type LineNumbersType = 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string); + + /** + * Configuration options for editor scrollbars + */ + export interface IEditorScrollbarOptions { + /** + * The size of arrows (if displayed). + * Defaults to 11. + */ + arrowSize?: number; + /** + * Render vertical scrollbar. + * Defaults to 'auto'. + */ + vertical?: 'auto' | 'visible' | 'hidden'; + /** + * Render horizontal scrollbar. + * Defaults to 'auto'. + */ + horizontal?: 'auto' | 'visible' | 'hidden'; + /** + * Cast horizontal and vertical shadows when the content is scrolled. + * Defaults to true. + */ + useShadows?: boolean; + /** + * Render arrows at the top and bottom of the vertical scrollbar. + * Defaults to false. + */ + verticalHasArrows?: boolean; + /** + * Render arrows at the left and right of the horizontal scrollbar. + * Defaults to false. + */ + horizontalHasArrows?: boolean; + /** + * Listen to mouse wheel events and react to them by scrolling. + * Defaults to true. + */ + handleMouseWheel?: boolean; + /** + * Always consume mouse wheel events (always call preventDefault() and stopPropagation() on the browser events). + * Defaults to true. + */ + alwaysConsumeMouseWheel?: boolean; + /** + * Height in pixels for the horizontal scrollbar. + * Defaults to 10 (px). + */ + horizontalScrollbarSize?: number; + /** + * Width in pixels for the vertical scrollbar. + * Defaults to 10 (px). + */ + verticalScrollbarSize?: number; + /** + * Width in pixels for the vertical slider. + * Defaults to `verticalScrollbarSize`. + */ + verticalSliderSize?: number; + /** + * Height in pixels for the horizontal slider. + * Defaults to `horizontalScrollbarSize`. + */ + horizontalSliderSize?: number; + } + + /** + * Configuration options for editor suggest widget + */ + export interface ISuggestOptions { + /** + * 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. + */ + filterGraceful?: boolean; + /** + * Prevent quick suggestions when a snippet is active. Defaults to true. + */ + snippetsPreventQuickSuggestions?: boolean; + /** + * Favours words that appear close to the cursor. + */ + localityBonus?: boolean; + /** + * Enable using global storage for remembering suggestions. + */ + shareSuggestSelections?: boolean; + /** + * Enable or disable icons in suggestions. Defaults to true. + */ + showIcons?: boolean; + /** + * Max suggestions to show in suggestions. Defaults to 12. + */ + maxVisibleSuggestions?: number; + /** + * Show method-suggestions. + */ + showMethods?: boolean; + /** + * Show function-suggestions. + */ + showFunctions?: boolean; + /** + * Show constructor-suggestions. + */ + showConstructors?: boolean; + /** + * Show field-suggestions. + */ + showFields?: boolean; + /** + * Show variable-suggestions. + */ + showVariables?: boolean; + /** + * Show class-suggestions. + */ + showClasses?: boolean; + /** + * Show struct-suggestions. + */ + showStructs?: boolean; + /** + * Show interface-suggestions. + */ + showInterfaces?: boolean; + /** + * Show module-suggestions. + */ + showModules?: boolean; + /** + * Show property-suggestions. + */ + showProperties?: boolean; + /** + * Show event-suggestions. + */ + showEvents?: boolean; + /** + * Show operator-suggestions. + */ + showOperators?: boolean; + /** + * Show unit-suggestions. + */ + showUnits?: boolean; + /** + * Show value-suggestions. + */ + showValues?: boolean; + /** + * Show constant-suggestions. + */ + showConstants?: boolean; + /** + * Show enum-suggestions. + */ + showEnums?: boolean; + /** + * Show enumMember-suggestions. + */ + showEnumMembers?: boolean; + /** + * Show keyword-suggestions. + */ + showKeywords?: boolean; + /** + * Show text-suggestions. + */ + showWords?: boolean; + /** + * Show color-suggestions. + */ + showColors?: boolean; + /** + * Show file-suggestions. + */ + showFiles?: boolean; + /** + * Show reference-suggestions. + */ + showReferences?: boolean; + /** + * Show folder-suggestions. + */ + showFolders?: boolean; + /** + * Show typeParameter-suggestions. + */ + showTypeParameters?: boolean; + /** + * Show snippet-suggestions. + */ + showSnippets?: boolean; } /** @@ -3876,7 +3758,7 @@ declare namespace monaco.editor { * An event emitted when the configuration of the editor has changed. (e.g. `editor.updateOptions()`) * @event */ - onDidChangeConfiguration(listener: (e: IConfigurationChangedEvent) => void): IDisposable; + onDidChangeConfiguration(listener: (e: ConfigurationChangedEvent) => void): IDisposable; /** * An event emitted when the cursor position has changed. * @event @@ -3925,6 +3807,11 @@ declare namespace monaco.editor { * An event emitted after composition has ended. */ onCompositionEnd(listener: () => void): IDisposable; + /** + * An event emitted when users paste text in the editor. + * @event + */ + onDidPaste(listener: (range: Range) => void): IDisposable; /** * An event emitted on a "mouseup". * @event @@ -4002,9 +3889,9 @@ declare namespace monaco.editor { */ setModel(model: ITextModel | null): void; /** - * Returns the current editor's configuration + * Returns the editor's configuration (without any validation or defaults). */ - getConfiguration(): InternalEditorOptions; + getRawOptions(): IEditorOptions; /** * Get value of the current model attached to this editor. * @see `ITextModel.getValue` @@ -4235,6 +4122,10 @@ declare namespace monaco.editor { * If the diff computation is not finished or the model is missing, will return null. */ getDiffLineInformationForModified(lineNumber: number): IDiffLineInformation | null; + /** + * Update the editor's options after the editor has been created. + */ + updateOptions(newOptions: IDiffEditorOptions): void; } export class FontInfo extends BareFontInfo { @@ -4247,12 +4138,14 @@ declare namespace monaco.editor { readonly spaceWidth: number; readonly maxDigitWidth: number; } + export class BareFontInfo { readonly _bareFontInfoBrand: void; readonly zoomLevel: number; readonly fontFamily: string; readonly fontWeight: string; readonly fontSize: number; + readonly fontFeatureSettings: string; readonly lineHeight: number; readonly letterSpacing: number; } @@ -4504,7 +4397,7 @@ declare namespace monaco.languages { /** * Provide commands for the given document and range. */ - provideCodeActions(model: editor.ITextModel, range: Range, context: CodeActionContext, token: CancellationToken): CodeActionList | Promise; + provideCodeActions(model: editor.ITextModel, range: Range, context: CodeActionContext, token: CancellationToken): ProviderResult; } /** @@ -4886,7 +4779,10 @@ declare namespace monaco.languages { * *Note:* The range must be a [single line](#Range.isSingleLine) and it must * [contain](#Range.contains) the position at which completion has been [requested](#CompletionItemProvider.provideCompletionItems). */ - range: IRange; + range: IRange | { + insert: IRange; + replace: IRange; + }; /** * An optional set of characters that when pressed while this completion is active will accept it first and * then type that character. *Note* that all commit characters should have `length=1` and that superfluous @@ -4970,6 +4866,7 @@ declare namespace monaco.languages { diagnostics?: editor.IMarkerData[]; kind?: string; isPreferred?: boolean; + disabled?: string; } export interface CodeActionList extends IDisposable { @@ -5265,7 +5162,7 @@ declare namespace monaco.languages { /** * The document symbol provider interface defines the contract between extensions and - * the [go to symbol](https://code.visualstudio.com/docs/editor/editingevolved#_goto-symbol)-feature. + * the [go to symbol](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-symbol)-feature. */ export interface DocumentSymbolProvider { displayName?: string; @@ -5499,9 +5396,9 @@ declare namespace monaco.languages { } export interface ResourceFileEdit { - oldUri: Uri; - newUri: Uri; - options: { + oldUri?: Uri; + newUri?: Uri; + options?: { overwrite?: boolean; ignoreIfNotExists?: boolean; ignoreIfExists?: boolean; @@ -5557,6 +5454,33 @@ declare namespace monaco.languages { resolveCodeLens?(model: editor.ITextModel, codeLens: CodeLens, token: CancellationToken): ProviderResult; } + export interface SemanticTokensLegend { + readonly tokenTypes: string[]; + readonly tokenModifiers: string[]; + } + + export interface SemanticTokens { + readonly resultId?: string; + readonly data: Uint32Array; + } + + export interface SemanticTokensEdit { + readonly start: number; + readonly deleteCount: number; + readonly data?: Uint32Array; + } + + export interface SemanticTokensEdits { + readonly resultId?: string; + readonly edits: SemanticTokensEdit[]; + } + + export interface SemanticTokensProvider { + getLegend(): SemanticTokensLegend; + provideSemanticTokens(model: editor.ITextModel, lastResultId: string | null, ranges: Range[] | null, token: CancellationToken): ProviderResult; + releaseSemanticTokens(resultId: string | undefined): void; + } + export interface ILanguageExtensionPoint { id: string; extensions?: string[]; @@ -5847,13 +5771,15 @@ declare namespace monaco.languages.typescript { export interface DiagnosticsOptions { noSemanticValidation?: boolean; noSyntaxValidation?: boolean; + noSuggestionDiagnostics?: boolean; + diagnosticCodesToIgnore?: number[]; } export interface LanguageServiceDefaults { /** * Add an additional source file to the language service. Use this * for typescript (definition) files that won't be loaded as editor - * document, like `jquery.d.ts`. + * documents, like `jquery.d.ts`. * * @param content The file content * @param filePath An optional file path @@ -5862,6 +5788,14 @@ declare namespace monaco.languages.typescript { */ addExtraLib(content: string, filePath?: string): IDisposable; + /** + * Remove all existing extra libs and set the additional source + * files to the language service. Use this for typescript definition + * files that won't be loaded as editor documents, like `jquery.d.ts`. + * @param libs An array of entries to register. + */ + setExtraLibs(libs: { content: string; filePath?: string }[]): void; + /** * Set TypeScript compiler options. */ @@ -5926,10 +5860,70 @@ declare namespace monaco.languages.css { } } + export interface ModeConfiguration { + /** + * Defines whether the built-in completionItemProvider is enabled. + */ + readonly completionItems?: boolean; + + /** + * Defines whether the built-in hoverProvider is enabled. + */ + readonly hovers?: boolean; + + /** + * Defines whether the built-in documentSymbolProvider is enabled. + */ + readonly documentSymbols?: boolean; + + /** + * Defines whether the built-in definitions provider is enabled. + */ + readonly definitions?: boolean; + + /** + * Defines whether the built-in references provider is enabled. + */ + readonly references?: boolean; + + /** + * Defines whether the built-in references provider is enabled. + */ + readonly documentHighlights?: boolean; + + /** + * Defines whether the built-in rename provider is enabled. + */ + readonly rename?: boolean; + + /** + * Defines whether the built-in color provider is enabled. + */ + readonly colors?: boolean; + + /** + * Defines whether the built-in foldingRange provider is enabled. + */ + readonly foldingRanges?: boolean; + + /** + * Defines whether the built-in diagnostic provider is enabled. + */ + readonly diagnostics?: boolean; + + /** + * Defines whether the built-in selection range provider is enabled. + */ + readonly selectionRanges?: boolean; + + } + export interface LanguageServiceDefaults { readonly onDidChange: IEvent; readonly diagnosticsOptions: DiagnosticsOptions; + readonly modeConfiguration: ModeConfiguration; setDiagnosticsOptions(options: DiagnosticsOptions): void; + setModeConfiguration(modeConfiguration: ModeConfiguration): void; } export var cssDefaults: LanguageServiceDefaults; @@ -6006,19 +6000,24 @@ declare namespace monaco.languages.json { readonly tokens?: boolean; /** - * Defines whether the built-in color provider is enabled. - */ + * Defines whether the built-in color provider is enabled. + */ readonly colors?: boolean; /** - * Defines whether the built-in foldingRange provider is enabled. - */ - readonly foldingRanges?: boolean; + * Defines whether the built-in foldingRange provider is enabled. + */ + readonly foldingRanges?: boolean; /** - * Defines whether the built-in diagnostic provider is enabled. - */ - readonly diagnostics?: boolean; + * Defines whether the built-in diagnostic provider is enabled. + */ + readonly diagnostics?: boolean; + + /** + * Defines whether the built-in selection range provider is enabled. + */ + readonly selectionRanges?: boolean; } @@ -6069,6 +6068,69 @@ declare namespace monaco.languages.html { readonly suggest?: CompletionConfiguration; } + export interface ModeConfiguration { + /** + * Defines whether the built-in completionItemProvider is enabled. + */ + readonly completionItems?: boolean; + + /** + * Defines whether the built-in hoverProvider is enabled. + */ + readonly hovers?: boolean; + + /** + * Defines whether the built-in documentSymbolProvider is enabled. + */ + readonly documentSymbols?: boolean; + + /** + * Defines whether the built-in definitions provider is enabled. + */ + readonly links?: boolean; + + /** + * Defines whether the built-in references provider is enabled. + */ + readonly documentHighlights?: boolean; + + /** + * Defines whether the built-in rename provider is enabled. + */ + readonly rename?: boolean; + + /** + * Defines whether the built-in color provider is enabled. + */ + readonly colors?: boolean; + + /** + * Defines whether the built-in foldingRange provider is enabled. + */ + readonly foldingRanges?: boolean; + + /** + * Defines whether the built-in diagnostic provider is enabled. + */ + readonly diagnostics?: boolean; + + /** + * Defines whether the built-in selection range provider is enabled. + */ + readonly selectionRanges?: boolean; + + /** + * Defines whether the built-in documentFormattingEdit provider is enabled. + */ + readonly documentFormattingEdits?: boolean; + + /** + * Defines whether the built-in documentRangeFormattingEdit provider is enabled. + */ + readonly documentRangeFormattingEdits?: boolean; + + } + export interface LanguageServiceDefaults { readonly onDidChange: IEvent; readonly options: Options;