Prepare for 0.30.0

This commit is contained in:
Alex Dima 2021-11-05 00:06:15 +01:00
parent ecfdb35cda
commit 4a8558dcef
No known key found for this signature in database
GPG key ID: 39563C1504FDD0C9
7 changed files with 312 additions and 282 deletions

View file

@ -1,5 +1,33 @@
# Monaco Editor Changelog # Monaco Editor Changelog
## [0.30.0] (04.11.2021)
* adds support for rendering horizontal guides between bracket pairs and improves the vertical rendering to account for content in between brackets.
* adds new `hover.above` option to control the hover position.
* adds `ICodeEditor.onDidChangeHiddenAreas` which is fired when folding/unfolding.
* to address [CVE-2021-42574](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-42574), the editor now renders Unicode directional formatting characters by default. The special rendering can be turned off using `renderControlCharacters`. See https://code.visualstudio.com/updates/v1_62#_unicode-directional-formatting-characters for an explanation.
### Breaking Changes
* renamed enum members of `monaco.KeyCode` to align with the names given for browser codes.
* renamed `ITextModel.getModeId()` to `ITextModel.getLanguageId()`
* renamed `IPasteEvent.mode` to `IPasteEvent.languageId`
### Thank you
Contributions to `monaco-editor-webpack-plugin`:
* [@silverwind](https://github.com/silverwind): Fix letter case in repo URL [PR #165](https://github.com/microsoft/monaco-editor-webpack-plugin/pull/165)
Contributions to `monaco-languages`:
* [@arlosi (Arlo Siemsen)](https://github.com/arlosi): Rust: highlighting raw strings and fix chars with escapes [PR #167](https://github.com/microsoft/monaco-languages/pull/167)
* [@MasterOdin (Matthew Peveler)](https://github.com/MasterOdin)
* Add new functions in postgresql 14 [PR #168](https://github.com/microsoft/monaco-languages/pull/168)
* Update json functions for postgresql [PR #169](https://github.com/microsoft/monaco-languages/pull/169)
* Add missing postgresql functions [PR #170](https://github.com/microsoft/monaco-languages/pull/170)
## [0.29.1] (11.10.2021) ## [0.29.1] (11.10.2021)
* fixes [an issue with the ESM version in DOMPurify](https://github.com/microsoft/monaco-editor/issues/2691). * fixes [an issue with the ESM version in DOMPurify](https://github.com/microsoft/monaco-editor/issues/2691).

36
package-lock.json generated
View file

@ -2362,39 +2362,39 @@
} }
}, },
"monaco-css": { "monaco-css": {
"version": "3.8.1", "version": "3.9.0",
"resolved": "https://registry.npmjs.org/monaco-css/-/monaco-css-3.8.1.tgz", "resolved": "https://registry.npmjs.org/monaco-css/-/monaco-css-3.9.0.tgz",
"integrity": "sha512-biXG+Y7RVWY8QAXnteMafIIrqFxAvcmCsa87tWAHcNRZauY+3VjNbllBxklPAkK0T+YrZDMuq1YAAE8wKreYiA==", "integrity": "sha512-QTzWIIyH3hgnEtq3gZ3Aohhs02E3BU9HLHafsUg/d9cQ2b9Bx79aSd7eRgVbvy5x6NnM7ihtT9P70zbu+8Bd8g==",
"dev": true "dev": true
}, },
"monaco-editor-core": { "monaco-editor-core": {
"version": "0.29.2", "version": "0.30.0",
"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.29.2.tgz", "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.30.0.tgz",
"integrity": "sha512-glydafVIfO2h7Wujb0iqbDjOK8p+Ab03xydLABcCzPzK5vy4/c3VPC1ff9+/KlZCn+0RbZHO+NZJsV2O4Y3m2A==", "integrity": "sha512-vFJ7BEOCqLv4xWgFW+UheI/PtccHHNht29lNmo79Re1kNhWCBLLb2nThjRMLPO1rd41vX9hhd9C07/iKOk9/jQ==",
"dev": true "dev": true
}, },
"monaco-html": { "monaco-html": {
"version": "3.8.1", "version": "3.9.0",
"resolved": "https://registry.npmjs.org/monaco-html/-/monaco-html-3.8.1.tgz", "resolved": "https://registry.npmjs.org/monaco-html/-/monaco-html-3.9.0.tgz",
"integrity": "sha512-qg5TH6HVJiQctEccsPG3r+tE0BjxcNZv6fFjT4Sr7p1c0fN92SvoDbxrjyqfzIfGsVlr76OfzPShjy1SOCHreA==", "integrity": "sha512-PirAgMiP8NpUAQLgh8GZOhPxzFI+EDaTJnJct+D/BHU71axvKmYyEN2P9coMcQ/26ZOml6maLQ37e+xesk4vHg==",
"dev": true "dev": true
}, },
"monaco-json": { "monaco-json": {
"version": "3.8.1", "version": "3.9.0",
"resolved": "https://registry.npmjs.org/monaco-json/-/monaco-json-3.8.1.tgz", "resolved": "https://registry.npmjs.org/monaco-json/-/monaco-json-3.9.0.tgz",
"integrity": "sha512-Uc8pSW9lljQwOznHIqVOeHaGEEjXK7ltbIjxXhkpi3XW7e/J+Sbt0JWpYjphD2EMb0MKCe2XhM8gBzRPF7lvYA==", "integrity": "sha512-Vj8wTxBH29JeqDzO8T8kgv4sk8Hbq8gxiyzmvn+92FAYh3Iba3fnTq9WjKCSR3ALRw65NjDgkFlSwkGyVjT2uA==",
"dev": true "dev": true
}, },
"monaco-languages": { "monaco-languages": {
"version": "2.10.0", "version": "2.11.1",
"resolved": "https://registry.npmjs.org/monaco-languages/-/monaco-languages-2.10.0.tgz", "resolved": "https://registry.npmjs.org/monaco-languages/-/monaco-languages-2.11.1.tgz",
"integrity": "sha512-3nXXNz+hgzE1AfEuuyr54qQlmYJcdmv0mg7feWll1v1ezQYk/7Qi6vSkiEf0f5kXDYD0olpTI9zzBJujU9BQYA==", "integrity": "sha512-XLd6RtqCTYQ1AD7Tz/JzT/Eag/OfvjUtsetqVe6Hm+Tj01osGgnlKsjmPPfTddOIfnSsT6S3TR5aMRL57bSrJg==",
"dev": true "dev": true
}, },
"monaco-typescript": { "monaco-typescript": {
"version": "4.9.1", "version": "4.10.0",
"resolved": "https://registry.npmjs.org/monaco-typescript/-/monaco-typescript-4.9.1.tgz", "resolved": "https://registry.npmjs.org/monaco-typescript/-/monaco-typescript-4.10.0.tgz",
"integrity": "sha512-ZxvQFK40fnNg6hhkIofwyH6XzaHSmxVsI41cwSLi4eNFaP/Z58tigUJ/g9evS6Evbm67SdhxvxB4jct/tq3oXw==", "integrity": "sha512-vzd7IGCshZO05YW/Kv2V/aKU/Pn8N3RjioHPmSJzG+4E9odnTrCOP8c/iOgkl2IyRS72WReDJ7xDYtMtg8WrOQ==",
"dev": true "dev": true
}, },
"ms": { "ms": {

View file

@ -22,12 +22,12 @@
"clean-css": "^5.1.1", "clean-css": "^5.1.1",
"event-stream": "4.0.1", "event-stream": "4.0.1",
"gulp": "^4.0.2", "gulp": "^4.0.2",
"monaco-css": "3.8.1", "monaco-css": "3.9.0",
"monaco-editor-core": "0.29.2", "monaco-editor-core": "0.30.0",
"monaco-html": "3.8.1", "monaco-html": "3.9.0",
"monaco-json": "3.8.1", "monaco-json": "3.9.0",
"monaco-languages": "2.10.0", "monaco-languages": "2.11.1",
"monaco-typescript": "4.9.1", "monaco-typescript": "4.10.0",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"typedoc": "^0.20.29", "typedoc": "^0.20.29",
"typescript": "4.2.3", "typescript": "4.2.3",

View file

@ -65,7 +65,7 @@ editor.addAction({
keybindings: [ keybindings: [
monaco.KeyMod.CtrlCmd | monaco.KeyCode.F10, monaco.KeyMod.CtrlCmd | monaco.KeyCode.F10,
// chord // chord
monaco.KeyMod.chord(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_K, monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_M) monaco.KeyMod.chord(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyK, monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyM)
], ],
// A precondition for this action. // A precondition for this action.

257
typedoc/monaco.d.ts vendored
View file

@ -220,7 +220,6 @@ declare namespace monaco {
query: string; query: string;
fragment: string; fragment: string;
} }
/** /**
* Virtual Key Codes, the value does not hold any inherent meaning. * Virtual Key Codes, the value does not hold any inherent meaning.
* Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx * Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
@ -252,42 +251,42 @@ declare namespace monaco {
DownArrow = 18, DownArrow = 18,
Insert = 19, Insert = 19,
Delete = 20, Delete = 20,
KEY_0 = 21, Digit0 = 21,
KEY_1 = 22, Digit1 = 22,
KEY_2 = 23, Digit2 = 23,
KEY_3 = 24, Digit3 = 24,
KEY_4 = 25, Digit4 = 25,
KEY_5 = 26, Digit5 = 26,
KEY_6 = 27, Digit6 = 27,
KEY_7 = 28, Digit7 = 28,
KEY_8 = 29, Digit8 = 29,
KEY_9 = 30, Digit9 = 30,
KEY_A = 31, KeyA = 31,
KEY_B = 32, KeyB = 32,
KEY_C = 33, KeyC = 33,
KEY_D = 34, KeyD = 34,
KEY_E = 35, KeyE = 35,
KEY_F = 36, KeyF = 36,
KEY_G = 37, KeyG = 37,
KEY_H = 38, KeyH = 38,
KEY_I = 39, KeyI = 39,
KEY_J = 40, KeyJ = 40,
KEY_K = 41, KeyK = 41,
KEY_L = 42, KeyL = 42,
KEY_M = 43, KeyM = 43,
KEY_N = 44, KeyN = 44,
KEY_O = 45, KeyO = 45,
KEY_P = 46, KeyP = 46,
KEY_Q = 47, KeyQ = 47,
KEY_R = 48, KeyR = 48,
KEY_S = 49, KeyS = 49,
KEY_T = 50, KeyT = 50,
KEY_U = 51, KeyU = 51,
KEY_V = 52, KeyV = 52,
KEY_W = 53, KeyW = 53,
KEY_X = 54, KeyX = 54,
KEY_Y = 55, KeyY = 55,
KEY_Z = 56, KeyZ = 56,
Meta = 57, Meta = 57,
ContextMenu = 58, ContextMenu = 58,
F1 = 59, F1 = 59,
@ -315,57 +314,57 @@ declare namespace monaco {
* Used for miscellaneous characters; it can vary by keyboard. * Used for miscellaneous characters; it can vary by keyboard.
* For the US standard keyboard, the ';:' key * For the US standard keyboard, the ';:' key
*/ */
US_SEMICOLON = 80, Semicolon = 80,
/** /**
* For any country/region, the '+' key * For any country/region, the '+' key
* For the US standard keyboard, the '=+' key * For the US standard keyboard, the '=+' key
*/ */
US_EQUAL = 81, Equal = 81,
/** /**
* For any country/region, the ',' key * For any country/region, the ',' key
* For the US standard keyboard, the ',<' key * For the US standard keyboard, the ',<' key
*/ */
US_COMMA = 82, Comma = 82,
/** /**
* For any country/region, the '-' key * For any country/region, the '-' key
* For the US standard keyboard, the '-_' key * For the US standard keyboard, the '-_' key
*/ */
US_MINUS = 83, Minus = 83,
/** /**
* For any country/region, the '.' key * For any country/region, the '.' key
* For the US standard keyboard, the '.>' key * For the US standard keyboard, the '.>' key
*/ */
US_DOT = 84, Period = 84,
/** /**
* Used for miscellaneous characters; it can vary by keyboard. * Used for miscellaneous characters; it can vary by keyboard.
* For the US standard keyboard, the '/?' key * For the US standard keyboard, the '/?' key
*/ */
US_SLASH = 85, Slash = 85,
/** /**
* Used for miscellaneous characters; it can vary by keyboard. * Used for miscellaneous characters; it can vary by keyboard.
* For the US standard keyboard, the '`~' key * For the US standard keyboard, the '`~' key
*/ */
US_BACKTICK = 86, Backquote = 86,
/** /**
* Used for miscellaneous characters; it can vary by keyboard. * Used for miscellaneous characters; it can vary by keyboard.
* For the US standard keyboard, the '[{' key * For the US standard keyboard, the '[{' key
*/ */
US_OPEN_SQUARE_BRACKET = 87, BracketLeft = 87,
/** /**
* Used for miscellaneous characters; it can vary by keyboard. * Used for miscellaneous characters; it can vary by keyboard.
* For the US standard keyboard, the '\|' key * For the US standard keyboard, the '\|' key
*/ */
US_BACKSLASH = 88, Backslash = 88,
/** /**
* Used for miscellaneous characters; it can vary by keyboard. * Used for miscellaneous characters; it can vary by keyboard.
* For the US standard keyboard, the ']}' key * For the US standard keyboard, the ']}' key
*/ */
US_CLOSE_SQUARE_BRACKET = 89, BracketRight = 89,
/** /**
* Used for miscellaneous characters; it can vary by keyboard. * Used for miscellaneous characters; it can vary by keyboard.
* For the US standard keyboard, the ''"' key * For the US standard keyboard, the ''"' key
*/ */
US_QUOTE = 90, Quote = 90,
/** /**
* Used for miscellaneous characters; it can vary by keyboard. * Used for miscellaneous characters; it can vary by keyboard.
*/ */
@ -373,34 +372,48 @@ declare namespace monaco {
/** /**
* Either the angle bracket key or the backslash key on the RT 102-key keyboard. * Either the angle bracket key or the backslash key on the RT 102-key keyboard.
*/ */
OEM_102 = 92, IntlBackslash = 92,
NUMPAD_0 = 93, Numpad0 = 93,
NUMPAD_1 = 94, Numpad1 = 94,
NUMPAD_2 = 95, Numpad2 = 95,
NUMPAD_3 = 96, Numpad3 = 96,
NUMPAD_4 = 97, Numpad4 = 97,
NUMPAD_5 = 98, Numpad5 = 98,
NUMPAD_6 = 99, Numpad6 = 99,
NUMPAD_7 = 100, Numpad7 = 100,
NUMPAD_8 = 101, Numpad8 = 101,
NUMPAD_9 = 102, Numpad9 = 102,
NUMPAD_MULTIPLY = 103, NumpadMultiply = 103,
NUMPAD_ADD = 104, NumpadAdd = 104,
NUMPAD_SEPARATOR = 105, NUMPAD_SEPARATOR = 105,
NUMPAD_SUBTRACT = 106, NumpadSubtract = 106,
NUMPAD_DECIMAL = 107, NumpadDecimal = 107,
NUMPAD_DIVIDE = 108, NumpadDivide = 108,
/** /**
* Cover all key codes when IME is processing input. * Cover all key codes when IME is processing input.
*/ */
KEY_IN_COMPOSITION = 109, KEY_IN_COMPOSITION = 109,
ABNT_C1 = 110, ABNT_C1 = 110,
ABNT_C2 = 111, ABNT_C2 = 111,
AudioVolumeMute = 112,
AudioVolumeUp = 113,
AudioVolumeDown = 114,
BrowserSearch = 115,
BrowserHome = 116,
BrowserBack = 117,
BrowserForward = 118,
MediaTrackNext = 119,
MediaTrackPrevious = 120,
MediaStop = 121,
MediaPlayPause = 122,
LaunchMediaPlayer = 123,
LaunchMail = 124,
LaunchApp2 = 125,
/** /**
* Placed last to cover the length of the enum. * Placed last to cover the length of the enum.
* Please do not depend on this value! * Please do not depend on this value!
*/ */
MAX_VALUE = 112 MAX_VALUE = 126
} }
export class KeyMod { export class KeyMod {
static readonly CtrlCmd: number; static readonly CtrlCmd: number;
@ -1882,7 +1895,7 @@ declare namespace monaco.editor {
/** /**
* Get the language associated with this model. * Get the language associated with this model.
*/ */
getModeId(): string; getLanguageId(): string;
/** /**
* Get the word under or besides `position`. * Get the word under or besides `position`.
* @param position The position to look for a word. * @param position The position to look for a word.
@ -2047,8 +2060,7 @@ declare namespace monaco.editor {
*/ */
onWillDispose(listener: () => void): IDisposable; onWillDispose(listener: () => void): IDisposable;
/** /**
* Destroy this model. This will unbind the model from the mode * Destroy this model.
* and make all necessary clean-up to release this object to the GC.
*/ */
dispose(): void; dispose(): void;
/** /**
@ -2479,7 +2491,7 @@ declare namespace monaco.editor {
}; };
/** /**
* An event describing that the current mode associated with a model has changed. * An event describing that the current language associated with a model has changed.
*/ */
export interface IModelLanguageChangedEvent { export interface IModelLanguageChangedEvent {
/** /**
@ -3219,7 +3231,7 @@ declare namespace monaco.editor {
renderWhitespace?: 'none' | 'boundary' | 'selection' | 'trailing' | 'all'; renderWhitespace?: 'none' | 'boundary' | 'selection' | 'trailing' | 'all';
/** /**
* Enable rendering of control characters. * Enable rendering of control characters.
* Defaults to false. * Defaults to true.
*/ */
renderControlCharacters?: boolean; renderControlCharacters?: boolean;
/** /**
@ -3382,8 +3394,6 @@ declare namespace monaco.editor {
ignoreEmptyLines?: boolean; ignoreEmptyLines?: boolean;
} }
export type EditorCommentsOptions = Readonly<Required<IEditorCommentsOptions>>;
/** /**
* The kind of animation in which the editor's cursor should be rendered. * The kind of animation in which the editor's cursor should be rendered.
*/ */
@ -3467,8 +3477,6 @@ declare namespace monaco.editor {
loop?: boolean; loop?: boolean;
} }
export type EditorFindOptions = Readonly<Required<IEditorFindOptions>>;
export type GoToLocationValues = 'peek' | 'gotoAndPeek' | 'goto'; export type GoToLocationValues = 'peek' | 'gotoAndPeek' | 'goto';
/** /**
@ -3488,8 +3496,6 @@ declare namespace monaco.editor {
alternativeReferenceCommand?: string; alternativeReferenceCommand?: string;
} }
export type GoToLocationOptions = Readonly<Required<IGotoLocationOptions>>;
/** /**
* Configuration options for editor hover * Configuration options for editor hover
*/ */
@ -3509,10 +3515,13 @@ declare namespace monaco.editor {
* Defaults to true. * Defaults to true.
*/ */
sticky?: boolean; sticky?: boolean;
/**
* Should the hover be shown above the line if possible?
* Defaults to false.
*/
above?: boolean;
} }
export type EditorHoverOptions = Readonly<Required<IEditorHoverOptions>>;
/** /**
* A description for the overview ruler position. * A description for the overview ruler position.
*/ */
@ -3638,8 +3647,6 @@ declare namespace monaco.editor {
enabled?: boolean; enabled?: boolean;
} }
export type EditorLightbulbOptions = Readonly<Required<IEditorLightbulbOptions>>;
/** /**
* Configuration options for editor inlayHints * Configuration options for editor inlayHints
*/ */
@ -3661,8 +3668,6 @@ declare namespace monaco.editor {
fontFamily?: string; fontFamily?: string;
} }
export type EditorInlayHintsOptions = Readonly<Required<IEditorInlayHintsOptions>>;
/** /**
* Configuration options for editor minimap * Configuration options for editor minimap
*/ */
@ -3703,8 +3708,6 @@ declare namespace monaco.editor {
scale?: number; scale?: number;
} }
export type EditorMinimapOptions = Readonly<Required<IEditorMinimapOptions>>;
/** /**
* Configuration options for editor padding * Configuration options for editor padding
*/ */
@ -3719,11 +3722,6 @@ declare namespace monaco.editor {
bottom?: number; bottom?: number;
} }
export interface InternalEditorPaddingOptions {
readonly top: number;
readonly bottom: number;
}
/** /**
* Configuration options for parameter hints * Configuration options for parameter hints
*/ */
@ -3740,8 +3738,6 @@ declare namespace monaco.editor {
cycle?: boolean; cycle?: boolean;
} }
export type InternalParameterHintOptions = Readonly<Required<IEditorParameterHintOptions>>;
/** /**
* Configuration options for quick suggestions * Configuration options for quick suggestions
*/ */
@ -3751,8 +3747,6 @@ declare namespace monaco.editor {
strings?: boolean; strings?: boolean;
} }
export type ValidQuickSuggestionsOptions = boolean | Readonly<Required<IQuickSuggestionsOptions>>;
export type LineNumbersType = 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string); export type LineNumbersType = 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string);
export enum RenderLineNumbersType { export enum RenderLineNumbersType {
@ -3882,8 +3876,6 @@ declare namespace monaco.editor {
mode?: 'prefix' | 'subword' | 'subwordSmart'; mode?: 'prefix' | 'subword' | 'subwordSmart';
} }
export type InternalInlineSuggestOptions = Readonly<Required<IInlineSuggestOptions>>;
export interface IBracketPairColorizationOptions { export interface IBracketPairColorizationOptions {
/** /**
* Enable or disable bracket pair colorization. * Enable or disable bracket pair colorization.
@ -3891,13 +3883,22 @@ declare namespace monaco.editor {
enabled?: boolean; enabled?: boolean;
} }
export type InternalBracketPairColorizationOptions = Readonly<Required<IBracketPairColorizationOptions>>;
export interface IGuidesOptions { export interface IGuidesOptions {
/** /**
* Enable rendering of bracket pair guides. * Enable rendering of bracket pair guides.
* Defaults to false.
*/ */
bracketPairs?: boolean; bracketPairs?: boolean | 'active';
/**
* Enable rendering of vertical bracket pair guides.
* Defaults to 'active'.
*/
bracketPairsHorizontal?: boolean | 'active';
/**
* Enable highlighting of the active bracket pair.
* Defaults to true.
*/
highlightActiveBracketPair?: boolean;
/** /**
* Enable rendering of indent guides. * Enable rendering of indent guides.
* Defaults to true. * Defaults to true.
@ -3910,8 +3911,6 @@ declare namespace monaco.editor {
highlightActiveIndentation?: boolean; highlightActiveIndentation?: boolean;
} }
export type InternalGuidesOptions = Readonly<Required<IGuidesOptions>>;
/** /**
* Configuration options for editor suggest widget * Configuration options for editor suggest widget
*/ */
@ -4070,14 +4069,10 @@ declare namespace monaco.editor {
showSnippets?: boolean; showSnippets?: boolean;
} }
export type InternalSuggestOptions = Readonly<Required<ISuggestOptions>>;
export interface ISmartSelectOptions { export interface ISmartSelectOptions {
selectLeadingAndTrailingWhitespace?: boolean; selectLeadingAndTrailingWhitespace?: boolean;
} }
export type SmartSelectOptions = Readonly<Required<ISmartSelectOptions>>;
/** /**
* Describes how to indent wrapped lines. * Describes how to indent wrapped lines.
*/ */
@ -4240,6 +4235,7 @@ declare namespace monaco.editor {
layoutInfo = 129, layoutInfo = 129,
wrappingInfo = 130 wrappingInfo = 130
} }
export const EditorOptions: { export const EditorOptions: {
acceptSuggestionOnCommitCharacter: IEditorOption<EditorOption.acceptSuggestionOnCommitCharacter, boolean>; acceptSuggestionOnCommitCharacter: IEditorOption<EditorOption.acceptSuggestionOnCommitCharacter, boolean>;
acceptSuggestionOnEnter: IEditorOption<EditorOption.acceptSuggestionOnEnter, 'on' | 'off' | 'smart'>; acceptSuggestionOnEnter: IEditorOption<EditorOption.acceptSuggestionOnEnter, 'on' | 'off' | 'smart'>;
@ -4315,11 +4311,11 @@ declare namespace monaco.editor {
occurrencesHighlight: IEditorOption<EditorOption.occurrencesHighlight, boolean>; occurrencesHighlight: IEditorOption<EditorOption.occurrencesHighlight, boolean>;
overviewRulerBorder: IEditorOption<EditorOption.overviewRulerBorder, boolean>; overviewRulerBorder: IEditorOption<EditorOption.overviewRulerBorder, boolean>;
overviewRulerLanes: IEditorOption<EditorOption.overviewRulerLanes, number>; overviewRulerLanes: IEditorOption<EditorOption.overviewRulerLanes, number>;
padding: IEditorOption<EditorOption.padding, InternalEditorPaddingOptions>; padding: IEditorOption<EditorOption.padding, Readonly<Required<IEditorPaddingOptions>>>;
parameterHints: IEditorOption<EditorOption.parameterHints, Readonly<Required<IEditorParameterHintOptions>>>; parameterHints: IEditorOption<EditorOption.parameterHints, Readonly<Required<IEditorParameterHintOptions>>>;
peekWidgetDefaultFocus: IEditorOption<EditorOption.peekWidgetDefaultFocus, 'tree' | 'editor'>; peekWidgetDefaultFocus: IEditorOption<EditorOption.peekWidgetDefaultFocus, 'tree' | 'editor'>;
definitionLinkOpensInPeek: IEditorOption<EditorOption.definitionLinkOpensInPeek, boolean>; definitionLinkOpensInPeek: IEditorOption<EditorOption.definitionLinkOpensInPeek, boolean>;
quickSuggestions: IEditorOption<EditorOption.quickSuggestions, ValidQuickSuggestionsOptions>; quickSuggestions: IEditorOption<EditorOption.quickSuggestions, any>;
quickSuggestionsDelay: IEditorOption<EditorOption.quickSuggestionsDelay, number>; quickSuggestionsDelay: IEditorOption<EditorOption.quickSuggestionsDelay, number>;
readOnly: IEditorOption<EditorOption.readOnly, boolean>; readOnly: IEditorOption<EditorOption.readOnly, boolean>;
renameOnType: IEditorOption<EditorOption.renameOnType, boolean>; renameOnType: IEditorOption<EditorOption.renameOnType, boolean>;
@ -4693,7 +4689,7 @@ declare namespace monaco.editor {
*/ */
export interface IPasteEvent { export interface IPasteEvent {
readonly range: Range; readonly range: Range;
readonly mode: string | null; readonly languageId: string | null;
} }
export interface IEditorConstructionOptions extends IEditorOptions { export interface IEditorConstructionOptions extends IEditorOptions {
@ -4741,47 +4737,47 @@ declare namespace monaco.editor {
* An event emitted when the content of the current model has changed. * An event emitted when the content of the current model has changed.
* @event * @event
*/ */
onDidChangeModelContent(listener: (e: IModelContentChangedEvent) => void): IDisposable; onDidChangeModelContent: IEvent<IModelContentChangedEvent>;
/** /**
* An event emitted when the language of the current model has changed. * An event emitted when the language of the current model has changed.
* @event * @event
*/ */
onDidChangeModelLanguage(listener: (e: IModelLanguageChangedEvent) => void): IDisposable; onDidChangeModelLanguage: IEvent<IModelLanguageChangedEvent>;
/** /**
* An event emitted when the language configuration of the current model has changed. * An event emitted when the language configuration of the current model has changed.
* @event * @event
*/ */
onDidChangeModelLanguageConfiguration(listener: (e: IModelLanguageConfigurationChangedEvent) => void): IDisposable; onDidChangeModelLanguageConfiguration: IEvent<IModelLanguageConfigurationChangedEvent>;
/** /**
* An event emitted when the options of the current model has changed. * An event emitted when the options of the current model has changed.
* @event * @event
*/ */
onDidChangeModelOptions(listener: (e: IModelOptionsChangedEvent) => void): IDisposable; onDidChangeModelOptions: IEvent<IModelOptionsChangedEvent>;
/** /**
* An event emitted when the configuration of the editor has changed. (e.g. `editor.updateOptions()`) * An event emitted when the configuration of the editor has changed. (e.g. `editor.updateOptions()`)
* @event * @event
*/ */
onDidChangeConfiguration(listener: (e: ConfigurationChangedEvent) => void): IDisposable; onDidChangeConfiguration: IEvent<ConfigurationChangedEvent>;
/** /**
* An event emitted when the cursor position has changed. * An event emitted when the cursor position has changed.
* @event * @event
*/ */
onDidChangeCursorPosition(listener: (e: ICursorPositionChangedEvent) => void): IDisposable; onDidChangeCursorPosition: IEvent<ICursorPositionChangedEvent>;
/** /**
* An event emitted when the cursor selection has changed. * An event emitted when the cursor selection has changed.
* @event * @event
*/ */
onDidChangeCursorSelection(listener: (e: ICursorSelectionChangedEvent) => void): IDisposable; onDidChangeCursorSelection: IEvent<ICursorSelectionChangedEvent>;
/** /**
* An event emitted when the model of this editor has changed (e.g. `editor.setModel()`). * An event emitted when the model of this editor has changed (e.g. `editor.setModel()`).
* @event * @event
*/ */
onDidChangeModel(listener: (e: IModelChangedEvent) => void): IDisposable; onDidChangeModel: IEvent<IModelChangedEvent>;
/** /**
* An event emitted when the decorations of the current model have changed. * An event emitted when the decorations of the current model have changed.
* @event * @event
*/ */
onDidChangeModelDecorations(listener: (e: IModelDecorationsChangedEvent) => void): IDisposable; onDidChangeModelDecorations: IEvent<IModelDecorationsChangedEvent>;
/** /**
* An event emitted when the text inside this editor gained focus (i.e. cursor starts blinking). * An event emitted when the text inside this editor gained focus (i.e. cursor starts blinking).
* @event * @event
@ -4819,57 +4815,62 @@ declare namespace monaco.editor {
* An event emitted when users paste text in the editor. * An event emitted when users paste text in the editor.
* @event * @event
*/ */
onDidPaste(listener: (e: IPasteEvent) => void): IDisposable; onDidPaste: IEvent<IPasteEvent>;
/** /**
* An event emitted on a "mouseup". * An event emitted on a "mouseup".
* @event * @event
*/ */
onMouseUp(listener: (e: IEditorMouseEvent) => void): IDisposable; onMouseUp: IEvent<IEditorMouseEvent>;
/** /**
* An event emitted on a "mousedown". * An event emitted on a "mousedown".
* @event * @event
*/ */
onMouseDown(listener: (e: IEditorMouseEvent) => void): IDisposable; onMouseDown: IEvent<IEditorMouseEvent>;
/** /**
* An event emitted on a "contextmenu". * An event emitted on a "contextmenu".
* @event * @event
*/ */
onContextMenu(listener: (e: IEditorMouseEvent) => void): IDisposable; onContextMenu: IEvent<IEditorMouseEvent>;
/** /**
* An event emitted on a "mousemove". * An event emitted on a "mousemove".
* @event * @event
*/ */
onMouseMove(listener: (e: IEditorMouseEvent) => void): IDisposable; onMouseMove: IEvent<IEditorMouseEvent>;
/** /**
* An event emitted on a "mouseleave". * An event emitted on a "mouseleave".
* @event * @event
*/ */
onMouseLeave(listener: (e: IPartialEditorMouseEvent) => void): IDisposable; onMouseLeave: IEvent<IPartialEditorMouseEvent>;
/** /**
* An event emitted on a "keyup". * An event emitted on a "keyup".
* @event * @event
*/ */
onKeyUp(listener: (e: IKeyboardEvent) => void): IDisposable; onKeyUp: IEvent<IKeyboardEvent>;
/** /**
* An event emitted on a "keydown". * An event emitted on a "keydown".
* @event * @event
*/ */
onKeyDown(listener: (e: IKeyboardEvent) => void): IDisposable; onKeyDown: IEvent<IKeyboardEvent>;
/** /**
* An event emitted when the layout of the editor has changed. * An event emitted when the layout of the editor has changed.
* @event * @event
*/ */
onDidLayoutChange(listener: (e: EditorLayoutInfo) => void): IDisposable; onDidLayoutChange: IEvent<EditorLayoutInfo>;
/** /**
* An event emitted when the content width or content height in the editor has changed. * An event emitted when the content width or content height in the editor has changed.
* @event * @event
*/ */
onDidContentSizeChange(listener: (e: IContentSizeChangedEvent) => void): IDisposable; onDidContentSizeChange: IEvent<IContentSizeChangedEvent>;
/** /**
* An event emitted when the scroll in the editor has changed. * An event emitted when the scroll in the editor has changed.
* @event * @event
*/ */
onDidScrollChange(listener: (e: IScrollEvent) => void): IDisposable; onDidScrollChange: IEvent<IScrollEvent>;
/**
* An event emitted when hidden areas change in the editor (e.g. due to folding).
* @event
*/
onDidChangeHiddenAreas: IEvent<void>;
/** /**
* Saves current view state of the editor in a serializable object. * Saves current view state of the editor in a serializable object.
*/ */
@ -6690,7 +6691,7 @@ declare namespace monaco.languages {
} }
export interface InlayHintsProvider { export interface InlayHintsProvider {
onDidChangeInlayHints?: IEvent<void> | undefined; onDidChangeInlayHints?: IEvent<void>;
provideInlayHints(model: editor.ITextModel, range: Range, token: CancellationToken): ProviderResult<InlayHint[]>; provideInlayHints(model: editor.ITextModel, range: Range, token: CancellationToken): ProviderResult<InlayHint[]>;
} }

View file

@ -220,7 +220,6 @@ declare namespace monaco {
query: string; query: string;
fragment: string; fragment: string;
} }
/** /**
* Virtual Key Codes, the value does not hold any inherent meaning. * Virtual Key Codes, the value does not hold any inherent meaning.
* Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx * Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
@ -252,42 +251,42 @@ declare namespace monaco {
DownArrow = 18, DownArrow = 18,
Insert = 19, Insert = 19,
Delete = 20, Delete = 20,
KEY_0 = 21, Digit0 = 21,
KEY_1 = 22, Digit1 = 22,
KEY_2 = 23, Digit2 = 23,
KEY_3 = 24, Digit3 = 24,
KEY_4 = 25, Digit4 = 25,
KEY_5 = 26, Digit5 = 26,
KEY_6 = 27, Digit6 = 27,
KEY_7 = 28, Digit7 = 28,
KEY_8 = 29, Digit8 = 29,
KEY_9 = 30, Digit9 = 30,
KEY_A = 31, KeyA = 31,
KEY_B = 32, KeyB = 32,
KEY_C = 33, KeyC = 33,
KEY_D = 34, KeyD = 34,
KEY_E = 35, KeyE = 35,
KEY_F = 36, KeyF = 36,
KEY_G = 37, KeyG = 37,
KEY_H = 38, KeyH = 38,
KEY_I = 39, KeyI = 39,
KEY_J = 40, KeyJ = 40,
KEY_K = 41, KeyK = 41,
KEY_L = 42, KeyL = 42,
KEY_M = 43, KeyM = 43,
KEY_N = 44, KeyN = 44,
KEY_O = 45, KeyO = 45,
KEY_P = 46, KeyP = 46,
KEY_Q = 47, KeyQ = 47,
KEY_R = 48, KeyR = 48,
KEY_S = 49, KeyS = 49,
KEY_T = 50, KeyT = 50,
KEY_U = 51, KeyU = 51,
KEY_V = 52, KeyV = 52,
KEY_W = 53, KeyW = 53,
KEY_X = 54, KeyX = 54,
KEY_Y = 55, KeyY = 55,
KEY_Z = 56, KeyZ = 56,
Meta = 57, Meta = 57,
ContextMenu = 58, ContextMenu = 58,
F1 = 59, F1 = 59,
@ -315,57 +314,57 @@ declare namespace monaco {
* Used for miscellaneous characters; it can vary by keyboard. * Used for miscellaneous characters; it can vary by keyboard.
* For the US standard keyboard, the ';:' key * For the US standard keyboard, the ';:' key
*/ */
US_SEMICOLON = 80, Semicolon = 80,
/** /**
* For any country/region, the '+' key * For any country/region, the '+' key
* For the US standard keyboard, the '=+' key * For the US standard keyboard, the '=+' key
*/ */
US_EQUAL = 81, Equal = 81,
/** /**
* For any country/region, the ',' key * For any country/region, the ',' key
* For the US standard keyboard, the ',<' key * For the US standard keyboard, the ',<' key
*/ */
US_COMMA = 82, Comma = 82,
/** /**
* For any country/region, the '-' key * For any country/region, the '-' key
* For the US standard keyboard, the '-_' key * For the US standard keyboard, the '-_' key
*/ */
US_MINUS = 83, Minus = 83,
/** /**
* For any country/region, the '.' key * For any country/region, the '.' key
* For the US standard keyboard, the '.>' key * For the US standard keyboard, the '.>' key
*/ */
US_DOT = 84, Period = 84,
/** /**
* Used for miscellaneous characters; it can vary by keyboard. * Used for miscellaneous characters; it can vary by keyboard.
* For the US standard keyboard, the '/?' key * For the US standard keyboard, the '/?' key
*/ */
US_SLASH = 85, Slash = 85,
/** /**
* Used for miscellaneous characters; it can vary by keyboard. * Used for miscellaneous characters; it can vary by keyboard.
* For the US standard keyboard, the '`~' key * For the US standard keyboard, the '`~' key
*/ */
US_BACKTICK = 86, Backquote = 86,
/** /**
* Used for miscellaneous characters; it can vary by keyboard. * Used for miscellaneous characters; it can vary by keyboard.
* For the US standard keyboard, the '[{' key * For the US standard keyboard, the '[{' key
*/ */
US_OPEN_SQUARE_BRACKET = 87, BracketLeft = 87,
/** /**
* Used for miscellaneous characters; it can vary by keyboard. * Used for miscellaneous characters; it can vary by keyboard.
* For the US standard keyboard, the '\|' key * For the US standard keyboard, the '\|' key
*/ */
US_BACKSLASH = 88, Backslash = 88,
/** /**
* Used for miscellaneous characters; it can vary by keyboard. * Used for miscellaneous characters; it can vary by keyboard.
* For the US standard keyboard, the ']}' key * For the US standard keyboard, the ']}' key
*/ */
US_CLOSE_SQUARE_BRACKET = 89, BracketRight = 89,
/** /**
* Used for miscellaneous characters; it can vary by keyboard. * Used for miscellaneous characters; it can vary by keyboard.
* For the US standard keyboard, the ''"' key * For the US standard keyboard, the ''"' key
*/ */
US_QUOTE = 90, Quote = 90,
/** /**
* Used for miscellaneous characters; it can vary by keyboard. * Used for miscellaneous characters; it can vary by keyboard.
*/ */
@ -373,34 +372,48 @@ declare namespace monaco {
/** /**
* Either the angle bracket key or the backslash key on the RT 102-key keyboard. * Either the angle bracket key or the backslash key on the RT 102-key keyboard.
*/ */
OEM_102 = 92, IntlBackslash = 92,
NUMPAD_0 = 93, Numpad0 = 93,
NUMPAD_1 = 94, Numpad1 = 94,
NUMPAD_2 = 95, Numpad2 = 95,
NUMPAD_3 = 96, Numpad3 = 96,
NUMPAD_4 = 97, Numpad4 = 97,
NUMPAD_5 = 98, Numpad5 = 98,
NUMPAD_6 = 99, Numpad6 = 99,
NUMPAD_7 = 100, Numpad7 = 100,
NUMPAD_8 = 101, Numpad8 = 101,
NUMPAD_9 = 102, Numpad9 = 102,
NUMPAD_MULTIPLY = 103, NumpadMultiply = 103,
NUMPAD_ADD = 104, NumpadAdd = 104,
NUMPAD_SEPARATOR = 105, NUMPAD_SEPARATOR = 105,
NUMPAD_SUBTRACT = 106, NumpadSubtract = 106,
NUMPAD_DECIMAL = 107, NumpadDecimal = 107,
NUMPAD_DIVIDE = 108, NumpadDivide = 108,
/** /**
* Cover all key codes when IME is processing input. * Cover all key codes when IME is processing input.
*/ */
KEY_IN_COMPOSITION = 109, KEY_IN_COMPOSITION = 109,
ABNT_C1 = 110, ABNT_C1 = 110,
ABNT_C2 = 111, ABNT_C2 = 111,
AudioVolumeMute = 112,
AudioVolumeUp = 113,
AudioVolumeDown = 114,
BrowserSearch = 115,
BrowserHome = 116,
BrowserBack = 117,
BrowserForward = 118,
MediaTrackNext = 119,
MediaTrackPrevious = 120,
MediaStop = 121,
MediaPlayPause = 122,
LaunchMediaPlayer = 123,
LaunchMail = 124,
LaunchApp2 = 125,
/** /**
* Placed last to cover the length of the enum. * Placed last to cover the length of the enum.
* Please do not depend on this value! * Please do not depend on this value!
*/ */
MAX_VALUE = 112 MAX_VALUE = 126
} }
export class KeyMod { export class KeyMod {
static readonly CtrlCmd: number; static readonly CtrlCmd: number;
@ -1882,7 +1895,7 @@ declare namespace monaco.editor {
/** /**
* Get the language associated with this model. * Get the language associated with this model.
*/ */
getModeId(): string; getLanguageId(): string;
/** /**
* Get the word under or besides `position`. * Get the word under or besides `position`.
* @param position The position to look for a word. * @param position The position to look for a word.
@ -2047,8 +2060,7 @@ declare namespace monaco.editor {
*/ */
onWillDispose(listener: () => void): IDisposable; onWillDispose(listener: () => void): IDisposable;
/** /**
* Destroy this model. This will unbind the model from the mode * Destroy this model.
* and make all necessary clean-up to release this object to the GC.
*/ */
dispose(): void; dispose(): void;
/** /**
@ -2479,7 +2491,7 @@ declare namespace monaco.editor {
}; };
/** /**
* An event describing that the current mode associated with a model has changed. * An event describing that the current language associated with a model has changed.
*/ */
export interface IModelLanguageChangedEvent { export interface IModelLanguageChangedEvent {
/** /**
@ -3219,7 +3231,7 @@ declare namespace monaco.editor {
renderWhitespace?: 'none' | 'boundary' | 'selection' | 'trailing' | 'all'; renderWhitespace?: 'none' | 'boundary' | 'selection' | 'trailing' | 'all';
/** /**
* Enable rendering of control characters. * Enable rendering of control characters.
* Defaults to false. * Defaults to true.
*/ */
renderControlCharacters?: boolean; renderControlCharacters?: boolean;
/** /**
@ -3382,8 +3394,6 @@ declare namespace monaco.editor {
ignoreEmptyLines?: boolean; ignoreEmptyLines?: boolean;
} }
export type EditorCommentsOptions = Readonly<Required<IEditorCommentsOptions>>;
/** /**
* The kind of animation in which the editor's cursor should be rendered. * The kind of animation in which the editor's cursor should be rendered.
*/ */
@ -3467,8 +3477,6 @@ declare namespace monaco.editor {
loop?: boolean; loop?: boolean;
} }
export type EditorFindOptions = Readonly<Required<IEditorFindOptions>>;
export type GoToLocationValues = 'peek' | 'gotoAndPeek' | 'goto'; export type GoToLocationValues = 'peek' | 'gotoAndPeek' | 'goto';
/** /**
@ -3488,8 +3496,6 @@ declare namespace monaco.editor {
alternativeReferenceCommand?: string; alternativeReferenceCommand?: string;
} }
export type GoToLocationOptions = Readonly<Required<IGotoLocationOptions>>;
/** /**
* Configuration options for editor hover * Configuration options for editor hover
*/ */
@ -3509,10 +3515,13 @@ declare namespace monaco.editor {
* Defaults to true. * Defaults to true.
*/ */
sticky?: boolean; sticky?: boolean;
/**
* Should the hover be shown above the line if possible?
* Defaults to false.
*/
above?: boolean;
} }
export type EditorHoverOptions = Readonly<Required<IEditorHoverOptions>>;
/** /**
* A description for the overview ruler position. * A description for the overview ruler position.
*/ */
@ -3638,8 +3647,6 @@ declare namespace monaco.editor {
enabled?: boolean; enabled?: boolean;
} }
export type EditorLightbulbOptions = Readonly<Required<IEditorLightbulbOptions>>;
/** /**
* Configuration options for editor inlayHints * Configuration options for editor inlayHints
*/ */
@ -3661,8 +3668,6 @@ declare namespace monaco.editor {
fontFamily?: string; fontFamily?: string;
} }
export type EditorInlayHintsOptions = Readonly<Required<IEditorInlayHintsOptions>>;
/** /**
* Configuration options for editor minimap * Configuration options for editor minimap
*/ */
@ -3703,8 +3708,6 @@ declare namespace monaco.editor {
scale?: number; scale?: number;
} }
export type EditorMinimapOptions = Readonly<Required<IEditorMinimapOptions>>;
/** /**
* Configuration options for editor padding * Configuration options for editor padding
*/ */
@ -3719,11 +3722,6 @@ declare namespace monaco.editor {
bottom?: number; bottom?: number;
} }
export interface InternalEditorPaddingOptions {
readonly top: number;
readonly bottom: number;
}
/** /**
* Configuration options for parameter hints * Configuration options for parameter hints
*/ */
@ -3740,8 +3738,6 @@ declare namespace monaco.editor {
cycle?: boolean; cycle?: boolean;
} }
export type InternalParameterHintOptions = Readonly<Required<IEditorParameterHintOptions>>;
/** /**
* Configuration options for quick suggestions * Configuration options for quick suggestions
*/ */
@ -3751,8 +3747,6 @@ declare namespace monaco.editor {
strings?: boolean; strings?: boolean;
} }
export type ValidQuickSuggestionsOptions = boolean | Readonly<Required<IQuickSuggestionsOptions>>;
export type LineNumbersType = 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string); export type LineNumbersType = 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string);
export enum RenderLineNumbersType { export enum RenderLineNumbersType {
@ -3882,8 +3876,6 @@ declare namespace monaco.editor {
mode?: 'prefix' | 'subword' | 'subwordSmart'; mode?: 'prefix' | 'subword' | 'subwordSmart';
} }
export type InternalInlineSuggestOptions = Readonly<Required<IInlineSuggestOptions>>;
export interface IBracketPairColorizationOptions { export interface IBracketPairColorizationOptions {
/** /**
* Enable or disable bracket pair colorization. * Enable or disable bracket pair colorization.
@ -3891,13 +3883,22 @@ declare namespace monaco.editor {
enabled?: boolean; enabled?: boolean;
} }
export type InternalBracketPairColorizationOptions = Readonly<Required<IBracketPairColorizationOptions>>;
export interface IGuidesOptions { export interface IGuidesOptions {
/** /**
* Enable rendering of bracket pair guides. * Enable rendering of bracket pair guides.
* Defaults to false.
*/ */
bracketPairs?: boolean; bracketPairs?: boolean | 'active';
/**
* Enable rendering of vertical bracket pair guides.
* Defaults to 'active'.
*/
bracketPairsHorizontal?: boolean | 'active';
/**
* Enable highlighting of the active bracket pair.
* Defaults to true.
*/
highlightActiveBracketPair?: boolean;
/** /**
* Enable rendering of indent guides. * Enable rendering of indent guides.
* Defaults to true. * Defaults to true.
@ -3910,8 +3911,6 @@ declare namespace monaco.editor {
highlightActiveIndentation?: boolean; highlightActiveIndentation?: boolean;
} }
export type InternalGuidesOptions = Readonly<Required<IGuidesOptions>>;
/** /**
* Configuration options for editor suggest widget * Configuration options for editor suggest widget
*/ */
@ -4070,14 +4069,10 @@ declare namespace monaco.editor {
showSnippets?: boolean; showSnippets?: boolean;
} }
export type InternalSuggestOptions = Readonly<Required<ISuggestOptions>>;
export interface ISmartSelectOptions { export interface ISmartSelectOptions {
selectLeadingAndTrailingWhitespace?: boolean; selectLeadingAndTrailingWhitespace?: boolean;
} }
export type SmartSelectOptions = Readonly<Required<ISmartSelectOptions>>;
/** /**
* Describes how to indent wrapped lines. * Describes how to indent wrapped lines.
*/ */
@ -4240,6 +4235,7 @@ declare namespace monaco.editor {
layoutInfo = 129, layoutInfo = 129,
wrappingInfo = 130 wrappingInfo = 130
} }
export const EditorOptions: { export const EditorOptions: {
acceptSuggestionOnCommitCharacter: IEditorOption<EditorOption.acceptSuggestionOnCommitCharacter, boolean>; acceptSuggestionOnCommitCharacter: IEditorOption<EditorOption.acceptSuggestionOnCommitCharacter, boolean>;
acceptSuggestionOnEnter: IEditorOption<EditorOption.acceptSuggestionOnEnter, 'on' | 'off' | 'smart'>; acceptSuggestionOnEnter: IEditorOption<EditorOption.acceptSuggestionOnEnter, 'on' | 'off' | 'smart'>;
@ -4315,11 +4311,11 @@ declare namespace monaco.editor {
occurrencesHighlight: IEditorOption<EditorOption.occurrencesHighlight, boolean>; occurrencesHighlight: IEditorOption<EditorOption.occurrencesHighlight, boolean>;
overviewRulerBorder: IEditorOption<EditorOption.overviewRulerBorder, boolean>; overviewRulerBorder: IEditorOption<EditorOption.overviewRulerBorder, boolean>;
overviewRulerLanes: IEditorOption<EditorOption.overviewRulerLanes, number>; overviewRulerLanes: IEditorOption<EditorOption.overviewRulerLanes, number>;
padding: IEditorOption<EditorOption.padding, InternalEditorPaddingOptions>; padding: IEditorOption<EditorOption.padding, Readonly<Required<IEditorPaddingOptions>>>;
parameterHints: IEditorOption<EditorOption.parameterHints, Readonly<Required<IEditorParameterHintOptions>>>; parameterHints: IEditorOption<EditorOption.parameterHints, Readonly<Required<IEditorParameterHintOptions>>>;
peekWidgetDefaultFocus: IEditorOption<EditorOption.peekWidgetDefaultFocus, 'tree' | 'editor'>; peekWidgetDefaultFocus: IEditorOption<EditorOption.peekWidgetDefaultFocus, 'tree' | 'editor'>;
definitionLinkOpensInPeek: IEditorOption<EditorOption.definitionLinkOpensInPeek, boolean>; definitionLinkOpensInPeek: IEditorOption<EditorOption.definitionLinkOpensInPeek, boolean>;
quickSuggestions: IEditorOption<EditorOption.quickSuggestions, ValidQuickSuggestionsOptions>; quickSuggestions: IEditorOption<EditorOption.quickSuggestions, any>;
quickSuggestionsDelay: IEditorOption<EditorOption.quickSuggestionsDelay, number>; quickSuggestionsDelay: IEditorOption<EditorOption.quickSuggestionsDelay, number>;
readOnly: IEditorOption<EditorOption.readOnly, boolean>; readOnly: IEditorOption<EditorOption.readOnly, boolean>;
renameOnType: IEditorOption<EditorOption.renameOnType, boolean>; renameOnType: IEditorOption<EditorOption.renameOnType, boolean>;
@ -4693,7 +4689,7 @@ declare namespace monaco.editor {
*/ */
export interface IPasteEvent { export interface IPasteEvent {
readonly range: Range; readonly range: Range;
readonly mode: string | null; readonly languageId: string | null;
} }
export interface IEditorConstructionOptions extends IEditorOptions { export interface IEditorConstructionOptions extends IEditorOptions {
@ -4741,47 +4737,47 @@ declare namespace monaco.editor {
* An event emitted when the content of the current model has changed. * An event emitted when the content of the current model has changed.
* @event * @event
*/ */
onDidChangeModelContent(listener: (e: IModelContentChangedEvent) => void): IDisposable; onDidChangeModelContent: IEvent<IModelContentChangedEvent>;
/** /**
* An event emitted when the language of the current model has changed. * An event emitted when the language of the current model has changed.
* @event * @event
*/ */
onDidChangeModelLanguage(listener: (e: IModelLanguageChangedEvent) => void): IDisposable; onDidChangeModelLanguage: IEvent<IModelLanguageChangedEvent>;
/** /**
* An event emitted when the language configuration of the current model has changed. * An event emitted when the language configuration of the current model has changed.
* @event * @event
*/ */
onDidChangeModelLanguageConfiguration(listener: (e: IModelLanguageConfigurationChangedEvent) => void): IDisposable; onDidChangeModelLanguageConfiguration: IEvent<IModelLanguageConfigurationChangedEvent>;
/** /**
* An event emitted when the options of the current model has changed. * An event emitted when the options of the current model has changed.
* @event * @event
*/ */
onDidChangeModelOptions(listener: (e: IModelOptionsChangedEvent) => void): IDisposable; onDidChangeModelOptions: IEvent<IModelOptionsChangedEvent>;
/** /**
* An event emitted when the configuration of the editor has changed. (e.g. `editor.updateOptions()`) * An event emitted when the configuration of the editor has changed. (e.g. `editor.updateOptions()`)
* @event * @event
*/ */
onDidChangeConfiguration(listener: (e: ConfigurationChangedEvent) => void): IDisposable; onDidChangeConfiguration: IEvent<ConfigurationChangedEvent>;
/** /**
* An event emitted when the cursor position has changed. * An event emitted when the cursor position has changed.
* @event * @event
*/ */
onDidChangeCursorPosition(listener: (e: ICursorPositionChangedEvent) => void): IDisposable; onDidChangeCursorPosition: IEvent<ICursorPositionChangedEvent>;
/** /**
* An event emitted when the cursor selection has changed. * An event emitted when the cursor selection has changed.
* @event * @event
*/ */
onDidChangeCursorSelection(listener: (e: ICursorSelectionChangedEvent) => void): IDisposable; onDidChangeCursorSelection: IEvent<ICursorSelectionChangedEvent>;
/** /**
* An event emitted when the model of this editor has changed (e.g. `editor.setModel()`). * An event emitted when the model of this editor has changed (e.g. `editor.setModel()`).
* @event * @event
*/ */
onDidChangeModel(listener: (e: IModelChangedEvent) => void): IDisposable; onDidChangeModel: IEvent<IModelChangedEvent>;
/** /**
* An event emitted when the decorations of the current model have changed. * An event emitted when the decorations of the current model have changed.
* @event * @event
*/ */
onDidChangeModelDecorations(listener: (e: IModelDecorationsChangedEvent) => void): IDisposable; onDidChangeModelDecorations: IEvent<IModelDecorationsChangedEvent>;
/** /**
* An event emitted when the text inside this editor gained focus (i.e. cursor starts blinking). * An event emitted when the text inside this editor gained focus (i.e. cursor starts blinking).
* @event * @event
@ -4819,57 +4815,62 @@ declare namespace monaco.editor {
* An event emitted when users paste text in the editor. * An event emitted when users paste text in the editor.
* @event * @event
*/ */
onDidPaste(listener: (e: IPasteEvent) => void): IDisposable; onDidPaste: IEvent<IPasteEvent>;
/** /**
* An event emitted on a "mouseup". * An event emitted on a "mouseup".
* @event * @event
*/ */
onMouseUp(listener: (e: IEditorMouseEvent) => void): IDisposable; onMouseUp: IEvent<IEditorMouseEvent>;
/** /**
* An event emitted on a "mousedown". * An event emitted on a "mousedown".
* @event * @event
*/ */
onMouseDown(listener: (e: IEditorMouseEvent) => void): IDisposable; onMouseDown: IEvent<IEditorMouseEvent>;
/** /**
* An event emitted on a "contextmenu". * An event emitted on a "contextmenu".
* @event * @event
*/ */
onContextMenu(listener: (e: IEditorMouseEvent) => void): IDisposable; onContextMenu: IEvent<IEditorMouseEvent>;
/** /**
* An event emitted on a "mousemove". * An event emitted on a "mousemove".
* @event * @event
*/ */
onMouseMove(listener: (e: IEditorMouseEvent) => void): IDisposable; onMouseMove: IEvent<IEditorMouseEvent>;
/** /**
* An event emitted on a "mouseleave". * An event emitted on a "mouseleave".
* @event * @event
*/ */
onMouseLeave(listener: (e: IPartialEditorMouseEvent) => void): IDisposable; onMouseLeave: IEvent<IPartialEditorMouseEvent>;
/** /**
* An event emitted on a "keyup". * An event emitted on a "keyup".
* @event * @event
*/ */
onKeyUp(listener: (e: IKeyboardEvent) => void): IDisposable; onKeyUp: IEvent<IKeyboardEvent>;
/** /**
* An event emitted on a "keydown". * An event emitted on a "keydown".
* @event * @event
*/ */
onKeyDown(listener: (e: IKeyboardEvent) => void): IDisposable; onKeyDown: IEvent<IKeyboardEvent>;
/** /**
* An event emitted when the layout of the editor has changed. * An event emitted when the layout of the editor has changed.
* @event * @event
*/ */
onDidLayoutChange(listener: (e: EditorLayoutInfo) => void): IDisposable; onDidLayoutChange: IEvent<EditorLayoutInfo>;
/** /**
* An event emitted when the content width or content height in the editor has changed. * An event emitted when the content width or content height in the editor has changed.
* @event * @event
*/ */
onDidContentSizeChange(listener: (e: IContentSizeChangedEvent) => void): IDisposable; onDidContentSizeChange: IEvent<IContentSizeChangedEvent>;
/** /**
* An event emitted when the scroll in the editor has changed. * An event emitted when the scroll in the editor has changed.
* @event * @event
*/ */
onDidScrollChange(listener: (e: IScrollEvent) => void): IDisposable; onDidScrollChange: IEvent<IScrollEvent>;
/**
* An event emitted when hidden areas change in the editor (e.g. due to folding).
* @event
*/
onDidChangeHiddenAreas: IEvent<void>;
/** /**
* Saves current view state of the editor in a serializable object. * Saves current view state of the editor in a serializable object.
*/ */
@ -6690,7 +6691,7 @@ declare namespace monaco.languages {
} }
export interface InlayHintsProvider { export interface InlayHintsProvider {
onDidChangeInlayHints?: IEvent<void> | undefined; onDidChangeInlayHints?: IEvent<void>;
provideInlayHints(model: editor.ITextModel, range: Range, token: CancellationToken): ProviderResult<InlayHint[]>; provideInlayHints(model: editor.ITextModel, range: Range, token: CancellationToken): ProviderResult<InlayHint[]>;
} }

View file

@ -28,7 +28,7 @@ editor.addAction({
keybindings: [ keybindings: [
monaco.KeyMod.CtrlCmd | monaco.KeyCode.F10, monaco.KeyMod.CtrlCmd | monaco.KeyCode.F10,
// chord // chord
monaco.KeyMod.chord(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_K, monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_M) monaco.KeyMod.chord(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyK, monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyM)
], ],
// A precondition for this action. // A precondition for this action.