import { IMarkdownString } from "../../../base/common/htmlContent.js"; import { ScrollbarVisibility } from "../../../base/common/scrollable.js"; import { FontInfo } from "./fontInfo.js"; import { AccessibilitySupport } from "../../../platform/accessibility/common/accessibility.js"; import { IConfigurationPropertySchema } from "../../../platform/configuration/common/configurationRegistry.js"; /** * Configuration options for auto closing quotes and brackets */ export type EditorAutoClosingStrategy = "always" | "languageDefined" | "beforeWhitespace" | "never"; /** * Configuration options for auto wrapping quotes and brackets */ export type EditorAutoSurroundStrategy = "languageDefined" | "quotes" | "brackets" | "never"; /** * Configuration options for typing over closing quotes or brackets */ export type EditorAutoClosingEditStrategy = "always" | "auto" | "never"; /** * Configuration options for auto indentation in the editor */ export declare enum EditorAutoIndentStrategy { None = 0, Keep = 1, Brackets = 2, Advanced = 3, Full = 4 } /** * Configuration options for the editor. */ export type IEditorOptions = import("monaco-editor").editor.IEditorOptions; /** * @internal * The width of the minimap gutter, in pixels. */ export declare const MINIMAP_GUTTER_WIDTH = 8; export interface IDiffEditorBaseOptions { /** * Allow the user to resize the diff editor split view. * Defaults to true. */ enableSplitViewResizing?: boolean; /** * The default ratio when rendering side-by-side editors. * Must be a number between 0 and 1, min sizes apply. * Defaults to 0.5 */ splitViewDefaultRatio?: number; /** * Render the differences in two side-by-side editors. * Defaults to true. */ renderSideBySide?: boolean; /** * When `renderSideBySide` is enabled, `useInlineViewWhenSpaceIsLimited` is set, * and the diff editor has a width less than `renderSideBySideInlineBreakpoint`, the inline view is used. */ renderSideBySideInlineBreakpoint?: number | undefined; /** * When `renderSideBySide` is enabled, `useInlineViewWhenSpaceIsLimited` is set, * and the diff editor has a width less than `renderSideBySideInlineBreakpoint`, the inline view is used. */ useInlineViewWhenSpaceIsLimited?: boolean; /** * If set, the diff editor is optimized for small views. * Defaults to `false`. */ compactMode?: boolean; /** * Timeout in milliseconds after which diff computation is cancelled. * Defaults to 5000. */ maxComputationTime?: number; /** * Maximum supported file size in MB. * Defaults to 50. */ maxFileSize?: number; /** * Compute the diff by ignoring leading/trailing whitespace * Defaults to true. */ ignoreTrimWhitespace?: boolean; /** * Render +/- indicators for added/deleted changes. * Defaults to true. */ renderIndicators?: boolean; /** * Shows icons in the glyph margin to revert changes. * Default to true. */ renderMarginRevertIcon?: boolean; /** * Indicates if the gutter menu should be rendered. */ renderGutterMenu?: boolean; /** * Original model should be editable? * Defaults to false. */ originalEditable?: boolean; /** * Should the diff editor enable code lens? * Defaults to false. */ diffCodeLens?: 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"; /** * Diff Algorithm */ diffAlgorithm?: "legacy" | "advanced"; /** * Whether the diff editor aria label should be verbose. */ accessibilityVerbose?: boolean; experimental?: { /** * Defaults to false. */ showMoves?: boolean; showEmptyDecorations?: boolean; /** * Only applies when `renderSideBySide` is set to false. */ useTrueInlineView?: boolean; }; /** * Is the diff editor inside another editor * Defaults to false */ isInEmbeddedEditor?: boolean; /** * If the diff editor should only show the difference review mode. */ onlyShowAccessibleDiffViewer?: boolean; hideUnchangedRegions?: { enabled?: boolean; revealLineCount?: number; minimumLineCount?: number; contextLineCount?: number; }; } /** * Configuration options for the diff editor. */ export interface IDiffEditorOptions extends IEditorOptions, IDiffEditorBaseOptions { } /** * @internal */ export type ValidDiffEditorBaseOptions = Readonly>; /** * An event describing that the configuration of the editor has changed. */ export declare class ConfigurationChangedEvent { private readonly _values; /** * @internal */ constructor(values: boolean[]); hasChanged(id: EditorOption): boolean; } /** * All computed editor options. */ export interface IComputedEditorOptions { get(id: T): FindComputedEditorOptionValueById; } /** * @internal */ export interface IEnvironmentalOptions { readonly memory: ComputeOptionsMemory | null; readonly outerWidth: number; readonly outerHeight: number; readonly fontInfo: FontInfo; readonly extraEditorClassName: string; readonly isDominatedByLongLines: boolean; readonly viewLineCount: number; readonly lineNumbersDigitCount: number; readonly emptySelectionClipboard: boolean; readonly pixelRatio: number; readonly tabFocusMode: boolean; readonly inputMode: "insert" | "overtype"; readonly accessibilitySupport: AccessibilitySupport; readonly glyphMarginDecorationLaneCount: number; readonly editContextSupported: boolean; } /** * @internal */ export declare class ComputeOptionsMemory { stableMinimapLayoutInput: IMinimapLayoutInput | null; stableFitMaxMinimapScale: number; stableFitRemainingWidth: number; constructor(); } export interface IEditorOption { readonly id: K; readonly name: string; defaultValue: V; /** * @internal */ readonly schema: IConfigurationPropertySchema | { [path: string]: IConfigurationPropertySchema; } | undefined; /** * @internal */ validate(input: unknown): V; /** * @internal */ compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: V): V; /** * Might modify `value`. */ applyUpdate(value: V | undefined, update: V): ApplyUpdateResult; } /** * @internal */ type PossibleKeyName0 = { [K in keyof IEditorOptions]: IEditorOptions[K] extends V | undefined ? K : never; }[keyof IEditorOptions]; /** * @internal */ type PossibleKeyName = NonNullable>; /** * @internal */ declare abstract class BaseEditorOption implements IEditorOption { readonly id: K; readonly name: string; readonly defaultValue: V; readonly schema: IConfigurationPropertySchema | { [path: string]: IConfigurationPropertySchema; } | undefined; constructor(id: K, name: PossibleKeyName, defaultValue: V, schema?: IConfigurationPropertySchema | { [path: string]: IConfigurationPropertySchema; }); applyUpdate(value: V | undefined, update: V): ApplyUpdateResult; abstract validate(input: unknown): V; compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: V): V; } export declare class ApplyUpdateResult { readonly newValue: T; readonly didChange: boolean; constructor(newValue: T, didChange: boolean); } /** * @internal */ declare abstract class ComputedEditorOption implements IEditorOption { readonly id: K; readonly name: "_never_"; readonly defaultValue: V; readonly schema: IConfigurationPropertySchema | undefined; constructor(id: K, defaultValue: V); applyUpdate(value: V | undefined, update: V): ApplyUpdateResult; validate(input: unknown): V; abstract compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: V): V; } /** * @internal */ export declare function boolean(value: unknown, defaultValue: boolean): boolean; /** * @internal */ export declare function clampedInt(value: unknown, defaultValue: T, minimum: number, maximum: number): number | T; /** * @internal */ export declare function clampedFloat(value: unknown, defaultValue: T, minimum: number, maximum: number): number | T; /** * @internal */ export declare function stringSet(value: unknown, defaultValue: T, allowedValues: ReadonlyArray, renamedValues?: Record): T; /** * Configuration options for editor comments */ export interface IEditorCommentsOptions { /** * Insert a space after the line comment token and inside the block comments tokens. * Defaults to true. */ insertSpace?: boolean; /** * Ignore empty lines when inserting line comments. * Defaults to true. */ ignoreEmptyLines?: boolean; } /** * @internal */ export type EditorCommentsOptions = Readonly>; /** * The kind of animation in which the editor's cursor should be rendered. */ export declare 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 } /** * @internal */ export declare function cursorBlinkingStyleFromString(cursorBlinkingStyle: "blink" | "smooth" | "phase" | "expand" | "solid"): TextEditorCursorBlinkingStyle; /** * The style in which the editor's cursor should be rendered. */ export declare 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 } /** * @internal */ export declare function cursorStyleToString(cursorStyle: TextEditorCursorStyle): "line" | "block" | "underline" | "line-thin" | "block-outline" | "underline-thin"; /** * @internal */ export declare function cursorStyleFromString(cursorStyle: "line" | "block" | "underline" | "line-thin" | "block-outline" | "underline-thin"): TextEditorCursorStyle; /** * Configuration options for editor find widget */ export interface IEditorFindOptions { /** * Controls whether the cursor should move to find matches while typing. */ cursorMoveOnType?: boolean; /** * Controls whether the find widget should search as you type. */ findOnType?: boolean; /** * Controls if we seed search string in the Find Widget with editor selection. */ seedSearchStringFromSelection?: "never" | "always" | "selection"; /** * Controls if Find in Selection flag is turned on in the editor. */ autoFindInSelection?: "never" | "always" | "multiline"; addExtraSpaceOnTop?: boolean; /** * @internal * Controls if the Find Widget should read or modify the shared find clipboard on macOS */ globalFindClipboard?: boolean; /** * Controls whether the search result and diff result automatically restarts from the beginning (or the end) when no further matches can be found */ loop?: boolean; /** * @internal * Controls how the find widget search history should be stored */ history?: "never" | "workspace"; /** * @internal * Controls how the replace widget search history should be stored */ replaceHistory?: "never" | "workspace"; } /** * @internal */ export type EditorFindOptions = Readonly>; /** * @internal */ export declare class EditorFontLigatures extends BaseEditorOption { static OFF: string; static ON: string; constructor(); validate(input: unknown): string; } /** * @internal */ export declare class EditorFontVariations extends BaseEditorOption { static OFF: string; static TRANSLATE: string; constructor(); validate(input: unknown): string; compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: string): string; } export type GoToLocationValues = "peek" | "gotoAndPeek" | "goto"; /** * Configuration options for go to location */ export interface IGotoLocationOptions { multiple?: GoToLocationValues; multipleDefinitions?: GoToLocationValues; multipleTypeDefinitions?: GoToLocationValues; multipleDeclarations?: GoToLocationValues; multipleImplementations?: GoToLocationValues; multipleReferences?: GoToLocationValues; multipleTests?: GoToLocationValues; alternativeDefinitionCommand?: string; alternativeTypeDefinitionCommand?: string; alternativeDeclarationCommand?: string; alternativeImplementationCommand?: string; alternativeReferenceCommand?: string; alternativeTestsCommand?: string; } /** * @internal */ export type GoToLocationOptions = Readonly>; /** * Configuration options for editor hover */ export interface IEditorHoverOptions { /** * Enable the hover. * Defaults to 'on'. */ enabled?: "on" | "off" | "onKeyboardModifier"; /** * Delay for showing the hover. * Defaults to 300. */ delay?: number; /** * Is the hover sticky such that it can be clicked and its contents selected? * Defaults to true. */ sticky?: boolean; /** * Controls how long the hover is visible after you hovered out of it. * Require sticky setting to be true. */ hidingDelay?: number; /** * Should the hover be shown above the line if possible? * Defaults to false. */ above?: boolean; /** * Should long line warning hovers be shown (tokenization skipped, rendering paused)? * Defaults to true. */ showLongLineWarning?: boolean; } /** * @internal */ export type EditorHoverOptions = Readonly>; /** * A description for the overview ruler position. */ export interface OverviewRulerPosition { /** * Width of the overview ruler */ readonly width: number; /** * Height of the overview ruler */ readonly height: number; /** * Top position for the overview ruler */ readonly top: number; /** * Right position for the overview ruler */ readonly right: number; } export declare enum RenderMinimap { None = 0, Text = 1, Blocks = 2 } /** * The internal layout details of the editor. */ export interface EditorLayoutInfo { /** * Full editor width. */ readonly width: number; /** * Full editor height. */ readonly height: number; /** * Left position for the glyph margin. */ readonly glyphMarginLeft: number; /** * The width of the glyph margin. */ readonly glyphMarginWidth: number; /** * The number of decoration lanes to render in the glyph margin. */ readonly glyphMarginDecorationLaneCount: number; /** * Left position for the line numbers. */ readonly lineNumbersLeft: number; /** * The width of the line numbers. */ readonly lineNumbersWidth: number; /** * Left position for the line decorations. */ readonly decorationsLeft: number; /** * The width of the line decorations. */ readonly decorationsWidth: number; /** * Left position for the content (actual text) */ readonly contentLeft: number; /** * The width of the content (actual text) */ readonly contentWidth: number; /** * Layout information for the minimap */ readonly minimap: EditorMinimapLayoutInfo; /** * The number of columns (of typical characters) fitting on a viewport line. */ readonly viewportColumn: number; readonly isWordWrapMinified: boolean; readonly isViewportWrapping: boolean; readonly wrappingColumn: number; /** * The width of the vertical scrollbar. */ readonly verticalScrollbarWidth: number; /** * The height of the horizontal scrollbar. */ readonly horizontalScrollbarHeight: number; /** * The position of the overview ruler. */ readonly overviewRuler: OverviewRulerPosition; } /** * The internal layout details of the editor. */ export interface EditorMinimapLayoutInfo { readonly renderMinimap: RenderMinimap; readonly minimapLeft: number; readonly minimapWidth: number; readonly minimapHeightIsEditorHeight: boolean; readonly minimapIsSampling: boolean; readonly minimapScale: number; readonly minimapLineHeight: number; readonly minimapCanvasInnerWidth: number; readonly minimapCanvasInnerHeight: number; readonly minimapCanvasOuterWidth: number; readonly minimapCanvasOuterHeight: number; } /** * @internal */ export interface EditorLayoutInfoComputerEnv { readonly memory: ComputeOptionsMemory | null; readonly outerWidth: number; readonly outerHeight: number; readonly isDominatedByLongLines: boolean; readonly lineHeight: number; readonly viewLineCount: number; readonly lineNumbersDigitCount: number; readonly typicalHalfwidthCharacterWidth: number; readonly maxDigitWidth: number; readonly pixelRatio: number; readonly glyphMarginDecorationLaneCount: number; } /** * @internal */ export interface IEditorLayoutComputerInput { readonly outerWidth: number; readonly outerHeight: number; readonly isDominatedByLongLines: boolean; readonly lineHeight: number; readonly lineNumbersDigitCount: number; readonly typicalHalfwidthCharacterWidth: number; readonly maxDigitWidth: number; readonly pixelRatio: number; readonly glyphMargin: boolean; readonly lineDecorationsWidth: string | number; readonly folding: boolean; readonly minimap: Readonly>; readonly scrollbar: InternalEditorScrollbarOptions; readonly lineNumbers: InternalEditorRenderLineNumbersOptions; readonly lineNumbersMinChars: number; readonly scrollBeyondLastLine: boolean; readonly wordWrap: "wordWrapColumn" | "on" | "off" | "bounded"; readonly wordWrapColumn: number; readonly wordWrapMinified: boolean; readonly accessibilitySupport: AccessibilitySupport; } /** * @internal */ export interface IMinimapLayoutInput { readonly outerWidth: number; readonly outerHeight: number; readonly lineHeight: number; readonly typicalHalfwidthCharacterWidth: number; readonly pixelRatio: number; readonly scrollBeyondLastLine: boolean; readonly paddingTop: number; readonly paddingBottom: number; readonly minimap: Readonly>; readonly verticalScrollbarWidth: number; readonly viewLineCount: number; readonly remainingWidth: number; readonly isViewportWrapping: boolean; } /** * @internal */ export declare class EditorLayoutInfoComputer extends ComputedEditorOption { constructor(); compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, _: EditorLayoutInfo): EditorLayoutInfo; static computeContainedMinimapLineCount(input: { viewLineCount: number; scrollBeyondLastLine: boolean; paddingTop: number; paddingBottom: number; height: number; lineHeight: number; pixelRatio: number; }): { typicalViewportLineCount: number; extraLinesBeforeFirstLine: number; extraLinesBeyondLastLine: number; desiredRatio: number; minimapLineCount: number; }; private static _computeMinimapLayout; static computeLayout(options: IComputedEditorOptions, env: EditorLayoutInfoComputerEnv): EditorLayoutInfo; } export declare enum ShowLightbulbIconMode { Off = "off", OnCode = "onCode", On = "on" } /** * Configuration options for editor lightbulb */ export interface IEditorLightbulbOptions { /** * Enable the lightbulb code action. * The three possible values are `off`, `on` and `onCode` and the default is `onCode`. * `off` disables the code action menu. * `on` shows the code action menu on code and on empty lines. * `onCode` shows the code action menu on code only. */ enabled?: ShowLightbulbIconMode; } /** * @internal */ export type EditorLightbulbOptions = Readonly>; export interface IEditorStickyScrollOptions { /** * Enable the sticky scroll */ enabled?: boolean; /** * Maximum number of sticky lines to show */ maxLineCount?: number; /** * Model to choose for sticky scroll by default */ defaultModel?: "outlineModel" | "foldingProviderModel" | "indentationModel"; /** * Define whether to scroll sticky scroll with editor horizontal scrollbae */ scrollWithEditor?: boolean; } /** * @internal */ export type EditorStickyScrollOptions = Readonly>; /** * Configuration options for editor inlayHints */ export interface IEditorInlayHintsOptions { /** * Enable the inline hints. * Defaults to true. */ enabled?: "on" | "off" | "offUnlessPressed" | "onUnlessPressed"; /** * 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; /** * Enables the padding around the inlay hint. * Defaults to false. */ padding?: boolean; /** * Maximum length for inlay hints per line * Set to 0 to have an unlimited length. */ maximumLength?: number; } /** * @internal */ export type EditorInlayHintsOptions = Readonly>; /** * Configuration options for editor minimap */ export interface IEditorMinimapOptions { /** * Enable the rendering of the minimap. * Defaults to true. */ enabled?: boolean; /** * Control the rendering of minimap. */ autohide?: "none" | "mouseover" | "scroll"; /** * Control the side of the minimap in editor. * Defaults to 'right'. */ side?: "right" | "left"; /** * Control the minimap rendering mode. * Defaults to 'actual'. */ size?: "proportional" | "fill" | "fit"; /** * Control the rendering of the minimap slider. * Defaults to 'mouseover'. */ showSlider?: "always" | "mouseover"; /** * Render the actual text on a line (as opposed to color blocks). * Defaults to true. */ renderCharacters?: boolean; /** * Limit the width of the minimap to render at most a certain number of columns. * Defaults to 120. */ maxColumn?: number; /** * Relative size of the font in the minimap. Defaults to 1. */ scale?: number; /** * Whether to show named regions as section headers. Defaults to true. */ showRegionSectionHeaders?: boolean; /** * Whether to show MARK: comments as section headers. Defaults to true. */ showMarkSectionHeaders?: boolean; /** * When specified, is used to create a custom section header parser regexp. * Must contain a match group named 'label' (written as (?