From cb1e32bf2b7dcbda815f7c88ee110c51e6579a70 Mon Sep 17 00:00:00 2001 From: Alexandru Dima Date: Fri, 29 Jan 2021 00:57:07 +0100 Subject: [PATCH] prepare 0.22.0 --- CHANGELOG.md | 46 +++ monaco.d.ts | 496 ++++++++++++++++++++--------- website/playground/monaco.d.ts.txt | 496 ++++++++++++++++++++--------- 3 files changed, 726 insertions(+), 312 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0881c45f..4f4fc9f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,51 @@ # Monaco Editor Changelog +## [0.22.0] (29.01.2021) + +### New & Noteworthy +* new grammars for Modula-3 and ECL (Enterprise Control Language). +* added `monaco.editor.onDidChangeMarkers` to listen for marker changes. +* added `monaco.editor.registerCommand` to register global commands. +* added `monaco.languages.setColorMap` to allow defining the color map used for tokenization. +* added `IMonarchLanguage.includeLF` to allow matching against the `\n` at the end of each line. +* new editor option `stickyTabStops` to make interacting with spaces in indentation behave more like interacting with tabs. + +### Breaking changes +* The ESM version of the editor will no longer define a global `monaco` object. You can define `global.MonacoEnvironment = { globalAPI: true }` if you want for the editor to define this global object. +* Renamed `OnTypeRenameProvider` to `LinkedEditingRangeProvider` and related methods like the editor option `renameOnType` (now `linkedEditing`), `registerOnTypeRenameProvider` (now `registerLinkedEditingRangeProvider`), etc. +* Renamed `OnEnterRule.oneLineAboveText` to `OnEnterRule.previousLineText` + +### Thank you + +Contributions to `monaco-editor`: + +* [@Gittenburg](https://github.com/Gittenburg): Fix comment in sample [PR #2161](https://github.com/microsoft/monaco-editor/pull/2161) +* [@luminaxster (David Gonzalez)](https://github.com/luminaxster): Missing breaking change [PR #2186](https://github.com/microsoft/monaco-editor/pull/2186) +* [@svick (Petr Onderka)](https://github.com/svick): Fixed indentation in C# sample [PR #2250](https://github.com/microsoft/monaco-editor/pull/2250) + +Contributions to `monaco-languages`: + +* [@arlosi (Arlo Siemsen)](https://github.com/arlosi): Rust: add support for keywords from the 2018 edition [PR #123](https://github.com/microsoft/monaco-languages/pull/123) +* [@dehilsterlexis (David de Hilster)](https://github.com/dehilsterlexis): LEXER-ECL-001 Lexer for ECL (Enterprise Control Language) [PR #118](https://github.com/microsoft/monaco-languages/pull/118) +* [@fonsecas72 (Hugo Fonseca)](https://github.com/fonsecas72): terraform Fix heredoc [PR #116](https://github.com/microsoft/monaco-languages/pull/116) +* [@jcchu](https://github.com/jcchu): Add Modula-3 support [PR #117](https://github.com/microsoft/monaco-languages/pull/117) +* [@maclockard (Mac Lockard)](https://github.com/maclockard): Fix highlighting of GROUP BY for redshift [PR #122](https://github.com/microsoft/monaco-languages/pull/122) +* [@philipsens (Sergi Philipsen)](https://github.com/philipsens): Add auto indent for xml [PR #113](https://github.com/microsoft/monaco-languages/pull/113) +* [@stla](https://github.com/stla) + * completed the list of roxygen tags [PR #114](https://github.com/microsoft/monaco-languages/pull/114) + * removed white spaces in constants [PR #115](https://github.com/microsoft/monaco-languages/pull/115) +* [@VarghaSabee (Sabolch Varha)](https://github.com/VarghaSabee): Safari regex error fix (negative lookbehind) #2179 [PR #121](https://github.com/microsoft/monaco-languages/pull/121) + +Contributions to `monaco-typescript`: + +* [@Kingwl (Wenlu Wang)](https://github.com/Kingwl): Add new jsx emit option [PR #73](https://github.com/microsoft/monaco-typescript/pull/73) + +Contributions to `monaco-css`: + +* [@jpett](https://github.com/jpett): Fix error Cannot read property 'getModeId' of null [PR #10](https://github.com/microsoft/monaco-css/pull/10) + + + ## [0.21.3] (18.01.2021) Fixes a regression in suggestions where the browser clipboard API would be accessed by incomplete suggestion lists (see https://github.com/microsoft/vscode/commit/96d61842bae1e5dd11f9ff6139fad9e3e5141401). diff --git a/monaco.d.ts b/monaco.d.ts index e97355b5..c55c5670 100644 --- a/monaco.d.ts +++ b/monaco.d.ts @@ -15,6 +15,7 @@ declare namespace monaco { export type Thenable = PromiseLike; export interface Environment { + globalAPI?: boolean; baseUrl?: string; getWorker?(workerId: string, label: string): Worker; getWorkerUrl?(workerId: string, label: string): string; @@ -902,6 +903,12 @@ declare namespace monaco.editor { take?: number; }): IMarker[]; + /** + * Emitted when markers change for a model. + * @event + */ + export function onDidChangeMarkers(listener: (e: readonly Uri[]) => void): IDisposable; + /** * Get the model that has `uri` if it exists. */ @@ -974,6 +981,11 @@ declare namespace monaco.editor { */ export function remeasureFonts(): void; + /** + * Register a command. + */ + export function registerCommand(id: string, handler: (accessor: any, ...args: any[]) => void): IDisposable; + export type BuiltinTheme = 'vs' | 'vs-dark' | 'hc-black'; export interface IStandaloneThemeData { @@ -1120,6 +1132,10 @@ declare namespace monaco.editor { * Defaults to true. */ wordBasedSuggestions?: boolean; + /** + * Controls whether word based completions should be included from opened documents of the same language or any language. + */ + wordBasedSuggestionsOnlySameLanguage?: boolean; /** * Controls whether the semanticHighlighting is shown for the languages that support it. * true: semanticHighlighting is enabled for all themes @@ -1690,6 +1706,10 @@ declare namespace monaco.editor { * @return EOL char sequence (e.g.: '\n' or '\r\n'). */ getEOL(): string; + /** + * Get the end of line sequence predominantly used in the text buffer. + */ + getEndOfLineSequence(): EndOfLineSequence; /** * Get the minimum legal column for line at `lineNumber` */ @@ -1887,11 +1907,15 @@ declare namespace monaco.editor { */ detectIndentation(defaultInsertSpaces: boolean, defaultTabSize: number): void; /** - * Push a stack element onto the undo stack. This acts as an undo/redo point. - * The idea is to use `pushEditOperations` to edit the model and then to - * `pushStackElement` to create an undo/redo stop point. + * Close the current undo-redo element. + * This offers a way to create an undo/redo stop point. */ pushStackElement(): void; + /** + * Open the current undo-redo element. + * This offers a way to remove the current undo/redo stop point. + */ + popStackElement(): void; /** * Push edit operations, basically editing the model. This is the preferred way * of editing the model. The edit operations will land on the undo stack. @@ -2644,7 +2668,7 @@ declare namespace monaco.editor { * Remove unusual line terminators like LINE SEPARATOR (LS), PARAGRAPH SEPARATOR (PS). * Defaults to 'prompt'. */ - unusualLineTerminators?: 'off' | 'prompt' | 'auto'; + unusualLineTerminators?: 'auto' | 'off' | 'prompt'; /** * Should the corresponding line be selected when clicking on the line number? * Defaults to true. @@ -2688,9 +2712,13 @@ declare namespace monaco.editor { */ readOnly?: boolean; /** - * Rename matching regions on type. + * Enable linked editing. * Defaults to false. */ + linkedEditing?: boolean; + /** + * deprecated, use linkedEditing instead + */ renameOnType?: boolean; /** * Should the editor render validation decorations. @@ -2804,6 +2832,14 @@ declare namespace monaco.editor { * Defaults to "off". */ wordWrap?: 'off' | 'on' | 'wordWrapColumn' | 'bounded'; + /** + * Override the `wordWrap` setting. + */ + wordWrapOverride1?: 'off' | 'on' | 'inherit'; + /** + * Override the `wordWrapOverride1` setting. + */ + wordWrapOverride2?: 'off' | 'on' | 'inherit'; /** * Control the wrapping of the editor. * When `wordWrap` = "off", the lines will never wrap. @@ -2813,11 +2849,6 @@ declare namespace monaco.editor { * Defaults to 80. */ wordWrapColumn?: number; - /** - * Force word wrapping when the text appears to be of a minified/generated file. - * Defaults to true. - */ - wordWrapMinified?: boolean; /** * Control indentation of wrapped lines. Can be: 'none', 'same', 'indent' or 'deepIndent'. * Defaults to 'same' in vscode and to 'none' in monaco-editor. @@ -2914,6 +2945,10 @@ declare namespace monaco.editor { * Suggest options. */ suggest?: ISuggestOptions; + /** + * Smart select opptions; + */ + smartSelect?: ISmartSelectOptions; /** * */ @@ -2960,6 +2995,11 @@ declare namespace monaco.editor { * Defaults to advanced. */ autoIndent?: 'none' | 'keep' | 'brackets' | 'advanced' | 'full'; + /** + * Emulate selection behaviour of tab characters when using spaces for indentation. + * This means selection will stick to tab stops. + */ + stickyTabStops?: boolean; /** * Enable format on type. * Defaults to false. @@ -3035,6 +3075,14 @@ declare namespace monaco.editor { * Defaults to true. */ codeLens?: boolean; + /** + * Code lens font family. Defaults to editor font family. + */ + codeLensFontFamily?: string; + /** + * Code lens font size. Default to 90% of the editor font size + */ + codeLensFontSize?: number; /** * Control the behavior and rendering of the code action lightbulb. */ @@ -3145,6 +3193,10 @@ declare namespace monaco.editor { * Controls strikethrough deprecated variables. */ showDeprecated?: boolean; + /** + * Control the behavior and rendering of the inline hints. + */ + inlineHints?: IEditorInlineHintsOptions; } /** @@ -3182,15 +3234,24 @@ declare namespace monaco.editor { */ originalEditable?: boolean; /** - * Original editor should be have code lens enabled? + * Should the diff editor enable code lens? * Defaults to false. */ - originalCodeLens?: boolean; + diffCodeLens?: boolean; /** - * Modified editor should be have code lens enabled? - * Defaults to false. + * Is the diff editor inside another editor + * Defaults to false */ - modifiedCodeLens?: boolean; + isInEmbeddedEditor?: boolean; + /** + * Is the diff editor should render overview ruler + * Defaults to true + */ + renderOverviewRuler?: boolean; + /** + * Control the wrapping of the diff editor. + */ + diffWordWrap?: 'off' | 'on' | 'inherit'; } /** @@ -3487,6 +3548,29 @@ declare namespace monaco.editor { export type EditorLightbulbOptions = Readonly>; + /** + * Configuration options for editor inlineHints + */ + export interface IEditorInlineHintsOptions { + /** + * Enable the inline hints. + * Defaults to true. + */ + enabled?: boolean; + /** + * Font size of inline hints. + * Default to 90% of the editor font size. + */ + fontSize?: number; + /** + * Font family of inline hints. + * Defaults to editor font family. + */ + fontFamily?: string; + } + + export type EditorInlineHintsOptions = Readonly>; + /** * Configuration options for editor minimap */ @@ -3661,6 +3745,11 @@ declare namespace monaco.editor { * Defaults to `horizontalScrollbarSize`. */ horizontalSliderSize?: number; + /** + * Scroll gutter clicks move by page vs jump to position. + * Defaults to false. + */ + scrollByPage?: boolean; } export interface InternalEditorScrollbarOptions { @@ -3676,6 +3765,7 @@ declare namespace monaco.editor { readonly horizontalSliderSize: number; readonly verticalScrollbarSize: number; readonly verticalSliderSize: number; + readonly scrollByPage: boolean; } /** @@ -3707,9 +3797,13 @@ declare namespace monaco.editor { */ showIcons?: boolean; /** - * Max suggestions to show in suggestions. Defaults to 12. + * Enable or disable the suggest status bar. */ - maxVisibleSuggestions?: number; + showStatusBar?: boolean; + /** + * Show details inline with the label. Defaults to true. + */ + showInlineDetails?: boolean; /** * Show method-suggestions. */ @@ -3818,19 +3912,16 @@ declare namespace monaco.editor { * Show snippet-suggestions. */ showSnippets?: boolean; - /** - * Status bar related settings. - */ - statusBar?: { - /** - * Controls the visibility of the status bar at the bottom of the suggest widget. - */ - visible?: boolean; - }; } export type InternalSuggestOptions = Readonly>; + export interface ISmartSelectOptions { + selectLeadingAndTrailingWhitespace?: boolean; + } + + export type SmartSelectOptions = Readonly>; + /** * Describes how to indent wrapped lines. */ @@ -3873,113 +3964,120 @@ declare namespace monaco.editor { automaticLayout = 9, autoSurround = 10, codeLens = 11, - colorDecorators = 12, - columnSelection = 13, - comments = 14, - contextmenu = 15, - copyWithSyntaxHighlighting = 16, - cursorBlinking = 17, - cursorSmoothCaretAnimation = 18, - cursorStyle = 19, - cursorSurroundingLines = 20, - cursorSurroundingLinesStyle = 21, - cursorWidth = 22, - disableLayerHinting = 23, - disableMonospaceOptimizations = 24, - dragAndDrop = 25, - emptySelectionClipboard = 26, - extraEditorClassName = 27, - fastScrollSensitivity = 28, - find = 29, - fixedOverflowWidgets = 30, - folding = 31, - foldingStrategy = 32, - foldingHighlight = 33, - unfoldOnClickAfterEndOfLine = 34, - fontFamily = 35, - fontInfo = 36, - fontLigatures = 37, - fontSize = 38, - fontWeight = 39, - formatOnPaste = 40, - formatOnType = 41, - glyphMargin = 42, - gotoLocation = 43, - hideCursorInOverviewRuler = 44, - highlightActiveIndentGuide = 45, - hover = 46, - inDiffEditor = 47, - letterSpacing = 48, - lightbulb = 49, - lineDecorationsWidth = 50, - lineHeight = 51, - lineNumbers = 52, - lineNumbersMinChars = 53, - links = 54, - matchBrackets = 55, - minimap = 56, - mouseStyle = 57, - mouseWheelScrollSensitivity = 58, - mouseWheelZoom = 59, - multiCursorMergeOverlapping = 60, - multiCursorModifier = 61, - multiCursorPaste = 62, - occurrencesHighlight = 63, - overviewRulerBorder = 64, - overviewRulerLanes = 65, - padding = 66, - parameterHints = 67, - peekWidgetDefaultFocus = 68, - definitionLinkOpensInPeek = 69, - quickSuggestions = 70, - quickSuggestionsDelay = 71, - readOnly = 72, - renameOnType = 73, - renderControlCharacters = 74, - renderIndentGuides = 75, - renderFinalNewline = 76, - renderLineHighlight = 77, - renderLineHighlightOnlyWhenFocus = 78, - renderValidationDecorations = 79, - renderWhitespace = 80, - revealHorizontalRightPadding = 81, - roundedSelection = 82, - rulers = 83, - scrollbar = 84, - scrollBeyondLastColumn = 85, - scrollBeyondLastLine = 86, - scrollPredominantAxis = 87, - selectionClipboard = 88, - selectionHighlight = 89, - selectOnLineNumbers = 90, - showFoldingControls = 91, - showUnused = 92, - snippetSuggestions = 93, - smoothScrolling = 94, - stopRenderingLineAfter = 95, - suggest = 96, - suggestFontSize = 97, - suggestLineHeight = 98, - suggestOnTriggerCharacters = 99, - suggestSelection = 100, - tabCompletion = 101, - tabIndex = 102, - unusualLineTerminators = 103, - useTabStops = 104, - wordSeparators = 105, - wordWrap = 106, - wordWrapBreakAfterCharacters = 107, - wordWrapBreakBeforeCharacters = 108, - wordWrapColumn = 109, - wordWrapMinified = 110, - wrappingIndent = 111, - wrappingStrategy = 112, - showDeprecated = 113, - editorClassName = 114, - pixelRatio = 115, - tabFocusMode = 116, - layoutInfo = 117, - wrappingInfo = 118 + codeLensFontFamily = 12, + codeLensFontSize = 13, + colorDecorators = 14, + columnSelection = 15, + comments = 16, + contextmenu = 17, + copyWithSyntaxHighlighting = 18, + cursorBlinking = 19, + cursorSmoothCaretAnimation = 20, + cursorStyle = 21, + cursorSurroundingLines = 22, + cursorSurroundingLinesStyle = 23, + cursorWidth = 24, + disableLayerHinting = 25, + disableMonospaceOptimizations = 26, + dragAndDrop = 27, + emptySelectionClipboard = 28, + extraEditorClassName = 29, + fastScrollSensitivity = 30, + find = 31, + fixedOverflowWidgets = 32, + folding = 33, + foldingStrategy = 34, + foldingHighlight = 35, + unfoldOnClickAfterEndOfLine = 36, + fontFamily = 37, + fontInfo = 38, + fontLigatures = 39, + fontSize = 40, + fontWeight = 41, + formatOnPaste = 42, + formatOnType = 43, + glyphMargin = 44, + gotoLocation = 45, + hideCursorInOverviewRuler = 46, + highlightActiveIndentGuide = 47, + hover = 48, + inDiffEditor = 49, + letterSpacing = 50, + lightbulb = 51, + lineDecorationsWidth = 52, + lineHeight = 53, + lineNumbers = 54, + lineNumbersMinChars = 55, + linkedEditing = 56, + links = 57, + matchBrackets = 58, + minimap = 59, + mouseStyle = 60, + mouseWheelScrollSensitivity = 61, + mouseWheelZoom = 62, + multiCursorMergeOverlapping = 63, + multiCursorModifier = 64, + multiCursorPaste = 65, + occurrencesHighlight = 66, + overviewRulerBorder = 67, + overviewRulerLanes = 68, + padding = 69, + parameterHints = 70, + peekWidgetDefaultFocus = 71, + definitionLinkOpensInPeek = 72, + quickSuggestions = 73, + quickSuggestionsDelay = 74, + readOnly = 75, + renameOnType = 76, + renderControlCharacters = 77, + renderIndentGuides = 78, + renderFinalNewline = 79, + renderLineHighlight = 80, + renderLineHighlightOnlyWhenFocus = 81, + renderValidationDecorations = 82, + renderWhitespace = 83, + revealHorizontalRightPadding = 84, + roundedSelection = 85, + rulers = 86, + scrollbar = 87, + scrollBeyondLastColumn = 88, + scrollBeyondLastLine = 89, + scrollPredominantAxis = 90, + selectionClipboard = 91, + selectionHighlight = 92, + selectOnLineNumbers = 93, + showFoldingControls = 94, + showUnused = 95, + snippetSuggestions = 96, + smartSelect = 97, + smoothScrolling = 98, + stickyTabStops = 99, + stopRenderingLineAfter = 100, + suggest = 101, + suggestFontSize = 102, + suggestLineHeight = 103, + suggestOnTriggerCharacters = 104, + suggestSelection = 105, + tabCompletion = 106, + tabIndex = 107, + unusualLineTerminators = 108, + useTabStops = 109, + wordSeparators = 110, + wordWrap = 111, + wordWrapBreakAfterCharacters = 112, + wordWrapBreakBeforeCharacters = 113, + wordWrapColumn = 114, + wordWrapOverride1 = 115, + wordWrapOverride2 = 116, + wrappingIndent = 117, + wrappingStrategy = 118, + showDeprecated = 119, + inlineHints = 120, + editorClassName = 121, + pixelRatio = 122, + tabFocusMode = 123, + layoutInfo = 124, + wrappingInfo = 125 } export const EditorOptions: { acceptSuggestionOnCommitCharacter: IEditorOption; @@ -3993,7 +4091,10 @@ declare namespace monaco.editor { autoIndent: IEditorOption; automaticLayout: IEditorOption; autoSurround: IEditorOption; + stickyTabStops: IEditorOption; codeLens: IEditorOption; + codeLensFontFamily: IEditorOption; + codeLensFontSize: IEditorOption; colorDecorators: IEditorOption; columnSelection: IEditorOption; comments: IEditorOption; @@ -4036,6 +4137,7 @@ declare namespace monaco.editor { lineHeight: IEditorOption; lineNumbers: IEditorOption; lineNumbersMinChars: IEditorOption; + linkedEditing: IEditorOption; links: IEditorOption; matchBrackets: IEditorOption; minimap: IEditorOption; @@ -4076,7 +4178,9 @@ declare namespace monaco.editor { showFoldingControls: IEditorOption; showUnused: IEditorOption; showDeprecated: IEditorOption; + inlineHints: IEditorOption; snippetSuggestions: IEditorOption; + smartSelect: IEditorOption; smoothScrolling: IEditorOption; stopRenderingLineAfter: IEditorOption; suggest: IEditorOption; @@ -4086,14 +4190,15 @@ declare namespace monaco.editor { suggestSelection: IEditorOption; tabCompletion: IEditorOption; tabIndex: IEditorOption; - unusualLineTerminators: IEditorOption; + unusualLineTerminators: IEditorOption; useTabStops: IEditorOption; wordSeparators: IEditorOption; wordWrap: IEditorOption; wordWrapBreakAfterCharacters: IEditorOption; wordWrapBreakBeforeCharacters: IEditorOption; wordWrapColumn: IEditorOption; - wordWrapMinified: IEditorOption; + wordWrapOverride1: IEditorOption; + wordWrapOverride2: IEditorOption; wrappingIndent: IEditorOption; wrappingStrategy: IEditorOption; editorClassName: IEditorOption; @@ -4251,6 +4356,18 @@ declare namespace monaco.editor { * If null is returned, the content widget will be placed off screen. */ getPosition(): IContentWidgetPosition | null; + /** + * Optional function that is invoked before rendering + * the content widget. If a dimension is returned the editor will + * attempt to use it. + */ + beforeRender?(): IDimension | null; + /** + * Optional function that is invoked after rendering the content + * widget. Is being invoked with the selected position preference + * or `null` if not rendered. + */ + afterRender?(position: ContentWidgetPositionPreference | null): void; } /** @@ -4426,6 +4543,10 @@ declare namespace monaco.editor { } export interface IDiffEditorConstructionOptions extends IDiffEditorOptions { + /** + * The initial editor dimension (to avoid measuring the container). + */ + dimension?: IDimension; /** * Place overflow widgets inside an external DOM node. * Defaults to an internal DOM node. @@ -4678,9 +4799,13 @@ declare namespace monaco.editor { */ executeCommand(source: string | null | undefined, command: ICommand): void; /** - * Push an "undo stop" in the undo-redo stack. + * Create an "undo stop" in the undo-redo stack. */ pushUndoStop(): boolean; + /** + * Remove the "undo stop" in the undo-redo stack. + */ + popUndoStop(): boolean; /** * Execute edits on the editor. * The edits will land on the undo-redo stack, but no "undo stop" will be pushed. @@ -4865,6 +4990,7 @@ declare namespace monaco.editor { export class FontInfo extends BareFontInfo { readonly _editorStylingBrand: void; + readonly version: number; readonly isTrusted: boolean; readonly isMonospace: boolean; readonly typicalHalfwidthCharacterWidth: number; @@ -4879,6 +5005,7 @@ declare namespace monaco.editor { export class BareFontInfo { readonly _bareFontInfoBrand: void; readonly zoomLevel: number; + readonly pixelRatio: number; readonly fontFamily: string; readonly fontWeight: string; readonly fontSize: number; @@ -4999,8 +5126,18 @@ declare namespace monaco.languages { * Tokenize a line given the state at the beginning of the line. */ tokenizeEncoded(line: string, state: IState): IEncodedLineTokens; + /** + * Tokenize a line given the state at the beginning of the line. + */ + tokenize?(line: string, state: IState): ILineTokens; } + /** + * Change the color map that is used for token colors. + * Supported formats (hex): #RRGGBB, $RRGGBBAA, #RGB, #RGBA + */ + export function setColorMap(colorMap: string[] | null): void; + /** * Set the tokens provider for a language (manual implementation). */ @@ -5042,9 +5179,9 @@ declare namespace monaco.languages { export function registerDocumentHighlightProvider(languageId: string, provider: DocumentHighlightProvider): IDisposable; /** - * Register an on type rename provider. + * Register an linked editing range provider. */ - export function registerOnTypeRenameProvider(languageId: string, provider: OnTypeRenameProvider): IDisposable; + export function registerLinkedEditingRangeProvider(languageId: string, provider: LinkedEditingRangeProvider): IDisposable; /** * Register a definition provider (used by e.g. go to definition). @@ -5292,7 +5429,7 @@ declare namespace monaco.languages { /** * This rule will only execute if the text above the this line matches this regular expression. */ - oneLineAboveText?: RegExp; + previousLineText?: RegExp; /** * The action to execute. */ @@ -5788,18 +5925,30 @@ declare namespace monaco.languages { } /** - * The rename provider interface defines the contract between extensions and - * the live-rename feature. + * The linked editing range provider interface defines the contract between extensions and + * the linked editing feature. */ - export interface OnTypeRenameProvider { - wordPattern?: RegExp; + export interface LinkedEditingRangeProvider { + /** + * Provide a list of ranges that can be edited together. + */ + provideLinkedEditingRanges(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult; + } + + /** + * Represents a list of ranges that can be edited together along with a word pattern to describe valid contents. + */ + export interface LinkedEditingRanges { + /** + * A list of ranges that can be edited together. The ranges must have + * identical length and text content. The ranges cannot overlap + */ + ranges: IRange[]; /** - * Provide a list of ranges that can be live-renamed together. + * An optional word pattern that describes valid contents for the given ranges. + * If no pattern is provided, the language configuration's word pattern will be used. */ - provideOnTypeRenameRanges(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<{ - ranges: IRange[]; - wordPattern?: RegExp; - }>; + wordPattern?: RegExp; } /** @@ -6142,6 +6291,10 @@ declare namespace monaco.languages { * A provider of folding ranges for editor models. */ export interface FoldingRangeProvider { + /** + * An optional event to signal that the folding ranges from this provider have changed. + */ + onDidChange?: IEvent; /** * Provides the folding ranges for a specific model. */ @@ -6193,12 +6346,6 @@ declare namespace monaco.languages { needsConfirmation: boolean; label: string; description?: string; - iconPath?: { - id: string; - } | Uri | { - light: Uri; - dark: Uri; - }; } export interface WorkspaceFileEditOptions { @@ -6206,6 +6353,10 @@ declare namespace monaco.languages { ignoreIfNotExists?: boolean; ignoreIfExists?: boolean; recursive?: boolean; + copy?: boolean; + folder?: boolean; + skipTrashBin?: boolean; + maxSize?: number; } export interface WorkspaceFileEdit { @@ -6264,6 +6415,19 @@ declare namespace monaco.languages { resolveCodeLens?(model: editor.ITextModel, codeLens: CodeLens, token: CancellationToken): ProviderResult; } + export interface InlineHint { + text: string; + range: IRange; + description?: string | IMarkdownString; + whitespaceBefore?: boolean; + whitespaceAfter?: boolean; + } + + export interface InlineHintsProvider { + onDidChangeInlineHints?: IEvent | undefined; + provideInlineHints(model: editor.ITextModel, range: Range, token: CancellationToken): ProviderResult; + } + export interface SemanticTokensLegend { readonly tokenTypes: string[]; readonly tokenModifiers: string[]; @@ -6341,6 +6505,11 @@ declare namespace monaco.languages { * attach this to every token class (by default '.' + name) */ tokenPostfix?: string; + /** + * include line feeds (in the form of a \n character) at the end of lines + * Defaults to false + */ + includeLF?: boolean; } /** @@ -6481,7 +6650,9 @@ declare namespace monaco.languages.typescript { None = 0, Preserve = 1, React = 2, - ReactNative = 3 + ReactNative = 3, + ReactJSX = 4, + ReactJSXDev = 5 } export enum NewLineKind { CarriageReturnLineFeed = 0, @@ -6765,7 +6936,11 @@ declare namespace monaco.languages.typescript { * Get signature help items for the item at the given file and position. * @returns `Promise` */ - getSignatureHelpItems(fileName: string, position: number): Promise; + getSignatureHelpItems( + fileName: string, + position: number, + options: any + ): Promise; /** * Get quick info for the item at the given position in the file. * @returns `Promise` @@ -6993,7 +7168,16 @@ declare namespace monaco.languages.json { * If set, the schema service would load schema content on-demand with 'fetch' if available */ readonly enableSchemaRequest?: boolean; + /** + * The severity of problems from schema validation. If set to 'ignore', schema validation will be skipped. If not set, 'warning' is used. + */ + readonly schemaValidation?: SeverityLevel; + /** + * The severity of problems that occurred when resolving and loading schemas. If set to 'ignore', schema resolving problems are not reported. If not set, 'warning' is used. + */ + readonly schemaRequest?: SeverityLevel; } + export type SeverityLevel = 'error' | 'warning' | 'ignore'; export interface ModeConfiguration { /** * Defines whether the built-in documentFormattingEdit provider is enabled. diff --git a/website/playground/monaco.d.ts.txt b/website/playground/monaco.d.ts.txt index e97355b5..c55c5670 100644 --- a/website/playground/monaco.d.ts.txt +++ b/website/playground/monaco.d.ts.txt @@ -15,6 +15,7 @@ declare namespace monaco { export type Thenable = PromiseLike; export interface Environment { + globalAPI?: boolean; baseUrl?: string; getWorker?(workerId: string, label: string): Worker; getWorkerUrl?(workerId: string, label: string): string; @@ -902,6 +903,12 @@ declare namespace monaco.editor { take?: number; }): IMarker[]; + /** + * Emitted when markers change for a model. + * @event + */ + export function onDidChangeMarkers(listener: (e: readonly Uri[]) => void): IDisposable; + /** * Get the model that has `uri` if it exists. */ @@ -974,6 +981,11 @@ declare namespace monaco.editor { */ export function remeasureFonts(): void; + /** + * Register a command. + */ + export function registerCommand(id: string, handler: (accessor: any, ...args: any[]) => void): IDisposable; + export type BuiltinTheme = 'vs' | 'vs-dark' | 'hc-black'; export interface IStandaloneThemeData { @@ -1120,6 +1132,10 @@ declare namespace monaco.editor { * Defaults to true. */ wordBasedSuggestions?: boolean; + /** + * Controls whether word based completions should be included from opened documents of the same language or any language. + */ + wordBasedSuggestionsOnlySameLanguage?: boolean; /** * Controls whether the semanticHighlighting is shown for the languages that support it. * true: semanticHighlighting is enabled for all themes @@ -1690,6 +1706,10 @@ declare namespace monaco.editor { * @return EOL char sequence (e.g.: '\n' or '\r\n'). */ getEOL(): string; + /** + * Get the end of line sequence predominantly used in the text buffer. + */ + getEndOfLineSequence(): EndOfLineSequence; /** * Get the minimum legal column for line at `lineNumber` */ @@ -1887,11 +1907,15 @@ declare namespace monaco.editor { */ detectIndentation(defaultInsertSpaces: boolean, defaultTabSize: number): void; /** - * Push a stack element onto the undo stack. This acts as an undo/redo point. - * The idea is to use `pushEditOperations` to edit the model and then to - * `pushStackElement` to create an undo/redo stop point. + * Close the current undo-redo element. + * This offers a way to create an undo/redo stop point. */ pushStackElement(): void; + /** + * Open the current undo-redo element. + * This offers a way to remove the current undo/redo stop point. + */ + popStackElement(): void; /** * Push edit operations, basically editing the model. This is the preferred way * of editing the model. The edit operations will land on the undo stack. @@ -2644,7 +2668,7 @@ declare namespace monaco.editor { * Remove unusual line terminators like LINE SEPARATOR (LS), PARAGRAPH SEPARATOR (PS). * Defaults to 'prompt'. */ - unusualLineTerminators?: 'off' | 'prompt' | 'auto'; + unusualLineTerminators?: 'auto' | 'off' | 'prompt'; /** * Should the corresponding line be selected when clicking on the line number? * Defaults to true. @@ -2688,9 +2712,13 @@ declare namespace monaco.editor { */ readOnly?: boolean; /** - * Rename matching regions on type. + * Enable linked editing. * Defaults to false. */ + linkedEditing?: boolean; + /** + * deprecated, use linkedEditing instead + */ renameOnType?: boolean; /** * Should the editor render validation decorations. @@ -2804,6 +2832,14 @@ declare namespace monaco.editor { * Defaults to "off". */ wordWrap?: 'off' | 'on' | 'wordWrapColumn' | 'bounded'; + /** + * Override the `wordWrap` setting. + */ + wordWrapOverride1?: 'off' | 'on' | 'inherit'; + /** + * Override the `wordWrapOverride1` setting. + */ + wordWrapOverride2?: 'off' | 'on' | 'inherit'; /** * Control the wrapping of the editor. * When `wordWrap` = "off", the lines will never wrap. @@ -2813,11 +2849,6 @@ declare namespace monaco.editor { * Defaults to 80. */ wordWrapColumn?: number; - /** - * Force word wrapping when the text appears to be of a minified/generated file. - * Defaults to true. - */ - wordWrapMinified?: boolean; /** * Control indentation of wrapped lines. Can be: 'none', 'same', 'indent' or 'deepIndent'. * Defaults to 'same' in vscode and to 'none' in monaco-editor. @@ -2914,6 +2945,10 @@ declare namespace monaco.editor { * Suggest options. */ suggest?: ISuggestOptions; + /** + * Smart select opptions; + */ + smartSelect?: ISmartSelectOptions; /** * */ @@ -2960,6 +2995,11 @@ declare namespace monaco.editor { * Defaults to advanced. */ autoIndent?: 'none' | 'keep' | 'brackets' | 'advanced' | 'full'; + /** + * Emulate selection behaviour of tab characters when using spaces for indentation. + * This means selection will stick to tab stops. + */ + stickyTabStops?: boolean; /** * Enable format on type. * Defaults to false. @@ -3035,6 +3075,14 @@ declare namespace monaco.editor { * Defaults to true. */ codeLens?: boolean; + /** + * Code lens font family. Defaults to editor font family. + */ + codeLensFontFamily?: string; + /** + * Code lens font size. Default to 90% of the editor font size + */ + codeLensFontSize?: number; /** * Control the behavior and rendering of the code action lightbulb. */ @@ -3145,6 +3193,10 @@ declare namespace monaco.editor { * Controls strikethrough deprecated variables. */ showDeprecated?: boolean; + /** + * Control the behavior and rendering of the inline hints. + */ + inlineHints?: IEditorInlineHintsOptions; } /** @@ -3182,15 +3234,24 @@ declare namespace monaco.editor { */ originalEditable?: boolean; /** - * Original editor should be have code lens enabled? + * Should the diff editor enable code lens? * Defaults to false. */ - originalCodeLens?: boolean; + diffCodeLens?: boolean; /** - * Modified editor should be have code lens enabled? - * Defaults to false. + * Is the diff editor inside another editor + * Defaults to false */ - modifiedCodeLens?: boolean; + isInEmbeddedEditor?: boolean; + /** + * Is the diff editor should render overview ruler + * Defaults to true + */ + renderOverviewRuler?: boolean; + /** + * Control the wrapping of the diff editor. + */ + diffWordWrap?: 'off' | 'on' | 'inherit'; } /** @@ -3487,6 +3548,29 @@ declare namespace monaco.editor { export type EditorLightbulbOptions = Readonly>; + /** + * Configuration options for editor inlineHints + */ + export interface IEditorInlineHintsOptions { + /** + * Enable the inline hints. + * Defaults to true. + */ + enabled?: boolean; + /** + * Font size of inline hints. + * Default to 90% of the editor font size. + */ + fontSize?: number; + /** + * Font family of inline hints. + * Defaults to editor font family. + */ + fontFamily?: string; + } + + export type EditorInlineHintsOptions = Readonly>; + /** * Configuration options for editor minimap */ @@ -3661,6 +3745,11 @@ declare namespace monaco.editor { * Defaults to `horizontalScrollbarSize`. */ horizontalSliderSize?: number; + /** + * Scroll gutter clicks move by page vs jump to position. + * Defaults to false. + */ + scrollByPage?: boolean; } export interface InternalEditorScrollbarOptions { @@ -3676,6 +3765,7 @@ declare namespace monaco.editor { readonly horizontalSliderSize: number; readonly verticalScrollbarSize: number; readonly verticalSliderSize: number; + readonly scrollByPage: boolean; } /** @@ -3707,9 +3797,13 @@ declare namespace monaco.editor { */ showIcons?: boolean; /** - * Max suggestions to show in suggestions. Defaults to 12. + * Enable or disable the suggest status bar. */ - maxVisibleSuggestions?: number; + showStatusBar?: boolean; + /** + * Show details inline with the label. Defaults to true. + */ + showInlineDetails?: boolean; /** * Show method-suggestions. */ @@ -3818,19 +3912,16 @@ declare namespace monaco.editor { * Show snippet-suggestions. */ showSnippets?: boolean; - /** - * Status bar related settings. - */ - statusBar?: { - /** - * Controls the visibility of the status bar at the bottom of the suggest widget. - */ - visible?: boolean; - }; } export type InternalSuggestOptions = Readonly>; + export interface ISmartSelectOptions { + selectLeadingAndTrailingWhitespace?: boolean; + } + + export type SmartSelectOptions = Readonly>; + /** * Describes how to indent wrapped lines. */ @@ -3873,113 +3964,120 @@ declare namespace monaco.editor { automaticLayout = 9, autoSurround = 10, codeLens = 11, - colorDecorators = 12, - columnSelection = 13, - comments = 14, - contextmenu = 15, - copyWithSyntaxHighlighting = 16, - cursorBlinking = 17, - cursorSmoothCaretAnimation = 18, - cursorStyle = 19, - cursorSurroundingLines = 20, - cursorSurroundingLinesStyle = 21, - cursorWidth = 22, - disableLayerHinting = 23, - disableMonospaceOptimizations = 24, - dragAndDrop = 25, - emptySelectionClipboard = 26, - extraEditorClassName = 27, - fastScrollSensitivity = 28, - find = 29, - fixedOverflowWidgets = 30, - folding = 31, - foldingStrategy = 32, - foldingHighlight = 33, - unfoldOnClickAfterEndOfLine = 34, - fontFamily = 35, - fontInfo = 36, - fontLigatures = 37, - fontSize = 38, - fontWeight = 39, - formatOnPaste = 40, - formatOnType = 41, - glyphMargin = 42, - gotoLocation = 43, - hideCursorInOverviewRuler = 44, - highlightActiveIndentGuide = 45, - hover = 46, - inDiffEditor = 47, - letterSpacing = 48, - lightbulb = 49, - lineDecorationsWidth = 50, - lineHeight = 51, - lineNumbers = 52, - lineNumbersMinChars = 53, - links = 54, - matchBrackets = 55, - minimap = 56, - mouseStyle = 57, - mouseWheelScrollSensitivity = 58, - mouseWheelZoom = 59, - multiCursorMergeOverlapping = 60, - multiCursorModifier = 61, - multiCursorPaste = 62, - occurrencesHighlight = 63, - overviewRulerBorder = 64, - overviewRulerLanes = 65, - padding = 66, - parameterHints = 67, - peekWidgetDefaultFocus = 68, - definitionLinkOpensInPeek = 69, - quickSuggestions = 70, - quickSuggestionsDelay = 71, - readOnly = 72, - renameOnType = 73, - renderControlCharacters = 74, - renderIndentGuides = 75, - renderFinalNewline = 76, - renderLineHighlight = 77, - renderLineHighlightOnlyWhenFocus = 78, - renderValidationDecorations = 79, - renderWhitespace = 80, - revealHorizontalRightPadding = 81, - roundedSelection = 82, - rulers = 83, - scrollbar = 84, - scrollBeyondLastColumn = 85, - scrollBeyondLastLine = 86, - scrollPredominantAxis = 87, - selectionClipboard = 88, - selectionHighlight = 89, - selectOnLineNumbers = 90, - showFoldingControls = 91, - showUnused = 92, - snippetSuggestions = 93, - smoothScrolling = 94, - stopRenderingLineAfter = 95, - suggest = 96, - suggestFontSize = 97, - suggestLineHeight = 98, - suggestOnTriggerCharacters = 99, - suggestSelection = 100, - tabCompletion = 101, - tabIndex = 102, - unusualLineTerminators = 103, - useTabStops = 104, - wordSeparators = 105, - wordWrap = 106, - wordWrapBreakAfterCharacters = 107, - wordWrapBreakBeforeCharacters = 108, - wordWrapColumn = 109, - wordWrapMinified = 110, - wrappingIndent = 111, - wrappingStrategy = 112, - showDeprecated = 113, - editorClassName = 114, - pixelRatio = 115, - tabFocusMode = 116, - layoutInfo = 117, - wrappingInfo = 118 + codeLensFontFamily = 12, + codeLensFontSize = 13, + colorDecorators = 14, + columnSelection = 15, + comments = 16, + contextmenu = 17, + copyWithSyntaxHighlighting = 18, + cursorBlinking = 19, + cursorSmoothCaretAnimation = 20, + cursorStyle = 21, + cursorSurroundingLines = 22, + cursorSurroundingLinesStyle = 23, + cursorWidth = 24, + disableLayerHinting = 25, + disableMonospaceOptimizations = 26, + dragAndDrop = 27, + emptySelectionClipboard = 28, + extraEditorClassName = 29, + fastScrollSensitivity = 30, + find = 31, + fixedOverflowWidgets = 32, + folding = 33, + foldingStrategy = 34, + foldingHighlight = 35, + unfoldOnClickAfterEndOfLine = 36, + fontFamily = 37, + fontInfo = 38, + fontLigatures = 39, + fontSize = 40, + fontWeight = 41, + formatOnPaste = 42, + formatOnType = 43, + glyphMargin = 44, + gotoLocation = 45, + hideCursorInOverviewRuler = 46, + highlightActiveIndentGuide = 47, + hover = 48, + inDiffEditor = 49, + letterSpacing = 50, + lightbulb = 51, + lineDecorationsWidth = 52, + lineHeight = 53, + lineNumbers = 54, + lineNumbersMinChars = 55, + linkedEditing = 56, + links = 57, + matchBrackets = 58, + minimap = 59, + mouseStyle = 60, + mouseWheelScrollSensitivity = 61, + mouseWheelZoom = 62, + multiCursorMergeOverlapping = 63, + multiCursorModifier = 64, + multiCursorPaste = 65, + occurrencesHighlight = 66, + overviewRulerBorder = 67, + overviewRulerLanes = 68, + padding = 69, + parameterHints = 70, + peekWidgetDefaultFocus = 71, + definitionLinkOpensInPeek = 72, + quickSuggestions = 73, + quickSuggestionsDelay = 74, + readOnly = 75, + renameOnType = 76, + renderControlCharacters = 77, + renderIndentGuides = 78, + renderFinalNewline = 79, + renderLineHighlight = 80, + renderLineHighlightOnlyWhenFocus = 81, + renderValidationDecorations = 82, + renderWhitespace = 83, + revealHorizontalRightPadding = 84, + roundedSelection = 85, + rulers = 86, + scrollbar = 87, + scrollBeyondLastColumn = 88, + scrollBeyondLastLine = 89, + scrollPredominantAxis = 90, + selectionClipboard = 91, + selectionHighlight = 92, + selectOnLineNumbers = 93, + showFoldingControls = 94, + showUnused = 95, + snippetSuggestions = 96, + smartSelect = 97, + smoothScrolling = 98, + stickyTabStops = 99, + stopRenderingLineAfter = 100, + suggest = 101, + suggestFontSize = 102, + suggestLineHeight = 103, + suggestOnTriggerCharacters = 104, + suggestSelection = 105, + tabCompletion = 106, + tabIndex = 107, + unusualLineTerminators = 108, + useTabStops = 109, + wordSeparators = 110, + wordWrap = 111, + wordWrapBreakAfterCharacters = 112, + wordWrapBreakBeforeCharacters = 113, + wordWrapColumn = 114, + wordWrapOverride1 = 115, + wordWrapOverride2 = 116, + wrappingIndent = 117, + wrappingStrategy = 118, + showDeprecated = 119, + inlineHints = 120, + editorClassName = 121, + pixelRatio = 122, + tabFocusMode = 123, + layoutInfo = 124, + wrappingInfo = 125 } export const EditorOptions: { acceptSuggestionOnCommitCharacter: IEditorOption; @@ -3993,7 +4091,10 @@ declare namespace monaco.editor { autoIndent: IEditorOption; automaticLayout: IEditorOption; autoSurround: IEditorOption; + stickyTabStops: IEditorOption; codeLens: IEditorOption; + codeLensFontFamily: IEditorOption; + codeLensFontSize: IEditorOption; colorDecorators: IEditorOption; columnSelection: IEditorOption; comments: IEditorOption; @@ -4036,6 +4137,7 @@ declare namespace monaco.editor { lineHeight: IEditorOption; lineNumbers: IEditorOption; lineNumbersMinChars: IEditorOption; + linkedEditing: IEditorOption; links: IEditorOption; matchBrackets: IEditorOption; minimap: IEditorOption; @@ -4076,7 +4178,9 @@ declare namespace monaco.editor { showFoldingControls: IEditorOption; showUnused: IEditorOption; showDeprecated: IEditorOption; + inlineHints: IEditorOption; snippetSuggestions: IEditorOption; + smartSelect: IEditorOption; smoothScrolling: IEditorOption; stopRenderingLineAfter: IEditorOption; suggest: IEditorOption; @@ -4086,14 +4190,15 @@ declare namespace monaco.editor { suggestSelection: IEditorOption; tabCompletion: IEditorOption; tabIndex: IEditorOption; - unusualLineTerminators: IEditorOption; + unusualLineTerminators: IEditorOption; useTabStops: IEditorOption; wordSeparators: IEditorOption; wordWrap: IEditorOption; wordWrapBreakAfterCharacters: IEditorOption; wordWrapBreakBeforeCharacters: IEditorOption; wordWrapColumn: IEditorOption; - wordWrapMinified: IEditorOption; + wordWrapOverride1: IEditorOption; + wordWrapOverride2: IEditorOption; wrappingIndent: IEditorOption; wrappingStrategy: IEditorOption; editorClassName: IEditorOption; @@ -4251,6 +4356,18 @@ declare namespace monaco.editor { * If null is returned, the content widget will be placed off screen. */ getPosition(): IContentWidgetPosition | null; + /** + * Optional function that is invoked before rendering + * the content widget. If a dimension is returned the editor will + * attempt to use it. + */ + beforeRender?(): IDimension | null; + /** + * Optional function that is invoked after rendering the content + * widget. Is being invoked with the selected position preference + * or `null` if not rendered. + */ + afterRender?(position: ContentWidgetPositionPreference | null): void; } /** @@ -4426,6 +4543,10 @@ declare namespace monaco.editor { } export interface IDiffEditorConstructionOptions extends IDiffEditorOptions { + /** + * The initial editor dimension (to avoid measuring the container). + */ + dimension?: IDimension; /** * Place overflow widgets inside an external DOM node. * Defaults to an internal DOM node. @@ -4678,9 +4799,13 @@ declare namespace monaco.editor { */ executeCommand(source: string | null | undefined, command: ICommand): void; /** - * Push an "undo stop" in the undo-redo stack. + * Create an "undo stop" in the undo-redo stack. */ pushUndoStop(): boolean; + /** + * Remove the "undo stop" in the undo-redo stack. + */ + popUndoStop(): boolean; /** * Execute edits on the editor. * The edits will land on the undo-redo stack, but no "undo stop" will be pushed. @@ -4865,6 +4990,7 @@ declare namespace monaco.editor { export class FontInfo extends BareFontInfo { readonly _editorStylingBrand: void; + readonly version: number; readonly isTrusted: boolean; readonly isMonospace: boolean; readonly typicalHalfwidthCharacterWidth: number; @@ -4879,6 +5005,7 @@ declare namespace monaco.editor { export class BareFontInfo { readonly _bareFontInfoBrand: void; readonly zoomLevel: number; + readonly pixelRatio: number; readonly fontFamily: string; readonly fontWeight: string; readonly fontSize: number; @@ -4999,8 +5126,18 @@ declare namespace monaco.languages { * Tokenize a line given the state at the beginning of the line. */ tokenizeEncoded(line: string, state: IState): IEncodedLineTokens; + /** + * Tokenize a line given the state at the beginning of the line. + */ + tokenize?(line: string, state: IState): ILineTokens; } + /** + * Change the color map that is used for token colors. + * Supported formats (hex): #RRGGBB, $RRGGBBAA, #RGB, #RGBA + */ + export function setColorMap(colorMap: string[] | null): void; + /** * Set the tokens provider for a language (manual implementation). */ @@ -5042,9 +5179,9 @@ declare namespace monaco.languages { export function registerDocumentHighlightProvider(languageId: string, provider: DocumentHighlightProvider): IDisposable; /** - * Register an on type rename provider. + * Register an linked editing range provider. */ - export function registerOnTypeRenameProvider(languageId: string, provider: OnTypeRenameProvider): IDisposable; + export function registerLinkedEditingRangeProvider(languageId: string, provider: LinkedEditingRangeProvider): IDisposable; /** * Register a definition provider (used by e.g. go to definition). @@ -5292,7 +5429,7 @@ declare namespace monaco.languages { /** * This rule will only execute if the text above the this line matches this regular expression. */ - oneLineAboveText?: RegExp; + previousLineText?: RegExp; /** * The action to execute. */ @@ -5788,18 +5925,30 @@ declare namespace monaco.languages { } /** - * The rename provider interface defines the contract between extensions and - * the live-rename feature. + * The linked editing range provider interface defines the contract between extensions and + * the linked editing feature. */ - export interface OnTypeRenameProvider { - wordPattern?: RegExp; + export interface LinkedEditingRangeProvider { + /** + * Provide a list of ranges that can be edited together. + */ + provideLinkedEditingRanges(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult; + } + + /** + * Represents a list of ranges that can be edited together along with a word pattern to describe valid contents. + */ + export interface LinkedEditingRanges { + /** + * A list of ranges that can be edited together. The ranges must have + * identical length and text content. The ranges cannot overlap + */ + ranges: IRange[]; /** - * Provide a list of ranges that can be live-renamed together. + * An optional word pattern that describes valid contents for the given ranges. + * If no pattern is provided, the language configuration's word pattern will be used. */ - provideOnTypeRenameRanges(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<{ - ranges: IRange[]; - wordPattern?: RegExp; - }>; + wordPattern?: RegExp; } /** @@ -6142,6 +6291,10 @@ declare namespace monaco.languages { * A provider of folding ranges for editor models. */ export interface FoldingRangeProvider { + /** + * An optional event to signal that the folding ranges from this provider have changed. + */ + onDidChange?: IEvent; /** * Provides the folding ranges for a specific model. */ @@ -6193,12 +6346,6 @@ declare namespace monaco.languages { needsConfirmation: boolean; label: string; description?: string; - iconPath?: { - id: string; - } | Uri | { - light: Uri; - dark: Uri; - }; } export interface WorkspaceFileEditOptions { @@ -6206,6 +6353,10 @@ declare namespace monaco.languages { ignoreIfNotExists?: boolean; ignoreIfExists?: boolean; recursive?: boolean; + copy?: boolean; + folder?: boolean; + skipTrashBin?: boolean; + maxSize?: number; } export interface WorkspaceFileEdit { @@ -6264,6 +6415,19 @@ declare namespace monaco.languages { resolveCodeLens?(model: editor.ITextModel, codeLens: CodeLens, token: CancellationToken): ProviderResult; } + export interface InlineHint { + text: string; + range: IRange; + description?: string | IMarkdownString; + whitespaceBefore?: boolean; + whitespaceAfter?: boolean; + } + + export interface InlineHintsProvider { + onDidChangeInlineHints?: IEvent | undefined; + provideInlineHints(model: editor.ITextModel, range: Range, token: CancellationToken): ProviderResult; + } + export interface SemanticTokensLegend { readonly tokenTypes: string[]; readonly tokenModifiers: string[]; @@ -6341,6 +6505,11 @@ declare namespace monaco.languages { * attach this to every token class (by default '.' + name) */ tokenPostfix?: string; + /** + * include line feeds (in the form of a \n character) at the end of lines + * Defaults to false + */ + includeLF?: boolean; } /** @@ -6481,7 +6650,9 @@ declare namespace monaco.languages.typescript { None = 0, Preserve = 1, React = 2, - ReactNative = 3 + ReactNative = 3, + ReactJSX = 4, + ReactJSXDev = 5 } export enum NewLineKind { CarriageReturnLineFeed = 0, @@ -6765,7 +6936,11 @@ declare namespace monaco.languages.typescript { * Get signature help items for the item at the given file and position. * @returns `Promise` */ - getSignatureHelpItems(fileName: string, position: number): Promise; + getSignatureHelpItems( + fileName: string, + position: number, + options: any + ): Promise; /** * Get quick info for the item at the given position in the file. * @returns `Promise` @@ -6993,7 +7168,16 @@ declare namespace monaco.languages.json { * If set, the schema service would load schema content on-demand with 'fetch' if available */ readonly enableSchemaRequest?: boolean; + /** + * The severity of problems from schema validation. If set to 'ignore', schema validation will be skipped. If not set, 'warning' is used. + */ + readonly schemaValidation?: SeverityLevel; + /** + * The severity of problems that occurred when resolving and loading schemas. If set to 'ignore', schema resolving problems are not reported. If not set, 'warning' is used. + */ + readonly schemaRequest?: SeverityLevel; } + export type SeverityLevel = 'error' | 'warning' | 'ignore'; export interface ModeConfiguration { /** * Defines whether the built-in documentFormattingEdit provider is enabled.