Merge from vscode a234f13c45b40a0929777cb440ee011b7549eed2 (#8911)

* Merge from vscode a234f13c45b40a0929777cb440ee011b7549eed2

* update distro

* fix layering

* update distro

* fix tests
This commit is contained in:
Anthony Dresser
2020-01-22 13:42:37 -08:00
committed by GitHub
parent 977111eb21
commit bd7aac8ee0
895 changed files with 24651 additions and 14520 deletions

556
src/vs/monaco.d.ts vendored
View File

@@ -405,6 +405,7 @@ declare namespace monaco {
readonly leftButton: boolean;
readonly middleButton: boolean;
readonly rightButton: boolean;
readonly buttons: number;
readonly target: HTMLElement;
readonly detail: number;
readonly posx: number;
@@ -1048,10 +1049,58 @@ declare namespace monaco.editor {
run(editor: ICodeEditor): void | Promise<void>;
}
/**
* Options which apply for all editors.
*/
export interface IGlobalEditorOptions {
/**
* The number of spaces a tab is equal to.
* This setting is overridden based on the file contents when `detectIndentation` is on.
* Defaults to 4.
*/
tabSize?: number;
/**
* Insert spaces when pressing `Tab`.
* This setting is overridden based on the file contents when detectIndentation` is on.
* Defaults to true.
*/
insertSpaces?: boolean;
/**
* Controls whether `tabSize` and `insertSpaces` will be automatically detected when a file is opened based on the file contents.
* Defaults to true.
*/
detectIndentation?: boolean;
/**
* Remove trailing auto inserted whitespace.
* Defaults to true.
*/
trimAutoWhitespace?: boolean;
/**
* Special handling for large files to disable certain memory intensive features.
* Defaults to true.
*/
largeFileOptimizations?: boolean;
/**
* Controls whether completions should be computed based on words in the document.
* Defaults to true.
*/
wordBasedSuggestions?: boolean;
/**
* Keep peek editors open even when double clicking their content or when hitting `Escape`.
* Defaults to false.
*/
stablePeek?: boolean;
/**
* Lines above this length will not be tokenized for performance reasons.
* Defaults to 20000.
*/
maxTokenizationLineLength?: number;
}
/**
* The options to create an editor.
*/
export interface IStandaloneEditorConstructionOptions extends IEditorConstructionOptions {
export interface IStandaloneEditorConstructionOptions extends IEditorConstructionOptions, IGlobalEditorOptions {
/**
* The initial model associated with this code editor.
*/
@@ -1096,6 +1145,7 @@ declare namespace monaco.editor {
}
export interface IStandaloneCodeEditor extends ICodeEditor {
updateOptions(newOptions: IEditorOptions & IGlobalEditorOptions): void;
addCommand(keybinding: number, handler: ICommandHandler, context?: string): string | null;
createContextKey<T>(key: string, defaultValue: T): IContextKey<T>;
addAction(descriptor: IActionDescriptor): IDisposable;
@@ -1857,14 +1907,14 @@ declare namespace monaco.editor {
* @param range The range to replace (delete). May be empty to represent a simple insert.
* @param text The text to replace with. May be null to represent a simple delete.
*/
addEditOperation(range: Range, text: string | null): void;
addEditOperation(range: Range, text: string | null, forceMoveMarkers?: boolean): void;
/**
* Add a new edit operation (a replace operation).
* The inverse edits will be accessible in `ICursorStateComputerData.getInverseEditOperations()`
* @param range The range to replace (delete). May be empty to represent a simple insert.
* @param text The text to replace with. May be null to represent a simple delete.
*/
addTrackedEditOperation(range: Range, text: string | null): void;
addTrackedEditOperation(range: Range, text: string | null, forceMoveMarkers?: boolean): void;
/**
* Track `selection` when applying edit operations.
* A best effort will be made to not grow/expand the selection.
@@ -1972,6 +2022,13 @@ declare namespace monaco.editor {
readonly charChanges: ICharChange[] | undefined;
}
export interface IContentSizeChangedEvent {
readonly contentWidth: number;
readonly contentHeight: number;
readonly contentWidthChanged: boolean;
readonly contentHeightChanged: boolean;
}
export interface INewScrollPosition {
scrollLeft?: number;
scrollTop?: number;
@@ -2424,6 +2481,15 @@ declare namespace monaco.editor {
readonly reason: CursorChangeReason;
}
export enum AccessibilitySupport {
/**
* This should be the browser case where it is not known if a screen reader is attached or no.
*/
Unknown = 0,
Disabled = 1,
Enabled = 2
}
/**
* Configuration options for auto closing quotes and brackets
*/
@@ -2439,6 +2505,17 @@ declare namespace monaco.editor {
*/
export type EditorAutoClosingOvertypeStrategy = 'always' | 'auto' | 'never';
/**
* Configuration options for auto indentation in the editor
*/
export enum EditorAutoIndentStrategy {
None = 0,
Keep = 1,
Brackets = 2,
Advanced = 3,
Full = 4
}
/**
* Configuration options for the editor.
*/
@@ -2658,21 +2735,21 @@ declare namespace monaco.editor {
* Defaults to 'same' in vscode and to 'none' in monaco-editor.
*/
wrappingIndent?: 'none' | 'same' | 'indent' | 'deepIndent';
/**
* Controls the wrapping algorithm to use.
* Defaults to 'monospace'.
*/
wrappingAlgorithm?: 'monospace' | 'dom';
/**
* Configure word wrapping characters. A break will be introduced before these characters.
* Defaults to '{([+'.
* Defaults to '([{‘“〈《「『【〔([{「£¥$£¥+'.
*/
wordWrapBreakBeforeCharacters?: string;
/**
* Configure word wrapping characters. A break will be introduced after these characters.
* Defaults to ' \t})]?|&,;'.
* Defaults to ' \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」'.
*/
wordWrapBreakAfterCharacters?: string;
/**
* Configure word wrapping characters. A break will be introduced after these characters only if no `wordWrapBreakBeforeCharacters` or `wordWrapBreakAfterCharacters` were found.
* Defaults to '.'.
*/
wordWrapBreakObtrusiveCharacters?: string;
/**
* Performance guard: Stop rendering a line after x characters.
* Defaults to 10000.
@@ -2861,7 +2938,7 @@ declare namespace monaco.editor {
*/
codeActionsOnSaveTimeout?: number;
/**
* Enable code folding
* Enable code folding.
* Defaults to true.
*/
folding?: boolean;
@@ -2870,6 +2947,11 @@ declare namespace monaco.editor {
* Defaults to 'auto'.
*/
foldingStrategy?: 'auto' | 'indentation';
/**
* Enable highlight for folded regions.
* Defaults to true.
*/
foldingHighlight?: boolean;
/**
* Controls whether the fold actions in the gutter stay always visible or hide unless the mouse is over the gutter.
* Defaults to 'mouseover'.
@@ -2933,6 +3015,11 @@ declare namespace monaco.editor {
* Controls fading out of unused variables.
*/
showUnused?: boolean;
/**
* Controls whether to focus the inline editor in the peek widget by default.
* Defaults to false.
*/
peekWidgetFocusInlineEditor?: boolean;
}
export interface IEditorConstructionOptions extends IEditorOptions {
@@ -2988,6 +3075,79 @@ declare namespace monaco.editor {
export class ConfigurationChangedEvent {
}
/**
* All computed editor options.
*/
export interface IComputedEditorOptions {
get<T extends EditorOption>(id: T): FindComputedEditorOptionValueById<T>;
}
export interface IEditorOption<K1 extends EditorOption, V> {
readonly id: K1;
readonly name: string;
defaultValue: V;
}
/**
* The kind of animation in which the editor's cursor should be rendered.
*/
export enum TextEditorCursorBlinkingStyle {
/**
* Hidden
*/
Hidden = 0,
/**
* Blinking
*/
Blink = 1,
/**
* Blinking with smooth fading
*/
Smooth = 2,
/**
* Blinking with prolonged filled state and smooth fading
*/
Phase = 3,
/**
* Expand collapse animation on the y axis
*/
Expand = 4,
/**
* No-Blinking
*/
Solid = 5
}
/**
* The style in which the editor's cursor should be rendered.
*/
export enum TextEditorCursorStyle {
/**
* As a vertical line (sitting between two characters).
*/
Line = 1,
/**
* As a block (sitting on top of a character).
*/
Block = 2,
/**
* As a horizontal line (sitting under a character).
*/
Underline = 3,
/**
* As a thin vertical line (sitting between two characters).
*/
LineThin = 4,
/**
* As an outlined block (sitting on top of a character).
*/
BlockOutline = 5,
/**
* As a thin horizontal line (sitting under a character).
*/
UnderlineThin = 6
}
/**
* Configuration options for editor find widget
*/
@@ -3003,6 +3163,8 @@ declare namespace monaco.editor {
addExtraSpaceOnTop?: boolean;
}
export type EditorFindOptions = Readonly<Required<IEditorFindOptions>>;
export type GoToLocationValues = 'peek' | 'gotoAndPeek' | 'goto';
/**
@@ -3022,6 +3184,8 @@ declare namespace monaco.editor {
alternativeReferenceCommand?: string;
}
export type GoToLocationOptions = Readonly<Required<IGotoLocationOptions>>;
/**
* Configuration options for editor hover
*/
@@ -3043,6 +3207,19 @@ declare namespace monaco.editor {
sticky?: boolean;
}
export type EditorHoverOptions = Readonly<Required<IEditorHoverOptions>>;
/**
* Configuration options for semantic highlighting
*/
export interface IEditorSemanticHighlightingOptions {
/**
* Enable semantic highlighting.
* Defaults to true.
*/
enabled?: boolean;
}
/**
* A description for the overview ruler position.
*/
@@ -3091,10 +3268,6 @@ declare namespace monaco.editor {
* The width of the glyph margin.
*/
readonly glyphMarginWidth: number;
/**
* The height of the glyph margin.
*/
readonly glyphMarginHeight: number;
/**
* Left position for the line numbers.
*/
@@ -3103,10 +3276,6 @@ declare namespace monaco.editor {
* The width of the line numbers.
*/
readonly lineNumbersWidth: number;
/**
* The height of the line numbers.
*/
readonly lineNumbersHeight: number;
/**
* Left position for the line decorations.
*/
@@ -3115,10 +3284,6 @@ declare namespace monaco.editor {
* The width of the line decorations.
*/
readonly decorationsWidth: number;
/**
* The height of the line decorations.
*/
readonly decorationsHeight: number;
/**
* Left position for the content (actual text)
*/
@@ -3127,10 +3292,6 @@ declare namespace monaco.editor {
* The width of the content (actual text)
*/
readonly contentWidth: number;
/**
* The height of the content (actual height)
*/
readonly contentHeight: number;
/**
* The position for the minimap
*/
@@ -3172,6 +3333,8 @@ declare namespace monaco.editor {
enabled?: boolean;
}
export type EditorLightbulbOptions = Readonly<Required<IEditorLightbulbOptions>>;
/**
* Configuration options for editor minimap
*/
@@ -3207,6 +3370,8 @@ declare namespace monaco.editor {
scale?: number;
}
export type EditorMinimapOptions = Readonly<Required<IEditorMinimapOptions>>;
/**
* Configuration options for parameter hints
*/
@@ -3223,6 +3388,8 @@ declare namespace monaco.editor {
cycle?: boolean;
}
export type InternalParameterHintOptions = Readonly<Required<IEditorParameterHintOptions>>;
/**
* Configuration options for quick suggestions
*/
@@ -3232,8 +3399,23 @@ declare namespace monaco.editor {
strings: boolean;
}
export type ValidQuickSuggestionsOptions = boolean | Readonly<Required<IQuickSuggestionsOptions>>;
export type LineNumbersType = 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string);
export enum RenderLineNumbersType {
Off = 0,
On = 1,
Relative = 2,
Interval = 3,
Custom = 4
}
export interface InternalEditorRenderLineNumbersOptions {
readonly renderType: RenderLineNumbersType;
readonly renderFn: ((lineNumber: number) => string) | null;
}
/**
* Configuration options for editor scrollbars
*/
@@ -3300,6 +3482,21 @@ declare namespace monaco.editor {
horizontalSliderSize?: number;
}
export interface InternalEditorScrollbarOptions {
readonly arrowSize: number;
readonly vertical: ScrollbarVisibility;
readonly horizontal: ScrollbarVisibility;
readonly useShadows: boolean;
readonly verticalHasArrows: boolean;
readonly horizontalHasArrows: boolean;
readonly handleMouseWheel: boolean;
readonly alwaysConsumeMouseWheel: boolean;
readonly horizontalScrollbarSize: number;
readonly horizontalSliderSize: number;
readonly verticalScrollbarSize: number;
readonly verticalSliderSize: number;
}
/**
* Configuration options for editor suggest widget
*/
@@ -3438,6 +3635,268 @@ declare namespace monaco.editor {
showSnippets?: boolean;
}
export type InternalSuggestOptions = Readonly<Required<ISuggestOptions>>;
/**
* Describes how to indent wrapped lines.
*/
export enum WrappingIndent {
/**
* No indentation => wrapped lines begin at column 1.
*/
None = 0,
/**
* Same => wrapped lines get the same indentation as the parent.
*/
Same = 1,
/**
* Indent => wrapped lines get +1 indentation toward the parent.
*/
Indent = 2,
/**
* DeepIndent => wrapped lines get +2 indentation toward the parent.
*/
DeepIndent = 3
}
export interface EditorWrappingInfo {
readonly isDominatedByLongLines: boolean;
readonly isWordWrapMinified: boolean;
readonly isViewportWrapping: boolean;
readonly wrappingColumn: number;
}
export enum EditorOption {
acceptSuggestionOnCommitCharacter = 0,
acceptSuggestionOnEnter = 1,
accessibilitySupport = 2,
accessibilityPageSize = 3,
ariaLabel = 4,
autoClosingBrackets = 5,
autoClosingOvertype = 6,
autoClosingQuotes = 7,
autoIndent = 8,
automaticLayout = 9,
autoSurround = 10,
codeLens = 11,
colorDecorators = 12,
contextmenu = 13,
copyWithSyntaxHighlighting = 14,
cursorBlinking = 15,
cursorSmoothCaretAnimation = 16,
cursorStyle = 17,
cursorSurroundingLines = 18,
cursorSurroundingLinesStyle = 19,
cursorWidth = 20,
disableLayerHinting = 21,
disableMonospaceOptimizations = 22,
dragAndDrop = 23,
emptySelectionClipboard = 24,
extraEditorClassName = 25,
fastScrollSensitivity = 26,
find = 27,
fixedOverflowWidgets = 28,
folding = 29,
foldingStrategy = 30,
foldingHighlight = 31,
fontFamily = 32,
fontInfo = 33,
fontLigatures = 34,
fontSize = 35,
fontWeight = 36,
formatOnPaste = 37,
formatOnType = 38,
glyphMargin = 39,
gotoLocation = 40,
hideCursorInOverviewRuler = 41,
highlightActiveIndentGuide = 42,
hover = 43,
inDiffEditor = 44,
letterSpacing = 45,
lightbulb = 46,
lineDecorationsWidth = 47,
lineHeight = 48,
lineNumbers = 49,
lineNumbersMinChars = 50,
links = 51,
matchBrackets = 52,
minimap = 53,
mouseStyle = 54,
mouseWheelScrollSensitivity = 55,
mouseWheelZoom = 56,
multiCursorMergeOverlapping = 57,
multiCursorModifier = 58,
multiCursorPaste = 59,
occurrencesHighlight = 60,
overviewRulerBorder = 61,
overviewRulerLanes = 62,
parameterHints = 63,
peekWidgetFocusInlineEditor = 64,
quickSuggestions = 65,
quickSuggestionsDelay = 66,
readOnly = 67,
renderControlCharacters = 68,
renderIndentGuides = 69,
renderFinalNewline = 70,
renderLineHighlight = 71,
renderWhitespace = 72,
revealHorizontalRightPadding = 73,
roundedSelection = 74,
rulers = 75,
scrollbar = 76,
scrollBeyondLastColumn = 77,
scrollBeyondLastLine = 78,
selectionClipboard = 79,
selectionHighlight = 80,
selectOnLineNumbers = 81,
semanticHighlighting = 82,
showFoldingControls = 83,
showUnused = 84,
snippetSuggestions = 85,
smoothScrolling = 86,
stopRenderingLineAfter = 87,
suggest = 88,
suggestFontSize = 89,
suggestLineHeight = 90,
suggestOnTriggerCharacters = 91,
suggestSelection = 92,
tabCompletion = 93,
useTabStops = 94,
wordSeparators = 95,
wordWrap = 96,
wordWrapBreakAfterCharacters = 97,
wordWrapBreakBeforeCharacters = 98,
wordWrapColumn = 99,
wordWrapMinified = 100,
wrappingIndent = 101,
wrappingAlgorithm = 102,
editorClassName = 103,
pixelRatio = 104,
tabFocusMode = 105,
layoutInfo = 106,
wrappingInfo = 107
}
export const EditorOptions: {
acceptSuggestionOnCommitCharacter: IEditorOption<EditorOption.acceptSuggestionOnCommitCharacter, boolean>;
acceptSuggestionOnEnter: IEditorOption<EditorOption.acceptSuggestionOnEnter, 'on' | 'off' | 'smart'>;
accessibilitySupport: IEditorOption<EditorOption.accessibilitySupport, AccessibilitySupport>;
accessibilityPageSize: IEditorOption<EditorOption.accessibilityPageSize, number>;
ariaLabel: IEditorOption<EditorOption.ariaLabel, string>;
autoClosingBrackets: IEditorOption<EditorOption.autoClosingBrackets, EditorAutoClosingStrategy>;
autoClosingOvertype: IEditorOption<EditorOption.autoClosingOvertype, EditorAutoClosingOvertypeStrategy>;
autoClosingQuotes: IEditorOption<EditorOption.autoClosingQuotes, EditorAutoClosingStrategy>;
autoIndent: IEditorOption<EditorOption.autoIndent, EditorAutoIndentStrategy>;
automaticLayout: IEditorOption<EditorOption.automaticLayout, boolean>;
autoSurround: IEditorOption<EditorOption.autoSurround, EditorAutoSurroundStrategy>;
codeLens: IEditorOption<EditorOption.codeLens, boolean>;
colorDecorators: IEditorOption<EditorOption.colorDecorators, boolean>;
contextmenu: IEditorOption<EditorOption.contextmenu, boolean>;
copyWithSyntaxHighlighting: IEditorOption<EditorOption.copyWithSyntaxHighlighting, boolean>;
cursorBlinking: IEditorOption<EditorOption.cursorBlinking, TextEditorCursorBlinkingStyle>;
cursorSmoothCaretAnimation: IEditorOption<EditorOption.cursorSmoothCaretAnimation, boolean>;
cursorStyle: IEditorOption<EditorOption.cursorStyle, TextEditorCursorStyle>;
cursorSurroundingLines: IEditorOption<EditorOption.cursorSurroundingLines, number>;
cursorSurroundingLinesStyle: IEditorOption<EditorOption.cursorSurroundingLinesStyle, 'default' | 'all'>;
cursorWidth: IEditorOption<EditorOption.cursorWidth, number>;
disableLayerHinting: IEditorOption<EditorOption.disableLayerHinting, boolean>;
disableMonospaceOptimizations: IEditorOption<EditorOption.disableMonospaceOptimizations, boolean>;
dragAndDrop: IEditorOption<EditorOption.dragAndDrop, boolean>;
emptySelectionClipboard: IEditorOption<EditorOption.emptySelectionClipboard, boolean>;
extraEditorClassName: IEditorOption<EditorOption.extraEditorClassName, string>;
fastScrollSensitivity: IEditorOption<EditorOption.fastScrollSensitivity, number>;
find: IEditorOption<EditorOption.find, EditorFindOptions>;
fixedOverflowWidgets: IEditorOption<EditorOption.fixedOverflowWidgets, boolean>;
folding: IEditorOption<EditorOption.folding, boolean>;
foldingStrategy: IEditorOption<EditorOption.foldingStrategy, 'auto' | 'indentation'>;
foldingHighlight: IEditorOption<EditorOption.foldingHighlight, boolean>;
fontFamily: IEditorOption<EditorOption.fontFamily, string>;
fontInfo: IEditorOption<EditorOption.fontInfo, FontInfo>;
fontLigatures2: IEditorOption<EditorOption.fontLigatures, string>;
fontSize: IEditorOption<EditorOption.fontSize, number>;
fontWeight: IEditorOption<EditorOption.fontWeight, string>;
formatOnPaste: IEditorOption<EditorOption.formatOnPaste, boolean>;
formatOnType: IEditorOption<EditorOption.formatOnType, boolean>;
glyphMargin: IEditorOption<EditorOption.glyphMargin, boolean>;
gotoLocation: IEditorOption<EditorOption.gotoLocation, GoToLocationOptions>;
hideCursorInOverviewRuler: IEditorOption<EditorOption.hideCursorInOverviewRuler, boolean>;
highlightActiveIndentGuide: IEditorOption<EditorOption.highlightActiveIndentGuide, boolean>;
hover: IEditorOption<EditorOption.hover, EditorHoverOptions>;
inDiffEditor: IEditorOption<EditorOption.inDiffEditor, boolean>;
letterSpacing: IEditorOption<EditorOption.letterSpacing, number>;
lightbulb: IEditorOption<EditorOption.lightbulb, EditorLightbulbOptions>;
lineDecorationsWidth: IEditorOption<EditorOption.lineDecorationsWidth, string | number>;
lineHeight: IEditorOption<EditorOption.lineHeight, number>;
lineNumbers: IEditorOption<EditorOption.lineNumbers, InternalEditorRenderLineNumbersOptions>;
lineNumbersMinChars: IEditorOption<EditorOption.lineNumbersMinChars, number>;
links: IEditorOption<EditorOption.links, boolean>;
matchBrackets: IEditorOption<EditorOption.matchBrackets, 'always' | 'never' | 'near'>;
minimap: IEditorOption<EditorOption.minimap, EditorMinimapOptions>;
mouseStyle: IEditorOption<EditorOption.mouseStyle, 'default' | 'text' | 'copy'>;
mouseWheelScrollSensitivity: IEditorOption<EditorOption.mouseWheelScrollSensitivity, number>;
mouseWheelZoom: IEditorOption<EditorOption.mouseWheelZoom, boolean>;
multiCursorMergeOverlapping: IEditorOption<EditorOption.multiCursorMergeOverlapping, boolean>;
multiCursorModifier: IEditorOption<EditorOption.multiCursorModifier, 'altKey' | 'metaKey' | 'ctrlKey'>;
multiCursorPaste: IEditorOption<EditorOption.multiCursorPaste, 'spread' | 'full'>;
occurrencesHighlight: IEditorOption<EditorOption.occurrencesHighlight, boolean>;
overviewRulerBorder: IEditorOption<EditorOption.overviewRulerBorder, boolean>;
overviewRulerLanes: IEditorOption<EditorOption.overviewRulerLanes, number>;
parameterHints: IEditorOption<EditorOption.parameterHints, InternalParameterHintOptions>;
peekWidgetFocusInlineEditor: IEditorOption<EditorOption.peekWidgetFocusInlineEditor, boolean>;
quickSuggestions: IEditorOption<EditorOption.quickSuggestions, ValidQuickSuggestionsOptions>;
quickSuggestionsDelay: IEditorOption<EditorOption.quickSuggestionsDelay, number>;
readOnly: IEditorOption<EditorOption.readOnly, boolean>;
renderControlCharacters: IEditorOption<EditorOption.renderControlCharacters, boolean>;
renderIndentGuides: IEditorOption<EditorOption.renderIndentGuides, boolean>;
renderFinalNewline: IEditorOption<EditorOption.renderFinalNewline, boolean>;
renderLineHighlight: IEditorOption<EditorOption.renderLineHighlight, 'all' | 'line' | 'none' | 'gutter'>;
renderWhitespace: IEditorOption<EditorOption.renderWhitespace, 'all' | 'none' | 'boundary' | 'selection'>;
revealHorizontalRightPadding: IEditorOption<EditorOption.revealHorizontalRightPadding, number>;
roundedSelection: IEditorOption<EditorOption.roundedSelection, boolean>;
rulers: IEditorOption<EditorOption.rulers, {}>;
scrollbar: IEditorOption<EditorOption.scrollbar, InternalEditorScrollbarOptions>;
scrollBeyondLastColumn: IEditorOption<EditorOption.scrollBeyondLastColumn, number>;
scrollBeyondLastLine: IEditorOption<EditorOption.scrollBeyondLastLine, boolean>;
selectionClipboard: IEditorOption<EditorOption.selectionClipboard, boolean>;
selectionHighlight: IEditorOption<EditorOption.selectionHighlight, boolean>;
selectOnLineNumbers: IEditorOption<EditorOption.selectOnLineNumbers, boolean>;
semanticHighlighting: IEditorOption<EditorOption.semanticHighlighting, any>;
showFoldingControls: IEditorOption<EditorOption.showFoldingControls, 'always' | 'mouseover'>;
showUnused: IEditorOption<EditorOption.showUnused, boolean>;
snippetSuggestions: IEditorOption<EditorOption.snippetSuggestions, 'none' | 'top' | 'bottom' | 'inline'>;
smoothScrolling: IEditorOption<EditorOption.smoothScrolling, boolean>;
stopRenderingLineAfter: IEditorOption<EditorOption.stopRenderingLineAfter, number>;
suggest: IEditorOption<EditorOption.suggest, InternalSuggestOptions>;
suggestFontSize: IEditorOption<EditorOption.suggestFontSize, number>;
suggestLineHeight: IEditorOption<EditorOption.suggestLineHeight, number>;
suggestOnTriggerCharacters: IEditorOption<EditorOption.suggestOnTriggerCharacters, boolean>;
suggestSelection: IEditorOption<EditorOption.suggestSelection, 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix'>;
tabCompletion: IEditorOption<EditorOption.tabCompletion, 'on' | 'off' | 'onlySnippets'>;
useTabStops: IEditorOption<EditorOption.useTabStops, boolean>;
wordSeparators: IEditorOption<EditorOption.wordSeparators, string>;
wordWrap: IEditorOption<EditorOption.wordWrap, 'on' | 'off' | 'wordWrapColumn' | 'bounded'>;
wordWrapBreakAfterCharacters: IEditorOption<EditorOption.wordWrapBreakAfterCharacters, string>;
wordWrapBreakBeforeCharacters: IEditorOption<EditorOption.wordWrapBreakBeforeCharacters, string>;
wordWrapColumn: IEditorOption<EditorOption.wordWrapColumn, number>;
wordWrapMinified: IEditorOption<EditorOption.wordWrapMinified, boolean>;
wrappingIndent: IEditorOption<EditorOption.wrappingIndent, WrappingIndent>;
wrappingAlgorithm: IEditorOption<EditorOption.wrappingAlgorithm, 'monospace' | 'dom'>;
editorClassName: IEditorOption<EditorOption.editorClassName, string>;
pixelRatio: IEditorOption<EditorOption.pixelRatio, number>;
tabFocusMode: IEditorOption<EditorOption.tabFocusMode, boolean>;
layoutInfo: IEditorOption<EditorOption.layoutInfo, EditorLayoutInfo>;
wrappingInfo: IEditorOption<EditorOption.wrappingInfo, EditorWrappingInfo>;
};
type EditorOptionsType = typeof EditorOptions;
type FindEditorOptionsKeyById<T extends EditorOption> = {
[K in keyof EditorOptionsType]: EditorOptionsType[K]['id'] extends T ? K : never;
}[keyof EditorOptionsType];
type ComputedEditorOptionValue<T extends IEditorOption<any, any>> = T extends IEditorOption<any, infer R> ? R : never;
export type FindComputedEditorOptionValueById<T extends EditorOption> = NonNullable<ComputedEditorOptionValue<EditorOptionsType[FindEditorOptionsKeyById<T>]>>;
/**
* A view zone is a full horizontal rectangle that 'pushes' text down.
* The editor reserves space for view zones when rendering.
@@ -3852,6 +4311,11 @@ declare namespace monaco.editor {
* @event
*/
onDidLayoutChange(listener: (e: EditorLayoutInfo) => void): IDisposable;
/**
* An event emitted when the content width or content height in the editor has changed.
* @event
*/
onDidContentSizeChange(listener: (e: IContentSizeChangedEvent) => void): IDisposable;
/**
* An event emitted when the scroll in the editor has changed.
* @event
@@ -3888,6 +4352,14 @@ declare namespace monaco.editor {
* It is safe to call setModel(null) to simply detach the current model from the editor.
*/
setModel(model: ITextModel | null): void;
/**
* Gets all the editor computed options.
*/
getOptions(): IComputedEditorOptions;
/**
* Gets a specific editor option.
*/
getOption<T extends EditorOption>(id: T): FindComputedEditorOptionValueById<T>;
/**
* Returns the editor's configuration (without any validation or defaults).
*/
@@ -3905,6 +4377,11 @@ declare namespace monaco.editor {
* @see `ITextModel.setValue`
*/
setValue(newValue: string): void;
/**
* Get the width of the editor's content.
* This is information that is "erased" when computing `scrollWidth = Math.max(contentWidth, width)`
*/
getContentWidth(): number;
/**
* Get the scrollWidth of the editor's viewport.
*/
@@ -3913,6 +4390,11 @@ declare namespace monaco.editor {
* Get the scrollLeft of the editor's viewport.
*/
getScrollLeft(): number;
/**
* Get the height of the editor's content.
* This is information that is "erased" when computing `scrollHeight = Math.max(contentHeight, height)`
*/
getContentHeight(): number;
/**
* Get the scrollHeight of the editor's viewport.
*/
@@ -4804,6 +5286,7 @@ declare namespace monaco.languages {
export interface CompletionList {
suggestions: CompletionItem[];
incomplete?: boolean;
isDetailsResolved?: boolean;
dispose?(): void;
}
@@ -5395,7 +5878,7 @@ declare namespace monaco.languages {
constructor(value: string);
}
export interface ResourceFileEdit {
export interface WorkspaceFileEdit {
oldUri?: Uri;
newUri?: Uri;
options?: {
@@ -5406,14 +5889,14 @@ declare namespace monaco.languages {
};
}
export interface ResourceTextEdit {
export interface WorkspaceTextEdit {
resource: Uri;
modelVersionId?: number;
edits: TextEdit[];
}
export interface WorkspaceEdit {
edits: Array<ResourceTextEdit | ResourceFileEdit>;
edits: Array<WorkspaceTextEdit | WorkspaceFileEdit>;
}
export interface Rejection {
@@ -5475,10 +5958,15 @@ declare namespace monaco.languages {
readonly edits: SemanticTokensEdit[];
}
export interface SemanticTokensProvider {
export interface DocumentSemanticTokensProvider {
getLegend(): SemanticTokensLegend;
provideSemanticTokens(model: editor.ITextModel, lastResultId: string | null, ranges: Range[] | null, token: CancellationToken): ProviderResult<SemanticTokens | SemanticTokensEdits>;
releaseSemanticTokens(resultId: string | undefined): void;
provideDocumentSemanticTokens(model: editor.ITextModel, lastResultId: string | null, token: CancellationToken): ProviderResult<SemanticTokens | SemanticTokensEdits>;
releaseDocumentSemanticTokens(resultId: string | undefined): void;
}
export interface DocumentRangeSemanticTokensProvider {
getLegend(): SemanticTokensLegend;
provideDocumentRangeSemanticTokens(model: editor.ITextModel, range: Range, token: CancellationToken): ProviderResult<SemanticTokens>;
}
export interface ILanguageExtensionPoint {
@@ -5639,4 +6127,4 @@ declare namespace monaco.worker {
}
//dtsv=2
//dtsv=3