Path: blob/main/src/vs/editor/common/config/editorOptions.ts
3294 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import * as arrays from '../../../base/common/arrays.js';6import { IMarkdownString } from '../../../base/common/htmlContent.js';7import { IJSONSchema } from '../../../base/common/jsonSchema.js';8import * as objects from '../../../base/common/objects.js';9import * as platform from '../../../base/common/platform.js';10import { ScrollbarVisibility } from '../../../base/common/scrollable.js';11import { Constants } from '../../../base/common/uint.js';12import { FontInfo } from './fontInfo.js';13import { EDITOR_MODEL_DEFAULTS } from '../core/misc/textModelDefaults.js';14import { USUAL_WORD_SEPARATORS } from '../core/wordHelper.js';15import * as nls from '../../../nls.js';16import { AccessibilitySupport } from '../../../platform/accessibility/common/accessibility.js';17import { IConfigurationPropertySchema } from '../../../platform/configuration/common/configurationRegistry.js';1819//#region typed options2021/**22* Configuration options for auto closing quotes and brackets23*/24export type EditorAutoClosingStrategy = 'always' | 'languageDefined' | 'beforeWhitespace' | 'never';2526/**27* Configuration options for auto wrapping quotes and brackets28*/29export type EditorAutoSurroundStrategy = 'languageDefined' | 'quotes' | 'brackets' | 'never';3031/**32* Configuration options for typing over closing quotes or brackets33*/34export type EditorAutoClosingEditStrategy = 'always' | 'auto' | 'never';3536/**37* Configuration options for auto indentation in the editor38*/39export const enum EditorAutoIndentStrategy {40None = 0,41Keep = 1,42Brackets = 2,43Advanced = 3,44Full = 445}4647/**48* Configuration options for the editor.49*/50export interface IEditorOptions {51/**52* This editor is used inside a diff editor.53*/54inDiffEditor?: boolean;55/**56* This editor is allowed to use variable line heights.57*/58allowVariableLineHeights?: boolean;59/**60* This editor is allowed to use variable font-sizes and font-families61*/62allowVariableFonts?: boolean;63/**64* This editor is allowed to use variable font-sizes and font-families in accessibility mode65*/66allowVariableFontsInAccessibilityMode?: boolean;67/**68* The aria label for the editor's textarea (when it is focused).69*/70ariaLabel?: string;7172/**73* Whether the aria-required attribute should be set on the editors textarea.74*/75ariaRequired?: boolean;76/**77* Control whether a screen reader announces inline suggestion content immediately.78*/79screenReaderAnnounceInlineSuggestion?: boolean;80/**81* The `tabindex` property of the editor's textarea82*/83tabIndex?: number;84/**85* Render vertical lines at the specified columns.86* Defaults to empty array.87*/88rulers?: (number | IRulerOption)[];89/**90* Locales used for segmenting lines into words when doing word related navigations or operations.91*92* Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.).93* Defaults to empty array94*/95wordSegmenterLocales?: string | string[];96/**97* A string containing the word separators used when doing word navigation.98* Defaults to `~!@#$%^&*()-=+[{]}\\|;:\'",.<>/?99*/100wordSeparators?: string;101/**102* Enable Linux primary clipboard.103* Defaults to true.104*/105selectionClipboard?: boolean;106/**107* Control the rendering of line numbers.108* If it is a function, it will be invoked when rendering a line number and the return value will be rendered.109* Otherwise, if it is a truthy, line numbers will be rendered normally (equivalent of using an identity function).110* Otherwise, line numbers will not be rendered.111* Defaults to `on`.112*/113lineNumbers?: LineNumbersType;114/**115* Controls the minimal number of visible leading and trailing lines surrounding the cursor.116* Defaults to 0.117*/118cursorSurroundingLines?: number;119/**120* Controls when `cursorSurroundingLines` should be enforced121* Defaults to `default`, `cursorSurroundingLines` is not enforced when cursor position is changed122* by mouse.123*/124cursorSurroundingLinesStyle?: 'default' | 'all';125/**126* Render last line number when the file ends with a newline.127* Defaults to 'on' for Windows and macOS and 'dimmed' for Linux.128*/129renderFinalNewline?: 'on' | 'off' | 'dimmed';130/**131* Remove unusual line terminators like LINE SEPARATOR (LS), PARAGRAPH SEPARATOR (PS).132* Defaults to 'prompt'.133*/134unusualLineTerminators?: 'auto' | 'off' | 'prompt';135/**136* Should the corresponding line be selected when clicking on the line number?137* Defaults to true.138*/139selectOnLineNumbers?: boolean;140/**141* Control the width of line numbers, by reserving horizontal space for rendering at least an amount of digits.142* Defaults to 5.143*/144lineNumbersMinChars?: number;145/**146* Enable the rendering of the glyph margin.147* Defaults to true in vscode and to false in monaco-editor.148*/149glyphMargin?: boolean;150/**151* The width reserved for line decorations (in px).152* Line decorations are placed between line numbers and the editor content.153* You can pass in a string in the format floating point followed by "ch". e.g. 1.3ch.154* Defaults to 10.155*/156lineDecorationsWidth?: number | string;157/**158* When revealing the cursor, a virtual padding (px) is added to the cursor, turning it into a rectangle.159* This virtual padding ensures that the cursor gets revealed before hitting the edge of the viewport.160* Defaults to 30 (px).161*/162revealHorizontalRightPadding?: number;163/**164* Render the editor selection with rounded borders.165* Defaults to true.166*/167roundedSelection?: boolean;168/**169* Class name to be added to the editor.170*/171extraEditorClassName?: string;172/**173* Should the editor be read only. See also `domReadOnly`.174* Defaults to false.175*/176readOnly?: boolean;177/**178* The message to display when the editor is readonly.179*/180readOnlyMessage?: IMarkdownString;181/**182* Should the textarea used for input use the DOM `readonly` attribute.183* Defaults to false.184*/185domReadOnly?: boolean;186/**187* Enable linked editing.188* Defaults to false.189*/190linkedEditing?: boolean;191/**192* deprecated, use linkedEditing instead193*/194renameOnType?: boolean;195/**196* Should the editor render validation decorations.197* Defaults to editable.198*/199renderValidationDecorations?: 'editable' | 'on' | 'off';200/**201* Control the behavior and rendering of the scrollbars.202*/203scrollbar?: IEditorScrollbarOptions;204/**205* Control the behavior of sticky scroll options206*/207stickyScroll?: IEditorStickyScrollOptions;208/**209* Control the behavior and rendering of the minimap.210*/211minimap?: IEditorMinimapOptions;212/**213* Control the behavior of the find widget.214*/215find?: IEditorFindOptions;216/**217* Display overflow widgets as `fixed`.218* Defaults to `false`.219*/220fixedOverflowWidgets?: boolean;221/**222* Allow content widgets and overflow widgets to overflow the editor viewport.223* Defaults to `true`.224*/225allowOverflow?: boolean;226/**227* The number of vertical lanes the overview ruler should render.228* Defaults to 3.229*/230overviewRulerLanes?: number;231/**232* Controls if a border should be drawn around the overview ruler.233* Defaults to `true`.234*/235overviewRulerBorder?: boolean;236/**237* Control the cursor animation style, possible values are 'blink', 'smooth', 'phase', 'expand' and 'solid'.238* Defaults to 'blink'.239*/240cursorBlinking?: 'blink' | 'smooth' | 'phase' | 'expand' | 'solid';241/**242* Zoom the font in the editor when using the mouse wheel in combination with holding Ctrl.243* Defaults to false.244*/245mouseWheelZoom?: boolean;246/**247* Control the mouse pointer style, either 'text' or 'default' or 'copy'248* Defaults to 'text'249*/250mouseStyle?: 'text' | 'default' | 'copy';251/**252* Enable smooth caret animation.253* Defaults to 'off'.254*/255cursorSmoothCaretAnimation?: 'off' | 'explicit' | 'on';256/**257* Control the cursor style in insert mode.258* Defaults to 'line'.259*/260cursorStyle?: 'line' | 'block' | 'underline' | 'line-thin' | 'block-outline' | 'underline-thin';261/**262* Control the cursor style in overtype mode.263* Defaults to 'block'.264*/265overtypeCursorStyle?: 'line' | 'block' | 'underline' | 'line-thin' | 'block-outline' | 'underline-thin';266/**267* Controls whether paste in overtype mode should overwrite or insert.268*/269overtypeOnPaste?: boolean;270/**271* Control the width of the cursor when cursorStyle is set to 'line'272*/273cursorWidth?: number;274/**275* Control the height of the cursor when cursorStyle is set to 'line'276*/277cursorHeight?: number;278/**279* Enable font ligatures.280* Defaults to false.281*/282fontLigatures?: boolean | string;283/**284* Enable font variations.285* Defaults to false.286*/287fontVariations?: boolean | string;288/**289* Controls whether to use default color decorations or not using the default document color provider290*/291defaultColorDecorators?: 'auto' | 'always' | 'never';292/**293* Disable the use of `transform: translate3d(0px, 0px, 0px)` for the editor margin and lines layers.294* The usage of `transform: translate3d(0px, 0px, 0px)` acts as a hint for browsers to create an extra layer.295* Defaults to false.296*/297disableLayerHinting?: boolean;298/**299* Disable the optimizations for monospace fonts.300* Defaults to false.301*/302disableMonospaceOptimizations?: boolean;303/**304* Should the cursor be hidden in the overview ruler.305* Defaults to false.306*/307hideCursorInOverviewRuler?: boolean;308/**309* Enable that scrolling can go one screen size after the last line.310* Defaults to true.311*/312scrollBeyondLastLine?: boolean;313/**314* Scroll editor on middle click315*/316scrollOnMiddleClick?: boolean;317/**318* Enable that scrolling can go beyond the last column by a number of columns.319* Defaults to 5.320*/321scrollBeyondLastColumn?: number;322/**323* Enable that the editor animates scrolling to a position.324* Defaults to false.325*/326smoothScrolling?: boolean;327/**328* Enable that the editor will install a ResizeObserver to check if its container dom node size has changed.329* Defaults to false.330*/331automaticLayout?: boolean;332/**333* Control the wrapping of the editor.334* When `wordWrap` = "off", the lines will never wrap.335* When `wordWrap` = "on", the lines will wrap at the viewport width.336* When `wordWrap` = "wordWrapColumn", the lines will wrap at `wordWrapColumn`.337* When `wordWrap` = "bounded", the lines will wrap at min(viewport width, wordWrapColumn).338* Defaults to "off".339*/340wordWrap?: 'off' | 'on' | 'wordWrapColumn' | 'bounded';341/**342* Override the `wordWrap` setting.343*/344wordWrapOverride1?: 'off' | 'on' | 'inherit';345/**346* Override the `wordWrapOverride1` setting.347*/348wordWrapOverride2?: 'off' | 'on' | 'inherit';349/**350* Control the wrapping of the editor.351* When `wordWrap` = "off", the lines will never wrap.352* When `wordWrap` = "on", the lines will wrap at the viewport width.353* When `wordWrap` = "wordWrapColumn", the lines will wrap at `wordWrapColumn`.354* When `wordWrap` = "bounded", the lines will wrap at min(viewport width, wordWrapColumn).355* Defaults to 80.356*/357wordWrapColumn?: number;358/**359* Control indentation of wrapped lines. Can be: 'none', 'same', 'indent' or 'deepIndent'.360* Defaults to 'same' in vscode and to 'none' in monaco-editor.361*/362wrappingIndent?: 'none' | 'same' | 'indent' | 'deepIndent';363/**364* Controls the wrapping strategy to use.365* Defaults to 'simple'.366*/367wrappingStrategy?: 'simple' | 'advanced';368/**369* Create a softwrap on every quoted "\n" literal.370* Defaults to false.371*/372wrapOnEscapedLineFeeds?: boolean;373/**374* Configure word wrapping characters. A break will be introduced before these characters.375*/376wordWrapBreakBeforeCharacters?: string;377/**378* Configure word wrapping characters. A break will be introduced after these characters.379*/380wordWrapBreakAfterCharacters?: string;381/**382* Sets whether line breaks appear wherever the text would otherwise overflow its content box.383* When wordBreak = 'normal', Use the default line break rule.384* When wordBreak = 'keepAll', Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.385*/386wordBreak?: 'normal' | 'keepAll';387/**388* Performance guard: Stop rendering a line after x characters.389* Defaults to 10000.390* Use -1 to never stop rendering391*/392stopRenderingLineAfter?: number;393/**394* Configure the editor's hover.395*/396hover?: IEditorHoverOptions;397/**398* Enable detecting links and making them clickable.399* Defaults to true.400*/401links?: boolean;402/**403* Enable inline color decorators and color picker rendering.404*/405colorDecorators?: boolean;406/**407* Controls what is the condition to spawn a color picker from a color dectorator408*/409colorDecoratorsActivatedOn?: 'clickAndHover' | 'click' | 'hover';410/**411* Controls the max number of color decorators that can be rendered in an editor at once.412*/413colorDecoratorsLimit?: number;414/**415* Control the behaviour of comments in the editor.416*/417comments?: IEditorCommentsOptions;418/**419* Enable custom contextmenu.420* Defaults to true.421*/422contextmenu?: boolean;423/**424* A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.425* Defaults to 1.426*/427mouseWheelScrollSensitivity?: number;428/**429* FastScrolling mulitplier speed when pressing `Alt`430* Defaults to 5.431*/432fastScrollSensitivity?: number;433/**434* Enable that the editor scrolls only the predominant axis. Prevents horizontal drift when scrolling vertically on a trackpad.435* Defaults to true.436*/437scrollPredominantAxis?: boolean;438/**439* Make scrolling inertial - mostly useful with touchpad on linux.440*/441inertialScroll?: boolean;442/**443* Enable that the selection with the mouse and keys is doing column selection.444* Defaults to false.445*/446columnSelection?: boolean;447/**448* The modifier to be used to add multiple cursors with the mouse.449* Defaults to 'alt'450*/451multiCursorModifier?: 'ctrlCmd' | 'alt';452/**453* Merge overlapping selections.454* Defaults to true455*/456multiCursorMergeOverlapping?: boolean;457/**458* Configure the behaviour when pasting a text with the line count equal to the cursor count.459* Defaults to 'spread'.460*/461multiCursorPaste?: 'spread' | 'full';462/**463* Controls the max number of text cursors that can be in an active editor at once.464*/465multiCursorLimit?: number;466/**467* Configure the editor's accessibility support.468* Defaults to 'auto'. It is best to leave this to 'auto'.469*/470accessibilitySupport?: 'auto' | 'off' | 'on';471/**472* Controls the number of lines in the editor that can be read out by a screen reader473*/474accessibilityPageSize?: number;475/**476* Suggest options.477*/478suggest?: ISuggestOptions;479inlineSuggest?: IInlineSuggestOptions;480/**481* Smart select options.482*/483smartSelect?: ISmartSelectOptions;484/**485*486*/487gotoLocation?: IGotoLocationOptions;488/**489* Enable quick suggestions (shadow suggestions)490* Defaults to true.491*/492quickSuggestions?: boolean | IQuickSuggestionsOptions;493/**494* Quick suggestions show delay (in ms)495* Defaults to 10 (ms)496*/497quickSuggestionsDelay?: number;498/**499* Controls the spacing around the editor.500*/501padding?: IEditorPaddingOptions;502/**503* Parameter hint options.504*/505parameterHints?: IEditorParameterHintOptions;506/**507* Options for auto closing brackets.508* Defaults to language defined behavior.509*/510autoClosingBrackets?: EditorAutoClosingStrategy;511/**512* Options for auto closing comments.513* Defaults to language defined behavior.514*/515autoClosingComments?: EditorAutoClosingStrategy;516/**517* Options for auto closing quotes.518* Defaults to language defined behavior.519*/520autoClosingQuotes?: EditorAutoClosingStrategy;521/**522* Options for pressing backspace near quotes or bracket pairs.523*/524autoClosingDelete?: EditorAutoClosingEditStrategy;525/**526* Options for typing over closing quotes or brackets.527*/528autoClosingOvertype?: EditorAutoClosingEditStrategy;529/**530* Options for auto surrounding.531* Defaults to always allowing auto surrounding.532*/533autoSurround?: EditorAutoSurroundStrategy;534/**535* Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.536* Defaults to advanced.537*/538autoIndent?: 'none' | 'keep' | 'brackets' | 'advanced' | 'full';539/**540* Boolean which controls whether to autoindent on paste541*/542autoIndentOnPaste?: boolean;543/**544* Boolean which controls whether to autoindent on paste within a string when autoIndentOnPaste is enabled.545*/546autoIndentOnPasteWithinString?: boolean;547/**548* Emulate selection behaviour of tab characters when using spaces for indentation.549* This means selection will stick to tab stops.550*/551stickyTabStops?: boolean;552/**553* Enable format on type.554* Defaults to false.555*/556formatOnType?: boolean;557/**558* Enable format on paste.559* Defaults to false.560*/561formatOnPaste?: boolean;562/**563* Controls if the editor should allow to move selections via drag and drop.564* Defaults to false.565*/566dragAndDrop?: boolean;567/**568* Enable the suggestion box to pop-up on trigger characters.569* Defaults to true.570*/571suggestOnTriggerCharacters?: boolean;572/**573* Accept suggestions on ENTER.574* Defaults to 'on'.575*/576acceptSuggestionOnEnter?: 'on' | 'smart' | 'off';577/**578* Accept suggestions on provider defined characters.579* Defaults to true.580*/581acceptSuggestionOnCommitCharacter?: boolean;582/**583* Enable snippet suggestions. Default to 'true'.584*/585snippetSuggestions?: 'top' | 'bottom' | 'inline' | 'none';586/**587* Copying without a selection copies the current line.588*/589emptySelectionClipboard?: boolean;590/**591* Syntax highlighting is copied.592*/593copyWithSyntaxHighlighting?: boolean;594/**595* The history mode for suggestions.596*/597suggestSelection?: 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix';598/**599* The font size for the suggest widget.600* Defaults to the editor font size.601*/602suggestFontSize?: number;603/**604* The line height for the suggest widget.605* Defaults to the editor line height.606*/607suggestLineHeight?: number;608/**609* Enable tab completion.610*/611tabCompletion?: 'on' | 'off' | 'onlySnippets';612/**613* Enable selection highlight.614* Defaults to true.615*/616selectionHighlight?: boolean;617/**618* Enable selection highlight for multiline selections.619* Defaults to false.620*/621selectionHighlightMultiline?: boolean;622/**623* Maximum length (in characters) for selection highlights.624* Set to 0 to have an unlimited length.625*/626selectionHighlightMaxLength?: number;627/**628* Enable semantic occurrences highlight.629* Defaults to 'singleFile'.630* 'off' disables occurrence highlighting631* 'singleFile' triggers occurrence highlighting in the current document632* 'multiFile' triggers occurrence highlighting across valid open documents633*/634occurrencesHighlight?: 'off' | 'singleFile' | 'multiFile';635/**636* Controls delay for occurrences highlighting637* Defaults to 250.638* Minimum value is 0639* Maximum value is 2000640*/641occurrencesHighlightDelay?: number;642/**643* Show code lens644* Defaults to true.645*/646codeLens?: boolean;647/**648* Code lens font family. Defaults to editor font family.649*/650codeLensFontFamily?: string;651/**652* Code lens font size. Default to 90% of the editor font size653*/654codeLensFontSize?: number;655/**656* Control the behavior and rendering of the code action lightbulb.657*/658lightbulb?: IEditorLightbulbOptions;659/**660* Timeout for running code actions on save.661*/662codeActionsOnSaveTimeout?: number;663/**664* Enable code folding.665* Defaults to true.666*/667folding?: boolean;668/**669* Selects the folding strategy. 'auto' uses the strategies contributed for the current document, 'indentation' uses the indentation based folding strategy.670* Defaults to 'auto'.671*/672foldingStrategy?: 'auto' | 'indentation';673/**674* Enable highlight for folded regions.675* Defaults to true.676*/677foldingHighlight?: boolean;678/**679* Auto fold imports folding regions.680* Defaults to true.681*/682foldingImportsByDefault?: boolean;683/**684* Maximum number of foldable regions.685* Defaults to 5000.686*/687foldingMaximumRegions?: number;688/**689* Controls whether the fold actions in the gutter stay always visible or hide unless the mouse is over the gutter.690* Defaults to 'mouseover'.691*/692showFoldingControls?: 'always' | 'never' | 'mouseover';693/**694* Controls whether clicking on the empty content after a folded line will unfold the line.695* Defaults to false.696*/697unfoldOnClickAfterEndOfLine?: boolean;698/**699* Enable highlighting of matching brackets.700* Defaults to 'always'.701*/702matchBrackets?: 'never' | 'near' | 'always';703/**704* Enable experimental rendering using WebGPU.705* Defaults to 'off'.706*/707experimentalGpuAcceleration?: 'on' | 'off';708/**709* Enable experimental whitespace rendering.710* Defaults to 'svg'.711*/712experimentalWhitespaceRendering?: 'svg' | 'font' | 'off';713/**714* Enable rendering of whitespace.715* Defaults to 'selection'.716*/717renderWhitespace?: 'none' | 'boundary' | 'selection' | 'trailing' | 'all';718/**719* Enable rendering of control characters.720* Defaults to true.721*/722renderControlCharacters?: boolean;723/**724* Enable rendering of current line highlight.725* Defaults to all.726*/727renderLineHighlight?: 'none' | 'gutter' | 'line' | 'all';728/**729* Control if the current line highlight should be rendered only the editor is focused.730* Defaults to false.731*/732renderLineHighlightOnlyWhenFocus?: boolean;733/**734* Inserting and deleting whitespace follows tab stops.735*/736useTabStops?: boolean;737/**738* Controls whether the editor should automatically remove indentation whitespace when joining lines with Delete.739* Defaults to false.740*/741trimWhitespaceOnDelete?: boolean;742/**743* The font family744*/745fontFamily?: string;746/**747* The font weight748*/749fontWeight?: string;750/**751* The font size752*/753fontSize?: number;754/**755* The line height756*/757lineHeight?: number;758/**759* The letter spacing760*/761letterSpacing?: number;762/**763* Controls fading out of unused variables.764*/765showUnused?: boolean;766/**767* Controls whether to focus the inline editor in the peek widget by default.768* Defaults to false.769*/770peekWidgetDefaultFocus?: 'tree' | 'editor';771772/**773* Sets a placeholder for the editor.774* If set, the placeholder is shown if the editor is empty.775*/776placeholder?: string | undefined;777778/**779* Controls whether the definition link opens element in the peek widget.780* Defaults to false.781*/782definitionLinkOpensInPeek?: boolean;783/**784* Controls strikethrough deprecated variables.785*/786showDeprecated?: boolean;787/**788* Controls whether suggestions allow matches in the middle of the word instead of only at the beginning789*/790matchOnWordStartOnly?: boolean;791/**792* Control the behavior and rendering of the inline hints.793*/794inlayHints?: IEditorInlayHintsOptions;795/**796* Control if the editor should use shadow DOM.797*/798useShadowDOM?: boolean;799/**800* Controls the behavior of editor guides.801*/802guides?: IGuidesOptions;803804/**805* Controls the behavior of the unicode highlight feature806* (by default, ambiguous and invisible characters are highlighted).807*/808unicodeHighlight?: IUnicodeHighlightOptions;809810/**811* Configures bracket pair colorization (disabled by default).812*/813bracketPairColorization?: IBracketPairColorizationOptions;814815/**816* Controls dropping into the editor from an external source.817*818* When enabled, this shows a preview of the drop location and triggers an `onDropIntoEditor` event.819*/820dropIntoEditor?: IDropIntoEditorOptions;821822/**823* Sets whether the new experimental edit context should be used instead of the text area.824*/825editContext?: boolean;826827/**828* Controls whether to render rich HTML screen reader content when the EditContext is enabled829*/830renderRichScreenReaderContent?: boolean;831832/**833* Controls support for changing how content is pasted into the editor.834*/835pasteAs?: IPasteAsOptions;836837/**838* Controls whether the editor / terminal receives tabs or defers them to the workbench for navigation.839*/840tabFocusMode?: boolean;841842/**843* Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.844*/845inlineCompletionsAccessibilityVerbose?: boolean;846}847848/**849* @internal850* The width of the minimap gutter, in pixels.851*/852export const MINIMAP_GUTTER_WIDTH = 8;853854export interface IDiffEditorBaseOptions {855/**856* Allow the user to resize the diff editor split view.857* Defaults to true.858*/859enableSplitViewResizing?: boolean;860861/**862* The default ratio when rendering side-by-side editors.863* Must be a number between 0 and 1, min sizes apply.864* Defaults to 0.5865*/866splitViewDefaultRatio?: number;867868/**869* Render the differences in two side-by-side editors.870* Defaults to true.871*/872renderSideBySide?: boolean;873874/**875* When `renderSideBySide` is enabled, `useInlineViewWhenSpaceIsLimited` is set,876* and the diff editor has a width less than `renderSideBySideInlineBreakpoint`, the inline view is used.877*/878renderSideBySideInlineBreakpoint?: number | undefined;879880/**881* When `renderSideBySide` is enabled, `useInlineViewWhenSpaceIsLimited` is set,882* and the diff editor has a width less than `renderSideBySideInlineBreakpoint`, the inline view is used.883*/884useInlineViewWhenSpaceIsLimited?: boolean;885886/**887* If set, the diff editor is optimized for small views.888* Defaults to `false`.889*/890compactMode?: boolean;891892/**893* Timeout in milliseconds after which diff computation is cancelled.894* Defaults to 5000.895*/896maxComputationTime?: number;897898/**899* Maximum supported file size in MB.900* Defaults to 50.901*/902maxFileSize?: number;903904/**905* Compute the diff by ignoring leading/trailing whitespace906* Defaults to true.907*/908ignoreTrimWhitespace?: boolean;909910/**911* Render +/- indicators for added/deleted changes.912* Defaults to true.913*/914renderIndicators?: boolean;915916/**917* Shows icons in the glyph margin to revert changes.918* Default to true.919*/920renderMarginRevertIcon?: boolean;921922/**923* Indicates if the gutter menu should be rendered.924*/925renderGutterMenu?: boolean;926927/**928* Original model should be editable?929* Defaults to false.930*/931originalEditable?: boolean;932933/**934* Should the diff editor enable code lens?935* Defaults to false.936*/937diffCodeLens?: boolean;938939/**940* Is the diff editor should render overview ruler941* Defaults to true942*/943renderOverviewRuler?: boolean;944945/**946* Control the wrapping of the diff editor.947*/948diffWordWrap?: 'off' | 'on' | 'inherit';949950/**951* Diff Algorithm952*/953diffAlgorithm?: 'legacy' | 'advanced';954955/**956* Whether the diff editor aria label should be verbose.957*/958accessibilityVerbose?: boolean;959960experimental?: {961/**962* Defaults to false.963*/964showMoves?: boolean;965966showEmptyDecorations?: boolean;967968/**969* Only applies when `renderSideBySide` is set to false.970*/971useTrueInlineView?: boolean;972};973974/**975* Is the diff editor inside another editor976* Defaults to false977*/978isInEmbeddedEditor?: boolean;979980/**981* If the diff editor should only show the difference review mode.982*/983onlyShowAccessibleDiffViewer?: boolean;984985hideUnchangedRegions?: {986enabled?: boolean;987revealLineCount?: number;988minimumLineCount?: number;989contextLineCount?: number;990};991}992993/**994* Configuration options for the diff editor.995*/996export interface IDiffEditorOptions extends IEditorOptions, IDiffEditorBaseOptions {997}998999/**1000* @internal1001*/1002export type ValidDiffEditorBaseOptions = Readonly<Required<IDiffEditorBaseOptions>>;10031004//#endregion10051006/**1007* An event describing that the configuration of the editor has changed.1008*/1009export class ConfigurationChangedEvent {1010private readonly _values: boolean[];1011/**1012* @internal1013*/1014constructor(values: boolean[]) {1015this._values = values;1016}1017public hasChanged(id: EditorOption): boolean {1018return this._values[id];1019}1020}10211022/**1023* All computed editor options.1024*/1025export interface IComputedEditorOptions {1026get<T extends EditorOption>(id: T): FindComputedEditorOptionValueById<T>;1027}10281029//#region IEditorOption10301031/**1032* @internal1033*/1034export interface IEnvironmentalOptions {1035readonly memory: ComputeOptionsMemory | null;1036readonly outerWidth: number;1037readonly outerHeight: number;1038readonly fontInfo: FontInfo;1039readonly extraEditorClassName: string;1040readonly isDominatedByLongLines: boolean;1041readonly viewLineCount: number;1042readonly lineNumbersDigitCount: number;1043readonly emptySelectionClipboard: boolean;1044readonly pixelRatio: number;1045readonly tabFocusMode: boolean;1046readonly inputMode: 'insert' | 'overtype';1047readonly accessibilitySupport: AccessibilitySupport;1048readonly glyphMarginDecorationLaneCount: number;1049readonly editContextSupported: boolean;1050}10511052/**1053* @internal1054*/1055export class ComputeOptionsMemory {10561057public stableMinimapLayoutInput: IMinimapLayoutInput | null;1058public stableFitMaxMinimapScale: number;1059public stableFitRemainingWidth: number;10601061constructor() {1062this.stableMinimapLayoutInput = null;1063this.stableFitMaxMinimapScale = 0;1064this.stableFitRemainingWidth = 0;1065}1066}10671068export interface IEditorOption<K extends EditorOption, V> {1069readonly id: K;1070readonly name: string;1071defaultValue: V;1072/**1073* @internal1074*/1075readonly schema: IConfigurationPropertySchema | { [path: string]: IConfigurationPropertySchema } | undefined;1076/**1077* @internal1078*/1079validate(input: any): V;1080/**1081* @internal1082*/1083compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: V): V;10841085/**1086* Might modify `value`.1087*/1088applyUpdate(value: V | undefined, update: V): ApplyUpdateResult<V>;1089}10901091/**1092* @internal1093*/1094type PossibleKeyName0<V> = { [K in keyof IEditorOptions]: IEditorOptions[K] extends V | undefined ? K : never }[keyof IEditorOptions];1095/**1096* @internal1097*/1098type PossibleKeyName<V> = NonNullable<PossibleKeyName0<V>>;10991100/**1101* @internal1102*/1103abstract class BaseEditorOption<K extends EditorOption, T, V> implements IEditorOption<K, V> {11041105public readonly id: K;1106public readonly name: string;1107public readonly defaultValue: V;1108public readonly schema: IConfigurationPropertySchema | { [path: string]: IConfigurationPropertySchema } | undefined;11091110constructor(id: K, name: PossibleKeyName<T>, defaultValue: V, schema?: IConfigurationPropertySchema | { [path: string]: IConfigurationPropertySchema }) {1111this.id = id;1112this.name = name;1113this.defaultValue = defaultValue;1114this.schema = schema;1115}11161117public applyUpdate(value: V | undefined, update: V): ApplyUpdateResult<V> {1118return applyUpdate(value, update);1119}11201121public abstract validate(input: any): V;11221123public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: V): V {1124return value;1125}1126}11271128export class ApplyUpdateResult<T> {1129constructor(1130public readonly newValue: T,1131public readonly didChange: boolean1132) { }1133}11341135function applyUpdate<T>(value: T | undefined, update: T): ApplyUpdateResult<T> {1136if (typeof value !== 'object' || typeof update !== 'object' || !value || !update) {1137return new ApplyUpdateResult(update, value !== update);1138}1139if (Array.isArray(value) || Array.isArray(update)) {1140const arrayEquals = Array.isArray(value) && Array.isArray(update) && arrays.equals(value, update);1141return new ApplyUpdateResult(update, !arrayEquals);1142}1143let didChange = false;1144for (const key in update) {1145if ((update as T & object).hasOwnProperty(key)) {1146const result = applyUpdate(value[key], update[key]);1147if (result.didChange) {1148value[key] = result.newValue;1149didChange = true;1150}1151}1152}1153return new ApplyUpdateResult(value, didChange);1154}11551156/**1157* @internal1158*/1159abstract class ComputedEditorOption<K extends EditorOption, V> implements IEditorOption<K, V> {11601161public readonly id: K;1162public readonly name: '_never_';1163public readonly defaultValue: V;1164public readonly schema: IConfigurationPropertySchema | undefined = undefined;11651166constructor(id: K) {1167this.id = id;1168this.name = '_never_';1169this.defaultValue = <any>undefined;1170}11711172public applyUpdate(value: V | undefined, update: V): ApplyUpdateResult<V> {1173return applyUpdate(value, update);1174}11751176public validate(input: any): V {1177return this.defaultValue;1178}11791180public abstract compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: V): V;1181}11821183class SimpleEditorOption<K extends EditorOption, V> implements IEditorOption<K, V> {11841185public readonly id: K;1186public readonly name: PossibleKeyName<V>;1187public readonly defaultValue: V;1188public readonly schema: IConfigurationPropertySchema | undefined;11891190constructor(id: K, name: PossibleKeyName<V>, defaultValue: V, schema?: IConfigurationPropertySchema) {1191this.id = id;1192this.name = name;1193this.defaultValue = defaultValue;1194this.schema = schema;1195}11961197public applyUpdate(value: V | undefined, update: V): ApplyUpdateResult<V> {1198return applyUpdate(value, update);1199}12001201public validate(input: any): V {1202if (typeof input === 'undefined') {1203return this.defaultValue;1204}1205return input as any;1206}12071208public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: V): V {1209return value;1210}1211}12121213/**1214* @internal1215*/1216export function boolean(value: any, defaultValue: boolean): boolean {1217if (typeof value === 'undefined') {1218return defaultValue;1219}1220if (value === 'false') {1221// treat the string 'false' as false1222return false;1223}1224return Boolean(value);1225}12261227class EditorBooleanOption<K extends EditorOption> extends SimpleEditorOption<K, boolean> {12281229constructor(id: K, name: PossibleKeyName<boolean>, defaultValue: boolean, schema: IConfigurationPropertySchema | undefined = undefined) {1230if (typeof schema !== 'undefined') {1231schema.type = 'boolean';1232schema.default = defaultValue;1233}1234super(id, name, defaultValue, schema);1235}12361237public override validate(input: any): boolean {1238return boolean(input, this.defaultValue);1239}1240}12411242/**1243* @internal1244*/1245export function clampedInt<T>(value: any, defaultValue: T, minimum: number, maximum: number): number | T {1246if (typeof value === 'undefined') {1247return defaultValue;1248}1249let r = parseInt(value, 10);1250if (isNaN(r)) {1251return defaultValue;1252}1253r = Math.max(minimum, r);1254r = Math.min(maximum, r);1255return r | 0;1256}12571258class EditorIntOption<K extends EditorOption> extends SimpleEditorOption<K, number> {12591260public static clampedInt<T>(value: any, defaultValue: T, minimum: number, maximum: number): number | T {1261return clampedInt(value, defaultValue, minimum, maximum);1262}12631264public readonly minimum: number;1265public readonly maximum: number;12661267constructor(id: K, name: PossibleKeyName<number>, defaultValue: number, minimum: number, maximum: number, schema: IConfigurationPropertySchema | undefined = undefined) {1268if (typeof schema !== 'undefined') {1269schema.type = 'integer';1270schema.default = defaultValue;1271schema.minimum = minimum;1272schema.maximum = maximum;1273}1274super(id, name, defaultValue, schema);1275this.minimum = minimum;1276this.maximum = maximum;1277}12781279public override validate(input: any): number {1280return EditorIntOption.clampedInt(input, this.defaultValue, this.minimum, this.maximum);1281}1282}1283/**1284* @internal1285*/1286export function clampedFloat<T extends number>(value: any, defaultValue: T, minimum: number, maximum: number): number | T {1287if (typeof value === 'undefined') {1288return defaultValue;1289}1290const r = EditorFloatOption.float(value, defaultValue);1291return EditorFloatOption.clamp(r, minimum, maximum);1292}12931294class EditorFloatOption<K extends EditorOption> extends SimpleEditorOption<K, number> {12951296public readonly minimum: number | undefined;1297public readonly maximum: number | undefined;12981299public static clamp(n: number, min: number, max: number): number {1300if (n < min) {1301return min;1302}1303if (n > max) {1304return max;1305}1306return n;1307}13081309public static float(value: any, defaultValue: number): number {1310if (typeof value === 'number') {1311return value;1312}1313if (typeof value === 'undefined') {1314return defaultValue;1315}1316const r = parseFloat(value);1317return (isNaN(r) ? defaultValue : r);1318}13191320public readonly validationFn: (value: number) => number;13211322constructor(id: K, name: PossibleKeyName<number>, defaultValue: number, validationFn: (value: number) => number, schema?: IConfigurationPropertySchema, minimum?: number, maximum?: number) {1323if (typeof schema !== 'undefined') {1324schema.type = 'number';1325schema.default = defaultValue;1326schema.minimum = minimum;1327schema.maximum = maximum;1328}1329super(id, name, defaultValue, schema);1330this.validationFn = validationFn;1331this.minimum = minimum;1332this.maximum = maximum;1333}13341335public override validate(input: any): number {1336return this.validationFn(EditorFloatOption.float(input, this.defaultValue));1337}1338}13391340class EditorStringOption<K extends EditorOption> extends SimpleEditorOption<K, string> {13411342public static string(value: any, defaultValue: string): string {1343if (typeof value !== 'string') {1344return defaultValue;1345}1346return value;1347}13481349constructor(id: K, name: PossibleKeyName<string>, defaultValue: string, schema: IConfigurationPropertySchema | undefined = undefined) {1350if (typeof schema !== 'undefined') {1351schema.type = 'string';1352schema.default = defaultValue;1353}1354super(id, name, defaultValue, schema);1355}13561357public override validate(input: any): string {1358return EditorStringOption.string(input, this.defaultValue);1359}1360}13611362/**1363* @internal1364*/1365export function stringSet<T>(value: T | undefined, defaultValue: T, allowedValues: ReadonlyArray<T>, renamedValues?: Record<string, T>): T {1366if (typeof value !== 'string') {1367return defaultValue;1368}1369if (renamedValues && value in renamedValues) {1370return renamedValues[value];1371}1372if (allowedValues.indexOf(value) === -1) {1373return defaultValue;1374}1375return value;1376}13771378class EditorStringEnumOption<K extends EditorOption, V extends string> extends SimpleEditorOption<K, V> {13791380private readonly _allowedValues: ReadonlyArray<V>;13811382constructor(id: K, name: PossibleKeyName<V>, defaultValue: V, allowedValues: ReadonlyArray<V>, schema: IConfigurationPropertySchema | undefined = undefined) {1383if (typeof schema !== 'undefined') {1384schema.type = 'string';1385schema.enum = <any>allowedValues;1386schema.default = defaultValue;1387}1388super(id, name, defaultValue, schema);1389this._allowedValues = allowedValues;1390}13911392public override validate(input: any): V {1393return stringSet<V>(input, this.defaultValue, this._allowedValues);1394}1395}13961397class EditorEnumOption<K extends EditorOption, T extends string, V> extends BaseEditorOption<K, T, V> {13981399private readonly _allowedValues: T[];1400private readonly _convert: (value: T) => V;14011402constructor(id: K, name: PossibleKeyName<T>, defaultValue: V, defaultStringValue: string, allowedValues: T[], convert: (value: T) => V, schema: IConfigurationPropertySchema | undefined = undefined) {1403if (typeof schema !== 'undefined') {1404schema.type = 'string';1405schema.enum = allowedValues;1406schema.default = defaultStringValue;1407}1408super(id, name, defaultValue, schema);1409this._allowedValues = allowedValues;1410this._convert = convert;1411}14121413public validate(input: any): V {1414if (typeof input !== 'string') {1415return this.defaultValue;1416}1417if (this._allowedValues.indexOf(<T>input) === -1) {1418return this.defaultValue;1419}1420return this._convert(<any>input);1421}1422}14231424//#endregion14251426//#region autoIndent14271428function _autoIndentFromString(autoIndent: 'none' | 'keep' | 'brackets' | 'advanced' | 'full'): EditorAutoIndentStrategy {1429switch (autoIndent) {1430case 'none': return EditorAutoIndentStrategy.None;1431case 'keep': return EditorAutoIndentStrategy.Keep;1432case 'brackets': return EditorAutoIndentStrategy.Brackets;1433case 'advanced': return EditorAutoIndentStrategy.Advanced;1434case 'full': return EditorAutoIndentStrategy.Full;1435}1436}14371438//#endregion14391440//#region accessibilitySupport14411442class EditorAccessibilitySupport extends BaseEditorOption<EditorOption.accessibilitySupport, 'auto' | 'off' | 'on', AccessibilitySupport> {14431444constructor() {1445super(1446EditorOption.accessibilitySupport, 'accessibilitySupport', AccessibilitySupport.Unknown,1447{1448type: 'string',1449enum: ['auto', 'on', 'off'],1450enumDescriptions: [1451nls.localize('accessibilitySupport.auto', "Use platform APIs to detect when a Screen Reader is attached."),1452nls.localize('accessibilitySupport.on', "Optimize for usage with a Screen Reader."),1453nls.localize('accessibilitySupport.off', "Assume a screen reader is not attached."),1454],1455default: 'auto',1456tags: ['accessibility'],1457description: nls.localize('accessibilitySupport', "Controls if the UI should run in a mode where it is optimized for screen readers.")1458}1459);1460}14611462public validate(input: any): AccessibilitySupport {1463switch (input) {1464case 'auto': return AccessibilitySupport.Unknown;1465case 'off': return AccessibilitySupport.Disabled;1466case 'on': return AccessibilitySupport.Enabled;1467}1468return this.defaultValue;1469}14701471public override compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: AccessibilitySupport): AccessibilitySupport {1472if (value === AccessibilitySupport.Unknown) {1473// The editor reads the `accessibilitySupport` from the environment1474return env.accessibilitySupport;1475}1476return value;1477}1478}14791480//#endregion14811482//#region comments14831484/**1485* Configuration options for editor comments1486*/1487export interface IEditorCommentsOptions {1488/**1489* Insert a space after the line comment token and inside the block comments tokens.1490* Defaults to true.1491*/1492insertSpace?: boolean;1493/**1494* Ignore empty lines when inserting line comments.1495* Defaults to true.1496*/1497ignoreEmptyLines?: boolean;1498}14991500/**1501* @internal1502*/1503export type EditorCommentsOptions = Readonly<Required<IEditorCommentsOptions>>;15041505class EditorComments extends BaseEditorOption<EditorOption.comments, IEditorCommentsOptions, EditorCommentsOptions> {15061507constructor() {1508const defaults: EditorCommentsOptions = {1509insertSpace: true,1510ignoreEmptyLines: true,1511};1512super(1513EditorOption.comments, 'comments', defaults,1514{1515'editor.comments.insertSpace': {1516type: 'boolean',1517default: defaults.insertSpace,1518description: nls.localize('comments.insertSpace', "Controls whether a space character is inserted when commenting.")1519},1520'editor.comments.ignoreEmptyLines': {1521type: 'boolean',1522default: defaults.ignoreEmptyLines,1523description: nls.localize('comments.ignoreEmptyLines', 'Controls if empty lines should be ignored with toggle, add or remove actions for line comments.')1524},1525}1526);1527}15281529public validate(_input: any): EditorCommentsOptions {1530if (!_input || typeof _input !== 'object') {1531return this.defaultValue;1532}1533const input = _input as IEditorCommentsOptions;1534return {1535insertSpace: boolean(input.insertSpace, this.defaultValue.insertSpace),1536ignoreEmptyLines: boolean(input.ignoreEmptyLines, this.defaultValue.ignoreEmptyLines),1537};1538}1539}15401541//#endregion15421543//#region cursorBlinking15441545/**1546* The kind of animation in which the editor's cursor should be rendered.1547*/1548export const enum TextEditorCursorBlinkingStyle {1549/**1550* Hidden1551*/1552Hidden = 0,1553/**1554* Blinking1555*/1556Blink = 1,1557/**1558* Blinking with smooth fading1559*/1560Smooth = 2,1561/**1562* Blinking with prolonged filled state and smooth fading1563*/1564Phase = 3,1565/**1566* Expand collapse animation on the y axis1567*/1568Expand = 4,1569/**1570* No-Blinking1571*/1572Solid = 51573}15741575/**1576* @internal1577*/1578export function cursorBlinkingStyleFromString(cursorBlinkingStyle: 'blink' | 'smooth' | 'phase' | 'expand' | 'solid'): TextEditorCursorBlinkingStyle {1579switch (cursorBlinkingStyle) {1580case 'blink': return TextEditorCursorBlinkingStyle.Blink;1581case 'smooth': return TextEditorCursorBlinkingStyle.Smooth;1582case 'phase': return TextEditorCursorBlinkingStyle.Phase;1583case 'expand': return TextEditorCursorBlinkingStyle.Expand;1584case 'solid': return TextEditorCursorBlinkingStyle.Solid;1585}1586}15871588//#endregion15891590//#region cursorStyle15911592/**1593* The style in which the editor's cursor should be rendered.1594*/1595export enum TextEditorCursorStyle {1596/**1597* As a vertical line (sitting between two characters).1598*/1599Line = 1,1600/**1601* As a block (sitting on top of a character).1602*/1603Block = 2,1604/**1605* As a horizontal line (sitting under a character).1606*/1607Underline = 3,1608/**1609* As a thin vertical line (sitting between two characters).1610*/1611LineThin = 4,1612/**1613* As an outlined block (sitting on top of a character).1614*/1615BlockOutline = 5,1616/**1617* As a thin horizontal line (sitting under a character).1618*/1619UnderlineThin = 61620}16211622/**1623* @internal1624*/1625export function cursorStyleToString(cursorStyle: TextEditorCursorStyle): 'line' | 'block' | 'underline' | 'line-thin' | 'block-outline' | 'underline-thin' {1626switch (cursorStyle) {1627case TextEditorCursorStyle.Line: return 'line';1628case TextEditorCursorStyle.Block: return 'block';1629case TextEditorCursorStyle.Underline: return 'underline';1630case TextEditorCursorStyle.LineThin: return 'line-thin';1631case TextEditorCursorStyle.BlockOutline: return 'block-outline';1632case TextEditorCursorStyle.UnderlineThin: return 'underline-thin';1633}1634}16351636/**1637* @internal1638*/1639export function cursorStyleFromString(cursorStyle: 'line' | 'block' | 'underline' | 'line-thin' | 'block-outline' | 'underline-thin'): TextEditorCursorStyle {1640switch (cursorStyle) {1641case 'line': return TextEditorCursorStyle.Line;1642case 'block': return TextEditorCursorStyle.Block;1643case 'underline': return TextEditorCursorStyle.Underline;1644case 'line-thin': return TextEditorCursorStyle.LineThin;1645case 'block-outline': return TextEditorCursorStyle.BlockOutline;1646case 'underline-thin': return TextEditorCursorStyle.UnderlineThin;1647}1648}16491650//#endregion16511652//#region editorClassName16531654class EditorClassName extends ComputedEditorOption<EditorOption.editorClassName, string> {16551656constructor() {1657super(EditorOption.editorClassName);1658}16591660public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, _: string): string {1661const classNames = ['monaco-editor'];1662if (options.get(EditorOption.extraEditorClassName)) {1663classNames.push(options.get(EditorOption.extraEditorClassName));1664}1665if (env.extraEditorClassName) {1666classNames.push(env.extraEditorClassName);1667}1668if (options.get(EditorOption.mouseStyle) === 'default') {1669classNames.push('mouse-default');1670} else if (options.get(EditorOption.mouseStyle) === 'copy') {1671classNames.push('mouse-copy');1672}16731674if (options.get(EditorOption.showUnused)) {1675classNames.push('showUnused');1676}16771678if (options.get(EditorOption.showDeprecated)) {1679classNames.push('showDeprecated');1680}16811682return classNames.join(' ');1683}1684}16851686//#endregion16871688//#region emptySelectionClipboard16891690class EditorEmptySelectionClipboard extends EditorBooleanOption<EditorOption.emptySelectionClipboard> {16911692constructor() {1693super(1694EditorOption.emptySelectionClipboard, 'emptySelectionClipboard', true,1695{ description: nls.localize('emptySelectionClipboard', "Controls whether copying without a selection copies the current line.") }1696);1697}16981699public override compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: boolean): boolean {1700return value && env.emptySelectionClipboard;1701}1702}17031704//#endregion17051706//#region find17071708/**1709* Configuration options for editor find widget1710*/1711export interface IEditorFindOptions {1712/**1713* Controls whether the cursor should move to find matches while typing.1714*/1715cursorMoveOnType?: boolean;1716/**1717* Controls whether the find widget should search as you type.1718*/1719findOnType?: boolean;1720/**1721* Controls if we seed search string in the Find Widget with editor selection.1722*/1723seedSearchStringFromSelection?: 'never' | 'always' | 'selection';1724/**1725* Controls if Find in Selection flag is turned on in the editor.1726*/1727autoFindInSelection?: 'never' | 'always' | 'multiline';1728/*1729* Controls whether the Find Widget should add extra lines on top of the editor.1730*/1731addExtraSpaceOnTop?: boolean;1732/**1733* @internal1734* Controls if the Find Widget should read or modify the shared find clipboard on macOS1735*/1736globalFindClipboard?: boolean;1737/**1738* Controls whether the search result and diff result automatically restarts from the beginning (or the end) when no further matches can be found1739*/1740loop?: boolean;1741/**1742* @internal1743* Controls how the find widget search history should be stored1744*/1745history?: 'never' | 'workspace';1746/**1747* @internal1748* Controls how the replace widget search history should be stored1749*/1750replaceHistory?: 'never' | 'workspace';1751}17521753/**1754* @internal1755*/1756export type EditorFindOptions = Readonly<Required<IEditorFindOptions>>;17571758class EditorFind extends BaseEditorOption<EditorOption.find, IEditorFindOptions, EditorFindOptions> {17591760constructor() {1761const defaults: EditorFindOptions = {1762cursorMoveOnType: true,1763findOnType: true,1764seedSearchStringFromSelection: 'always',1765autoFindInSelection: 'never',1766globalFindClipboard: false,1767addExtraSpaceOnTop: true,1768loop: true,1769history: 'workspace',1770replaceHistory: 'workspace',1771};1772super(1773EditorOption.find, 'find', defaults,1774{1775'editor.find.cursorMoveOnType': {1776type: 'boolean',1777default: defaults.cursorMoveOnType,1778description: nls.localize('find.cursorMoveOnType', "Controls whether the cursor should jump to find matches while typing.")1779},1780'editor.find.seedSearchStringFromSelection': {1781type: 'string',1782enum: ['never', 'always', 'selection'],1783default: defaults.seedSearchStringFromSelection,1784enumDescriptions: [1785nls.localize('editor.find.seedSearchStringFromSelection.never', 'Never seed search string from the editor selection.'),1786nls.localize('editor.find.seedSearchStringFromSelection.always', 'Always seed search string from the editor selection, including word at cursor position.'),1787nls.localize('editor.find.seedSearchStringFromSelection.selection', 'Only seed search string from the editor selection.')1788],1789description: nls.localize('find.seedSearchStringFromSelection', "Controls whether the search string in the Find Widget is seeded from the editor selection.")1790},1791'editor.find.autoFindInSelection': {1792type: 'string',1793enum: ['never', 'always', 'multiline'],1794default: defaults.autoFindInSelection,1795enumDescriptions: [1796nls.localize('editor.find.autoFindInSelection.never', 'Never turn on Find in Selection automatically (default).'),1797nls.localize('editor.find.autoFindInSelection.always', 'Always turn on Find in Selection automatically.'),1798nls.localize('editor.find.autoFindInSelection.multiline', 'Turn on Find in Selection automatically when multiple lines of content are selected.')1799],1800description: nls.localize('find.autoFindInSelection', "Controls the condition for turning on Find in Selection automatically.")1801},1802'editor.find.globalFindClipboard': {1803type: 'boolean',1804default: defaults.globalFindClipboard,1805description: nls.localize('find.globalFindClipboard', "Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),1806included: platform.isMacintosh1807},1808'editor.find.addExtraSpaceOnTop': {1809type: 'boolean',1810default: defaults.addExtraSpaceOnTop,1811description: nls.localize('find.addExtraSpaceOnTop', "Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")1812},1813'editor.find.loop': {1814type: 'boolean',1815default: defaults.loop,1816description: nls.localize('find.loop', "Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")1817},1818'editor.find.history': {1819type: 'string',1820enum: ['never', 'workspace'],1821default: 'workspace',1822enumDescriptions: [1823nls.localize('editor.find.history.never', 'Do not store search history from the find widget.'),1824nls.localize('editor.find.history.workspace', 'Store search history across the active workspace'),1825],1826description: nls.localize('find.history', "Controls how the find widget history should be stored")1827},1828'editor.find.replaceHistory': {1829type: 'string',1830enum: ['never', 'workspace'],1831default: 'workspace',1832enumDescriptions: [1833nls.localize('editor.find.replaceHistory.never', 'Do not store history from the replace widget.'),1834nls.localize('editor.find.replaceHistory.workspace', 'Store replace history across the active workspace'),1835],1836description: nls.localize('find.replaceHistory', "Controls how the replace widget history should be stored")1837},1838'editor.find.findOnType': {1839type: 'boolean',1840default: defaults.findOnType,1841description: nls.localize('find.findOnType', "Controls whether the Find Widget should search as you type.")1842},1843}1844);1845}18461847public validate(_input: any): EditorFindOptions {1848if (!_input || typeof _input !== 'object') {1849return this.defaultValue;1850}1851const input = _input as IEditorFindOptions;1852return {1853cursorMoveOnType: boolean(input.cursorMoveOnType, this.defaultValue.cursorMoveOnType),1854findOnType: boolean(input.findOnType, this.defaultValue.findOnType),1855seedSearchStringFromSelection: typeof _input.seedSearchStringFromSelection === 'boolean'1856? (_input.seedSearchStringFromSelection ? 'always' : 'never')1857: stringSet<'never' | 'always' | 'selection'>(input.seedSearchStringFromSelection, this.defaultValue.seedSearchStringFromSelection, ['never', 'always', 'selection']),1858autoFindInSelection: typeof _input.autoFindInSelection === 'boolean'1859? (_input.autoFindInSelection ? 'always' : 'never')1860: stringSet<'never' | 'always' | 'multiline'>(input.autoFindInSelection, this.defaultValue.autoFindInSelection, ['never', 'always', 'multiline']),1861globalFindClipboard: boolean(input.globalFindClipboard, this.defaultValue.globalFindClipboard),1862addExtraSpaceOnTop: boolean(input.addExtraSpaceOnTop, this.defaultValue.addExtraSpaceOnTop),1863loop: boolean(input.loop, this.defaultValue.loop),1864history: stringSet<'never' | 'workspace'>(input.history, this.defaultValue.history, ['never', 'workspace']),1865replaceHistory: stringSet<'never' | 'workspace'>(input.replaceHistory, this.defaultValue.replaceHistory, ['never', 'workspace']),1866};1867}1868}18691870//#endregion18711872//#region fontLigatures18731874/**1875* @internal1876*/1877export class EditorFontLigatures extends BaseEditorOption<EditorOption.fontLigatures, boolean | string, string> {18781879public static OFF = '"liga" off, "calt" off';1880public static ON = '"liga" on, "calt" on';18811882constructor() {1883super(1884EditorOption.fontLigatures, 'fontLigatures', EditorFontLigatures.OFF,1885{1886anyOf: [1887{1888type: 'boolean',1889description: nls.localize('fontLigatures', "Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property."),1890},1891{1892type: 'string',1893description: nls.localize('fontFeatureSettings', "Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")1894}1895],1896description: nls.localize('fontLigaturesGeneral', "Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),1897default: false1898}1899);1900}19011902public validate(input: any): string {1903if (typeof input === 'undefined') {1904return this.defaultValue;1905}1906if (typeof input === 'string') {1907if (input === 'false' || input.length === 0) {1908return EditorFontLigatures.OFF;1909}1910if (input === 'true') {1911return EditorFontLigatures.ON;1912}1913return input;1914}1915if (Boolean(input)) {1916return EditorFontLigatures.ON;1917}1918return EditorFontLigatures.OFF;1919}1920}19211922//#endregion19231924//#region fontVariations19251926/**1927* @internal1928*/1929export class EditorFontVariations extends BaseEditorOption<EditorOption.fontVariations, boolean | string, string> {1930// Text is laid out using default settings.1931public static OFF = 'normal';19321933// Translate `fontWeight` config to the `font-variation-settings` CSS property.1934public static TRANSLATE = 'translate';19351936constructor() {1937super(1938EditorOption.fontVariations, 'fontVariations', EditorFontVariations.OFF,1939{1940anyOf: [1941{1942type: 'boolean',1943description: nls.localize('fontVariations', "Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property."),1944},1945{1946type: 'string',1947description: nls.localize('fontVariationSettings', "Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")1948}1949],1950description: nls.localize('fontVariationsGeneral', "Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),1951default: false1952}1953);1954}19551956public validate(input: any): string {1957if (typeof input === 'undefined') {1958return this.defaultValue;1959}1960if (typeof input === 'string') {1961if (input === 'false') {1962return EditorFontVariations.OFF;1963}1964if (input === 'true') {1965return EditorFontVariations.TRANSLATE;1966}1967return input;1968}1969if (Boolean(input)) {1970return EditorFontVariations.TRANSLATE;1971}1972return EditorFontVariations.OFF;1973}19741975public override compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: string): string {1976// The value is computed from the fontWeight if it is true.1977// So take the result from env.fontInfo1978return env.fontInfo.fontVariationSettings;1979}1980}19811982//#endregion19831984//#region fontInfo19851986class EditorFontInfo extends ComputedEditorOption<EditorOption.fontInfo, FontInfo> {19871988constructor() {1989super(EditorOption.fontInfo);1990}19911992public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, _: FontInfo): FontInfo {1993return env.fontInfo;1994}1995}19961997//#endregion19981999//#region effectiveCursorStyle20002001class EffectiveCursorStyle extends ComputedEditorOption<EditorOption.effectiveCursorStyle, TextEditorCursorStyle> {20022003constructor() {2004super(EditorOption.effectiveCursorStyle);2005}20062007public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, _: TextEditorCursorStyle): TextEditorCursorStyle {2008return env.inputMode === 'overtype' ?2009options.get(EditorOption.overtypeCursorStyle) :2010options.get(EditorOption.cursorStyle);2011}2012}20132014//#endregion20152016//#region effectiveExperimentalEditContext20172018class EffectiveEditContextEnabled extends ComputedEditorOption<EditorOption.effectiveEditContext, boolean> {20192020constructor() {2021super(EditorOption.effectiveEditContext);2022}20232024public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions): boolean {2025return env.editContextSupported && options.get(EditorOption.editContext);2026}2027}20282029//#endregion20302031//#region effectiveAllowVariableFonts20322033class EffectiveAllowVariableFonts extends ComputedEditorOption<EditorOption.effectiveAllowVariableFonts, boolean> {20342035constructor() {2036super(EditorOption.effectiveAllowVariableFonts);2037}20382039public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions): boolean {2040const accessibilitySupport = env.accessibilitySupport;2041if (accessibilitySupport === AccessibilitySupport.Enabled) {2042return options.get(EditorOption.allowVariableFontsInAccessibilityMode);2043} else {2044return options.get(EditorOption.allowVariableFonts);2045}2046}2047}20482049//#engregion20502051//#region fontSize20522053class EditorFontSize extends SimpleEditorOption<EditorOption.fontSize, number> {20542055constructor() {2056super(2057EditorOption.fontSize, 'fontSize', EDITOR_FONT_DEFAULTS.fontSize,2058{2059type: 'number',2060minimum: 6,2061maximum: 100,2062default: EDITOR_FONT_DEFAULTS.fontSize,2063description: nls.localize('fontSize', "Controls the font size in pixels.")2064}2065);2066}20672068public override validate(input: any): number {2069const r = EditorFloatOption.float(input, this.defaultValue);2070if (r === 0) {2071return EDITOR_FONT_DEFAULTS.fontSize;2072}2073return EditorFloatOption.clamp(r, 6, 100);2074}2075public override compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: number): number {2076// The final fontSize respects the editor zoom level.2077// So take the result from env.fontInfo2078return env.fontInfo.fontSize;2079}2080}20812082//#endregion20832084//#region fontWeight20852086class EditorFontWeight extends BaseEditorOption<EditorOption.fontWeight, string, string> {2087private static SUGGESTION_VALUES = ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'];2088private static MINIMUM_VALUE = 1;2089private static MAXIMUM_VALUE = 1000;20902091constructor() {2092super(2093EditorOption.fontWeight, 'fontWeight', EDITOR_FONT_DEFAULTS.fontWeight,2094{2095anyOf: [2096{2097type: 'number',2098minimum: EditorFontWeight.MINIMUM_VALUE,2099maximum: EditorFontWeight.MAXIMUM_VALUE,2100errorMessage: nls.localize('fontWeightErrorMessage', "Only \"normal\" and \"bold\" keywords or numbers between 1 and 1000 are allowed.")2101},2102{2103type: 'string',2104pattern: '^(normal|bold|1000|[1-9][0-9]{0,2})$'2105},2106{2107enum: EditorFontWeight.SUGGESTION_VALUES2108}2109],2110default: EDITOR_FONT_DEFAULTS.fontWeight,2111description: nls.localize('fontWeight', "Controls the font weight. Accepts \"normal\" and \"bold\" keywords or numbers between 1 and 1000.")2112}2113);2114}21152116public validate(input: any): string {2117if (input === 'normal' || input === 'bold') {2118return input;2119}2120return String(EditorIntOption.clampedInt(input, EDITOR_FONT_DEFAULTS.fontWeight, EditorFontWeight.MINIMUM_VALUE, EditorFontWeight.MAXIMUM_VALUE));2121}2122}21232124//#endregion21252126//#region gotoLocation21272128export type GoToLocationValues = 'peek' | 'gotoAndPeek' | 'goto';21292130/**2131* Configuration options for go to location2132*/2133export interface IGotoLocationOptions {21342135multiple?: GoToLocationValues;21362137multipleDefinitions?: GoToLocationValues;2138multipleTypeDefinitions?: GoToLocationValues;2139multipleDeclarations?: GoToLocationValues;2140multipleImplementations?: GoToLocationValues;2141multipleReferences?: GoToLocationValues;2142multipleTests?: GoToLocationValues;21432144alternativeDefinitionCommand?: string;2145alternativeTypeDefinitionCommand?: string;2146alternativeDeclarationCommand?: string;2147alternativeImplementationCommand?: string;2148alternativeReferenceCommand?: string;2149alternativeTestsCommand?: string;2150}21512152/**2153* @internal2154*/2155export type GoToLocationOptions = Readonly<Required<IGotoLocationOptions>>;21562157class EditorGoToLocation extends BaseEditorOption<EditorOption.gotoLocation, IGotoLocationOptions, GoToLocationOptions> {21582159constructor() {2160const defaults: GoToLocationOptions = {2161multiple: 'peek',2162multipleDefinitions: 'peek',2163multipleTypeDefinitions: 'peek',2164multipleDeclarations: 'peek',2165multipleImplementations: 'peek',2166multipleReferences: 'peek',2167multipleTests: 'peek',2168alternativeDefinitionCommand: 'editor.action.goToReferences',2169alternativeTypeDefinitionCommand: 'editor.action.goToReferences',2170alternativeDeclarationCommand: 'editor.action.goToReferences',2171alternativeImplementationCommand: '',2172alternativeReferenceCommand: '',2173alternativeTestsCommand: '',2174};2175const jsonSubset: IJSONSchema = {2176type: 'string',2177enum: ['peek', 'gotoAndPeek', 'goto'],2178default: defaults.multiple,2179enumDescriptions: [2180nls.localize('editor.gotoLocation.multiple.peek', 'Show Peek view of the results (default)'),2181nls.localize('editor.gotoLocation.multiple.gotoAndPeek', 'Go to the primary result and show a Peek view'),2182nls.localize('editor.gotoLocation.multiple.goto', 'Go to the primary result and enable Peek-less navigation to others')2183]2184};2185const alternativeCommandOptions = ['', 'editor.action.referenceSearch.trigger', 'editor.action.goToReferences', 'editor.action.peekImplementation', 'editor.action.goToImplementation', 'editor.action.peekTypeDefinition', 'editor.action.goToTypeDefinition', 'editor.action.peekDeclaration', 'editor.action.revealDeclaration', 'editor.action.peekDefinition', 'editor.action.revealDefinitionAside', 'editor.action.revealDefinition'];2186super(2187EditorOption.gotoLocation, 'gotoLocation', defaults,2188{2189'editor.gotoLocation.multiple': {2190deprecationMessage: nls.localize('editor.gotoLocation.multiple.deprecated', "This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead."),2191},2192'editor.gotoLocation.multipleDefinitions': {2193description: nls.localize('editor.editor.gotoLocation.multipleDefinitions', "Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),2194...jsonSubset,2195},2196'editor.gotoLocation.multipleTypeDefinitions': {2197description: nls.localize('editor.editor.gotoLocation.multipleTypeDefinitions', "Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),2198...jsonSubset,2199},2200'editor.gotoLocation.multipleDeclarations': {2201description: nls.localize('editor.editor.gotoLocation.multipleDeclarations', "Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),2202...jsonSubset,2203},2204'editor.gotoLocation.multipleImplementations': {2205description: nls.localize('editor.editor.gotoLocation.multipleImplemenattions', "Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),2206...jsonSubset,2207},2208'editor.gotoLocation.multipleReferences': {2209description: nls.localize('editor.editor.gotoLocation.multipleReferences', "Controls the behavior the 'Go to References'-command when multiple target locations exist."),2210...jsonSubset,2211},2212'editor.gotoLocation.alternativeDefinitionCommand': {2213type: 'string',2214default: defaults.alternativeDefinitionCommand,2215enum: alternativeCommandOptions,2216description: nls.localize('alternativeDefinitionCommand', "Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")2217},2218'editor.gotoLocation.alternativeTypeDefinitionCommand': {2219type: 'string',2220default: defaults.alternativeTypeDefinitionCommand,2221enum: alternativeCommandOptions,2222description: nls.localize('alternativeTypeDefinitionCommand', "Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")2223},2224'editor.gotoLocation.alternativeDeclarationCommand': {2225type: 'string',2226default: defaults.alternativeDeclarationCommand,2227enum: alternativeCommandOptions,2228description: nls.localize('alternativeDeclarationCommand', "Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")2229},2230'editor.gotoLocation.alternativeImplementationCommand': {2231type: 'string',2232default: defaults.alternativeImplementationCommand,2233enum: alternativeCommandOptions,2234description: nls.localize('alternativeImplementationCommand', "Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")2235},2236'editor.gotoLocation.alternativeReferenceCommand': {2237type: 'string',2238default: defaults.alternativeReferenceCommand,2239enum: alternativeCommandOptions,2240description: nls.localize('alternativeReferenceCommand', "Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")2241},2242}2243);2244}22452246public validate(_input: any): GoToLocationOptions {2247if (!_input || typeof _input !== 'object') {2248return this.defaultValue;2249}2250const input = _input as IGotoLocationOptions;2251return {2252multiple: stringSet<GoToLocationValues>(input.multiple, this.defaultValue.multiple, ['peek', 'gotoAndPeek', 'goto']),2253multipleDefinitions: input.multipleDefinitions ?? stringSet<GoToLocationValues>(input.multipleDefinitions, 'peek', ['peek', 'gotoAndPeek', 'goto']),2254multipleTypeDefinitions: input.multipleTypeDefinitions ?? stringSet<GoToLocationValues>(input.multipleTypeDefinitions, 'peek', ['peek', 'gotoAndPeek', 'goto']),2255multipleDeclarations: input.multipleDeclarations ?? stringSet<GoToLocationValues>(input.multipleDeclarations, 'peek', ['peek', 'gotoAndPeek', 'goto']),2256multipleImplementations: input.multipleImplementations ?? stringSet<GoToLocationValues>(input.multipleImplementations, 'peek', ['peek', 'gotoAndPeek', 'goto']),2257multipleReferences: input.multipleReferences ?? stringSet<GoToLocationValues>(input.multipleReferences, 'peek', ['peek', 'gotoAndPeek', 'goto']),2258multipleTests: input.multipleTests ?? stringSet<GoToLocationValues>(input.multipleTests, 'peek', ['peek', 'gotoAndPeek', 'goto']),2259alternativeDefinitionCommand: EditorStringOption.string(input.alternativeDefinitionCommand, this.defaultValue.alternativeDefinitionCommand),2260alternativeTypeDefinitionCommand: EditorStringOption.string(input.alternativeTypeDefinitionCommand, this.defaultValue.alternativeTypeDefinitionCommand),2261alternativeDeclarationCommand: EditorStringOption.string(input.alternativeDeclarationCommand, this.defaultValue.alternativeDeclarationCommand),2262alternativeImplementationCommand: EditorStringOption.string(input.alternativeImplementationCommand, this.defaultValue.alternativeImplementationCommand),2263alternativeReferenceCommand: EditorStringOption.string(input.alternativeReferenceCommand, this.defaultValue.alternativeReferenceCommand),2264alternativeTestsCommand: EditorStringOption.string(input.alternativeTestsCommand, this.defaultValue.alternativeTestsCommand),2265};2266}2267}22682269//#endregion22702271//#region hover22722273/**2274* Configuration options for editor hover2275*/2276export interface IEditorHoverOptions {2277/**2278* Enable the hover.2279* Defaults to true.2280*/2281enabled?: boolean;2282/**2283* Delay for showing the hover.2284* Defaults to 300.2285*/2286delay?: number;2287/**2288* Is the hover sticky such that it can be clicked and its contents selected?2289* Defaults to true.2290*/2291sticky?: boolean;2292/**2293* Controls how long the hover is visible after you hovered out of it.2294* Require sticky setting to be true.2295*/2296hidingDelay?: number;2297/**2298* Should the hover be shown above the line if possible?2299* Defaults to false.2300*/2301above?: boolean;2302}23032304/**2305* @internal2306*/2307export type EditorHoverOptions = Readonly<Required<IEditorHoverOptions>>;23082309class EditorHover extends BaseEditorOption<EditorOption.hover, IEditorHoverOptions, EditorHoverOptions> {23102311constructor() {2312const defaults: EditorHoverOptions = {2313enabled: true,2314delay: 300,2315hidingDelay: 300,2316sticky: true,2317above: true,2318};2319super(2320EditorOption.hover, 'hover', defaults,2321{2322'editor.hover.enabled': {2323type: 'boolean',2324default: defaults.enabled,2325description: nls.localize('hover.enabled', "Controls whether the hover is shown.")2326},2327'editor.hover.delay': {2328type: 'number',2329default: defaults.delay,2330minimum: 0,2331maximum: 10000,2332description: nls.localize('hover.delay', "Controls the delay in milliseconds after which the hover is shown.")2333},2334'editor.hover.sticky': {2335type: 'boolean',2336default: defaults.sticky,2337description: nls.localize('hover.sticky', "Controls whether the hover should remain visible when mouse is moved over it.")2338},2339'editor.hover.hidingDelay': {2340type: 'integer',2341minimum: 0,2342default: defaults.hidingDelay,2343markdownDescription: nls.localize('hover.hidingDelay', "Controls the delay in milliseconds after which the hover is hidden. Requires `#editor.hover.sticky#` to be enabled.")2344},2345'editor.hover.above': {2346type: 'boolean',2347default: defaults.above,2348description: nls.localize('hover.above', "Prefer showing hovers above the line, if there's space.")2349},2350}2351);2352}23532354public validate(_input: any): EditorHoverOptions {2355if (!_input || typeof _input !== 'object') {2356return this.defaultValue;2357}2358const input = _input as IEditorHoverOptions;2359return {2360enabled: boolean(input.enabled, this.defaultValue.enabled),2361delay: EditorIntOption.clampedInt(input.delay, this.defaultValue.delay, 0, 10000),2362sticky: boolean(input.sticky, this.defaultValue.sticky),2363hidingDelay: EditorIntOption.clampedInt(input.hidingDelay, this.defaultValue.hidingDelay, 0, 600000),2364above: boolean(input.above, this.defaultValue.above),2365};2366}2367}23682369//#endregion23702371//#region layoutInfo23722373/**2374* A description for the overview ruler position.2375*/2376export interface OverviewRulerPosition {2377/**2378* Width of the overview ruler2379*/2380readonly width: number;2381/**2382* Height of the overview ruler2383*/2384readonly height: number;2385/**2386* Top position for the overview ruler2387*/2388readonly top: number;2389/**2390* Right position for the overview ruler2391*/2392readonly right: number;2393}23942395export const enum RenderMinimap {2396None = 0,2397Text = 1,2398Blocks = 2,2399}24002401/**2402* The internal layout details of the editor.2403*/2404export interface EditorLayoutInfo {24052406/**2407* Full editor width.2408*/2409readonly width: number;2410/**2411* Full editor height.2412*/2413readonly height: number;24142415/**2416* Left position for the glyph margin.2417*/2418readonly glyphMarginLeft: number;2419/**2420* The width of the glyph margin.2421*/2422readonly glyphMarginWidth: number;24232424/**2425* The number of decoration lanes to render in the glyph margin.2426*/2427readonly glyphMarginDecorationLaneCount: number;24282429/**2430* Left position for the line numbers.2431*/2432readonly lineNumbersLeft: number;2433/**2434* The width of the line numbers.2435*/2436readonly lineNumbersWidth: number;24372438/**2439* Left position for the line decorations.2440*/2441readonly decorationsLeft: number;2442/**2443* The width of the line decorations.2444*/2445readonly decorationsWidth: number;24462447/**2448* Left position for the content (actual text)2449*/2450readonly contentLeft: number;2451/**2452* The width of the content (actual text)2453*/2454readonly contentWidth: number;24552456/**2457* Layout information for the minimap2458*/2459readonly minimap: EditorMinimapLayoutInfo;24602461/**2462* The number of columns (of typical characters) fitting on a viewport line.2463*/2464readonly viewportColumn: number;24652466readonly isWordWrapMinified: boolean;2467readonly isViewportWrapping: boolean;2468readonly wrappingColumn: number;24692470/**2471* The width of the vertical scrollbar.2472*/2473readonly verticalScrollbarWidth: number;2474/**2475* The height of the horizontal scrollbar.2476*/2477readonly horizontalScrollbarHeight: number;24782479/**2480* The position of the overview ruler.2481*/2482readonly overviewRuler: OverviewRulerPosition;2483}24842485/**2486* The internal layout details of the editor.2487*/2488export interface EditorMinimapLayoutInfo {2489readonly renderMinimap: RenderMinimap;2490readonly minimapLeft: number;2491readonly minimapWidth: number;2492readonly minimapHeightIsEditorHeight: boolean;2493readonly minimapIsSampling: boolean;2494readonly minimapScale: number;2495readonly minimapLineHeight: number;2496readonly minimapCanvasInnerWidth: number;2497readonly minimapCanvasInnerHeight: number;2498readonly minimapCanvasOuterWidth: number;2499readonly minimapCanvasOuterHeight: number;2500}25012502/**2503* @internal2504*/2505export interface EditorLayoutInfoComputerEnv {2506readonly memory: ComputeOptionsMemory | null;2507readonly outerWidth: number;2508readonly outerHeight: number;2509readonly isDominatedByLongLines: boolean;2510readonly lineHeight: number;2511readonly viewLineCount: number;2512readonly lineNumbersDigitCount: number;2513readonly typicalHalfwidthCharacterWidth: number;2514readonly maxDigitWidth: number;2515readonly pixelRatio: number;2516readonly glyphMarginDecorationLaneCount: number;2517}25182519/**2520* @internal2521*/2522export interface IEditorLayoutComputerInput {2523readonly outerWidth: number;2524readonly outerHeight: number;2525readonly isDominatedByLongLines: boolean;2526readonly lineHeight: number;2527readonly lineNumbersDigitCount: number;2528readonly typicalHalfwidthCharacterWidth: number;2529readonly maxDigitWidth: number;2530readonly pixelRatio: number;2531readonly glyphMargin: boolean;2532readonly lineDecorationsWidth: string | number;2533readonly folding: boolean;2534readonly minimap: Readonly<Required<IEditorMinimapOptions>>;2535readonly scrollbar: InternalEditorScrollbarOptions;2536readonly lineNumbers: InternalEditorRenderLineNumbersOptions;2537readonly lineNumbersMinChars: number;2538readonly scrollBeyondLastLine: boolean;2539readonly wordWrap: 'wordWrapColumn' | 'on' | 'off' | 'bounded';2540readonly wordWrapColumn: number;2541readonly wordWrapMinified: boolean;2542readonly accessibilitySupport: AccessibilitySupport;2543}25442545/**2546* @internal2547*/2548export interface IMinimapLayoutInput {2549readonly outerWidth: number;2550readonly outerHeight: number;2551readonly lineHeight: number;2552readonly typicalHalfwidthCharacterWidth: number;2553readonly pixelRatio: number;2554readonly scrollBeyondLastLine: boolean;2555readonly paddingTop: number;2556readonly paddingBottom: number;2557readonly minimap: Readonly<Required<IEditorMinimapOptions>>;2558readonly verticalScrollbarWidth: number;2559readonly viewLineCount: number;2560readonly remainingWidth: number;2561readonly isViewportWrapping: boolean;2562}25632564/**2565* @internal2566*/2567export class EditorLayoutInfoComputer extends ComputedEditorOption<EditorOption.layoutInfo, EditorLayoutInfo> {25682569constructor() {2570super(EditorOption.layoutInfo);2571}25722573public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, _: EditorLayoutInfo): EditorLayoutInfo {2574return EditorLayoutInfoComputer.computeLayout(options, {2575memory: env.memory,2576outerWidth: env.outerWidth,2577outerHeight: env.outerHeight,2578isDominatedByLongLines: env.isDominatedByLongLines,2579lineHeight: env.fontInfo.lineHeight,2580viewLineCount: env.viewLineCount,2581lineNumbersDigitCount: env.lineNumbersDigitCount,2582typicalHalfwidthCharacterWidth: env.fontInfo.typicalHalfwidthCharacterWidth,2583maxDigitWidth: env.fontInfo.maxDigitWidth,2584pixelRatio: env.pixelRatio,2585glyphMarginDecorationLaneCount: env.glyphMarginDecorationLaneCount2586});2587}25882589public static computeContainedMinimapLineCount(input: {2590viewLineCount: number;2591scrollBeyondLastLine: boolean;2592paddingTop: number;2593paddingBottom: number;2594height: number;2595lineHeight: number;2596pixelRatio: number;2597}): { typicalViewportLineCount: number; extraLinesBeforeFirstLine: number; extraLinesBeyondLastLine: number; desiredRatio: number; minimapLineCount: number } {2598const typicalViewportLineCount = input.height / input.lineHeight;2599const extraLinesBeforeFirstLine = Math.floor(input.paddingTop / input.lineHeight);2600let extraLinesBeyondLastLine = Math.floor(input.paddingBottom / input.lineHeight);2601if (input.scrollBeyondLastLine) {2602extraLinesBeyondLastLine = Math.max(extraLinesBeyondLastLine, typicalViewportLineCount - 1);2603}2604const desiredRatio = (extraLinesBeforeFirstLine + input.viewLineCount + extraLinesBeyondLastLine) / (input.pixelRatio * input.height);2605const minimapLineCount = Math.floor(input.viewLineCount / desiredRatio);2606return { typicalViewportLineCount, extraLinesBeforeFirstLine, extraLinesBeyondLastLine, desiredRatio, minimapLineCount };2607}26082609private static _computeMinimapLayout(input: IMinimapLayoutInput, memory: ComputeOptionsMemory): EditorMinimapLayoutInfo {2610const outerWidth = input.outerWidth;2611const outerHeight = input.outerHeight;2612const pixelRatio = input.pixelRatio;26132614if (!input.minimap.enabled) {2615return {2616renderMinimap: RenderMinimap.None,2617minimapLeft: 0,2618minimapWidth: 0,2619minimapHeightIsEditorHeight: false,2620minimapIsSampling: false,2621minimapScale: 1,2622minimapLineHeight: 1,2623minimapCanvasInnerWidth: 0,2624minimapCanvasInnerHeight: Math.floor(pixelRatio * outerHeight),2625minimapCanvasOuterWidth: 0,2626minimapCanvasOuterHeight: outerHeight,2627};2628}26292630// Can use memory if only the `viewLineCount` and `remainingWidth` have changed2631const stableMinimapLayoutInput = memory.stableMinimapLayoutInput;2632const couldUseMemory = (2633stableMinimapLayoutInput2634// && input.outerWidth === lastMinimapLayoutInput.outerWidth !!! INTENTIONAL OMITTED2635&& input.outerHeight === stableMinimapLayoutInput.outerHeight2636&& input.lineHeight === stableMinimapLayoutInput.lineHeight2637&& input.typicalHalfwidthCharacterWidth === stableMinimapLayoutInput.typicalHalfwidthCharacterWidth2638&& input.pixelRatio === stableMinimapLayoutInput.pixelRatio2639&& input.scrollBeyondLastLine === stableMinimapLayoutInput.scrollBeyondLastLine2640&& input.paddingTop === stableMinimapLayoutInput.paddingTop2641&& input.paddingBottom === stableMinimapLayoutInput.paddingBottom2642&& input.minimap.enabled === stableMinimapLayoutInput.minimap.enabled2643&& input.minimap.side === stableMinimapLayoutInput.minimap.side2644&& input.minimap.size === stableMinimapLayoutInput.minimap.size2645&& input.minimap.showSlider === stableMinimapLayoutInput.minimap.showSlider2646&& input.minimap.renderCharacters === stableMinimapLayoutInput.minimap.renderCharacters2647&& input.minimap.maxColumn === stableMinimapLayoutInput.minimap.maxColumn2648&& input.minimap.scale === stableMinimapLayoutInput.minimap.scale2649&& input.verticalScrollbarWidth === stableMinimapLayoutInput.verticalScrollbarWidth2650// && input.viewLineCount === lastMinimapLayoutInput.viewLineCount !!! INTENTIONAL OMITTED2651// && input.remainingWidth === lastMinimapLayoutInput.remainingWidth !!! INTENTIONAL OMITTED2652&& input.isViewportWrapping === stableMinimapLayoutInput.isViewportWrapping2653);26542655const lineHeight = input.lineHeight;2656const typicalHalfwidthCharacterWidth = input.typicalHalfwidthCharacterWidth;2657const scrollBeyondLastLine = input.scrollBeyondLastLine;2658const minimapRenderCharacters = input.minimap.renderCharacters;2659let minimapScale = (pixelRatio >= 2 ? Math.round(input.minimap.scale * 2) : input.minimap.scale);2660const minimapMaxColumn = input.minimap.maxColumn;2661const minimapSize = input.minimap.size;2662const minimapSide = input.minimap.side;2663const verticalScrollbarWidth = input.verticalScrollbarWidth;2664const viewLineCount = input.viewLineCount;2665const remainingWidth = input.remainingWidth;2666const isViewportWrapping = input.isViewportWrapping;26672668const baseCharHeight = minimapRenderCharacters ? 2 : 3;2669let minimapCanvasInnerHeight = Math.floor(pixelRatio * outerHeight);2670const minimapCanvasOuterHeight = minimapCanvasInnerHeight / pixelRatio;2671let minimapHeightIsEditorHeight = false;2672let minimapIsSampling = false;2673let minimapLineHeight = baseCharHeight * minimapScale;2674let minimapCharWidth = minimapScale / pixelRatio;2675let minimapWidthMultiplier: number = 1;26762677if (minimapSize === 'fill' || minimapSize === 'fit') {2678const { typicalViewportLineCount, extraLinesBeforeFirstLine, extraLinesBeyondLastLine, desiredRatio, minimapLineCount } = EditorLayoutInfoComputer.computeContainedMinimapLineCount({2679viewLineCount: viewLineCount,2680scrollBeyondLastLine: scrollBeyondLastLine,2681paddingTop: input.paddingTop,2682paddingBottom: input.paddingBottom,2683height: outerHeight,2684lineHeight: lineHeight,2685pixelRatio: pixelRatio2686});2687// ratio is intentionally not part of the layout to avoid the layout changing all the time2688// when doing sampling2689const ratio = viewLineCount / minimapLineCount;26902691if (ratio > 1) {2692minimapHeightIsEditorHeight = true;2693minimapIsSampling = true;2694minimapScale = 1;2695minimapLineHeight = 1;2696minimapCharWidth = minimapScale / pixelRatio;2697} else {2698let fitBecomesFill = false;2699let maxMinimapScale = minimapScale + 1;27002701if (minimapSize === 'fit') {2702const effectiveMinimapHeight = Math.ceil((extraLinesBeforeFirstLine + viewLineCount + extraLinesBeyondLastLine) * minimapLineHeight);2703if (isViewportWrapping && couldUseMemory && remainingWidth <= memory.stableFitRemainingWidth) {2704// There is a loop when using `fit` and viewport wrapping:2705// - view line count impacts minimap layout2706// - minimap layout impacts viewport width2707// - viewport width impacts view line count2708// To break the loop, once we go to a smaller minimap scale, we try to stick with it.2709fitBecomesFill = true;2710maxMinimapScale = memory.stableFitMaxMinimapScale;2711} else {2712fitBecomesFill = (effectiveMinimapHeight > minimapCanvasInnerHeight);2713}2714}27152716if (minimapSize === 'fill' || fitBecomesFill) {2717minimapHeightIsEditorHeight = true;2718const configuredMinimapScale = minimapScale;2719minimapLineHeight = Math.min(lineHeight * pixelRatio, Math.max(1, Math.floor(1 / desiredRatio)));2720if (isViewportWrapping && couldUseMemory && remainingWidth <= memory.stableFitRemainingWidth) {2721// There is a loop when using `fill` and viewport wrapping:2722// - view line count impacts minimap layout2723// - minimap layout impacts viewport width2724// - viewport width impacts view line count2725// To break the loop, once we go to a smaller minimap scale, we try to stick with it.2726maxMinimapScale = memory.stableFitMaxMinimapScale;2727}2728minimapScale = Math.min(maxMinimapScale, Math.max(1, Math.floor(minimapLineHeight / baseCharHeight)));2729if (minimapScale > configuredMinimapScale) {2730minimapWidthMultiplier = Math.min(2, minimapScale / configuredMinimapScale);2731}2732minimapCharWidth = minimapScale / pixelRatio / minimapWidthMultiplier;2733minimapCanvasInnerHeight = Math.ceil((Math.max(typicalViewportLineCount, extraLinesBeforeFirstLine + viewLineCount + extraLinesBeyondLastLine)) * minimapLineHeight);2734if (isViewportWrapping) {2735// remember for next time2736memory.stableMinimapLayoutInput = input;2737memory.stableFitRemainingWidth = remainingWidth;2738memory.stableFitMaxMinimapScale = minimapScale;2739} else {2740memory.stableMinimapLayoutInput = null;2741memory.stableFitRemainingWidth = 0;2742}2743}2744}2745}27462747// Given:2748// (leaving 2px for the cursor to have space after the last character)2749// viewportColumn = (contentWidth - verticalScrollbarWidth - 2) / typicalHalfwidthCharacterWidth2750// minimapWidth = viewportColumn * minimapCharWidth2751// contentWidth = remainingWidth - minimapWidth2752// What are good values for contentWidth and minimapWidth ?27532754// minimapWidth = ((contentWidth - verticalScrollbarWidth - 2) / typicalHalfwidthCharacterWidth) * minimapCharWidth2755// typicalHalfwidthCharacterWidth * minimapWidth = (contentWidth - verticalScrollbarWidth - 2) * minimapCharWidth2756// typicalHalfwidthCharacterWidth * minimapWidth = (remainingWidth - minimapWidth - verticalScrollbarWidth - 2) * minimapCharWidth2757// (typicalHalfwidthCharacterWidth + minimapCharWidth) * minimapWidth = (remainingWidth - verticalScrollbarWidth - 2) * minimapCharWidth2758// minimapWidth = ((remainingWidth - verticalScrollbarWidth - 2) * minimapCharWidth) / (typicalHalfwidthCharacterWidth + minimapCharWidth)27592760const minimapMaxWidth = Math.floor(minimapMaxColumn * minimapCharWidth);2761const minimapWidth = Math.min(minimapMaxWidth, Math.max(0, Math.floor(((remainingWidth - verticalScrollbarWidth - 2) * minimapCharWidth) / (typicalHalfwidthCharacterWidth + minimapCharWidth))) + MINIMAP_GUTTER_WIDTH);27622763let minimapCanvasInnerWidth = Math.floor(pixelRatio * minimapWidth);2764const minimapCanvasOuterWidth = minimapCanvasInnerWidth / pixelRatio;2765minimapCanvasInnerWidth = Math.floor(minimapCanvasInnerWidth * minimapWidthMultiplier);27662767const renderMinimap = (minimapRenderCharacters ? RenderMinimap.Text : RenderMinimap.Blocks);2768const minimapLeft = (minimapSide === 'left' ? 0 : (outerWidth - minimapWidth - verticalScrollbarWidth));27692770return {2771renderMinimap,2772minimapLeft,2773minimapWidth,2774minimapHeightIsEditorHeight,2775minimapIsSampling,2776minimapScale,2777minimapLineHeight,2778minimapCanvasInnerWidth,2779minimapCanvasInnerHeight,2780minimapCanvasOuterWidth,2781minimapCanvasOuterHeight,2782};2783}27842785public static computeLayout(options: IComputedEditorOptions, env: EditorLayoutInfoComputerEnv): EditorLayoutInfo {2786const outerWidth = env.outerWidth | 0;2787const outerHeight = env.outerHeight | 0;2788const lineHeight = env.lineHeight | 0;2789const lineNumbersDigitCount = env.lineNumbersDigitCount | 0;2790const typicalHalfwidthCharacterWidth = env.typicalHalfwidthCharacterWidth;2791const maxDigitWidth = env.maxDigitWidth;2792const pixelRatio = env.pixelRatio;2793const viewLineCount = env.viewLineCount;27942795const wordWrapOverride2 = options.get(EditorOption.wordWrapOverride2);2796const wordWrapOverride1 = (wordWrapOverride2 === 'inherit' ? options.get(EditorOption.wordWrapOverride1) : wordWrapOverride2);2797const wordWrap = (wordWrapOverride1 === 'inherit' ? options.get(EditorOption.wordWrap) : wordWrapOverride1);27982799const wordWrapColumn = options.get(EditorOption.wordWrapColumn);2800const isDominatedByLongLines = env.isDominatedByLongLines;28012802const showGlyphMargin = options.get(EditorOption.glyphMargin);2803const showLineNumbers = (options.get(EditorOption.lineNumbers).renderType !== RenderLineNumbersType.Off);2804const lineNumbersMinChars = options.get(EditorOption.lineNumbersMinChars);2805const scrollBeyondLastLine = options.get(EditorOption.scrollBeyondLastLine);2806const padding = options.get(EditorOption.padding);2807const minimap = options.get(EditorOption.minimap);28082809const scrollbar = options.get(EditorOption.scrollbar);2810const verticalScrollbarWidth = scrollbar.verticalScrollbarSize;2811const verticalScrollbarHasArrows = scrollbar.verticalHasArrows;2812const scrollbarArrowSize = scrollbar.arrowSize;2813const horizontalScrollbarHeight = scrollbar.horizontalScrollbarSize;28142815const folding = options.get(EditorOption.folding);2816const showFoldingDecoration = options.get(EditorOption.showFoldingControls) !== 'never';28172818let lineDecorationsWidth = options.get(EditorOption.lineDecorationsWidth);2819if (folding && showFoldingDecoration) {2820lineDecorationsWidth += 16;2821}28222823let lineNumbersWidth = 0;2824if (showLineNumbers) {2825const digitCount = Math.max(lineNumbersDigitCount, lineNumbersMinChars);2826lineNumbersWidth = Math.round(digitCount * maxDigitWidth);2827}28282829let glyphMarginWidth = 0;2830if (showGlyphMargin) {2831glyphMarginWidth = lineHeight * env.glyphMarginDecorationLaneCount;2832}28332834let glyphMarginLeft = 0;2835let lineNumbersLeft = glyphMarginLeft + glyphMarginWidth;2836let decorationsLeft = lineNumbersLeft + lineNumbersWidth;2837let contentLeft = decorationsLeft + lineDecorationsWidth;28382839const remainingWidth = outerWidth - glyphMarginWidth - lineNumbersWidth - lineDecorationsWidth;28402841let isWordWrapMinified = false;2842let isViewportWrapping = false;2843let wrappingColumn = -1;28442845if (options.get(EditorOption.accessibilitySupport) === AccessibilitySupport.Enabled && wordWrapOverride1 === 'inherit' && isDominatedByLongLines) {2846// Force viewport width wrapping if model is dominated by long lines2847isWordWrapMinified = true;2848isViewportWrapping = true;2849} else if (wordWrap === 'on' || wordWrap === 'bounded') {2850isViewportWrapping = true;2851} else if (wordWrap === 'wordWrapColumn') {2852wrappingColumn = wordWrapColumn;2853}28542855const minimapLayout = EditorLayoutInfoComputer._computeMinimapLayout({2856outerWidth: outerWidth,2857outerHeight: outerHeight,2858lineHeight: lineHeight,2859typicalHalfwidthCharacterWidth: typicalHalfwidthCharacterWidth,2860pixelRatio: pixelRatio,2861scrollBeyondLastLine: scrollBeyondLastLine,2862paddingTop: padding.top,2863paddingBottom: padding.bottom,2864minimap: minimap,2865verticalScrollbarWidth: verticalScrollbarWidth,2866viewLineCount: viewLineCount,2867remainingWidth: remainingWidth,2868isViewportWrapping: isViewportWrapping,2869}, env.memory || new ComputeOptionsMemory());28702871if (minimapLayout.renderMinimap !== RenderMinimap.None && minimapLayout.minimapLeft === 0) {2872// the minimap is rendered to the left, so move everything to the right2873glyphMarginLeft += minimapLayout.minimapWidth;2874lineNumbersLeft += minimapLayout.minimapWidth;2875decorationsLeft += minimapLayout.minimapWidth;2876contentLeft += minimapLayout.minimapWidth;2877}2878const contentWidth = remainingWidth - minimapLayout.minimapWidth;28792880// (leaving 2px for the cursor to have space after the last character)2881const viewportColumn = Math.max(1, Math.floor((contentWidth - verticalScrollbarWidth - 2) / typicalHalfwidthCharacterWidth));28822883const verticalArrowSize = (verticalScrollbarHasArrows ? scrollbarArrowSize : 0);28842885if (isViewportWrapping) {2886// compute the actual wrappingColumn2887wrappingColumn = Math.max(1, viewportColumn);2888if (wordWrap === 'bounded') {2889wrappingColumn = Math.min(wrappingColumn, wordWrapColumn);2890}2891}28922893return {2894width: outerWidth,2895height: outerHeight,28962897glyphMarginLeft: glyphMarginLeft,2898glyphMarginWidth: glyphMarginWidth,2899glyphMarginDecorationLaneCount: env.glyphMarginDecorationLaneCount,29002901lineNumbersLeft: lineNumbersLeft,2902lineNumbersWidth: lineNumbersWidth,29032904decorationsLeft: decorationsLeft,2905decorationsWidth: lineDecorationsWidth,29062907contentLeft: contentLeft,2908contentWidth: contentWidth,29092910minimap: minimapLayout,29112912viewportColumn: viewportColumn,29132914isWordWrapMinified: isWordWrapMinified,2915isViewportWrapping: isViewportWrapping,2916wrappingColumn: wrappingColumn,29172918verticalScrollbarWidth: verticalScrollbarWidth,2919horizontalScrollbarHeight: horizontalScrollbarHeight,29202921overviewRuler: {2922top: verticalArrowSize,2923width: verticalScrollbarWidth,2924height: (outerHeight - 2 * verticalArrowSize),2925right: 02926}2927};2928}2929}29302931//#endregion29322933//#region WrappingStrategy2934class WrappingStrategy extends BaseEditorOption<EditorOption.wrappingStrategy, 'simple' | 'advanced', 'simple' | 'advanced'> {29352936constructor() {2937super(EditorOption.wrappingStrategy, 'wrappingStrategy', 'simple',2938{2939'editor.wrappingStrategy': {2940enumDescriptions: [2941nls.localize('wrappingStrategy.simple', "Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),2942nls.localize('wrappingStrategy.advanced', "Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")2943],2944type: 'string',2945enum: ['simple', 'advanced'],2946default: 'simple',2947description: nls.localize('wrappingStrategy', "Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")2948}2949}2950);2951}29522953public validate(input: any): 'simple' | 'advanced' {2954return stringSet<'simple' | 'advanced'>(input, 'simple', ['simple', 'advanced']);2955}29562957public override compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: 'simple' | 'advanced'): 'simple' | 'advanced' {2958const accessibilitySupport = options.get(EditorOption.accessibilitySupport);2959if (accessibilitySupport === AccessibilitySupport.Enabled) {2960// if we know for a fact that a screen reader is attached, we switch our strategy to advanced to2961// help that the editor's wrapping points match the textarea's wrapping points2962return 'advanced';2963}2964return value;2965}2966}2967//#endregion29682969//#region lightbulb29702971export enum ShowLightbulbIconMode {2972Off = 'off',2973OnCode = 'onCode',2974On = 'on'2975}29762977/**2978* Configuration options for editor lightbulb2979*/2980export interface IEditorLightbulbOptions {2981/**2982* Enable the lightbulb code action.2983* The three possible values are `off`, `on` and `onCode` and the default is `onCode`.2984* `off` disables the code action menu.2985* `on` shows the code action menu on code and on empty lines.2986* `onCode` shows the code action menu on code only.2987*/2988enabled?: ShowLightbulbIconMode;2989}29902991/**2992* @internal2993*/2994export type EditorLightbulbOptions = Readonly<Required<IEditorLightbulbOptions>>;29952996class EditorLightbulb extends BaseEditorOption<EditorOption.lightbulb, IEditorLightbulbOptions, EditorLightbulbOptions> {29972998constructor() {2999const defaults: EditorLightbulbOptions = { enabled: ShowLightbulbIconMode.OnCode };3000super(3001EditorOption.lightbulb, 'lightbulb', defaults,3002{3003'editor.lightbulb.enabled': {3004type: 'string',3005enum: [ShowLightbulbIconMode.Off, ShowLightbulbIconMode.OnCode, ShowLightbulbIconMode.On],3006default: defaults.enabled,3007enumDescriptions: [3008nls.localize('editor.lightbulb.enabled.off', 'Disable the code action menu.'),3009nls.localize('editor.lightbulb.enabled.onCode', 'Show the code action menu when the cursor is on lines with code.'),3010nls.localize('editor.lightbulb.enabled.on', 'Show the code action menu when the cursor is on lines with code or on empty lines.'),3011],3012description: nls.localize('enabled', "Enables the Code Action lightbulb in the editor.")3013}3014}3015);3016}30173018public validate(_input: any): EditorLightbulbOptions {3019if (!_input || typeof _input !== 'object') {3020return this.defaultValue;3021}3022const input = _input as IEditorLightbulbOptions;3023return {3024enabled: stringSet(input.enabled, this.defaultValue.enabled, [ShowLightbulbIconMode.Off, ShowLightbulbIconMode.OnCode, ShowLightbulbIconMode.On])3025};3026}3027}30283029//#endregion30303031//#region stickyScroll30323033export interface IEditorStickyScrollOptions {3034/**3035* Enable the sticky scroll3036*/3037enabled?: boolean;3038/**3039* Maximum number of sticky lines to show3040*/3041maxLineCount?: number;3042/**3043* Model to choose for sticky scroll by default3044*/3045defaultModel?: 'outlineModel' | 'foldingProviderModel' | 'indentationModel';3046/**3047* Define whether to scroll sticky scroll with editor horizontal scrollbae3048*/3049scrollWithEditor?: boolean;3050}30513052/**3053* @internal3054*/3055export type EditorStickyScrollOptions = Readonly<Required<IEditorStickyScrollOptions>>;30563057class EditorStickyScroll extends BaseEditorOption<EditorOption.stickyScroll, IEditorStickyScrollOptions, EditorStickyScrollOptions> {30583059constructor() {3060const defaults: EditorStickyScrollOptions = { enabled: true, maxLineCount: 5, defaultModel: 'outlineModel', scrollWithEditor: true };3061super(3062EditorOption.stickyScroll, 'stickyScroll', defaults,3063{3064'editor.stickyScroll.enabled': {3065type: 'boolean',3066default: defaults.enabled,3067description: nls.localize('editor.stickyScroll.enabled', "Shows the nested current scopes during the scroll at the top of the editor.")3068},3069'editor.stickyScroll.maxLineCount': {3070type: 'number',3071default: defaults.maxLineCount,3072minimum: 1,3073maximum: 20,3074description: nls.localize('editor.stickyScroll.maxLineCount', "Defines the maximum number of sticky lines to show.")3075},3076'editor.stickyScroll.defaultModel': {3077type: 'string',3078enum: ['outlineModel', 'foldingProviderModel', 'indentationModel'],3079default: defaults.defaultModel,3080description: nls.localize('editor.stickyScroll.defaultModel', "Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")3081},3082'editor.stickyScroll.scrollWithEditor': {3083type: 'boolean',3084default: defaults.scrollWithEditor,3085description: nls.localize('editor.stickyScroll.scrollWithEditor', "Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")3086},3087}3088);3089}30903091public validate(_input: any): EditorStickyScrollOptions {3092if (!_input || typeof _input !== 'object') {3093return this.defaultValue;3094}3095const input = _input as IEditorStickyScrollOptions;3096return {3097enabled: boolean(input.enabled, this.defaultValue.enabled),3098maxLineCount: EditorIntOption.clampedInt(input.maxLineCount, this.defaultValue.maxLineCount, 1, 20),3099defaultModel: stringSet<'outlineModel' | 'foldingProviderModel' | 'indentationModel'>(input.defaultModel, this.defaultValue.defaultModel, ['outlineModel', 'foldingProviderModel', 'indentationModel']),3100scrollWithEditor: boolean(input.scrollWithEditor, this.defaultValue.scrollWithEditor)3101};3102}3103}31043105//#endregion31063107//#region inlayHints31083109/**3110* Configuration options for editor inlayHints3111*/3112export interface IEditorInlayHintsOptions {3113/**3114* Enable the inline hints.3115* Defaults to true.3116*/3117enabled?: 'on' | 'off' | 'offUnlessPressed' | 'onUnlessPressed';31183119/**3120* Font size of inline hints.3121* Default to 90% of the editor font size.3122*/3123fontSize?: number;31243125/**3126* Font family of inline hints.3127* Defaults to editor font family.3128*/3129fontFamily?: string;31303131/**3132* Enables the padding around the inlay hint.3133* Defaults to false.3134*/3135padding?: boolean;31363137/**3138* Maximum length for inlay hints per line3139* Set to 0 to have an unlimited length.3140*/3141maximumLength?: number;3142}31433144/**3145* @internal3146*/3147export type EditorInlayHintsOptions = Readonly<Required<IEditorInlayHintsOptions>>;31483149class EditorInlayHints extends BaseEditorOption<EditorOption.inlayHints, IEditorInlayHintsOptions, EditorInlayHintsOptions> {31503151constructor() {3152const defaults: EditorInlayHintsOptions = { enabled: 'on', fontSize: 0, fontFamily: '', padding: false, maximumLength: 43 };3153super(3154EditorOption.inlayHints, 'inlayHints', defaults,3155{3156'editor.inlayHints.enabled': {3157type: 'string',3158default: defaults.enabled,3159description: nls.localize('inlayHints.enable', "Enables the inlay hints in the editor."),3160enum: ['on', 'onUnlessPressed', 'offUnlessPressed', 'off'],3161markdownEnumDescriptions: [3162nls.localize('editor.inlayHints.on', "Inlay hints are enabled"),3163nls.localize('editor.inlayHints.onUnlessPressed', "Inlay hints are showing by default and hide when holding {0}", platform.isMacintosh ? `Ctrl+Option` : `Ctrl+Alt`),3164nls.localize('editor.inlayHints.offUnlessPressed', "Inlay hints are hidden by default and show when holding {0}", platform.isMacintosh ? `Ctrl+Option` : `Ctrl+Alt`),3165nls.localize('editor.inlayHints.off', "Inlay hints are disabled"),3166],3167},3168'editor.inlayHints.fontSize': {3169type: 'number',3170default: defaults.fontSize,3171markdownDescription: nls.localize('inlayHints.fontSize', "Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.", '`#editor.fontSize#`', '`5`')3172},3173'editor.inlayHints.fontFamily': {3174type: 'string',3175default: defaults.fontFamily,3176markdownDescription: nls.localize('inlayHints.fontFamily', "Controls font family of inlay hints in the editor. When set to empty, the {0} is used.", '`#editor.fontFamily#`')3177},3178'editor.inlayHints.padding': {3179type: 'boolean',3180default: defaults.padding,3181description: nls.localize('inlayHints.padding', "Enables the padding around the inlay hints in the editor.")3182},3183'editor.inlayHints.maximumLength': {3184type: 'number',3185default: defaults.maximumLength,3186markdownDescription: nls.localize('inlayHints.maximumLength', "Maximum overall length of inlay hints, for a single line, before they get truncated by the editor. Set to `0` to never truncate")3187}3188}3189);3190}31913192public validate(_input: any): EditorInlayHintsOptions {3193if (!_input || typeof _input !== 'object') {3194return this.defaultValue;3195}3196const input = _input as IEditorInlayHintsOptions;3197if (typeof input.enabled === 'boolean') {3198input.enabled = input.enabled ? 'on' : 'off';3199}3200return {3201enabled: stringSet<'on' | 'off' | 'offUnlessPressed' | 'onUnlessPressed'>(input.enabled, this.defaultValue.enabled, ['on', 'off', 'offUnlessPressed', 'onUnlessPressed']),3202fontSize: EditorIntOption.clampedInt(input.fontSize, this.defaultValue.fontSize, 0, 100),3203fontFamily: EditorStringOption.string(input.fontFamily, this.defaultValue.fontFamily),3204padding: boolean(input.padding, this.defaultValue.padding),3205maximumLength: EditorIntOption.clampedInt(input.maximumLength, this.defaultValue.maximumLength, 0, Number.MAX_SAFE_INTEGER),3206};3207}3208}32093210//#endregion32113212//#region lineDecorationsWidth32133214class EditorLineDecorationsWidth extends BaseEditorOption<EditorOption.lineDecorationsWidth, number | string, number> {32153216constructor() {3217super(EditorOption.lineDecorationsWidth, 'lineDecorationsWidth', 10);3218}32193220public validate(input: any): number {3221if (typeof input === 'string' && /^\d+(\.\d+)?ch$/.test(input)) {3222const multiple = parseFloat(input.substring(0, input.length - 2));3223return -multiple; // negative numbers signal a multiple3224} else {3225return EditorIntOption.clampedInt(input, this.defaultValue, 0, 1000);3226}3227}32283229public override compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: number): number {3230if (value < 0) {3231// negative numbers signal a multiple3232return EditorIntOption.clampedInt(-value * env.fontInfo.typicalHalfwidthCharacterWidth, this.defaultValue, 0, 1000);3233} else {3234return value;3235}3236}3237}32383239//#endregion32403241//#region lineHeight32423243class EditorLineHeight extends EditorFloatOption<EditorOption.lineHeight> {32443245constructor() {3246super(3247EditorOption.lineHeight, 'lineHeight',3248EDITOR_FONT_DEFAULTS.lineHeight,3249x => EditorFloatOption.clamp(x, 0, 150),3250{ markdownDescription: nls.localize('lineHeight', "Controls the line height. \n - Use 0 to automatically compute the line height from the font size.\n - Values between 0 and 8 will be used as a multiplier with the font size.\n - Values greater than or equal to 8 will be used as effective values.") },32510,32521503253);3254}32553256public override compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: number): number {3257// The lineHeight is computed from the fontSize if it is 0.3258// Moreover, the final lineHeight respects the editor zoom level.3259// So take the result from env.fontInfo3260return env.fontInfo.lineHeight;3261}3262}32633264//#endregion32653266//#region minimap32673268/**3269* Configuration options for editor minimap3270*/3271export interface IEditorMinimapOptions {3272/**3273* Enable the rendering of the minimap.3274* Defaults to true.3275*/3276enabled?: boolean;3277/**3278* Control the rendering of minimap.3279*/3280autohide?: 'none' | 'mouseover' | 'scroll';3281/**3282* Control the side of the minimap in editor.3283* Defaults to 'right'.3284*/3285side?: 'right' | 'left';3286/**3287* Control the minimap rendering mode.3288* Defaults to 'actual'.3289*/3290size?: 'proportional' | 'fill' | 'fit';3291/**3292* Control the rendering of the minimap slider.3293* Defaults to 'mouseover'.3294*/3295showSlider?: 'always' | 'mouseover';3296/**3297* Render the actual text on a line (as opposed to color blocks).3298* Defaults to true.3299*/3300renderCharacters?: boolean;3301/**3302* Limit the width of the minimap to render at most a certain number of columns.3303* Defaults to 120.3304*/3305maxColumn?: number;3306/**3307* Relative size of the font in the minimap. Defaults to 1.3308*/3309scale?: number;3310/**3311* Whether to show named regions as section headers. Defaults to true.3312*/3313showRegionSectionHeaders?: boolean;3314/**3315* Whether to show MARK: comments as section headers. Defaults to true.3316*/3317showMarkSectionHeaders?: boolean;3318/**3319* When specified, is used to create a custom section header parser regexp.3320* Must contain a match group named 'label' (written as (?<label>.+)) that encapsulates the section header.3321* Optionally can include another match group named 'separator'.3322* To match multi-line headers like:3323* // ==========3324* // My Section3325* // ==========3326* Use a pattern like: ^={3,}\n^\/\/ *(?<label>[^\n]*?)\n^={3,}$3327*/3328markSectionHeaderRegex?: string;3329/**3330* Font size of section headers. Defaults to 9.3331*/3332sectionHeaderFontSize?: number;3333/**3334* Spacing between the section header characters (in CSS px). Defaults to 1.3335*/3336sectionHeaderLetterSpacing?: number;3337}33383339/**3340* @internal3341*/3342export type EditorMinimapOptions = Readonly<Required<IEditorMinimapOptions>>;33433344class EditorMinimap extends BaseEditorOption<EditorOption.minimap, IEditorMinimapOptions, EditorMinimapOptions> {33453346constructor() {3347const defaults: EditorMinimapOptions = {3348enabled: true,3349size: 'proportional',3350side: 'right',3351showSlider: 'mouseover',3352autohide: 'none',3353renderCharacters: true,3354maxColumn: 120,3355scale: 1,3356showRegionSectionHeaders: true,3357showMarkSectionHeaders: true,3358markSectionHeaderRegex: '\\bMARK:\\s*(?<separator>\-?)\\s*(?<label>.*)$',3359sectionHeaderFontSize: 9,3360sectionHeaderLetterSpacing: 1,3361};3362super(3363EditorOption.minimap, 'minimap', defaults,3364{3365'editor.minimap.enabled': {3366type: 'boolean',3367default: defaults.enabled,3368description: nls.localize('minimap.enabled', "Controls whether the minimap is shown.")3369},3370'editor.minimap.autohide': {3371type: 'string',3372enum: ['none', 'mouseover', 'scroll'],3373enumDescriptions: [3374nls.localize('minimap.autohide.none', "The minimap is always shown."),3375nls.localize('minimap.autohide.mouseover', "The minimap is hidden when mouse is not over the minimap and shown when mouse is over the minimap."),3376nls.localize('minimap.autohide.scroll', "The minimap is only shown when the editor is scrolled"),3377],3378default: defaults.autohide,3379description: nls.localize('minimap.autohide', "Controls whether the minimap is hidden automatically.")3380},3381'editor.minimap.size': {3382type: 'string',3383enum: ['proportional', 'fill', 'fit'],3384enumDescriptions: [3385nls.localize('minimap.size.proportional', "The minimap has the same size as the editor contents (and might scroll)."),3386nls.localize('minimap.size.fill', "The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),3387nls.localize('minimap.size.fit', "The minimap will shrink as necessary to never be larger than the editor (no scrolling)."),3388],3389default: defaults.size,3390description: nls.localize('minimap.size', "Controls the size of the minimap.")3391},3392'editor.minimap.side': {3393type: 'string',3394enum: ['left', 'right'],3395default: defaults.side,3396description: nls.localize('minimap.side', "Controls the side where to render the minimap.")3397},3398'editor.minimap.showSlider': {3399type: 'string',3400enum: ['always', 'mouseover'],3401default: defaults.showSlider,3402description: nls.localize('minimap.showSlider', "Controls when the minimap slider is shown.")3403},3404'editor.minimap.scale': {3405type: 'number',3406default: defaults.scale,3407minimum: 1,3408maximum: 3,3409enum: [1, 2, 3],3410description: nls.localize('minimap.scale', "Scale of content drawn in the minimap: 1, 2 or 3.")3411},3412'editor.minimap.renderCharacters': {3413type: 'boolean',3414default: defaults.renderCharacters,3415description: nls.localize('minimap.renderCharacters', "Render the actual characters on a line as opposed to color blocks.")3416},3417'editor.minimap.maxColumn': {3418type: 'number',3419default: defaults.maxColumn,3420description: nls.localize('minimap.maxColumn', "Limit the width of the minimap to render at most a certain number of columns.")3421},3422'editor.minimap.showRegionSectionHeaders': {3423type: 'boolean',3424default: defaults.showRegionSectionHeaders,3425description: nls.localize('minimap.showRegionSectionHeaders', "Controls whether named regions are shown as section headers in the minimap.")3426},3427'editor.minimap.showMarkSectionHeaders': {3428type: 'boolean',3429default: defaults.showMarkSectionHeaders,3430description: nls.localize('minimap.showMarkSectionHeaders', "Controls whether MARK: comments are shown as section headers in the minimap.")3431},3432'editor.minimap.markSectionHeaderRegex': {3433type: 'string',3434default: defaults.markSectionHeaderRegex,3435description: nls.localize('minimap.markSectionHeaderRegex', "Defines the regular expression used to find section headers in comments. The regex must contain a named match group `label` (written as `(?<label>.+)`) that encapsulates the section header, otherwise it will not work. Optionally you can include another match group named `separator`. Use \\n in the pattern to match multi-line headers."),3436},3437'editor.minimap.sectionHeaderFontSize': {3438type: 'number',3439default: defaults.sectionHeaderFontSize,3440description: nls.localize('minimap.sectionHeaderFontSize', "Controls the font size of section headers in the minimap.")3441},3442'editor.minimap.sectionHeaderLetterSpacing': {3443type: 'number',3444default: defaults.sectionHeaderLetterSpacing,3445description: nls.localize('minimap.sectionHeaderLetterSpacing', "Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes.")3446}3447}3448);3449}34503451public validate(_input: any): EditorMinimapOptions {3452if (!_input || typeof _input !== 'object') {3453return this.defaultValue;3454}3455const input = _input as IEditorMinimapOptions;34563457// Validate mark section header regex3458let markSectionHeaderRegex = this.defaultValue.markSectionHeaderRegex;3459const inputRegex = _input.markSectionHeaderRegex;3460if (typeof inputRegex === 'string') {3461try {3462new RegExp(inputRegex, 'd');3463markSectionHeaderRegex = inputRegex;3464} catch { }3465}34663467return {3468enabled: boolean(input.enabled, this.defaultValue.enabled),3469autohide: stringSet<'none' | 'mouseover' | 'scroll'>(input.autohide, this.defaultValue.autohide, ['none', 'mouseover', 'scroll']),3470size: stringSet<'proportional' | 'fill' | 'fit'>(input.size, this.defaultValue.size, ['proportional', 'fill', 'fit']),3471side: stringSet<'right' | 'left'>(input.side, this.defaultValue.side, ['right', 'left']),3472showSlider: stringSet<'always' | 'mouseover'>(input.showSlider, this.defaultValue.showSlider, ['always', 'mouseover']),3473renderCharacters: boolean(input.renderCharacters, this.defaultValue.renderCharacters),3474scale: EditorIntOption.clampedInt(input.scale, 1, 1, 3),3475maxColumn: EditorIntOption.clampedInt(input.maxColumn, this.defaultValue.maxColumn, 1, 10000),3476showRegionSectionHeaders: boolean(input.showRegionSectionHeaders, this.defaultValue.showRegionSectionHeaders),3477showMarkSectionHeaders: boolean(input.showMarkSectionHeaders, this.defaultValue.showMarkSectionHeaders),3478markSectionHeaderRegex: markSectionHeaderRegex,3479sectionHeaderFontSize: EditorFloatOption.clamp(input.sectionHeaderFontSize ?? this.defaultValue.sectionHeaderFontSize, 4, 32),3480sectionHeaderLetterSpacing: EditorFloatOption.clamp(input.sectionHeaderLetterSpacing ?? this.defaultValue.sectionHeaderLetterSpacing, 0, 5),3481};3482}3483}34843485//#endregion34863487//#region multiCursorModifier34883489function _multiCursorModifierFromString(multiCursorModifier: 'ctrlCmd' | 'alt'): 'altKey' | 'metaKey' | 'ctrlKey' {3490if (multiCursorModifier === 'ctrlCmd') {3491return (platform.isMacintosh ? 'metaKey' : 'ctrlKey');3492}3493return 'altKey';3494}34953496//#endregion34973498//#region padding34993500/**3501* Configuration options for editor padding3502*/3503export interface IEditorPaddingOptions {3504/**3505* Spacing between top edge of editor and first line.3506*/3507top?: number;3508/**3509* Spacing between bottom edge of editor and last line.3510*/3511bottom?: number;3512}35133514/**3515* @internal3516*/3517export type InternalEditorPaddingOptions = Readonly<Required<IEditorPaddingOptions>>;35183519class EditorPadding extends BaseEditorOption<EditorOption.padding, IEditorPaddingOptions, InternalEditorPaddingOptions> {35203521constructor() {3522super(3523EditorOption.padding, 'padding', { top: 0, bottom: 0 },3524{3525'editor.padding.top': {3526type: 'number',3527default: 0,3528minimum: 0,3529maximum: 1000,3530description: nls.localize('padding.top', "Controls the amount of space between the top edge of the editor and the first line.")3531},3532'editor.padding.bottom': {3533type: 'number',3534default: 0,3535minimum: 0,3536maximum: 1000,3537description: nls.localize('padding.bottom', "Controls the amount of space between the bottom edge of the editor and the last line.")3538}3539}3540);3541}35423543public validate(_input: any): InternalEditorPaddingOptions {3544if (!_input || typeof _input !== 'object') {3545return this.defaultValue;3546}3547const input = _input as IEditorPaddingOptions;35483549return {3550top: EditorIntOption.clampedInt(input.top, 0, 0, 1000),3551bottom: EditorIntOption.clampedInt(input.bottom, 0, 0, 1000)3552};3553}3554}3555//#endregion35563557//#region parameterHints35583559/**3560* Configuration options for parameter hints3561*/3562export interface IEditorParameterHintOptions {3563/**3564* Enable parameter hints.3565* Defaults to true.3566*/3567enabled?: boolean;3568/**3569* Enable cycling of parameter hints.3570* Defaults to false.3571*/3572cycle?: boolean;3573}35743575/**3576* @internal3577*/3578export type InternalParameterHintOptions = Readonly<Required<IEditorParameterHintOptions>>;35793580class EditorParameterHints extends BaseEditorOption<EditorOption.parameterHints, IEditorParameterHintOptions, InternalParameterHintOptions> {35813582constructor() {3583const defaults: InternalParameterHintOptions = {3584enabled: true,3585cycle: true3586};3587super(3588EditorOption.parameterHints, 'parameterHints', defaults,3589{3590'editor.parameterHints.enabled': {3591type: 'boolean',3592default: defaults.enabled,3593description: nls.localize('parameterHints.enabled', "Enables a pop-up that shows parameter documentation and type information as you type.")3594},3595'editor.parameterHints.cycle': {3596type: 'boolean',3597default: defaults.cycle,3598description: nls.localize('parameterHints.cycle', "Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")3599},3600}3601);3602}36033604public validate(_input: any): InternalParameterHintOptions {3605if (!_input || typeof _input !== 'object') {3606return this.defaultValue;3607}3608const input = _input as IEditorParameterHintOptions;3609return {3610enabled: boolean(input.enabled, this.defaultValue.enabled),3611cycle: boolean(input.cycle, this.defaultValue.cycle)3612};3613}3614}36153616//#endregion36173618//#region pixelRatio36193620class EditorPixelRatio extends ComputedEditorOption<EditorOption.pixelRatio, number> {36213622constructor() {3623super(EditorOption.pixelRatio);3624}36253626public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, _: number): number {3627return env.pixelRatio;3628}3629}36303631//#endregion36323633//#region36343635class PlaceholderOption extends BaseEditorOption<EditorOption.placeholder, string | undefined, string | undefined> {3636constructor() {3637super(EditorOption.placeholder, 'placeholder', undefined);3638}36393640public validate(input: any): string | undefined {3641if (typeof input === 'undefined') {3642return this.defaultValue;3643}3644if (typeof input === 'string') {3645return input;3646}3647return this.defaultValue;3648}3649}3650//#endregion36513652//#region quickSuggestions36533654export type QuickSuggestionsValue = 'on' | 'inline' | 'off';36553656/**3657* Configuration options for quick suggestions3658*/3659export interface IQuickSuggestionsOptions {3660other?: boolean | QuickSuggestionsValue;3661comments?: boolean | QuickSuggestionsValue;3662strings?: boolean | QuickSuggestionsValue;3663}36643665export interface InternalQuickSuggestionsOptions {3666readonly other: QuickSuggestionsValue;3667readonly comments: QuickSuggestionsValue;3668readonly strings: QuickSuggestionsValue;3669}36703671class EditorQuickSuggestions extends BaseEditorOption<EditorOption.quickSuggestions, boolean | IQuickSuggestionsOptions, InternalQuickSuggestionsOptions> {36723673public override readonly defaultValue: InternalQuickSuggestionsOptions;36743675constructor() {3676const defaults: InternalQuickSuggestionsOptions = {3677other: 'on',3678comments: 'off',3679strings: 'off'3680};3681const types: IJSONSchema[] = [3682{ type: 'boolean' },3683{3684type: 'string',3685enum: ['on', 'inline', 'off'],3686enumDescriptions: [nls.localize('on', "Quick suggestions show inside the suggest widget"), nls.localize('inline', "Quick suggestions show as ghost text"), nls.localize('off', "Quick suggestions are disabled")]3687}3688];3689super(EditorOption.quickSuggestions, 'quickSuggestions', defaults, {3690type: 'object',3691additionalProperties: false,3692properties: {3693strings: {3694anyOf: types,3695default: defaults.strings,3696description: nls.localize('quickSuggestions.strings', "Enable quick suggestions inside strings.")3697},3698comments: {3699anyOf: types,3700default: defaults.comments,3701description: nls.localize('quickSuggestions.comments', "Enable quick suggestions inside comments.")3702},3703other: {3704anyOf: types,3705default: defaults.other,3706description: nls.localize('quickSuggestions.other', "Enable quick suggestions outside of strings and comments.")3707},3708},3709default: defaults,3710markdownDescription: nls.localize('quickSuggestions', "Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the {0}-setting which controls if suggestions are triggered by special characters.", '`#editor.suggestOnTriggerCharacters#`')3711});3712this.defaultValue = defaults;3713}37143715public validate(input: any): InternalQuickSuggestionsOptions {3716if (typeof input === 'boolean') {3717// boolean -> all on/off3718const value = input ? 'on' : 'off';3719return { comments: value, strings: value, other: value };3720}3721if (!input || typeof input !== 'object') {3722// invalid object3723return this.defaultValue;3724}37253726const { other, comments, strings } = (<IQuickSuggestionsOptions>input);3727const allowedValues: QuickSuggestionsValue[] = ['on', 'inline', 'off'];3728let validatedOther: QuickSuggestionsValue;3729let validatedComments: QuickSuggestionsValue;3730let validatedStrings: QuickSuggestionsValue;37313732if (typeof other === 'boolean') {3733validatedOther = other ? 'on' : 'off';3734} else {3735validatedOther = stringSet(other, this.defaultValue.other, allowedValues);3736}3737if (typeof comments === 'boolean') {3738validatedComments = comments ? 'on' : 'off';3739} else {3740validatedComments = stringSet(comments, this.defaultValue.comments, allowedValues);3741}3742if (typeof strings === 'boolean') {3743validatedStrings = strings ? 'on' : 'off';3744} else {3745validatedStrings = stringSet(strings, this.defaultValue.strings, allowedValues);3746}3747return {3748other: validatedOther,3749comments: validatedComments,3750strings: validatedStrings3751};3752}3753}37543755//#endregion37563757//#region renderLineNumbers37583759export type LineNumbersType = 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string);37603761export const enum RenderLineNumbersType {3762Off = 0,3763On = 1,3764Relative = 2,3765Interval = 3,3766Custom = 43767}37683769export interface InternalEditorRenderLineNumbersOptions {3770readonly renderType: RenderLineNumbersType;3771readonly renderFn: ((lineNumber: number) => string) | null;3772}37733774class EditorRenderLineNumbersOption extends BaseEditorOption<EditorOption.lineNumbers, LineNumbersType, InternalEditorRenderLineNumbersOptions> {37753776constructor() {3777super(3778EditorOption.lineNumbers, 'lineNumbers', { renderType: RenderLineNumbersType.On, renderFn: null },3779{3780type: 'string',3781enum: ['off', 'on', 'relative', 'interval'],3782enumDescriptions: [3783nls.localize('lineNumbers.off', "Line numbers are not rendered."),3784nls.localize('lineNumbers.on', "Line numbers are rendered as absolute number."),3785nls.localize('lineNumbers.relative', "Line numbers are rendered as distance in lines to cursor position."),3786nls.localize('lineNumbers.interval', "Line numbers are rendered every 10 lines.")3787],3788default: 'on',3789description: nls.localize('lineNumbers', "Controls the display of line numbers.")3790}3791);3792}37933794public validate(lineNumbers: any): InternalEditorRenderLineNumbersOptions {3795let renderType: RenderLineNumbersType = this.defaultValue.renderType;3796let renderFn: ((lineNumber: number) => string) | null = this.defaultValue.renderFn;37973798if (typeof lineNumbers !== 'undefined') {3799if (typeof lineNumbers === 'function') {3800renderType = RenderLineNumbersType.Custom;3801renderFn = lineNumbers;3802} else if (lineNumbers === 'interval') {3803renderType = RenderLineNumbersType.Interval;3804} else if (lineNumbers === 'relative') {3805renderType = RenderLineNumbersType.Relative;3806} else if (lineNumbers === 'on') {3807renderType = RenderLineNumbersType.On;3808} else {3809renderType = RenderLineNumbersType.Off;3810}3811}38123813return {3814renderType,3815renderFn3816};3817}3818}38193820//#endregion38213822//#region renderValidationDecorations38233824/**3825* @internal3826*/3827export function filterValidationDecorations(options: IComputedEditorOptions): boolean {3828const renderValidationDecorations = options.get(EditorOption.renderValidationDecorations);3829if (renderValidationDecorations === 'editable') {3830return options.get(EditorOption.readOnly);3831}3832return renderValidationDecorations === 'on' ? false : true;3833}38343835//#endregion38363837//#region filterFontDecorations38383839/**3840* @internal3841*/3842export function filterFontDecorations(options: IComputedEditorOptions): boolean {3843return !options.get(EditorOption.effectiveAllowVariableFonts);3844}38453846//#endregion38473848//#region rulers38493850export interface IRulerOption {3851readonly column: number;3852readonly color: string | null;3853}38543855class EditorRulers extends BaseEditorOption<EditorOption.rulers, (number | IRulerOption)[], IRulerOption[]> {38563857constructor() {3858const defaults: IRulerOption[] = [];3859const columnSchema: IJSONSchema = { type: 'number', description: nls.localize('rulers.size', "Number of monospace characters at which this editor ruler will render.") };3860super(3861EditorOption.rulers, 'rulers', defaults,3862{3863type: 'array',3864items: {3865anyOf: [3866columnSchema,3867{3868type: [3869'object'3870],3871properties: {3872column: columnSchema,3873color: {3874type: 'string',3875description: nls.localize('rulers.color', "Color of this editor ruler."),3876format: 'color-hex'3877}3878}3879}3880]3881},3882default: defaults,3883description: nls.localize('rulers', "Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")3884}3885);3886}38873888public validate(input: any): IRulerOption[] {3889if (Array.isArray(input)) {3890const rulers: IRulerOption[] = [];3891for (const _element of input) {3892if (typeof _element === 'number') {3893rulers.push({3894column: EditorIntOption.clampedInt(_element, 0, 0, 10000),3895color: null3896});3897} else if (_element && typeof _element === 'object') {3898const element = _element as IRulerOption;3899rulers.push({3900column: EditorIntOption.clampedInt(element.column, 0, 0, 10000),3901color: element.color3902});3903}3904}3905rulers.sort((a, b) => a.column - b.column);3906return rulers;3907}3908return this.defaultValue;3909}3910}39113912//#endregion39133914//#region readonly39153916/**3917* Configuration options for readonly message3918*/3919class ReadonlyMessage extends BaseEditorOption<EditorOption.readOnlyMessage, IMarkdownString | undefined, IMarkdownString | undefined> {3920constructor() {3921const defaults = undefined;39223923super(3924EditorOption.readOnlyMessage, 'readOnlyMessage', defaults3925);3926}39273928public validate(_input: any): IMarkdownString | undefined {3929if (!_input || typeof _input !== 'object') {3930return this.defaultValue;3931}3932return _input as IMarkdownString;3933}3934}39353936//#endregion39373938//#region scrollbar39393940/**3941* Configuration options for editor scrollbars3942*/3943export interface IEditorScrollbarOptions {3944/**3945* The size of arrows (if displayed).3946* Defaults to 11.3947* **NOTE**: This option cannot be updated using `updateOptions()`3948*/3949arrowSize?: number;3950/**3951* Render vertical scrollbar.3952* Defaults to 'auto'.3953*/3954vertical?: 'auto' | 'visible' | 'hidden';3955/**3956* Render horizontal scrollbar.3957* Defaults to 'auto'.3958*/3959horizontal?: 'auto' | 'visible' | 'hidden';3960/**3961* Cast horizontal and vertical shadows when the content is scrolled.3962* Defaults to true.3963* **NOTE**: This option cannot be updated using `updateOptions()`3964*/3965useShadows?: boolean;3966/**3967* Render arrows at the top and bottom of the vertical scrollbar.3968* Defaults to false.3969* **NOTE**: This option cannot be updated using `updateOptions()`3970*/3971verticalHasArrows?: boolean;3972/**3973* Render arrows at the left and right of the horizontal scrollbar.3974* Defaults to false.3975* **NOTE**: This option cannot be updated using `updateOptions()`3976*/3977horizontalHasArrows?: boolean;3978/**3979* Listen to mouse wheel events and react to them by scrolling.3980* Defaults to true.3981*/3982handleMouseWheel?: boolean;3983/**3984* Always consume mouse wheel events (always call preventDefault() and stopPropagation() on the browser events).3985* Defaults to true.3986* **NOTE**: This option cannot be updated using `updateOptions()`3987*/3988alwaysConsumeMouseWheel?: boolean;3989/**3990* Height in pixels for the horizontal scrollbar.3991* Defaults to 12 (px).3992*/3993horizontalScrollbarSize?: number;3994/**3995* Width in pixels for the vertical scrollbar.3996* Defaults to 14 (px).3997*/3998verticalScrollbarSize?: number;3999/**4000* Width in pixels for the vertical slider.4001* Defaults to `verticalScrollbarSize`.4002* **NOTE**: This option cannot be updated using `updateOptions()`4003*/4004verticalSliderSize?: number;4005/**4006* Height in pixels for the horizontal slider.4007* Defaults to `horizontalScrollbarSize`.4008* **NOTE**: This option cannot be updated using `updateOptions()`4009*/4010horizontalSliderSize?: number;4011/**4012* Scroll gutter clicks move by page vs jump to position.4013* Defaults to false.4014*/4015scrollByPage?: boolean;40164017/**4018* When set, the horizontal scrollbar will not increase content height.4019* Defaults to false.4020*/4021ignoreHorizontalScrollbarInContentHeight?: boolean;4022}40234024export interface InternalEditorScrollbarOptions {4025readonly arrowSize: number;4026readonly vertical: ScrollbarVisibility;4027readonly horizontal: ScrollbarVisibility;4028readonly useShadows: boolean;4029readonly verticalHasArrows: boolean;4030readonly horizontalHasArrows: boolean;4031readonly handleMouseWheel: boolean;4032readonly alwaysConsumeMouseWheel: boolean;4033readonly horizontalScrollbarSize: number;4034readonly horizontalSliderSize: number;4035readonly verticalScrollbarSize: number;4036readonly verticalSliderSize: number;4037readonly scrollByPage: boolean;4038readonly ignoreHorizontalScrollbarInContentHeight: boolean;4039}40404041function _scrollbarVisibilityFromString(visibility: string | undefined, defaultValue: ScrollbarVisibility): ScrollbarVisibility {4042if (typeof visibility !== 'string') {4043return defaultValue;4044}4045switch (visibility) {4046case 'hidden': return ScrollbarVisibility.Hidden;4047case 'visible': return ScrollbarVisibility.Visible;4048default: return ScrollbarVisibility.Auto;4049}4050}40514052class EditorScrollbar extends BaseEditorOption<EditorOption.scrollbar, IEditorScrollbarOptions, InternalEditorScrollbarOptions> {40534054constructor() {4055const defaults: InternalEditorScrollbarOptions = {4056vertical: ScrollbarVisibility.Auto,4057horizontal: ScrollbarVisibility.Auto,4058arrowSize: 11,4059useShadows: true,4060verticalHasArrows: false,4061horizontalHasArrows: false,4062horizontalScrollbarSize: 12,4063horizontalSliderSize: 12,4064verticalScrollbarSize: 14,4065verticalSliderSize: 14,4066handleMouseWheel: true,4067alwaysConsumeMouseWheel: true,4068scrollByPage: false,4069ignoreHorizontalScrollbarInContentHeight: false,4070};4071super(4072EditorOption.scrollbar, 'scrollbar', defaults,4073{4074'editor.scrollbar.vertical': {4075type: 'string',4076enum: ['auto', 'visible', 'hidden'],4077enumDescriptions: [4078nls.localize('scrollbar.vertical.auto', "The vertical scrollbar will be visible only when necessary."),4079nls.localize('scrollbar.vertical.visible', "The vertical scrollbar will always be visible."),4080nls.localize('scrollbar.vertical.fit', "The vertical scrollbar will always be hidden."),4081],4082default: 'auto',4083description: nls.localize('scrollbar.vertical', "Controls the visibility of the vertical scrollbar.")4084},4085'editor.scrollbar.horizontal': {4086type: 'string',4087enum: ['auto', 'visible', 'hidden'],4088enumDescriptions: [4089nls.localize('scrollbar.horizontal.auto', "The horizontal scrollbar will be visible only when necessary."),4090nls.localize('scrollbar.horizontal.visible', "The horizontal scrollbar will always be visible."),4091nls.localize('scrollbar.horizontal.fit', "The horizontal scrollbar will always be hidden."),4092],4093default: 'auto',4094description: nls.localize('scrollbar.horizontal', "Controls the visibility of the horizontal scrollbar.")4095},4096'editor.scrollbar.verticalScrollbarSize': {4097type: 'number',4098default: defaults.verticalScrollbarSize,4099description: nls.localize('scrollbar.verticalScrollbarSize', "The width of the vertical scrollbar.")4100},4101'editor.scrollbar.horizontalScrollbarSize': {4102type: 'number',4103default: defaults.horizontalScrollbarSize,4104description: nls.localize('scrollbar.horizontalScrollbarSize', "The height of the horizontal scrollbar.")4105},4106'editor.scrollbar.scrollByPage': {4107type: 'boolean',4108default: defaults.scrollByPage,4109description: nls.localize('scrollbar.scrollByPage', "Controls whether clicks scroll by page or jump to click position.")4110},4111'editor.scrollbar.ignoreHorizontalScrollbarInContentHeight': {4112type: 'boolean',4113default: defaults.ignoreHorizontalScrollbarInContentHeight,4114description: nls.localize('scrollbar.ignoreHorizontalScrollbarInContentHeight', "When set, the horizontal scrollbar will not increase the size of the editor's content.")4115}4116}4117);4118}41194120public validate(_input: any): InternalEditorScrollbarOptions {4121if (!_input || typeof _input !== 'object') {4122return this.defaultValue;4123}4124const input = _input as IEditorScrollbarOptions;4125const horizontalScrollbarSize = EditorIntOption.clampedInt(input.horizontalScrollbarSize, this.defaultValue.horizontalScrollbarSize, 0, 1000);4126const verticalScrollbarSize = EditorIntOption.clampedInt(input.verticalScrollbarSize, this.defaultValue.verticalScrollbarSize, 0, 1000);4127return {4128arrowSize: EditorIntOption.clampedInt(input.arrowSize, this.defaultValue.arrowSize, 0, 1000),4129vertical: _scrollbarVisibilityFromString(input.vertical, this.defaultValue.vertical),4130horizontal: _scrollbarVisibilityFromString(input.horizontal, this.defaultValue.horizontal),4131useShadows: boolean(input.useShadows, this.defaultValue.useShadows),4132verticalHasArrows: boolean(input.verticalHasArrows, this.defaultValue.verticalHasArrows),4133horizontalHasArrows: boolean(input.horizontalHasArrows, this.defaultValue.horizontalHasArrows),4134handleMouseWheel: boolean(input.handleMouseWheel, this.defaultValue.handleMouseWheel),4135alwaysConsumeMouseWheel: boolean(input.alwaysConsumeMouseWheel, this.defaultValue.alwaysConsumeMouseWheel),4136horizontalScrollbarSize: horizontalScrollbarSize,4137horizontalSliderSize: EditorIntOption.clampedInt(input.horizontalSliderSize, horizontalScrollbarSize, 0, 1000),4138verticalScrollbarSize: verticalScrollbarSize,4139verticalSliderSize: EditorIntOption.clampedInt(input.verticalSliderSize, verticalScrollbarSize, 0, 1000),4140scrollByPage: boolean(input.scrollByPage, this.defaultValue.scrollByPage),4141ignoreHorizontalScrollbarInContentHeight: boolean(input.ignoreHorizontalScrollbarInContentHeight, this.defaultValue.ignoreHorizontalScrollbarInContentHeight),4142};4143}4144}41454146//#endregion41474148//#region UnicodeHighlight41494150export type InUntrustedWorkspace = 'inUntrustedWorkspace';41514152/**4153* @internal4154*/4155export const inUntrustedWorkspace: InUntrustedWorkspace = 'inUntrustedWorkspace';41564157/**4158* Configuration options for unicode highlighting.4159*/4160export interface IUnicodeHighlightOptions {41614162/**4163* Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.4164*/4165nonBasicASCII?: boolean | InUntrustedWorkspace;41664167/**4168* Controls whether characters that just reserve space or have no width at all are highlighted.4169*/4170invisibleCharacters?: boolean;41714172/**4173* Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.4174*/4175ambiguousCharacters?: boolean;41764177/**4178* Controls whether characters in comments should also be subject to unicode highlighting.4179*/4180includeComments?: boolean | InUntrustedWorkspace;41814182/**4183* Controls whether characters in strings should also be subject to unicode highlighting.4184*/4185includeStrings?: boolean | InUntrustedWorkspace;41864187/**4188* Defines allowed characters that are not being highlighted.4189*/4190allowedCharacters?: Record<string, true>;41914192/**4193* Unicode characters that are common in allowed locales are not being highlighted.4194*/4195allowedLocales?: Record<string | '_os' | '_vscode', true>;4196}41974198/**4199* @internal4200*/4201export type InternalUnicodeHighlightOptions = Required<Readonly<IUnicodeHighlightOptions>>;42024203/**4204* @internal4205*/4206export const unicodeHighlightConfigKeys = {4207allowedCharacters: 'editor.unicodeHighlight.allowedCharacters',4208invisibleCharacters: 'editor.unicodeHighlight.invisibleCharacters',4209nonBasicASCII: 'editor.unicodeHighlight.nonBasicASCII',4210ambiguousCharacters: 'editor.unicodeHighlight.ambiguousCharacters',4211includeComments: 'editor.unicodeHighlight.includeComments',4212includeStrings: 'editor.unicodeHighlight.includeStrings',4213allowedLocales: 'editor.unicodeHighlight.allowedLocales',4214};42154216class UnicodeHighlight extends BaseEditorOption<EditorOption.unicodeHighlighting, IUnicodeHighlightOptions, InternalUnicodeHighlightOptions> {4217constructor() {4218const defaults: InternalUnicodeHighlightOptions = {4219nonBasicASCII: inUntrustedWorkspace,4220invisibleCharacters: true,4221ambiguousCharacters: true,4222includeComments: inUntrustedWorkspace,4223includeStrings: true,4224allowedCharacters: {},4225allowedLocales: { _os: true, _vscode: true },4226};42274228super(4229EditorOption.unicodeHighlighting, 'unicodeHighlight', defaults,4230{4231[unicodeHighlightConfigKeys.nonBasicASCII]: {4232restricted: true,4233type: ['boolean', 'string'],4234enum: [true, false, inUntrustedWorkspace],4235default: defaults.nonBasicASCII,4236description: nls.localize('unicodeHighlight.nonBasicASCII', "Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")4237},4238[unicodeHighlightConfigKeys.invisibleCharacters]: {4239restricted: true,4240type: 'boolean',4241default: defaults.invisibleCharacters,4242description: nls.localize('unicodeHighlight.invisibleCharacters', "Controls whether characters that just reserve space or have no width at all are highlighted.")4243},4244[unicodeHighlightConfigKeys.ambiguousCharacters]: {4245restricted: true,4246type: 'boolean',4247default: defaults.ambiguousCharacters,4248description: nls.localize('unicodeHighlight.ambiguousCharacters', "Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")4249},4250[unicodeHighlightConfigKeys.includeComments]: {4251restricted: true,4252type: ['boolean', 'string'],4253enum: [true, false, inUntrustedWorkspace],4254default: defaults.includeComments,4255description: nls.localize('unicodeHighlight.includeComments', "Controls whether characters in comments should also be subject to Unicode highlighting.")4256},4257[unicodeHighlightConfigKeys.includeStrings]: {4258restricted: true,4259type: ['boolean', 'string'],4260enum: [true, false, inUntrustedWorkspace],4261default: defaults.includeStrings,4262description: nls.localize('unicodeHighlight.includeStrings', "Controls whether characters in strings should also be subject to Unicode highlighting.")4263},4264[unicodeHighlightConfigKeys.allowedCharacters]: {4265restricted: true,4266type: 'object',4267default: defaults.allowedCharacters,4268description: nls.localize('unicodeHighlight.allowedCharacters', "Defines allowed characters that are not being highlighted."),4269additionalProperties: {4270type: 'boolean'4271}4272},4273[unicodeHighlightConfigKeys.allowedLocales]: {4274restricted: true,4275type: 'object',4276additionalProperties: {4277type: 'boolean'4278},4279default: defaults.allowedLocales,4280description: nls.localize('unicodeHighlight.allowedLocales', "Unicode characters that are common in allowed locales are not being highlighted.")4281},4282}4283);4284}42854286public override applyUpdate(value: Required<Readonly<IUnicodeHighlightOptions>> | undefined, update: Required<Readonly<IUnicodeHighlightOptions>>): ApplyUpdateResult<Required<Readonly<IUnicodeHighlightOptions>>> {4287let didChange = false;4288if (update.allowedCharacters && value) {4289// Treat allowedCharacters atomically4290if (!objects.equals(value.allowedCharacters, update.allowedCharacters)) {4291value = { ...value, allowedCharacters: update.allowedCharacters };4292didChange = true;4293}4294}4295if (update.allowedLocales && value) {4296// Treat allowedLocales atomically4297if (!objects.equals(value.allowedLocales, update.allowedLocales)) {4298value = { ...value, allowedLocales: update.allowedLocales };4299didChange = true;4300}4301}43024303const result = super.applyUpdate(value, update);4304if (didChange) {4305return new ApplyUpdateResult(result.newValue, true);4306}4307return result;4308}43094310public validate(_input: any): InternalUnicodeHighlightOptions {4311if (!_input || typeof _input !== 'object') {4312return this.defaultValue;4313}4314const input = _input as IUnicodeHighlightOptions;4315return {4316nonBasicASCII: primitiveSet<boolean | InUntrustedWorkspace>(input.nonBasicASCII, inUntrustedWorkspace, [true, false, inUntrustedWorkspace]),4317invisibleCharacters: boolean(input.invisibleCharacters, this.defaultValue.invisibleCharacters),4318ambiguousCharacters: boolean(input.ambiguousCharacters, this.defaultValue.ambiguousCharacters),4319includeComments: primitiveSet<boolean | InUntrustedWorkspace>(input.includeComments, inUntrustedWorkspace, [true, false, inUntrustedWorkspace]),4320includeStrings: primitiveSet<boolean | InUntrustedWorkspace>(input.includeStrings, inUntrustedWorkspace, [true, false, inUntrustedWorkspace]),4321allowedCharacters: this.validateBooleanMap(_input.allowedCharacters, this.defaultValue.allowedCharacters),4322allowedLocales: this.validateBooleanMap(_input.allowedLocales, this.defaultValue.allowedLocales),4323};4324}43254326private validateBooleanMap(map: unknown, defaultValue: Record<string, true>): Record<string, true> {4327if ((typeof map !== 'object') || !map) {4328return defaultValue;4329}4330const result: Record<string, true> = {};4331for (const [key, value] of Object.entries(map)) {4332if (value === true) {4333result[key] = true;4334}4335}4336return result;4337}4338}43394340//#endregion43414342//#region inlineSuggest43434344export interface IInlineSuggestOptions {4345/**4346* Enable or disable the rendering of automatic inline completions.4347*/4348enabled?: boolean;43494350/**4351* Configures the mode.4352* Use `prefix` to only show ghost text if the text to replace is a prefix of the suggestion text.4353* Use `subword` to only show ghost text if the replace text is a subword of the suggestion text.4354* Use `subwordSmart` to only show ghost text if the replace text is a subword of the suggestion text, but the subword must start after the cursor position.4355* Defaults to `prefix`.4356*/4357mode?: 'prefix' | 'subword' | 'subwordSmart';43584359showToolbar?: 'always' | 'onHover' | 'never';43604361syntaxHighlightingEnabled?: boolean;43624363suppressSuggestions?: boolean;43644365minShowDelay?: number;43664367/**4368* Does not clear active inline suggestions when the editor loses focus.4369*/4370keepOnBlur?: boolean;43714372/**4373* Font family for inline suggestions.4374*/4375fontFamily?: string | 'default';43764377edits?: {4378allowCodeShifting?: 'always' | 'horizontal' | 'never';43794380renderSideBySide?: 'never' | 'auto';43814382showCollapsed?: boolean;43834384/**4385* @internal4386*/4387enabled?: boolean;4388};43894390/**4391* @internal4392*/4393triggerCommandOnProviderChange?: boolean;43944395/**4396* @internal4397*/4398experimental?: {4399/**4400* @internal4401*/4402suppressInlineSuggestions?: string;44034404showOnSuggestConflict?: 'always' | 'never' | 'whenSuggestListIsIncomplete';4405};4406}44074408type RequiredRecursive<T> = {4409[P in keyof T]-?: T[P] extends object | undefined ? RequiredRecursive<T[P]> : T[P];4410};44114412/**4413* @internal4414*/4415export type InternalInlineSuggestOptions = Readonly<RequiredRecursive<IInlineSuggestOptions>>;44164417/**4418* Configuration options for inline suggestions4419*/4420class InlineEditorSuggest extends BaseEditorOption<EditorOption.inlineSuggest, IInlineSuggestOptions, InternalInlineSuggestOptions> {4421constructor() {4422const defaults: InternalInlineSuggestOptions = {4423enabled: true,4424mode: 'subwordSmart',4425showToolbar: 'onHover',4426suppressSuggestions: false,4427keepOnBlur: false,4428fontFamily: 'default',4429syntaxHighlightingEnabled: true,4430minShowDelay: 0,4431edits: {4432enabled: true,4433showCollapsed: false,4434renderSideBySide: 'auto',4435allowCodeShifting: 'always',4436},4437triggerCommandOnProviderChange: false,4438experimental: {4439suppressInlineSuggestions: '',4440showOnSuggestConflict: 'never',4441},4442};44434444super(4445EditorOption.inlineSuggest, 'inlineSuggest', defaults,4446{4447'editor.inlineSuggest.enabled': {4448type: 'boolean',4449default: defaults.enabled,4450description: nls.localize('inlineSuggest.enabled', "Controls whether to automatically show inline suggestions in the editor.")4451},4452'editor.inlineSuggest.showToolbar': {4453type: 'string',4454default: defaults.showToolbar,4455enum: ['always', 'onHover', 'never'],4456enumDescriptions: [4457nls.localize('inlineSuggest.showToolbar.always', "Show the inline suggestion toolbar whenever an inline suggestion is shown."),4458nls.localize('inlineSuggest.showToolbar.onHover', "Show the inline suggestion toolbar when hovering over an inline suggestion."),4459nls.localize('inlineSuggest.showToolbar.never', "Never show the inline suggestion toolbar."),4460],4461description: nls.localize('inlineSuggest.showToolbar', "Controls when to show the inline suggestion toolbar."),4462},4463'editor.inlineSuggest.syntaxHighlightingEnabled': {4464type: 'boolean',4465default: defaults.syntaxHighlightingEnabled,4466description: nls.localize('inlineSuggest.syntaxHighlightingEnabled', "Controls whether to show syntax highlighting for inline suggestions in the editor."),4467},4468'editor.inlineSuggest.suppressSuggestions': {4469type: 'boolean',4470default: defaults.suppressSuggestions,4471description: nls.localize('inlineSuggest.suppressSuggestions', "Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")4472},4473'editor.inlineSuggest.minShowDelay': {4474type: 'number',4475default: 0,4476minimum: 0,4477maximum: 10000,4478description: nls.localize('inlineSuggest.minShowDelay', "Controls the minimal delay in milliseconds after which inline suggestions are shown after typing."),4479},4480'editor.inlineSuggest.experimental.suppressInlineSuggestions': {4481type: 'string',4482default: defaults.experimental.suppressInlineSuggestions,4483tags: ['experimental'],4484description: nls.localize('inlineSuggest.suppressInlineSuggestions', "Suppresses inline completions for specified extension IDs -- comma separated."),4485experiment: {4486mode: 'auto'4487}4488},4489'editor.inlineSuggest.triggerCommandOnProviderChange': {4490type: 'boolean',4491default: defaults.triggerCommandOnProviderChange,4492tags: ['experimental'],4493description: nls.localize('inlineSuggest.triggerCommandOnProviderChange', "Controls whether to trigger a command when the inline suggestion provider changes."),4494experiment: {4495mode: 'auto'4496}4497},4498'editor.inlineSuggest.experimental.showOnSuggestConflict': {4499type: 'string',4500default: defaults.experimental.showOnSuggestConflict,4501tags: ['experimental'],4502enum: ['always', 'never', 'whenSuggestListIsIncomplete'],4503description: nls.localize('inlineSuggest.showOnSuggestConflict', "Controls whether to show inline suggestions when there is a suggest conflict."),4504experiment: {4505mode: 'auto'4506}4507},4508'editor.inlineSuggest.fontFamily': {4509type: 'string',4510default: defaults.fontFamily,4511description: nls.localize('inlineSuggest.fontFamily', "Controls the font family of the inline suggestions.")4512},4513'editor.inlineSuggest.edits.allowCodeShifting': {4514type: 'string',4515default: defaults.edits.allowCodeShifting,4516description: nls.localize('inlineSuggest.edits.allowCodeShifting', "Controls whether showing a suggestion will shift the code to make space for the suggestion inline."),4517enum: ['always', 'horizontal', 'never'],4518tags: ['nextEditSuggestions']4519},4520'editor.inlineSuggest.edits.renderSideBySide': {4521type: 'string',4522default: defaults.edits.renderSideBySide,4523description: nls.localize('inlineSuggest.edits.renderSideBySide', "Controls whether larger suggestions can be shown side by side."),4524enum: ['auto', 'never'],4525enumDescriptions: [4526nls.localize('editor.inlineSuggest.edits.renderSideBySide.auto', "Larger suggestions will show side by side if there is enough space, otherwise they will be shown below."),4527nls.localize('editor.inlineSuggest.edits.renderSideBySide.never', "Larger suggestions are never shown side by side and will always be shown below."),4528],4529tags: ['nextEditSuggestions']4530},4531'editor.inlineSuggest.edits.showCollapsed': {4532type: 'boolean',4533default: defaults.edits.showCollapsed,4534description: nls.localize('inlineSuggest.edits.showCollapsed', "Controls whether the suggestion will show as collapsed until jumping to it."),4535tags: ['nextEditSuggestions']4536},4537}4538);4539}45404541public validate(_input: any): InternalInlineSuggestOptions {4542if (!_input || typeof _input !== 'object') {4543return this.defaultValue;4544}4545const input = _input as IInlineSuggestOptions;4546return {4547enabled: boolean(input.enabled, this.defaultValue.enabled),4548mode: stringSet(input.mode, this.defaultValue.mode, ['prefix', 'subword', 'subwordSmart']),4549showToolbar: stringSet(input.showToolbar, this.defaultValue.showToolbar, ['always', 'onHover', 'never']),4550suppressSuggestions: boolean(input.suppressSuggestions, this.defaultValue.suppressSuggestions),4551keepOnBlur: boolean(input.keepOnBlur, this.defaultValue.keepOnBlur),4552fontFamily: EditorStringOption.string(input.fontFamily, this.defaultValue.fontFamily),4553syntaxHighlightingEnabled: boolean(input.syntaxHighlightingEnabled, this.defaultValue.syntaxHighlightingEnabled),4554minShowDelay: EditorIntOption.clampedInt(input.minShowDelay, 0, 0, 10000),4555edits: {4556enabled: boolean(input.edits?.enabled, this.defaultValue.edits.enabled),4557showCollapsed: boolean(input.edits?.showCollapsed, this.defaultValue.edits.showCollapsed),4558allowCodeShifting: stringSet(input.edits?.allowCodeShifting, this.defaultValue.edits.allowCodeShifting, ['always', 'horizontal', 'never']),4559renderSideBySide: stringSet(input.edits?.renderSideBySide, this.defaultValue.edits.renderSideBySide, ['never', 'auto']),4560},4561triggerCommandOnProviderChange: boolean(input.triggerCommandOnProviderChange, this.defaultValue.triggerCommandOnProviderChange),4562experimental: {4563suppressInlineSuggestions: EditorStringOption.string(input.experimental?.suppressInlineSuggestions, this.defaultValue.experimental.suppressInlineSuggestions),4564showOnSuggestConflict: stringSet(input.experimental?.showOnSuggestConflict, this.defaultValue.experimental.showOnSuggestConflict, ['always', 'never', 'whenSuggestListIsIncomplete']),4565},4566};4567}4568}45694570//#endregion45714572//#region bracketPairColorization45734574export interface IBracketPairColorizationOptions {4575/**4576* Enable or disable bracket pair colorization.4577*/4578enabled?: boolean;45794580/**4581* Use independent color pool per bracket type.4582*/4583independentColorPoolPerBracketType?: boolean;4584}45854586/**4587* @internal4588*/4589export type InternalBracketPairColorizationOptions = Readonly<Required<IBracketPairColorizationOptions>>;45904591/**4592* Configuration options for inline suggestions4593*/4594class BracketPairColorization extends BaseEditorOption<EditorOption.bracketPairColorization, IBracketPairColorizationOptions, InternalBracketPairColorizationOptions> {4595constructor() {4596const defaults: InternalBracketPairColorizationOptions = {4597enabled: EDITOR_MODEL_DEFAULTS.bracketPairColorizationOptions.enabled,4598independentColorPoolPerBracketType: EDITOR_MODEL_DEFAULTS.bracketPairColorizationOptions.independentColorPoolPerBracketType,4599};46004601super(4602EditorOption.bracketPairColorization, 'bracketPairColorization', defaults,4603{4604'editor.bracketPairColorization.enabled': {4605type: 'boolean',4606default: defaults.enabled,4607markdownDescription: nls.localize('bracketPairColorization.enabled', "Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.", '`#workbench.colorCustomizations#`')4608},4609'editor.bracketPairColorization.independentColorPoolPerBracketType': {4610type: 'boolean',4611default: defaults.independentColorPoolPerBracketType,4612description: nls.localize('bracketPairColorization.independentColorPoolPerBracketType', "Controls whether each bracket type has its own independent color pool.")4613},4614}4615);4616}46174618public validate(_input: any): InternalBracketPairColorizationOptions {4619if (!_input || typeof _input !== 'object') {4620return this.defaultValue;4621}4622const input = _input as IBracketPairColorizationOptions;4623return {4624enabled: boolean(input.enabled, this.defaultValue.enabled),4625independentColorPoolPerBracketType: boolean(input.independentColorPoolPerBracketType, this.defaultValue.independentColorPoolPerBracketType),4626};4627}4628}46294630//#endregion46314632//#region guides46334634export interface IGuidesOptions {4635/**4636* Enable rendering of bracket pair guides.4637* Defaults to false.4638*/4639bracketPairs?: boolean | 'active';46404641/**4642* Enable rendering of vertical bracket pair guides.4643* Defaults to 'active'.4644*/4645bracketPairsHorizontal?: boolean | 'active';46464647/**4648* Enable highlighting of the active bracket pair.4649* Defaults to true.4650*/4651highlightActiveBracketPair?: boolean;46524653/**4654* Enable rendering of indent guides.4655* Defaults to true.4656*/4657indentation?: boolean;46584659/**4660* Enable highlighting of the active indent guide.4661* Defaults to true.4662*/4663highlightActiveIndentation?: boolean | 'always';4664}46654666/**4667* @internal4668*/4669export type InternalGuidesOptions = Readonly<Required<IGuidesOptions>>;46704671/**4672* Configuration options for inline suggestions4673*/4674class GuideOptions extends BaseEditorOption<EditorOption.guides, IGuidesOptions, InternalGuidesOptions> {4675constructor() {4676const defaults: InternalGuidesOptions = {4677bracketPairs: false,4678bracketPairsHorizontal: 'active',4679highlightActiveBracketPair: true,46804681indentation: true,4682highlightActiveIndentation: true4683};46844685super(4686EditorOption.guides, 'guides', defaults,4687{4688'editor.guides.bracketPairs': {4689type: ['boolean', 'string'],4690enum: [true, 'active', false],4691enumDescriptions: [4692nls.localize('editor.guides.bracketPairs.true', "Enables bracket pair guides."),4693nls.localize('editor.guides.bracketPairs.active', "Enables bracket pair guides only for the active bracket pair."),4694nls.localize('editor.guides.bracketPairs.false', "Disables bracket pair guides."),4695],4696default: defaults.bracketPairs,4697description: nls.localize('editor.guides.bracketPairs', "Controls whether bracket pair guides are enabled or not.")4698},4699'editor.guides.bracketPairsHorizontal': {4700type: ['boolean', 'string'],4701enum: [true, 'active', false],4702enumDescriptions: [4703nls.localize('editor.guides.bracketPairsHorizontal.true', "Enables horizontal guides as addition to vertical bracket pair guides."),4704nls.localize('editor.guides.bracketPairsHorizontal.active', "Enables horizontal guides only for the active bracket pair."),4705nls.localize('editor.guides.bracketPairsHorizontal.false', "Disables horizontal bracket pair guides."),4706],4707default: defaults.bracketPairsHorizontal,4708description: nls.localize('editor.guides.bracketPairsHorizontal', "Controls whether horizontal bracket pair guides are enabled or not.")4709},4710'editor.guides.highlightActiveBracketPair': {4711type: 'boolean',4712default: defaults.highlightActiveBracketPair,4713description: nls.localize('editor.guides.highlightActiveBracketPair', "Controls whether the editor should highlight the active bracket pair.")4714},4715'editor.guides.indentation': {4716type: 'boolean',4717default: defaults.indentation,4718description: nls.localize('editor.guides.indentation', "Controls whether the editor should render indent guides.")4719},4720'editor.guides.highlightActiveIndentation': {4721type: ['boolean', 'string'],4722enum: [true, 'always', false],4723enumDescriptions: [4724nls.localize('editor.guides.highlightActiveIndentation.true', "Highlights the active indent guide."),4725nls.localize('editor.guides.highlightActiveIndentation.always', "Highlights the active indent guide even if bracket guides are highlighted."),4726nls.localize('editor.guides.highlightActiveIndentation.false', "Do not highlight the active indent guide."),4727],4728default: defaults.highlightActiveIndentation,47294730description: nls.localize('editor.guides.highlightActiveIndentation', "Controls whether the editor should highlight the active indent guide.")4731}4732}4733);4734}47354736public validate(_input: any): InternalGuidesOptions {4737if (!_input || typeof _input !== 'object') {4738return this.defaultValue;4739}4740const input = _input as IGuidesOptions;4741return {4742bracketPairs: primitiveSet(input.bracketPairs, this.defaultValue.bracketPairs, [true, false, 'active']),4743bracketPairsHorizontal: primitiveSet(input.bracketPairsHorizontal, this.defaultValue.bracketPairsHorizontal, [true, false, 'active']),4744highlightActiveBracketPair: boolean(input.highlightActiveBracketPair, this.defaultValue.highlightActiveBracketPair),47454746indentation: boolean(input.indentation, this.defaultValue.indentation),4747highlightActiveIndentation: primitiveSet(input.highlightActiveIndentation, this.defaultValue.highlightActiveIndentation, [true, false, 'always']),4748};4749}4750}47514752function primitiveSet<T extends string | boolean>(value: unknown, defaultValue: T, allowedValues: T[]): T {4753const idx = allowedValues.indexOf(value as any);4754if (idx === -1) {4755return defaultValue;4756}4757return allowedValues[idx];4758}47594760//#endregion47614762//#region suggest47634764/**4765* Configuration options for editor suggest widget4766*/4767export interface ISuggestOptions {4768/**4769* Overwrite word ends on accept. Default to false.4770*/4771insertMode?: 'insert' | 'replace';4772/**4773* Enable graceful matching. Defaults to true.4774*/4775filterGraceful?: boolean;4776/**4777* Prevent quick suggestions when a snippet is active. Defaults to true.4778*/4779snippetsPreventQuickSuggestions?: boolean;4780/**4781* Favors words that appear close to the cursor.4782*/4783localityBonus?: boolean;4784/**4785* Enable using global storage for remembering suggestions.4786*/4787shareSuggestSelections?: boolean;4788/**4789* Select suggestions when triggered via quick suggest or trigger characters4790*/4791selectionMode?: 'always' | 'never' | 'whenTriggerCharacter' | 'whenQuickSuggestion';4792/**4793* Enable or disable icons in suggestions. Defaults to true.4794*/4795showIcons?: boolean;4796/**4797* Enable or disable the suggest status bar.4798*/4799showStatusBar?: boolean;4800/**4801* Enable or disable the rendering of the suggestion preview.4802*/4803preview?: boolean;4804/**4805* Configures the mode of the preview.4806*/4807previewMode?: 'prefix' | 'subword' | 'subwordSmart';4808/**4809* Show details inline with the label. Defaults to true.4810*/4811showInlineDetails?: boolean;4812/**4813* Show method-suggestions.4814*/4815showMethods?: boolean;4816/**4817* Show function-suggestions.4818*/4819showFunctions?: boolean;4820/**4821* Show constructor-suggestions.4822*/4823showConstructors?: boolean;4824/**4825* Show deprecated-suggestions.4826*/4827showDeprecated?: boolean;4828/**4829* Controls whether suggestions allow matches in the middle of the word instead of only at the beginning4830*/4831matchOnWordStartOnly?: boolean;4832/**4833* Show field-suggestions.4834*/4835showFields?: boolean;4836/**4837* Show variable-suggestions.4838*/4839showVariables?: boolean;4840/**4841* Show class-suggestions.4842*/4843showClasses?: boolean;4844/**4845* Show struct-suggestions.4846*/4847showStructs?: boolean;4848/**4849* Show interface-suggestions.4850*/4851showInterfaces?: boolean;4852/**4853* Show module-suggestions.4854*/4855showModules?: boolean;4856/**4857* Show property-suggestions.4858*/4859showProperties?: boolean;4860/**4861* Show event-suggestions.4862*/4863showEvents?: boolean;4864/**4865* Show operator-suggestions.4866*/4867showOperators?: boolean;4868/**4869* Show unit-suggestions.4870*/4871showUnits?: boolean;4872/**4873* Show value-suggestions.4874*/4875showValues?: boolean;4876/**4877* Show constant-suggestions.4878*/4879showConstants?: boolean;4880/**4881* Show enum-suggestions.4882*/4883showEnums?: boolean;4884/**4885* Show enumMember-suggestions.4886*/4887showEnumMembers?: boolean;4888/**4889* Show keyword-suggestions.4890*/4891showKeywords?: boolean;4892/**4893* Show text-suggestions.4894*/4895showWords?: boolean;4896/**4897* Show color-suggestions.4898*/4899showColors?: boolean;4900/**4901* Show file-suggestions.4902*/4903showFiles?: boolean;4904/**4905* Show reference-suggestions.4906*/4907showReferences?: boolean;4908/**4909* Show folder-suggestions.4910*/4911showFolders?: boolean;4912/**4913* Show typeParameter-suggestions.4914*/4915showTypeParameters?: boolean;4916/**4917* Show issue-suggestions.4918*/4919showIssues?: boolean;4920/**4921* Show user-suggestions.4922*/4923showUsers?: boolean;4924/**4925* Show snippet-suggestions.4926*/4927showSnippets?: boolean;4928}49294930/**4931* @internal4932*/4933export type InternalSuggestOptions = Readonly<Required<ISuggestOptions>>;49344935class EditorSuggest extends BaseEditorOption<EditorOption.suggest, ISuggestOptions, InternalSuggestOptions> {49364937constructor() {4938const defaults: InternalSuggestOptions = {4939insertMode: 'insert',4940filterGraceful: true,4941snippetsPreventQuickSuggestions: false,4942localityBonus: false,4943shareSuggestSelections: false,4944selectionMode: 'always',4945showIcons: true,4946showStatusBar: false,4947preview: false,4948previewMode: 'subwordSmart',4949showInlineDetails: true,4950showMethods: true,4951showFunctions: true,4952showConstructors: true,4953showDeprecated: true,4954matchOnWordStartOnly: true,4955showFields: true,4956showVariables: true,4957showClasses: true,4958showStructs: true,4959showInterfaces: true,4960showModules: true,4961showProperties: true,4962showEvents: true,4963showOperators: true,4964showUnits: true,4965showValues: true,4966showConstants: true,4967showEnums: true,4968showEnumMembers: true,4969showKeywords: true,4970showWords: true,4971showColors: true,4972showFiles: true,4973showReferences: true,4974showFolders: true,4975showTypeParameters: true,4976showSnippets: true,4977showUsers: true,4978showIssues: true,4979};4980super(4981EditorOption.suggest, 'suggest', defaults,4982{4983'editor.suggest.insertMode': {4984type: 'string',4985enum: ['insert', 'replace'],4986enumDescriptions: [4987nls.localize('suggest.insertMode.insert', "Insert suggestion without overwriting text right of the cursor."),4988nls.localize('suggest.insertMode.replace', "Insert suggestion and overwrite text right of the cursor."),4989],4990default: defaults.insertMode,4991description: nls.localize('suggest.insertMode', "Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")4992},4993'editor.suggest.filterGraceful': {4994type: 'boolean',4995default: defaults.filterGraceful,4996description: nls.localize('suggest.filterGraceful', "Controls whether filtering and sorting suggestions accounts for small typos.")4997},4998'editor.suggest.localityBonus': {4999type: 'boolean',5000default: defaults.localityBonus,5001description: nls.localize('suggest.localityBonus', "Controls whether sorting favors words that appear close to the cursor.")5002},5003'editor.suggest.shareSuggestSelections': {5004type: 'boolean',5005default: defaults.shareSuggestSelections,5006markdownDescription: nls.localize('suggest.shareSuggestSelections', "Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")5007},5008'editor.suggest.selectionMode': {5009type: 'string',5010enum: ['always', 'never', 'whenTriggerCharacter', 'whenQuickSuggestion'],5011enumDescriptions: [5012nls.localize('suggest.insertMode.always', "Always select a suggestion when automatically triggering IntelliSense."),5013nls.localize('suggest.insertMode.never', "Never select a suggestion when automatically triggering IntelliSense."),5014nls.localize('suggest.insertMode.whenTriggerCharacter', "Select a suggestion only when triggering IntelliSense from a trigger character."),5015nls.localize('suggest.insertMode.whenQuickSuggestion', "Select a suggestion only when triggering IntelliSense as you type."),5016],5017default: defaults.selectionMode,5018markdownDescription: nls.localize('suggest.selectionMode', "Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions ({0} and {1}) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.", '`#editor.quickSuggestions#`', '`#editor.suggestOnTriggerCharacters#`')5019},5020'editor.suggest.snippetsPreventQuickSuggestions': {5021type: 'boolean',5022default: defaults.snippetsPreventQuickSuggestions,5023description: nls.localize('suggest.snippetsPreventQuickSuggestions', "Controls whether an active snippet prevents quick suggestions.")5024},5025'editor.suggest.showIcons': {5026type: 'boolean',5027default: defaults.showIcons,5028description: nls.localize('suggest.showIcons', "Controls whether to show or hide icons in suggestions.")5029},5030'editor.suggest.showStatusBar': {5031type: 'boolean',5032default: defaults.showStatusBar,5033description: nls.localize('suggest.showStatusBar', "Controls the visibility of the status bar at the bottom of the suggest widget.")5034},5035'editor.suggest.preview': {5036type: 'boolean',5037default: defaults.preview,5038description: nls.localize('suggest.preview', "Controls whether to preview the suggestion outcome in the editor.")5039},5040'editor.suggest.showInlineDetails': {5041type: 'boolean',5042default: defaults.showInlineDetails,5043description: nls.localize('suggest.showInlineDetails', "Controls whether suggest details show inline with the label or only in the details widget.")5044},5045'editor.suggest.maxVisibleSuggestions': {5046type: 'number',5047deprecationMessage: nls.localize('suggest.maxVisibleSuggestions.dep', "This setting is deprecated. The suggest widget can now be resized."),5048},5049'editor.suggest.filteredTypes': {5050type: 'object',5051deprecationMessage: nls.localize('deprecated', "This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")5052},5053'editor.suggest.showMethods': {5054type: 'boolean',5055default: true,5056markdownDescription: nls.localize('editor.suggest.showMethods', "When enabled IntelliSense shows `method`-suggestions.")5057},5058'editor.suggest.showFunctions': {5059type: 'boolean',5060default: true,5061markdownDescription: nls.localize('editor.suggest.showFunctions', "When enabled IntelliSense shows `function`-suggestions.")5062},5063'editor.suggest.showConstructors': {5064type: 'boolean',5065default: true,5066markdownDescription: nls.localize('editor.suggest.showConstructors', "When enabled IntelliSense shows `constructor`-suggestions.")5067},5068'editor.suggest.showDeprecated': {5069type: 'boolean',5070default: true,5071markdownDescription: nls.localize('editor.suggest.showDeprecated', "When enabled IntelliSense shows `deprecated`-suggestions.")5072},5073'editor.suggest.matchOnWordStartOnly': {5074type: 'boolean',5075default: true,5076markdownDescription: nls.localize('editor.suggest.matchOnWordStartOnly', "When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")5077},5078'editor.suggest.showFields': {5079type: 'boolean',5080default: true,5081markdownDescription: nls.localize('editor.suggest.showFields', "When enabled IntelliSense shows `field`-suggestions.")5082},5083'editor.suggest.showVariables': {5084type: 'boolean',5085default: true,5086markdownDescription: nls.localize('editor.suggest.showVariables', "When enabled IntelliSense shows `variable`-suggestions.")5087},5088'editor.suggest.showClasses': {5089type: 'boolean',5090default: true,5091markdownDescription: nls.localize('editor.suggest.showClasss', "When enabled IntelliSense shows `class`-suggestions.")5092},5093'editor.suggest.showStructs': {5094type: 'boolean',5095default: true,5096markdownDescription: nls.localize('editor.suggest.showStructs', "When enabled IntelliSense shows `struct`-suggestions.")5097},5098'editor.suggest.showInterfaces': {5099type: 'boolean',5100default: true,5101markdownDescription: nls.localize('editor.suggest.showInterfaces', "When enabled IntelliSense shows `interface`-suggestions.")5102},5103'editor.suggest.showModules': {5104type: 'boolean',5105default: true,5106markdownDescription: nls.localize('editor.suggest.showModules', "When enabled IntelliSense shows `module`-suggestions.")5107},5108'editor.suggest.showProperties': {5109type: 'boolean',5110default: true,5111markdownDescription: nls.localize('editor.suggest.showPropertys', "When enabled IntelliSense shows `property`-suggestions.")5112},5113'editor.suggest.showEvents': {5114type: 'boolean',5115default: true,5116markdownDescription: nls.localize('editor.suggest.showEvents', "When enabled IntelliSense shows `event`-suggestions.")5117},5118'editor.suggest.showOperators': {5119type: 'boolean',5120default: true,5121markdownDescription: nls.localize('editor.suggest.showOperators', "When enabled IntelliSense shows `operator`-suggestions.")5122},5123'editor.suggest.showUnits': {5124type: 'boolean',5125default: true,5126markdownDescription: nls.localize('editor.suggest.showUnits', "When enabled IntelliSense shows `unit`-suggestions.")5127},5128'editor.suggest.showValues': {5129type: 'boolean',5130default: true,5131markdownDescription: nls.localize('editor.suggest.showValues', "When enabled IntelliSense shows `value`-suggestions.")5132},5133'editor.suggest.showConstants': {5134type: 'boolean',5135default: true,5136markdownDescription: nls.localize('editor.suggest.showConstants', "When enabled IntelliSense shows `constant`-suggestions.")5137},5138'editor.suggest.showEnums': {5139type: 'boolean',5140default: true,5141markdownDescription: nls.localize('editor.suggest.showEnums', "When enabled IntelliSense shows `enum`-suggestions.")5142},5143'editor.suggest.showEnumMembers': {5144type: 'boolean',5145default: true,5146markdownDescription: nls.localize('editor.suggest.showEnumMembers', "When enabled IntelliSense shows `enumMember`-suggestions.")5147},5148'editor.suggest.showKeywords': {5149type: 'boolean',5150default: true,5151markdownDescription: nls.localize('editor.suggest.showKeywords', "When enabled IntelliSense shows `keyword`-suggestions.")5152},5153'editor.suggest.showWords': {5154type: 'boolean',5155default: true,5156markdownDescription: nls.localize('editor.suggest.showTexts', "When enabled IntelliSense shows `text`-suggestions.")5157},5158'editor.suggest.showColors': {5159type: 'boolean',5160default: true,5161markdownDescription: nls.localize('editor.suggest.showColors', "When enabled IntelliSense shows `color`-suggestions.")5162},5163'editor.suggest.showFiles': {5164type: 'boolean',5165default: true,5166markdownDescription: nls.localize('editor.suggest.showFiles', "When enabled IntelliSense shows `file`-suggestions.")5167},5168'editor.suggest.showReferences': {5169type: 'boolean',5170default: true,5171markdownDescription: nls.localize('editor.suggest.showReferences', "When enabled IntelliSense shows `reference`-suggestions.")5172},5173'editor.suggest.showCustomcolors': {5174type: 'boolean',5175default: true,5176markdownDescription: nls.localize('editor.suggest.showCustomcolors', "When enabled IntelliSense shows `customcolor`-suggestions.")5177},5178'editor.suggest.showFolders': {5179type: 'boolean',5180default: true,5181markdownDescription: nls.localize('editor.suggest.showFolders', "When enabled IntelliSense shows `folder`-suggestions.")5182},5183'editor.suggest.showTypeParameters': {5184type: 'boolean',5185default: true,5186markdownDescription: nls.localize('editor.suggest.showTypeParameters', "When enabled IntelliSense shows `typeParameter`-suggestions.")5187},5188'editor.suggest.showSnippets': {5189type: 'boolean',5190default: true,5191markdownDescription: nls.localize('editor.suggest.showSnippets', "When enabled IntelliSense shows `snippet`-suggestions.")5192},5193'editor.suggest.showUsers': {5194type: 'boolean',5195default: true,5196markdownDescription: nls.localize('editor.suggest.showUsers', "When enabled IntelliSense shows `user`-suggestions.")5197},5198'editor.suggest.showIssues': {5199type: 'boolean',5200default: true,5201markdownDescription: nls.localize('editor.suggest.showIssues', "When enabled IntelliSense shows `issues`-suggestions.")5202}5203}5204);5205}52065207public validate(_input: any): InternalSuggestOptions {5208if (!_input || typeof _input !== 'object') {5209return this.defaultValue;5210}5211const input = _input as ISuggestOptions;5212return {5213insertMode: stringSet(input.insertMode, this.defaultValue.insertMode, ['insert', 'replace']),5214filterGraceful: boolean(input.filterGraceful, this.defaultValue.filterGraceful),5215snippetsPreventQuickSuggestions: boolean(input.snippetsPreventQuickSuggestions, this.defaultValue.filterGraceful),5216localityBonus: boolean(input.localityBonus, this.defaultValue.localityBonus),5217shareSuggestSelections: boolean(input.shareSuggestSelections, this.defaultValue.shareSuggestSelections),5218selectionMode: stringSet(input.selectionMode, this.defaultValue.selectionMode, ['always', 'never', 'whenQuickSuggestion', 'whenTriggerCharacter']),5219showIcons: boolean(input.showIcons, this.defaultValue.showIcons),5220showStatusBar: boolean(input.showStatusBar, this.defaultValue.showStatusBar),5221preview: boolean(input.preview, this.defaultValue.preview),5222previewMode: stringSet(input.previewMode, this.defaultValue.previewMode, ['prefix', 'subword', 'subwordSmart']),5223showInlineDetails: boolean(input.showInlineDetails, this.defaultValue.showInlineDetails),5224showMethods: boolean(input.showMethods, this.defaultValue.showMethods),5225showFunctions: boolean(input.showFunctions, this.defaultValue.showFunctions),5226showConstructors: boolean(input.showConstructors, this.defaultValue.showConstructors),5227showDeprecated: boolean(input.showDeprecated, this.defaultValue.showDeprecated),5228matchOnWordStartOnly: boolean(input.matchOnWordStartOnly, this.defaultValue.matchOnWordStartOnly),5229showFields: boolean(input.showFields, this.defaultValue.showFields),5230showVariables: boolean(input.showVariables, this.defaultValue.showVariables),5231showClasses: boolean(input.showClasses, this.defaultValue.showClasses),5232showStructs: boolean(input.showStructs, this.defaultValue.showStructs),5233showInterfaces: boolean(input.showInterfaces, this.defaultValue.showInterfaces),5234showModules: boolean(input.showModules, this.defaultValue.showModules),5235showProperties: boolean(input.showProperties, this.defaultValue.showProperties),5236showEvents: boolean(input.showEvents, this.defaultValue.showEvents),5237showOperators: boolean(input.showOperators, this.defaultValue.showOperators),5238showUnits: boolean(input.showUnits, this.defaultValue.showUnits),5239showValues: boolean(input.showValues, this.defaultValue.showValues),5240showConstants: boolean(input.showConstants, this.defaultValue.showConstants),5241showEnums: boolean(input.showEnums, this.defaultValue.showEnums),5242showEnumMembers: boolean(input.showEnumMembers, this.defaultValue.showEnumMembers),5243showKeywords: boolean(input.showKeywords, this.defaultValue.showKeywords),5244showWords: boolean(input.showWords, this.defaultValue.showWords),5245showColors: boolean(input.showColors, this.defaultValue.showColors),5246showFiles: boolean(input.showFiles, this.defaultValue.showFiles),5247showReferences: boolean(input.showReferences, this.defaultValue.showReferences),5248showFolders: boolean(input.showFolders, this.defaultValue.showFolders),5249showTypeParameters: boolean(input.showTypeParameters, this.defaultValue.showTypeParameters),5250showSnippets: boolean(input.showSnippets, this.defaultValue.showSnippets),5251showUsers: boolean(input.showUsers, this.defaultValue.showUsers),5252showIssues: boolean(input.showIssues, this.defaultValue.showIssues),5253};5254}5255}52565257//#endregion52585259//#region smart select52605261export interface ISmartSelectOptions {5262selectLeadingAndTrailingWhitespace?: boolean;5263selectSubwords?: boolean;5264}52655266/**5267* @internal5268*/5269export type SmartSelectOptions = Readonly<Required<ISmartSelectOptions>>;52705271class SmartSelect extends BaseEditorOption<EditorOption.smartSelect, ISmartSelectOptions, SmartSelectOptions> {52725273constructor() {5274super(5275EditorOption.smartSelect, 'smartSelect',5276{5277selectLeadingAndTrailingWhitespace: true,5278selectSubwords: true,5279},5280{5281'editor.smartSelect.selectLeadingAndTrailingWhitespace': {5282description: nls.localize('selectLeadingAndTrailingWhitespace', "Whether leading and trailing whitespace should always be selected."),5283default: true,5284type: 'boolean'5285},5286'editor.smartSelect.selectSubwords': {5287description: nls.localize('selectSubwords', "Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),5288default: true,5289type: 'boolean'5290}5291}5292);5293}52945295public validate(input: any): Readonly<Required<ISmartSelectOptions>> {5296if (!input || typeof input !== 'object') {5297return this.defaultValue;5298}5299return {5300selectLeadingAndTrailingWhitespace: boolean((input as ISmartSelectOptions).selectLeadingAndTrailingWhitespace, this.defaultValue.selectLeadingAndTrailingWhitespace),5301selectSubwords: boolean((input as ISmartSelectOptions).selectSubwords, this.defaultValue.selectSubwords),5302};5303}5304}53055306//#endregion53075308//#region wordSegmenterLocales53095310/**5311* Locales used for segmenting lines into words when doing word related navigations or operations.5312*5313* Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.).5314*/5315class WordSegmenterLocales extends BaseEditorOption<EditorOption.wordSegmenterLocales, string | string[], string[]> {5316constructor() {5317const defaults: string[] = [];53185319super(5320EditorOption.wordSegmenterLocales, 'wordSegmenterLocales', defaults,5321{5322anyOf: [5323{5324type: 'string',5325}, {5326type: 'array',5327items: {5328type: 'string'5329}5330}5331],5332description: nls.localize('wordSegmenterLocales', "Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),5333type: 'array',5334items: {5335type: 'string',5336},5337default: defaults,5338},5339);5340}53415342public validate(input: any): string[] {5343if (typeof input === 'string') {5344input = [input];5345}5346if (Array.isArray(input)) {5347const validLocales: string[] = [];5348for (const locale of input) {5349if (typeof locale === 'string') {5350try {5351if (Intl.Segmenter.supportedLocalesOf(locale).length > 0) {5352validLocales.push(locale);5353}5354} catch {5355// ignore invalid locales5356}5357}5358}5359return validLocales;5360}53615362return this.defaultValue;5363}5364}536553665367//#endregion53685369//#region wrappingIndent53705371/**5372* Describes how to indent wrapped lines.5373*/5374export const enum WrappingIndent {5375/**5376* No indentation => wrapped lines begin at column 1.5377*/5378None = 0,5379/**5380* Same => wrapped lines get the same indentation as the parent.5381*/5382Same = 1,5383/**5384* Indent => wrapped lines get +1 indentation toward the parent.5385*/5386Indent = 2,5387/**5388* DeepIndent => wrapped lines get +2 indentation toward the parent.5389*/5390DeepIndent = 35391}53925393class WrappingIndentOption extends BaseEditorOption<EditorOption.wrappingIndent, 'none' | 'same' | 'indent' | 'deepIndent', WrappingIndent> {53945395constructor() {5396super(EditorOption.wrappingIndent, 'wrappingIndent', WrappingIndent.Same,5397{5398'editor.wrappingIndent': {5399type: 'string',5400enum: ['none', 'same', 'indent', 'deepIndent'],5401enumDescriptions: [5402nls.localize('wrappingIndent.none', "No indentation. Wrapped lines begin at column 1."),5403nls.localize('wrappingIndent.same', "Wrapped lines get the same indentation as the parent."),5404nls.localize('wrappingIndent.indent', "Wrapped lines get +1 indentation toward the parent."),5405nls.localize('wrappingIndent.deepIndent', "Wrapped lines get +2 indentation toward the parent."),5406],5407description: nls.localize('wrappingIndent', "Controls the indentation of wrapped lines."),5408default: 'same'5409}5410}5411);5412}54135414public validate(input: any): WrappingIndent {5415switch (input) {5416case 'none': return WrappingIndent.None;5417case 'same': return WrappingIndent.Same;5418case 'indent': return WrappingIndent.Indent;5419case 'deepIndent': return WrappingIndent.DeepIndent;5420}5421return WrappingIndent.Same;5422}54235424public override compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: WrappingIndent): WrappingIndent {5425const accessibilitySupport = options.get(EditorOption.accessibilitySupport);5426if (accessibilitySupport === AccessibilitySupport.Enabled) {5427// if we know for a fact that a screen reader is attached, we use no indent wrapping to5428// help that the editor's wrapping points match the textarea's wrapping points5429return WrappingIndent.None;5430}5431return value;5432}5433}54345435//#endregion54365437//#region wrappingInfo54385439export interface EditorWrappingInfo {5440readonly isDominatedByLongLines: boolean;5441readonly isWordWrapMinified: boolean;5442readonly isViewportWrapping: boolean;5443readonly wrappingColumn: number;5444}54455446class EditorWrappingInfoComputer extends ComputedEditorOption<EditorOption.wrappingInfo, EditorWrappingInfo> {54475448constructor() {5449super(EditorOption.wrappingInfo);5450}54515452public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, _: EditorWrappingInfo): EditorWrappingInfo {5453const layoutInfo = options.get(EditorOption.layoutInfo);54545455return {5456isDominatedByLongLines: env.isDominatedByLongLines,5457isWordWrapMinified: layoutInfo.isWordWrapMinified,5458isViewportWrapping: layoutInfo.isViewportWrapping,5459wrappingColumn: layoutInfo.wrappingColumn,5460};5461}5462}54635464//#endregion54655466//#region dropIntoEditor54675468/**5469* Configuration options for editor drop into behavior5470*/5471export interface IDropIntoEditorOptions {5472/**5473* Enable dropping into editor.5474* Defaults to true.5475*/5476enabled?: boolean;54775478/**5479* Controls if a widget is shown after a drop.5480* Defaults to 'afterDrop'.5481*/5482showDropSelector?: 'afterDrop' | 'never';5483}54845485/**5486* @internal5487*/5488export type EditorDropIntoEditorOptions = Readonly<Required<IDropIntoEditorOptions>>;54895490class EditorDropIntoEditor extends BaseEditorOption<EditorOption.dropIntoEditor, IDropIntoEditorOptions, EditorDropIntoEditorOptions> {54915492constructor() {5493const defaults: EditorDropIntoEditorOptions = { enabled: true, showDropSelector: 'afterDrop' };5494super(5495EditorOption.dropIntoEditor, 'dropIntoEditor', defaults,5496{5497'editor.dropIntoEditor.enabled': {5498type: 'boolean',5499default: defaults.enabled,5500markdownDescription: nls.localize('dropIntoEditor.enabled', "Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor)."),5501},5502'editor.dropIntoEditor.showDropSelector': {5503type: 'string',5504markdownDescription: nls.localize('dropIntoEditor.showDropSelector', "Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),5505enum: [5506'afterDrop',5507'never'5508],5509enumDescriptions: [5510nls.localize('dropIntoEditor.showDropSelector.afterDrop', "Show the drop selector widget after a file is dropped into the editor."),5511nls.localize('dropIntoEditor.showDropSelector.never', "Never show the drop selector widget. Instead the default drop provider is always used."),5512],5513default: 'afterDrop',5514},5515}5516);5517}55185519public validate(_input: any): EditorDropIntoEditorOptions {5520if (!_input || typeof _input !== 'object') {5521return this.defaultValue;5522}5523const input = _input as IDropIntoEditorOptions;5524return {5525enabled: boolean(input.enabled, this.defaultValue.enabled),5526showDropSelector: stringSet(input.showDropSelector, this.defaultValue.showDropSelector, ['afterDrop', 'never']),5527};5528}5529}55305531//#endregion55325533//#region pasteAs55345535/**5536* Configuration options for editor pasting as into behavior5537*/5538export interface IPasteAsOptions {5539/**5540* Enable paste as functionality in editors.5541* Defaults to true.5542*/5543enabled?: boolean;55445545/**5546* Controls if a widget is shown after a drop.5547* Defaults to 'afterPaste'.5548*/5549showPasteSelector?: 'afterPaste' | 'never';5550}55515552/**5553* @internal5554*/5555export type EditorPasteAsOptions = Readonly<Required<IPasteAsOptions>>;55565557class EditorPasteAs extends BaseEditorOption<EditorOption.pasteAs, IPasteAsOptions, EditorPasteAsOptions> {55585559constructor() {5560const defaults: EditorPasteAsOptions = { enabled: true, showPasteSelector: 'afterPaste' };5561super(5562EditorOption.pasteAs, 'pasteAs', defaults,5563{5564'editor.pasteAs.enabled': {5565type: 'boolean',5566default: defaults.enabled,5567markdownDescription: nls.localize('pasteAs.enabled', "Controls whether you can paste content in different ways."),5568},5569'editor.pasteAs.showPasteSelector': {5570type: 'string',5571markdownDescription: nls.localize('pasteAs.showPasteSelector', "Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),5572enum: [5573'afterPaste',5574'never'5575],5576enumDescriptions: [5577nls.localize('pasteAs.showPasteSelector.afterPaste', "Show the paste selector widget after content is pasted into the editor."),5578nls.localize('pasteAs.showPasteSelector.never', "Never show the paste selector widget. Instead the default pasting behavior is always used."),5579],5580default: 'afterPaste',5581},5582}5583);5584}55855586public validate(_input: any): EditorPasteAsOptions {5587if (!_input || typeof _input !== 'object') {5588return this.defaultValue;5589}5590const input = _input as IPasteAsOptions;5591return {5592enabled: boolean(input.enabled, this.defaultValue.enabled),5593showPasteSelector: stringSet(input.showPasteSelector, this.defaultValue.showPasteSelector, ['afterPaste', 'never']),5594};5595}5596}55975598//#endregion55995600const DEFAULT_WINDOWS_FONT_FAMILY = 'Consolas, \'Courier New\', monospace';5601const DEFAULT_MAC_FONT_FAMILY = 'Menlo, Monaco, \'Courier New\', monospace';5602const DEFAULT_LINUX_FONT_FAMILY = '\'Droid Sans Mono\', \'monospace\', monospace';56035604/**5605* @internal5606*/5607export const EDITOR_FONT_DEFAULTS = {5608fontFamily: (5609platform.isMacintosh ? DEFAULT_MAC_FONT_FAMILY : (platform.isWindows ? DEFAULT_WINDOWS_FONT_FAMILY : DEFAULT_LINUX_FONT_FAMILY)5610),5611fontWeight: 'normal',5612fontSize: (5613platform.isMacintosh ? 12 : 145614),5615lineHeight: 0,5616letterSpacing: 0,5617};56185619/**5620* @internal5621*/5622export const editorOptionsRegistry: IEditorOption<EditorOption, any>[] = [];56235624function register<K extends EditorOption, V>(option: IEditorOption<K, V>): IEditorOption<K, V> {5625editorOptionsRegistry[option.id] = option;5626return option;5627}56285629export const enum EditorOption {5630acceptSuggestionOnCommitCharacter,5631acceptSuggestionOnEnter,5632accessibilitySupport,5633accessibilityPageSize,5634allowOverflow,5635allowVariableLineHeights,5636allowVariableFonts,5637allowVariableFontsInAccessibilityMode,5638ariaLabel,5639ariaRequired,5640autoClosingBrackets,5641autoClosingComments,5642screenReaderAnnounceInlineSuggestion,5643autoClosingDelete,5644autoClosingOvertype,5645autoClosingQuotes,5646autoIndent,5647autoIndentOnPaste,5648autoIndentOnPasteWithinString,5649automaticLayout,5650autoSurround,5651bracketPairColorization,5652guides,5653codeLens,5654codeLensFontFamily,5655codeLensFontSize,5656colorDecorators,5657colorDecoratorsLimit,5658columnSelection,5659comments,5660contextmenu,5661copyWithSyntaxHighlighting,5662cursorBlinking,5663cursorSmoothCaretAnimation,5664cursorStyle,5665cursorSurroundingLines,5666cursorSurroundingLinesStyle,5667cursorWidth,5668cursorHeight,5669disableLayerHinting,5670disableMonospaceOptimizations,5671domReadOnly,5672dragAndDrop,5673dropIntoEditor,5674editContext,5675emptySelectionClipboard,5676experimentalGpuAcceleration,5677experimentalWhitespaceRendering,5678extraEditorClassName,5679fastScrollSensitivity,5680find,5681fixedOverflowWidgets,5682folding,5683foldingStrategy,5684foldingHighlight,5685foldingImportsByDefault,5686foldingMaximumRegions,5687unfoldOnClickAfterEndOfLine,5688fontFamily,5689fontInfo,5690fontLigatures,5691fontSize,5692fontWeight,5693fontVariations,5694formatOnPaste,5695formatOnType,5696glyphMargin,5697gotoLocation,5698hideCursorInOverviewRuler,5699hover,5700inDiffEditor,5701inlineSuggest,5702letterSpacing,5703lightbulb,5704lineDecorationsWidth,5705lineHeight,5706lineNumbers,5707lineNumbersMinChars,5708linkedEditing,5709links,5710matchBrackets,5711minimap,5712mouseStyle,5713mouseWheelScrollSensitivity,5714mouseWheelZoom,5715multiCursorMergeOverlapping,5716multiCursorModifier,5717multiCursorPaste,5718multiCursorLimit,5719occurrencesHighlight,5720occurrencesHighlightDelay,5721overtypeCursorStyle,5722overtypeOnPaste,5723overviewRulerBorder,5724overviewRulerLanes,5725padding,5726pasteAs,5727parameterHints,5728peekWidgetDefaultFocus,5729placeholder,5730definitionLinkOpensInPeek,5731quickSuggestions,5732quickSuggestionsDelay,5733readOnly,5734readOnlyMessage,5735renameOnType,5736renderRichScreenReaderContent,5737renderControlCharacters,5738renderFinalNewline,5739renderLineHighlight,5740renderLineHighlightOnlyWhenFocus,5741renderValidationDecorations,5742renderWhitespace,5743revealHorizontalRightPadding,5744roundedSelection,5745rulers,5746scrollbar,5747scrollBeyondLastColumn,5748scrollBeyondLastLine,5749scrollPredominantAxis,5750selectionClipboard,5751selectionHighlight,5752selectionHighlightMaxLength,5753selectionHighlightMultiline,5754selectOnLineNumbers,5755showFoldingControls,5756showUnused,5757snippetSuggestions,5758smartSelect,5759smoothScrolling,5760stickyScroll,5761stickyTabStops,5762stopRenderingLineAfter,5763suggest,5764suggestFontSize,5765suggestLineHeight,5766suggestOnTriggerCharacters,5767suggestSelection,5768tabCompletion,5769tabIndex,5770trimWhitespaceOnDelete,5771unicodeHighlighting,5772unusualLineTerminators,5773useShadowDOM,5774useTabStops,5775wordBreak,5776wordSegmenterLocales,5777wordSeparators,5778wordWrap,5779wordWrapBreakAfterCharacters,5780wordWrapBreakBeforeCharacters,5781wordWrapColumn,5782wordWrapOverride1,5783wordWrapOverride2,5784wrappingIndent,5785wrappingStrategy,5786showDeprecated,5787inertialScroll,5788inlayHints,5789wrapOnEscapedLineFeeds,5790// Leave these at the end (because they have dependencies!)5791effectiveCursorStyle,5792editorClassName,5793pixelRatio,5794tabFocusMode,5795layoutInfo,5796wrappingInfo,5797defaultColorDecorators,5798colorDecoratorsActivatedOn,5799inlineCompletionsAccessibilityVerbose,5800effectiveEditContext,5801scrollOnMiddleClick,5802effectiveAllowVariableFonts5803}58045805export const EditorOptions = {5806acceptSuggestionOnCommitCharacter: register(new EditorBooleanOption(5807EditorOption.acceptSuggestionOnCommitCharacter, 'acceptSuggestionOnCommitCharacter', true,5808{ markdownDescription: nls.localize('acceptSuggestionOnCommitCharacter', "Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.") }5809)),5810acceptSuggestionOnEnter: register(new EditorStringEnumOption(5811EditorOption.acceptSuggestionOnEnter, 'acceptSuggestionOnEnter',5812'on' as 'on' | 'smart' | 'off',5813['on', 'smart', 'off'] as const,5814{5815markdownEnumDescriptions: [5816'',5817nls.localize('acceptSuggestionOnEnterSmart', "Only accept a suggestion with `Enter` when it makes a textual change."),5818''5819],5820markdownDescription: nls.localize('acceptSuggestionOnEnter', "Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")5821}5822)),5823accessibilitySupport: register(new EditorAccessibilitySupport()),5824accessibilityPageSize: register(new EditorIntOption(EditorOption.accessibilityPageSize, 'accessibilityPageSize', 500, 1, Constants.MAX_SAFE_SMALL_INTEGER,5825{5826description: nls.localize('accessibilityPageSize', "Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),5827tags: ['accessibility']5828}5829)),5830allowOverflow: register(new EditorBooleanOption(5831EditorOption.allowOverflow, 'allowOverflow', true,5832)),5833allowVariableLineHeights: register(new EditorBooleanOption(5834EditorOption.allowVariableLineHeights, 'allowVariableLineHeights', true,5835{5836description: nls.localize('allowVariableLineHeights', "Controls whether to allow using variable line heights in the editor.")5837}5838)),5839allowVariableFonts: register(new EditorBooleanOption(5840EditorOption.allowVariableFonts, 'allowVariableFonts', true,5841{5842description: nls.localize('allowVariableFonts', "Controls whether to allow using variable fonts in the editor.")5843}5844)),5845allowVariableFontsInAccessibilityMode: register(new EditorBooleanOption(5846EditorOption.allowVariableFontsInAccessibilityMode, 'allowVariableFontsInAccessibilityMode', false,5847{5848description: nls.localize('allowVariableFontsInAccessibilityMode', "Controls whether to allow using variable fonts in the editor in the accessibility mode."),5849tags: ['accessibility']5850}5851)),5852ariaLabel: register(new EditorStringOption(5853EditorOption.ariaLabel, 'ariaLabel', nls.localize('editorViewAccessibleLabel', "Editor content")5854)),5855ariaRequired: register(new EditorBooleanOption(5856EditorOption.ariaRequired, 'ariaRequired', false, undefined5857)),5858screenReaderAnnounceInlineSuggestion: register(new EditorBooleanOption(5859EditorOption.screenReaderAnnounceInlineSuggestion, 'screenReaderAnnounceInlineSuggestion', true,5860{5861description: nls.localize('screenReaderAnnounceInlineSuggestion', "Control whether inline suggestions are announced by a screen reader."),5862tags: ['accessibility']5863}5864)),5865autoClosingBrackets: register(new EditorStringEnumOption(5866EditorOption.autoClosingBrackets, 'autoClosingBrackets',5867'languageDefined' as 'always' | 'languageDefined' | 'beforeWhitespace' | 'never',5868['always', 'languageDefined', 'beforeWhitespace', 'never'] as const,5869{5870enumDescriptions: [5871'',5872nls.localize('editor.autoClosingBrackets.languageDefined', "Use language configurations to determine when to autoclose brackets."),5873nls.localize('editor.autoClosingBrackets.beforeWhitespace', "Autoclose brackets only when the cursor is to the left of whitespace."),5874'',5875],5876description: nls.localize('autoClosingBrackets', "Controls whether the editor should automatically close brackets after the user adds an opening bracket.")5877}5878)),5879autoClosingComments: register(new EditorStringEnumOption(5880EditorOption.autoClosingComments, 'autoClosingComments',5881'languageDefined' as 'always' | 'languageDefined' | 'beforeWhitespace' | 'never',5882['always', 'languageDefined', 'beforeWhitespace', 'never'] as const,5883{5884enumDescriptions: [5885'',5886nls.localize('editor.autoClosingComments.languageDefined', "Use language configurations to determine when to autoclose comments."),5887nls.localize('editor.autoClosingComments.beforeWhitespace', "Autoclose comments only when the cursor is to the left of whitespace."),5888'',5889],5890description: nls.localize('autoClosingComments', "Controls whether the editor should automatically close comments after the user adds an opening comment.")5891}5892)),5893autoClosingDelete: register(new EditorStringEnumOption(5894EditorOption.autoClosingDelete, 'autoClosingDelete',5895'auto' as 'always' | 'auto' | 'never',5896['always', 'auto', 'never'] as const,5897{5898enumDescriptions: [5899'',5900nls.localize('editor.autoClosingDelete.auto', "Remove adjacent closing quotes or brackets only if they were automatically inserted."),5901'',5902],5903description: nls.localize('autoClosingDelete', "Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")5904}5905)),5906autoClosingOvertype: register(new EditorStringEnumOption(5907EditorOption.autoClosingOvertype, 'autoClosingOvertype',5908'auto' as 'always' | 'auto' | 'never',5909['always', 'auto', 'never'] as const,5910{5911enumDescriptions: [5912'',5913nls.localize('editor.autoClosingOvertype.auto', "Type over closing quotes or brackets only if they were automatically inserted."),5914'',5915],5916description: nls.localize('autoClosingOvertype', "Controls whether the editor should type over closing quotes or brackets.")5917}5918)),5919autoClosingQuotes: register(new EditorStringEnumOption(5920EditorOption.autoClosingQuotes, 'autoClosingQuotes',5921'languageDefined' as 'always' | 'languageDefined' | 'beforeWhitespace' | 'never',5922['always', 'languageDefined', 'beforeWhitespace', 'never'] as const,5923{5924enumDescriptions: [5925'',5926nls.localize('editor.autoClosingQuotes.languageDefined', "Use language configurations to determine when to autoclose quotes."),5927nls.localize('editor.autoClosingQuotes.beforeWhitespace', "Autoclose quotes only when the cursor is to the left of whitespace."),5928'',5929],5930description: nls.localize('autoClosingQuotes', "Controls whether the editor should automatically close quotes after the user adds an opening quote.")5931}5932)),5933autoIndent: register(new EditorEnumOption(5934EditorOption.autoIndent, 'autoIndent',5935EditorAutoIndentStrategy.Full, 'full',5936['none', 'keep', 'brackets', 'advanced', 'full'],5937_autoIndentFromString,5938{5939enumDescriptions: [5940nls.localize('editor.autoIndent.none', "The editor will not insert indentation automatically."),5941nls.localize('editor.autoIndent.keep', "The editor will keep the current line's indentation."),5942nls.localize('editor.autoIndent.brackets', "The editor will keep the current line's indentation and honor language defined brackets."),5943nls.localize('editor.autoIndent.advanced', "The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),5944nls.localize('editor.autoIndent.full', "The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages."),5945],5946description: nls.localize('autoIndent', "Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")5947}5948)),5949autoIndentOnPaste: register(new EditorBooleanOption(5950EditorOption.autoIndentOnPaste, 'autoIndentOnPaste', false,5951{ description: nls.localize('autoIndentOnPaste', "Controls whether the editor should automatically auto-indent the pasted content.") }5952)),5953autoIndentOnPasteWithinString: register(new EditorBooleanOption(5954EditorOption.autoIndentOnPasteWithinString, 'autoIndentOnPasteWithinString', true,5955{ description: nls.localize('autoIndentOnPasteWithinString', "Controls whether the editor should automatically auto-indent the pasted content when pasted within a string. This takes effect when autoIndentOnPaste is true.") }5956)),5957automaticLayout: register(new EditorBooleanOption(5958EditorOption.automaticLayout, 'automaticLayout', false,5959)),5960autoSurround: register(new EditorStringEnumOption(5961EditorOption.autoSurround, 'autoSurround',5962'languageDefined' as 'languageDefined' | 'quotes' | 'brackets' | 'never',5963['languageDefined', 'quotes', 'brackets', 'never'] as const,5964{5965enumDescriptions: [5966nls.localize('editor.autoSurround.languageDefined', "Use language configurations to determine when to automatically surround selections."),5967nls.localize('editor.autoSurround.quotes', "Surround with quotes but not brackets."),5968nls.localize('editor.autoSurround.brackets', "Surround with brackets but not quotes."),5969''5970],5971description: nls.localize('autoSurround', "Controls whether the editor should automatically surround selections when typing quotes or brackets.")5972}5973)),5974bracketPairColorization: register(new BracketPairColorization()),5975bracketPairGuides: register(new GuideOptions()),5976stickyTabStops: register(new EditorBooleanOption(5977EditorOption.stickyTabStops, 'stickyTabStops', false,5978{ description: nls.localize('stickyTabStops', "Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.") }5979)),5980codeLens: register(new EditorBooleanOption(5981EditorOption.codeLens, 'codeLens', true,5982{ description: nls.localize('codeLens', "Controls whether the editor shows CodeLens.") }5983)),5984codeLensFontFamily: register(new EditorStringOption(5985EditorOption.codeLensFontFamily, 'codeLensFontFamily', '',5986{ description: nls.localize('codeLensFontFamily', "Controls the font family for CodeLens.") }5987)),5988codeLensFontSize: register(new EditorIntOption(EditorOption.codeLensFontSize, 'codeLensFontSize', 0, 0, 100, {5989type: 'number',5990default: 0,5991minimum: 0,5992maximum: 100,5993markdownDescription: nls.localize('codeLensFontSize', "Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")5994})),5995colorDecorators: register(new EditorBooleanOption(5996EditorOption.colorDecorators, 'colorDecorators', true,5997{ description: nls.localize('colorDecorators', "Controls whether the editor should render the inline color decorators and color picker.") }5998)),5999colorDecoratorActivatedOn: register(new EditorStringEnumOption(EditorOption.colorDecoratorsActivatedOn, 'colorDecoratorsActivatedOn', 'clickAndHover' as 'clickAndHover' | 'hover' | 'click', ['clickAndHover', 'hover', 'click'] as const, {6000enumDescriptions: [6001nls.localize('editor.colorDecoratorActivatedOn.clickAndHover', "Make the color picker appear both on click and hover of the color decorator"),6002nls.localize('editor.colorDecoratorActivatedOn.hover', "Make the color picker appear on hover of the color decorator"),6003nls.localize('editor.colorDecoratorActivatedOn.click', "Make the color picker appear on click of the color decorator")6004],6005description: nls.localize('colorDecoratorActivatedOn', "Controls the condition to make a color picker appear from a color decorator.")6006})),6007colorDecoratorsLimit: register(new EditorIntOption(6008EditorOption.colorDecoratorsLimit, 'colorDecoratorsLimit', 500, 1, 1000000,6009{6010markdownDescription: nls.localize('colorDecoratorsLimit', "Controls the max number of color decorators that can be rendered in an editor at once.")6011}6012)),6013columnSelection: register(new EditorBooleanOption(6014EditorOption.columnSelection, 'columnSelection', false,6015{ description: nls.localize('columnSelection', "Enable that the selection with the mouse and keys is doing column selection.") }6016)),6017comments: register(new EditorComments()),6018contextmenu: register(new EditorBooleanOption(6019EditorOption.contextmenu, 'contextmenu', true,6020)),6021copyWithSyntaxHighlighting: register(new EditorBooleanOption(6022EditorOption.copyWithSyntaxHighlighting, 'copyWithSyntaxHighlighting', true,6023{ description: nls.localize('copyWithSyntaxHighlighting', "Controls whether syntax highlighting should be copied into the clipboard.") }6024)),6025cursorBlinking: register(new EditorEnumOption(6026EditorOption.cursorBlinking, 'cursorBlinking',6027TextEditorCursorBlinkingStyle.Blink, 'blink',6028['blink', 'smooth', 'phase', 'expand', 'solid'],6029cursorBlinkingStyleFromString,6030{ description: nls.localize('cursorBlinking', "Control the cursor animation style.") }6031)),6032cursorSmoothCaretAnimation: register(new EditorStringEnumOption(6033EditorOption.cursorSmoothCaretAnimation, 'cursorSmoothCaretAnimation',6034'off' as 'off' | 'explicit' | 'on',6035['off', 'explicit', 'on'] as const,6036{6037enumDescriptions: [6038nls.localize('cursorSmoothCaretAnimation.off', "Smooth caret animation is disabled."),6039nls.localize('cursorSmoothCaretAnimation.explicit', "Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),6040nls.localize('cursorSmoothCaretAnimation.on', "Smooth caret animation is always enabled.")6041],6042description: nls.localize('cursorSmoothCaretAnimation', "Controls whether the smooth caret animation should be enabled.")6043}6044)),6045cursorStyle: register(new EditorEnumOption(6046EditorOption.cursorStyle, 'cursorStyle',6047TextEditorCursorStyle.Line, 'line',6048['line', 'block', 'underline', 'line-thin', 'block-outline', 'underline-thin'],6049cursorStyleFromString,6050{ description: nls.localize('cursorStyle', "Controls the cursor style in insert input mode.") }6051)),6052overtypeCursorStyle: register(new EditorEnumOption(6053EditorOption.overtypeCursorStyle, 'overtypeCursorStyle',6054TextEditorCursorStyle.Block, 'block',6055['line', 'block', 'underline', 'line-thin', 'block-outline', 'underline-thin'],6056cursorStyleFromString,6057{ description: nls.localize('overtypeCursorStyle', "Controls the cursor style in overtype input mode.") }6058)),6059cursorSurroundingLines: register(new EditorIntOption(6060EditorOption.cursorSurroundingLines, 'cursorSurroundingLines',60610, 0, Constants.MAX_SAFE_SMALL_INTEGER,6062{ description: nls.localize('cursorSurroundingLines', "Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.") }6063)),6064cursorSurroundingLinesStyle: register(new EditorStringEnumOption(6065EditorOption.cursorSurroundingLinesStyle, 'cursorSurroundingLinesStyle',6066'default' as 'default' | 'all',6067['default', 'all'] as const,6068{6069enumDescriptions: [6070nls.localize('cursorSurroundingLinesStyle.default', "`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),6071nls.localize('cursorSurroundingLinesStyle.all', "`cursorSurroundingLines` is enforced always.")6072],6073markdownDescription: nls.localize('cursorSurroundingLinesStyle', "Controls when `#editor.cursorSurroundingLines#` should be enforced.")6074}6075)),6076cursorWidth: register(new EditorIntOption(6077EditorOption.cursorWidth, 'cursorWidth',60780, 0, Constants.MAX_SAFE_SMALL_INTEGER,6079{ markdownDescription: nls.localize('cursorWidth', "Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.") }6080)),6081cursorHeight: register(new EditorIntOption(6082EditorOption.cursorHeight, 'cursorHeight',60830, 0, Constants.MAX_SAFE_SMALL_INTEGER,6084{ markdownDescription: nls.localize('cursorHeight', "Controls the height of the cursor when `#editor.cursorStyle#` is set to `line`. Cursor's max height depends on line height.") }6085)),6086disableLayerHinting: register(new EditorBooleanOption(6087EditorOption.disableLayerHinting, 'disableLayerHinting', false,6088)),6089disableMonospaceOptimizations: register(new EditorBooleanOption(6090EditorOption.disableMonospaceOptimizations, 'disableMonospaceOptimizations', false6091)),6092domReadOnly: register(new EditorBooleanOption(6093EditorOption.domReadOnly, 'domReadOnly', false,6094)),6095dragAndDrop: register(new EditorBooleanOption(6096EditorOption.dragAndDrop, 'dragAndDrop', true,6097{ description: nls.localize('dragAndDrop', "Controls whether the editor should allow moving selections via drag and drop.") }6098)),6099emptySelectionClipboard: register(new EditorEmptySelectionClipboard()),6100dropIntoEditor: register(new EditorDropIntoEditor()),6101editContext: register(new EditorBooleanOption(6102EditorOption.editContext, 'editContext', true,6103{6104description: nls.localize('editContext', "Sets whether the EditContext API should be used instead of the text area to power input in the editor."),6105included: platform.isChrome || platform.isEdge || platform.isNative6106}6107)),6108renderRichScreenReaderContent: register(new EditorBooleanOption(6109EditorOption.renderRichScreenReaderContent, 'renderRichScreenReaderContent', false,6110{6111markdownDescription: nls.localize('renderRichScreenReaderContent', "Whether to render rich screen reader content when the `#editor.editContext#` setting is enabled."),6112}6113)),6114stickyScroll: register(new EditorStickyScroll()),6115experimentalGpuAcceleration: register(new EditorStringEnumOption(6116EditorOption.experimentalGpuAcceleration, 'experimentalGpuAcceleration',6117'off' as 'off' | 'on',6118['off', 'on'] as const,6119{6120tags: ['experimental'],6121enumDescriptions: [6122nls.localize('experimentalGpuAcceleration.off', "Use regular DOM-based rendering."),6123nls.localize('experimentalGpuAcceleration.on', "Use GPU acceleration."),6124],6125description: nls.localize('experimentalGpuAcceleration', "Controls whether to use the experimental GPU acceleration to render the editor.")6126}6127)),6128experimentalWhitespaceRendering: register(new EditorStringEnumOption(6129EditorOption.experimentalWhitespaceRendering, 'experimentalWhitespaceRendering',6130'svg' as 'svg' | 'font' | 'off',6131['svg', 'font', 'off'] as const,6132{6133enumDescriptions: [6134nls.localize('experimentalWhitespaceRendering.svg', "Use a new rendering method with svgs."),6135nls.localize('experimentalWhitespaceRendering.font', "Use a new rendering method with font characters."),6136nls.localize('experimentalWhitespaceRendering.off', "Use the stable rendering method."),6137],6138description: nls.localize('experimentalWhitespaceRendering', "Controls whether whitespace is rendered with a new, experimental method.")6139}6140)),6141extraEditorClassName: register(new EditorStringOption(6142EditorOption.extraEditorClassName, 'extraEditorClassName', '',6143)),6144fastScrollSensitivity: register(new EditorFloatOption(6145EditorOption.fastScrollSensitivity, 'fastScrollSensitivity',61465, x => (x <= 0 ? 5 : x),6147{ markdownDescription: nls.localize('fastScrollSensitivity', "Scrolling speed multiplier when pressing `Alt`.") }6148)),6149find: register(new EditorFind()),6150fixedOverflowWidgets: register(new EditorBooleanOption(6151EditorOption.fixedOverflowWidgets, 'fixedOverflowWidgets', false,6152)),6153folding: register(new EditorBooleanOption(6154EditorOption.folding, 'folding', true,6155{ description: nls.localize('folding', "Controls whether the editor has code folding enabled.") }6156)),6157foldingStrategy: register(new EditorStringEnumOption(6158EditorOption.foldingStrategy, 'foldingStrategy',6159'auto' as 'auto' | 'indentation',6160['auto', 'indentation'] as const,6161{6162enumDescriptions: [6163nls.localize('foldingStrategy.auto', "Use a language-specific folding strategy if available, else the indentation-based one."),6164nls.localize('foldingStrategy.indentation', "Use the indentation-based folding strategy."),6165],6166description: nls.localize('foldingStrategy', "Controls the strategy for computing folding ranges.")6167}6168)),6169foldingHighlight: register(new EditorBooleanOption(6170EditorOption.foldingHighlight, 'foldingHighlight', true,6171{ description: nls.localize('foldingHighlight', "Controls whether the editor should highlight folded ranges.") }6172)),6173foldingImportsByDefault: register(new EditorBooleanOption(6174EditorOption.foldingImportsByDefault, 'foldingImportsByDefault', false,6175{ description: nls.localize('foldingImportsByDefault', "Controls whether the editor automatically collapses import ranges.") }6176)),6177foldingMaximumRegions: register(new EditorIntOption(6178EditorOption.foldingMaximumRegions, 'foldingMaximumRegions',61795000, 10, 65000, // limit must be less than foldingRanges MAX_FOLDING_REGIONS6180{ description: nls.localize('foldingMaximumRegions', "The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.") }6181)),6182unfoldOnClickAfterEndOfLine: register(new EditorBooleanOption(6183EditorOption.unfoldOnClickAfterEndOfLine, 'unfoldOnClickAfterEndOfLine', false,6184{ description: nls.localize('unfoldOnClickAfterEndOfLine', "Controls whether clicking on the empty content after a folded line will unfold the line.") }6185)),6186fontFamily: register(new EditorStringOption(6187EditorOption.fontFamily, 'fontFamily', EDITOR_FONT_DEFAULTS.fontFamily,6188{ description: nls.localize('fontFamily', "Controls the font family.") }6189)),6190fontInfo: register(new EditorFontInfo()),6191fontLigatures2: register(new EditorFontLigatures()),6192fontSize: register(new EditorFontSize()),6193fontWeight: register(new EditorFontWeight()),6194fontVariations: register(new EditorFontVariations()),6195formatOnPaste: register(new EditorBooleanOption(6196EditorOption.formatOnPaste, 'formatOnPaste', false,6197{ description: nls.localize('formatOnPaste', "Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.") }6198)),6199formatOnType: register(new EditorBooleanOption(6200EditorOption.formatOnType, 'formatOnType', false,6201{ description: nls.localize('formatOnType', "Controls whether the editor should automatically format the line after typing.") }6202)),6203glyphMargin: register(new EditorBooleanOption(6204EditorOption.glyphMargin, 'glyphMargin', true,6205{ description: nls.localize('glyphMargin', "Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.") }6206)),6207gotoLocation: register(new EditorGoToLocation()),6208hideCursorInOverviewRuler: register(new EditorBooleanOption(6209EditorOption.hideCursorInOverviewRuler, 'hideCursorInOverviewRuler', false,6210{ description: nls.localize('hideCursorInOverviewRuler', "Controls whether the cursor should be hidden in the overview ruler.") }6211)),6212hover: register(new EditorHover()),6213inDiffEditor: register(new EditorBooleanOption(6214EditorOption.inDiffEditor, 'inDiffEditor', false6215)),6216inertialScroll: register(new EditorBooleanOption(6217EditorOption.inertialScroll, 'inertialScroll', false,6218{ description: nls.localize('inertialScroll', "Make scrolling inertial - mostly useful with touchpad on linux.") }6219)),6220letterSpacing: register(new EditorFloatOption(6221EditorOption.letterSpacing, 'letterSpacing',6222EDITOR_FONT_DEFAULTS.letterSpacing, x => EditorFloatOption.clamp(x, -5, 20),6223{ description: nls.localize('letterSpacing', "Controls the letter spacing in pixels.") }6224)),6225lightbulb: register(new EditorLightbulb()),6226lineDecorationsWidth: register(new EditorLineDecorationsWidth()),6227lineHeight: register(new EditorLineHeight()),6228lineNumbers: register(new EditorRenderLineNumbersOption()),6229lineNumbersMinChars: register(new EditorIntOption(6230EditorOption.lineNumbersMinChars, 'lineNumbersMinChars',62315, 1, 3006232)),6233linkedEditing: register(new EditorBooleanOption(6234EditorOption.linkedEditing, 'linkedEditing', false,6235{ description: nls.localize('linkedEditing', "Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.") }6236)),6237links: register(new EditorBooleanOption(6238EditorOption.links, 'links', true,6239{ description: nls.localize('links', "Controls whether the editor should detect links and make them clickable.") }6240)),6241matchBrackets: register(new EditorStringEnumOption(6242EditorOption.matchBrackets, 'matchBrackets',6243'always' as 'never' | 'near' | 'always',6244['always', 'near', 'never'] as const,6245{ description: nls.localize('matchBrackets', "Highlight matching brackets.") }6246)),6247minimap: register(new EditorMinimap()),6248mouseStyle: register(new EditorStringEnumOption(6249EditorOption.mouseStyle, 'mouseStyle',6250'text' as 'text' | 'default' | 'copy',6251['text', 'default', 'copy'] as const,6252)),6253mouseWheelScrollSensitivity: register(new EditorFloatOption(6254EditorOption.mouseWheelScrollSensitivity, 'mouseWheelScrollSensitivity',62551, x => (x === 0 ? 1 : x),6256{ markdownDescription: nls.localize('mouseWheelScrollSensitivity', "A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.") }6257)),6258mouseWheelZoom: register(new EditorBooleanOption(6259EditorOption.mouseWheelZoom, 'mouseWheelZoom', false,6260{6261markdownDescription: platform.isMacintosh6262? nls.localize('mouseWheelZoom.mac', "Zoom the font of the editor when using mouse wheel and holding `Cmd`.")6263: nls.localize('mouseWheelZoom', "Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")6264}6265)),6266multiCursorMergeOverlapping: register(new EditorBooleanOption(6267EditorOption.multiCursorMergeOverlapping, 'multiCursorMergeOverlapping', true,6268{ description: nls.localize('multiCursorMergeOverlapping', "Merge multiple cursors when they are overlapping.") }6269)),6270multiCursorModifier: register(new EditorEnumOption(6271EditorOption.multiCursorModifier, 'multiCursorModifier',6272'altKey', 'alt',6273['ctrlCmd', 'alt'],6274_multiCursorModifierFromString,6275{6276markdownEnumDescriptions: [6277nls.localize('multiCursorModifier.ctrlCmd', "Maps to `Control` on Windows and Linux and to `Command` on macOS."),6278nls.localize('multiCursorModifier.alt', "Maps to `Alt` on Windows and Linux and to `Option` on macOS.")6279],6280markdownDescription: nls.localize({6281key: 'multiCursorModifier',6282comment: [6283'- `ctrlCmd` refers to a value the setting can take and should not be localized.',6284'- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized.'6285]6286}, "The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")6287}6288)),6289multiCursorPaste: register(new EditorStringEnumOption(6290EditorOption.multiCursorPaste, 'multiCursorPaste',6291'spread' as 'spread' | 'full',6292['spread', 'full'] as const,6293{6294markdownEnumDescriptions: [6295nls.localize('multiCursorPaste.spread', "Each cursor pastes a single line of the text."),6296nls.localize('multiCursorPaste.full', "Each cursor pastes the full text.")6297],6298markdownDescription: nls.localize('multiCursorPaste', "Controls pasting when the line count of the pasted text matches the cursor count.")6299}6300)),6301multiCursorLimit: register(new EditorIntOption(6302EditorOption.multiCursorLimit, 'multiCursorLimit', 10000, 1, 100000,6303{6304markdownDescription: nls.localize('multiCursorLimit', "Controls the max number of cursors that can be in an active editor at once.")6305}6306)),6307occurrencesHighlight: register(new EditorStringEnumOption(6308EditorOption.occurrencesHighlight, 'occurrencesHighlight',6309'singleFile' as 'off' | 'singleFile' | 'multiFile',6310['off', 'singleFile', 'multiFile'] as const,6311{6312markdownEnumDescriptions: [6313nls.localize('occurrencesHighlight.off', "Does not highlight occurrences."),6314nls.localize('occurrencesHighlight.singleFile', "Highlights occurrences only in the current file."),6315nls.localize('occurrencesHighlight.multiFile', "Experimental: Highlights occurrences across all valid open files.")6316],6317markdownDescription: nls.localize('occurrencesHighlight', "Controls whether occurrences should be highlighted across open files.")6318}6319)),6320occurrencesHighlightDelay: register(new EditorIntOption(6321EditorOption.occurrencesHighlightDelay, 'occurrencesHighlightDelay',63220, 0, 2000,6323{6324description: nls.localize('occurrencesHighlightDelay', "Controls the delay in milliseconds after which occurrences are highlighted."),6325tags: ['preview']6326}6327)),6328overtypeOnPaste: register(new EditorBooleanOption(6329EditorOption.overtypeOnPaste, 'overtypeOnPaste', true,6330{ description: nls.localize('overtypeOnPaste', "Controls whether pasting should overtype.") }6331)),6332overviewRulerBorder: register(new EditorBooleanOption(6333EditorOption.overviewRulerBorder, 'overviewRulerBorder', true,6334{ description: nls.localize('overviewRulerBorder', "Controls whether a border should be drawn around the overview ruler.") }6335)),6336overviewRulerLanes: register(new EditorIntOption(6337EditorOption.overviewRulerLanes, 'overviewRulerLanes',63383, 0, 36339)),6340padding: register(new EditorPadding()),6341pasteAs: register(new EditorPasteAs()),6342parameterHints: register(new EditorParameterHints()),6343peekWidgetDefaultFocus: register(new EditorStringEnumOption(6344EditorOption.peekWidgetDefaultFocus, 'peekWidgetDefaultFocus',6345'tree' as 'tree' | 'editor',6346['tree', 'editor'] as const,6347{6348enumDescriptions: [6349nls.localize('peekWidgetDefaultFocus.tree', "Focus the tree when opening peek"),6350nls.localize('peekWidgetDefaultFocus.editor', "Focus the editor when opening peek")6351],6352description: nls.localize('peekWidgetDefaultFocus', "Controls whether to focus the inline editor or the tree in the peek widget.")6353}6354)),6355placeholder: register(new PlaceholderOption()),6356definitionLinkOpensInPeek: register(new EditorBooleanOption(6357EditorOption.definitionLinkOpensInPeek, 'definitionLinkOpensInPeek', false,6358{ description: nls.localize('definitionLinkOpensInPeek', "Controls whether the Go to Definition mouse gesture always opens the peek widget.") }6359)),6360quickSuggestions: register(new EditorQuickSuggestions()),6361quickSuggestionsDelay: register(new EditorIntOption(6362EditorOption.quickSuggestionsDelay, 'quickSuggestionsDelay',636310, 0, Constants.MAX_SAFE_SMALL_INTEGER,6364{6365description: nls.localize('quickSuggestionsDelay', "Controls the delay in milliseconds after which quick suggestions will show up."),6366experiment: {6367mode: 'auto'6368}6369}6370)),6371readOnly: register(new EditorBooleanOption(6372EditorOption.readOnly, 'readOnly', false,6373)),6374readOnlyMessage: register(new ReadonlyMessage()),6375renameOnType: register(new EditorBooleanOption(6376EditorOption.renameOnType, 'renameOnType', false,6377{ description: nls.localize('renameOnType', "Controls whether the editor auto renames on type."), markdownDeprecationMessage: nls.localize('renameOnTypeDeprecate', "Deprecated, use `#editor.linkedEditing#` instead.") }6378)),6379renderControlCharacters: register(new EditorBooleanOption(6380EditorOption.renderControlCharacters, 'renderControlCharacters', true,6381{ description: nls.localize('renderControlCharacters', "Controls whether the editor should render control characters."), restricted: true }6382)),6383renderFinalNewline: register(new EditorStringEnumOption(6384EditorOption.renderFinalNewline, 'renderFinalNewline',6385(platform.isLinux ? 'dimmed' : 'on') as 'off' | 'on' | 'dimmed',6386['off', 'on', 'dimmed'] as const,6387{ description: nls.localize('renderFinalNewline', "Render last line number when the file ends with a newline.") }6388)),6389renderLineHighlight: register(new EditorStringEnumOption(6390EditorOption.renderLineHighlight, 'renderLineHighlight',6391'line' as 'none' | 'gutter' | 'line' | 'all',6392['none', 'gutter', 'line', 'all'] as const,6393{6394enumDescriptions: [6395'',6396'',6397'',6398nls.localize('renderLineHighlight.all', "Highlights both the gutter and the current line."),6399],6400description: nls.localize('renderLineHighlight', "Controls how the editor should render the current line highlight.")6401}6402)),6403renderLineHighlightOnlyWhenFocus: register(new EditorBooleanOption(6404EditorOption.renderLineHighlightOnlyWhenFocus, 'renderLineHighlightOnlyWhenFocus', false,6405{ description: nls.localize('renderLineHighlightOnlyWhenFocus', "Controls if the editor should render the current line highlight only when the editor is focused.") }6406)),6407renderValidationDecorations: register(new EditorStringEnumOption(6408EditorOption.renderValidationDecorations, 'renderValidationDecorations',6409'editable' as 'editable' | 'on' | 'off',6410['editable', 'on', 'off'] as const6411)),6412renderWhitespace: register(new EditorStringEnumOption(6413EditorOption.renderWhitespace, 'renderWhitespace',6414'selection' as 'selection' | 'none' | 'boundary' | 'trailing' | 'all',6415['none', 'boundary', 'selection', 'trailing', 'all'] as const,6416{6417enumDescriptions: [6418'',6419nls.localize('renderWhitespace.boundary', "Render whitespace characters except for single spaces between words."),6420nls.localize('renderWhitespace.selection', "Render whitespace characters only on selected text."),6421nls.localize('renderWhitespace.trailing', "Render only trailing whitespace characters."),6422''6423],6424description: nls.localize('renderWhitespace', "Controls how the editor should render whitespace characters.")6425}6426)),6427revealHorizontalRightPadding: register(new EditorIntOption(6428EditorOption.revealHorizontalRightPadding, 'revealHorizontalRightPadding',642915, 0, 1000,6430)),6431roundedSelection: register(new EditorBooleanOption(6432EditorOption.roundedSelection, 'roundedSelection', true,6433{ description: nls.localize('roundedSelection', "Controls whether selections should have rounded corners.") }6434)),6435rulers: register(new EditorRulers()),6436scrollbar: register(new EditorScrollbar()),6437scrollBeyondLastColumn: register(new EditorIntOption(6438EditorOption.scrollBeyondLastColumn, 'scrollBeyondLastColumn',64394, 0, Constants.MAX_SAFE_SMALL_INTEGER,6440{ description: nls.localize('scrollBeyondLastColumn', "Controls the number of extra characters beyond which the editor will scroll horizontally.") }6441)),6442scrollBeyondLastLine: register(new EditorBooleanOption(6443EditorOption.scrollBeyondLastLine, 'scrollBeyondLastLine', true,6444{ description: nls.localize('scrollBeyondLastLine', "Controls whether the editor will scroll beyond the last line.") }6445)),6446scrollOnMiddleClick: register(new EditorBooleanOption(6447EditorOption.scrollOnMiddleClick, 'scrollOnMiddleClick', false,6448{ description: nls.localize('scrollOnMiddleClick', "Controls whether the editor will scroll when the middle button is pressed.") }6449)),6450scrollPredominantAxis: register(new EditorBooleanOption(6451EditorOption.scrollPredominantAxis, 'scrollPredominantAxis', true,6452{ description: nls.localize('scrollPredominantAxis', "Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.") }6453)),6454selectionClipboard: register(new EditorBooleanOption(6455EditorOption.selectionClipboard, 'selectionClipboard', true,6456{6457description: nls.localize('selectionClipboard', "Controls whether the Linux primary clipboard should be supported."),6458included: platform.isLinux6459}6460)),6461selectionHighlight: register(new EditorBooleanOption(6462EditorOption.selectionHighlight, 'selectionHighlight', true,6463{ description: nls.localize('selectionHighlight', "Controls whether the editor should highlight matches similar to the selection.") }6464)),6465selectionHighlightMaxLength: register(new EditorIntOption(6466EditorOption.selectionHighlightMaxLength, 'selectionHighlightMaxLength',6467200, 0, Constants.MAX_SAFE_SMALL_INTEGER,6468{ description: nls.localize('selectionHighlightMaxLength', "Controls how many characters can be in the selection before similiar matches are not highlighted. Set to zero for unlimited.") }6469)),6470selectionHighlightMultiline: register(new EditorBooleanOption(6471EditorOption.selectionHighlightMultiline, 'selectionHighlightMultiline', false,6472{ description: nls.localize('selectionHighlightMultiline', "Controls whether the editor should highlight selection matches that span multiple lines.") }6473)),6474selectOnLineNumbers: register(new EditorBooleanOption(6475EditorOption.selectOnLineNumbers, 'selectOnLineNumbers', true,6476)),6477showFoldingControls: register(new EditorStringEnumOption(6478EditorOption.showFoldingControls, 'showFoldingControls',6479'mouseover' as 'always' | 'never' | 'mouseover',6480['always', 'never', 'mouseover'] as const,6481{6482enumDescriptions: [6483nls.localize('showFoldingControls.always', "Always show the folding controls."),6484nls.localize('showFoldingControls.never', "Never show the folding controls and reduce the gutter size."),6485nls.localize('showFoldingControls.mouseover', "Only show the folding controls when the mouse is over the gutter."),6486],6487description: nls.localize('showFoldingControls', "Controls when the folding controls on the gutter are shown.")6488}6489)),6490showUnused: register(new EditorBooleanOption(6491EditorOption.showUnused, 'showUnused', true,6492{ description: nls.localize('showUnused', "Controls fading out of unused code.") }6493)),6494showDeprecated: register(new EditorBooleanOption(6495EditorOption.showDeprecated, 'showDeprecated', true,6496{ description: nls.localize('showDeprecated', "Controls strikethrough deprecated variables.") }6497)),6498inlayHints: register(new EditorInlayHints()),6499snippetSuggestions: register(new EditorStringEnumOption(6500EditorOption.snippetSuggestions, 'snippetSuggestions',6501'inline' as 'top' | 'bottom' | 'inline' | 'none',6502['top', 'bottom', 'inline', 'none'] as const,6503{6504enumDescriptions: [6505nls.localize('snippetSuggestions.top', "Show snippet suggestions on top of other suggestions."),6506nls.localize('snippetSuggestions.bottom', "Show snippet suggestions below other suggestions."),6507nls.localize('snippetSuggestions.inline', "Show snippets suggestions with other suggestions."),6508nls.localize('snippetSuggestions.none', "Do not show snippet suggestions."),6509],6510description: nls.localize('snippetSuggestions', "Controls whether snippets are shown with other suggestions and how they are sorted.")6511}6512)),6513smartSelect: register(new SmartSelect()),6514smoothScrolling: register(new EditorBooleanOption(6515EditorOption.smoothScrolling, 'smoothScrolling', false,6516{ description: nls.localize('smoothScrolling', "Controls whether the editor will scroll using an animation.") }6517)),6518stopRenderingLineAfter: register(new EditorIntOption(6519EditorOption.stopRenderingLineAfter, 'stopRenderingLineAfter',652010000, -1, Constants.MAX_SAFE_SMALL_INTEGER,6521)),6522suggest: register(new EditorSuggest()),6523inlineSuggest: register(new InlineEditorSuggest()),6524inlineCompletionsAccessibilityVerbose: register(new EditorBooleanOption(EditorOption.inlineCompletionsAccessibilityVerbose, 'inlineCompletionsAccessibilityVerbose', false,6525{ description: nls.localize('inlineCompletionsAccessibilityVerbose', "Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.") })),6526suggestFontSize: register(new EditorIntOption(6527EditorOption.suggestFontSize, 'suggestFontSize',65280, 0, 1000,6529{ markdownDescription: nls.localize('suggestFontSize', "Font size for the suggest widget. When set to {0}, the value of {1} is used.", '`0`', '`#editor.fontSize#`') }6530)),6531suggestLineHeight: register(new EditorIntOption(6532EditorOption.suggestLineHeight, 'suggestLineHeight',65330, 0, 1000,6534{ markdownDescription: nls.localize('suggestLineHeight', "Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.", '`0`', '`#editor.lineHeight#`') }6535)),6536suggestOnTriggerCharacters: register(new EditorBooleanOption(6537EditorOption.suggestOnTriggerCharacters, 'suggestOnTriggerCharacters', true,6538{ description: nls.localize('suggestOnTriggerCharacters', "Controls whether suggestions should automatically show up when typing trigger characters.") }6539)),6540suggestSelection: register(new EditorStringEnumOption(6541EditorOption.suggestSelection, 'suggestSelection',6542'first' as 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix',6543['first', 'recentlyUsed', 'recentlyUsedByPrefix'] as const,6544{6545markdownEnumDescriptions: [6546nls.localize('suggestSelection.first', "Always select the first suggestion."),6547nls.localize('suggestSelection.recentlyUsed', "Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),6548nls.localize('suggestSelection.recentlyUsedByPrefix', "Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`."),6549],6550description: nls.localize('suggestSelection', "Controls how suggestions are pre-selected when showing the suggest list.")6551}6552)),6553tabCompletion: register(new EditorStringEnumOption(6554EditorOption.tabCompletion, 'tabCompletion',6555'off' as 'on' | 'off' | 'onlySnippets',6556['on', 'off', 'onlySnippets'] as const,6557{6558enumDescriptions: [6559nls.localize('tabCompletion.on', "Tab complete will insert the best matching suggestion when pressing tab."),6560nls.localize('tabCompletion.off', "Disable tab completions."),6561nls.localize('tabCompletion.onlySnippets', "Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled."),6562],6563description: nls.localize('tabCompletion', "Enables tab completions.")6564}6565)),6566tabIndex: register(new EditorIntOption(6567EditorOption.tabIndex, 'tabIndex',65680, -1, Constants.MAX_SAFE_SMALL_INTEGER6569)),6570trimWhitespaceOnDelete: register(new EditorBooleanOption(6571EditorOption.trimWhitespaceOnDelete, 'trimWhitespaceOnDelete', false,6572{ description: nls.localize('trimWhitespaceOnDelete', "Controls whether the editor will also delete the next line's indentation whitespace when deleting a newline.") }6573)),6574unicodeHighlight: register(new UnicodeHighlight()),6575unusualLineTerminators: register(new EditorStringEnumOption(6576EditorOption.unusualLineTerminators, 'unusualLineTerminators',6577'prompt' as 'auto' | 'off' | 'prompt',6578['auto', 'off', 'prompt'] as const,6579{6580enumDescriptions: [6581nls.localize('unusualLineTerminators.auto', "Unusual line terminators are automatically removed."),6582nls.localize('unusualLineTerminators.off', "Unusual line terminators are ignored."),6583nls.localize('unusualLineTerminators.prompt', "Unusual line terminators prompt to be removed."),6584],6585description: nls.localize('unusualLineTerminators', "Remove unusual line terminators that might cause problems.")6586}6587)),6588useShadowDOM: register(new EditorBooleanOption(6589EditorOption.useShadowDOM, 'useShadowDOM', true6590)),6591useTabStops: register(new EditorBooleanOption(6592EditorOption.useTabStops, 'useTabStops', true,6593{ description: nls.localize('useTabStops', "Spaces and tabs are inserted and deleted in alignment with tab stops.") }6594)),6595wordBreak: register(new EditorStringEnumOption(6596EditorOption.wordBreak, 'wordBreak',6597'normal' as 'normal' | 'keepAll',6598['normal', 'keepAll'] as const,6599{6600markdownEnumDescriptions: [6601nls.localize('wordBreak.normal', "Use the default line break rule."),6602nls.localize('wordBreak.keepAll', "Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal."),6603],6604description: nls.localize('wordBreak', "Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")6605}6606)),6607wordSegmenterLocales: register(new WordSegmenterLocales()),6608wordSeparators: register(new EditorStringOption(6609EditorOption.wordSeparators, 'wordSeparators', USUAL_WORD_SEPARATORS,6610{ description: nls.localize('wordSeparators', "Characters that will be used as word separators when doing word related navigations or operations.") }6611)),6612wordWrap: register(new EditorStringEnumOption(6613EditorOption.wordWrap, 'wordWrap',6614'off' as 'off' | 'on' | 'wordWrapColumn' | 'bounded',6615['off', 'on', 'wordWrapColumn', 'bounded'] as const,6616{6617markdownEnumDescriptions: [6618nls.localize('wordWrap.off', "Lines will never wrap."),6619nls.localize('wordWrap.on', "Lines will wrap at the viewport width."),6620nls.localize({6621key: 'wordWrap.wordWrapColumn',6622comment: [6623'- `editor.wordWrapColumn` refers to a different setting and should not be localized.'6624]6625}, "Lines will wrap at `#editor.wordWrapColumn#`."),6626nls.localize({6627key: 'wordWrap.bounded',6628comment: [6629'- viewport means the edge of the visible window size.',6630'- `editor.wordWrapColumn` refers to a different setting and should not be localized.'6631]6632}, "Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`."),6633],6634description: nls.localize({6635key: 'wordWrap',6636comment: [6637'- \'off\', \'on\', \'wordWrapColumn\' and \'bounded\' refer to values the setting can take and should not be localized.',6638'- `editor.wordWrapColumn` refers to a different setting and should not be localized.'6639]6640}, "Controls how lines should wrap.")6641}6642)),6643wordWrapBreakAfterCharacters: register(new EditorStringOption(6644EditorOption.wordWrapBreakAfterCharacters, 'wordWrapBreakAfterCharacters',6645// allow-any-unicode-next-line6646' \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」',6647)),6648wordWrapBreakBeforeCharacters: register(new EditorStringOption(6649EditorOption.wordWrapBreakBeforeCharacters, 'wordWrapBreakBeforeCharacters',6650// allow-any-unicode-next-line6651'([{‘“〈《「『【〔([{「£¥$£¥++'6652)),6653wordWrapColumn: register(new EditorIntOption(6654EditorOption.wordWrapColumn, 'wordWrapColumn',665580, 1, Constants.MAX_SAFE_SMALL_INTEGER,6656{6657markdownDescription: nls.localize({6658key: 'wordWrapColumn',6659comment: [6660'- `editor.wordWrap` refers to a different setting and should not be localized.',6661'- \'wordWrapColumn\' and \'bounded\' refer to values the different setting can take and should not be localized.'6662]6663}, "Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")6664}6665)),6666wordWrapOverride1: register(new EditorStringEnumOption(6667EditorOption.wordWrapOverride1, 'wordWrapOverride1',6668'inherit' as 'off' | 'on' | 'inherit',6669['off', 'on', 'inherit'] as const6670)),6671wordWrapOverride2: register(new EditorStringEnumOption(6672EditorOption.wordWrapOverride2, 'wordWrapOverride2',6673'inherit' as 'off' | 'on' | 'inherit',6674['off', 'on', 'inherit'] as const6675)),6676wrapOnEscapedLineFeeds: register(new EditorBooleanOption(6677EditorOption.wrapOnEscapedLineFeeds, 'wrapOnEscapedLineFeeds', false,6678{ markdownDescription: nls.localize('wrapOnEscapedLineFeeds', "Controls whether literal `\\n` shall trigger a wordWrap when `#editor.wordWrap#` is enabled.\n\nFor example:\n```c\nchar* str=\"hello\\nworld\"\n```\nwill be displayed as\n```c\nchar* str=\"hello\\n\n world\"\n```") }6679)),66806681// Leave these at the end (because they have dependencies!)6682effectiveCursorStyle: register(new EffectiveCursorStyle()),6683editorClassName: register(new EditorClassName()),6684defaultColorDecorators: register(new EditorStringEnumOption(6685EditorOption.defaultColorDecorators, 'defaultColorDecorators', 'auto' as 'auto' | 'always' | 'never',6686['auto', 'always', 'never'] as const,6687{6688enumDescriptions: [6689nls.localize('editor.defaultColorDecorators.auto', "Show default color decorators only when no extension provides colors decorators."),6690nls.localize('editor.defaultColorDecorators.always', "Always show default color decorators."),6691nls.localize('editor.defaultColorDecorators.never', "Never show default color decorators."),6692],6693description: nls.localize('defaultColorDecorators', "Controls whether inline color decorations should be shown using the default document color provider.")6694}6695)),6696pixelRatio: register(new EditorPixelRatio()),6697tabFocusMode: register(new EditorBooleanOption(EditorOption.tabFocusMode, 'tabFocusMode', false,6698{ markdownDescription: nls.localize('tabFocusMode', "Controls whether the editor receives tabs or defers them to the workbench for navigation.") }6699)),6700layoutInfo: register(new EditorLayoutInfoComputer()),6701wrappingInfo: register(new EditorWrappingInfoComputer()),6702wrappingIndent: register(new WrappingIndentOption()),6703wrappingStrategy: register(new WrappingStrategy()),6704effectiveEditContextEnabled: register(new EffectiveEditContextEnabled()),6705effectiveAllowVariableFonts: register(new EffectiveAllowVariableFonts())6706};67076708type EditorOptionsType = typeof EditorOptions;6709type FindEditorOptionsKeyById<T extends EditorOption> = { [K in keyof EditorOptionsType]: EditorOptionsType[K]['id'] extends T ? K : never }[keyof EditorOptionsType];6710type ComputedEditorOptionValue<T extends IEditorOption<any, any>> = T extends IEditorOption<any, infer R> ? R : never;6711export type FindComputedEditorOptionValueById<T extends EditorOption> = NonNullable<ComputedEditorOptionValue<EditorOptionsType[FindEditorOptionsKeyById<T>]>>;671267136714