editorOptions.ts ×92

Frontier kind: Code frontier

unlabeled · c_055ecea3e058

1048 tests · 12535 LOC · 37 files · introduces 0 tests · 6015 LOC · 5 files

Introduces — evidence that enters the hierarchy at this concept

Code
103 ranges6015 lines · 5 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1172 ranges12535 lines · 37 files · Browse complete extent
All tests (intent)
1048 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

5 files ranked by introduced lines: 6015 introduced LOC across 103 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/editor/common/config/editorOptions.ts 5717 introduced LOC · 92 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- editorOptions.ts
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import * as arrays from '../../../base/common/arrays.js';
7 > import { IMarkdownString } from '../../../base/common/htmlContent.js';
8 > import { IJSONSchema } from '../../../base/common/jsonSchema.js';
9 > import * as objects from '../../../base/common/objects.js';
10 > import * as platform from '../../../base/common/platform.js';
11 > import { ScrollbarVisibility } from '../../../base/common/scrollable.js';
12 > import { Constants } from '../../../base/common/uint.js';
13 > import { EDITOR_FONT_DEFAULTS, FONT_VARIATION_OFF, FONT_VARIATION_TRANSLATE, FontInfo } from './fontInfo.js';
14 > import { EDITOR_MODEL_DEFAULTS } from '../core/misc/textModelDefaults.js';
15 > import { USUAL_WORD_SEPARATORS } from '../core/wordHelper.js';
16 > import * as nls from '../../../nls.js';
17 > import { AccessibilitySupport } from '../../../platform/accessibility/common/accessibility.js';
18 > import { IConfigurationPropertySchema } from '../../../platform/configuration/common/configurationRegistry.js';
19 >
20 > //#region typed options
21 >
22 > /**
23 > * Configuration options for auto closing quotes and brackets
24 > */
25 > export type EditorAutoClosingStrategy = 'always' | 'languageDefined' | 'beforeWhitespace' | 'never';
26 >
27 > /**
28 > * Configuration options for auto wrapping quotes and brackets
29 > */
30 > export type EditorAutoSurroundStrategy = 'languageDefined' | 'quotes' | 'brackets' | 'never';
31 >
32 > /**
33 > * Configuration options for typing over closing quotes or brackets
34 > */
35 > export type EditorAutoClosingEditStrategy = 'always' | 'auto' | 'never';
36 >
37 > type Unknown<T> = { [K in keyof T]: unknown };
38 >
39 > /**
40 > * Configuration options for auto indentation in the editor
41 > */
42 > export const enum EditorAutoIndentStrategy {
43 > None = 0,
44 > Keep = 1,
45 > Brackets = 2,
46 > Advanced = 3,
47 > Full = 4
48 > }
49 >
50 > /**
51 > * Configuration options for the editor.
52 > */
53 > export interface IEditorOptions {
54 > /**
55 > * This editor is used inside a diff editor.
56 > */
57 > inDiffEditor?: boolean;
58 > /**
59 > * This editor is allowed to use variable line heights.
60 > */
61 > allowVariableLineHeights?: boolean;
62 > /**
63 > * This editor is allowed to use variable font-sizes and font-families
64 > */
65 > allowVariableFonts?: boolean;
66 > /**
67 > * This editor is allowed to use variable font-sizes and font-families in accessibility mode
68 > */
69 > allowVariableFontsInAccessibilityMode?: boolean;
70 > /**
71 > * The aria label for the editor's textarea (when it is focused).
72 > */
73 > ariaLabel?: string;
74 >
75 > /**
76 > * Whether the aria-required attribute should be set on the editors textarea.
77 > */
78 > ariaRequired?: boolean;
79 > /**
80 > * Control whether a screen reader announces inline suggestion content immediately.
81 > */
82 > screenReaderAnnounceInlineSuggestion?: boolean;
83 > /**
84 > * The `tabindex` property of the editor's textarea
85 > */
86 > tabIndex?: number;
87 > /**
88 > * Render vertical lines at the specified columns.
89 > * Defaults to empty array.
90 > */
91 > rulers?: (number | IRulerOption)[];
92 > /**
93 > * Locales used for segmenting lines into words when doing word related navigations or operations.
94 > *
95 > * Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.).
96 > * Defaults to empty array
97 > */
98 > wordSegmenterLocales?: string | string[];
99 > /**
100 > * A string containing the word separators used when doing word navigation.
101 > * Defaults to `~!@#$%^&*()-=+[{]}\\|;:\'",.<>/?
102 > */
103 > wordSeparators?: string;
104 > /**
105 > * Enable Linux primary clipboard.
106 > * Defaults to true.
107 > */
108 > selectionClipboard?: boolean;
109 > /**
110 > * Control the rendering of line numbers.
111 > * If it is a function, it will be invoked when rendering a line number and the return value will be rendered.
112 > * Otherwise, if it is a truthy, line numbers will be rendered normally (equivalent of using an identity function).
113 > * Otherwise, line numbers will not be rendered.
114 > * Defaults to `on`.
115 > */
116 > lineNumbers?: LineNumbersType;
117 > /**
118 > * Controls the minimal number of visible leading and trailing lines surrounding the cursor.
119 > * Defaults to 0.
120 > */
121 > cursorSurroundingLines?: number;
122 > /**
123 > * Controls when `cursorSurroundingLines` should be enforced
124 > * Defaults to `default`, `cursorSurroundingLines` is not enforced when cursor position is changed
125 > * by mouse.
126 > */
127 > cursorSurroundingLinesStyle?: 'default' | 'all';
128 > /**
129 > * Render last line number when the file ends with a newline.
130 > * Defaults to 'on' for Windows and macOS and 'dimmed' for Linux.
131 > */
132 > renderFinalNewline?: 'on' | 'off' | 'dimmed';
133 > /**
134 > * Remove unusual line terminators like LINE SEPARATOR (LS), PARAGRAPH SEPARATOR (PS).
135 > * Defaults to 'prompt'.
136 > */
137 > unusualLineTerminators?: 'auto' | 'off' | 'prompt';
138 > /**
139 > * Should the corresponding line be selected when clicking on the line number?
140 > * Defaults to true.
141 > */
142 > selectOnLineNumbers?: boolean;
143 > /**
144 > * Control the width of line numbers, by reserving horizontal space for rendering at least an amount of digits.
145 > * Defaults to 5.
146 > */
147 > lineNumbersMinChars?: number;
148 > /**
149 > * Enable the rendering of the glyph margin.
150 > * Defaults to true in vscode and to false in monaco-editor.
151 > */
152 > glyphMargin?: boolean;
153 > /**
154 > * The width reserved for line decorations (in px).
155 > * Line decorations are placed between line numbers and the editor content.
156 > * You can pass in a string in the format floating point followed by "ch". e.g. 1.3ch.
157 > * Defaults to 10.
158 > */
159 > lineDecorationsWidth?: number | string;
160 > /**
161 > * When revealing the cursor, a virtual padding (px) is added to the cursor, turning it into a rectangle.
162 > * This virtual padding ensures that the cursor gets revealed before hitting the edge of the viewport.
163 > * Defaults to 30 (px).
164 > */
165 > revealHorizontalRightPadding?: number;
166 > /**
167 > * Render the editor selection with rounded borders.
168 > * Defaults to true.
169 > */
170 > roundedSelection?: boolean;
171 > /**
172 > * Class name to be added to the editor.
173 > */
174 > extraEditorClassName?: string;
175 > /**
176 > * Should the editor be read only. See also `domReadOnly`.
177 > * Defaults to false.
178 > */
179 > readOnly?: boolean;
180 > /**
181 > * The message to display when the editor is readonly.
182 > */
183 > readOnlyMessage?: IMarkdownString;
184 > /**
185 > * Should the textarea used for input use the DOM `readonly` attribute.
186 > * Defaults to false.
187 > */
188 > domReadOnly?: boolean;
189 > /**
190 > * Enable linked editing.
191 > * Defaults to false.
192 > */
193 > linkedEditing?: boolean;
194 > /**
195 > * deprecated, use linkedEditing instead
196 > */
197 > renameOnType?: boolean;
198 > /**
199 > * Should the editor render validation decorations.
200 > * Defaults to editable.
201 > */
202 > renderValidationDecorations?: 'editable' | 'on' | 'off';
203 > /**
204 > * Control the behavior and rendering of the scrollbars.
205 > */
206 > scrollbar?: IEditorScrollbarOptions;
207 > /**
208 > * Control the behavior of sticky scroll options
209 > */
210 > stickyScroll?: IEditorStickyScrollOptions;
211 > /**
212 > * Control the behavior and rendering of the minimap.
213 > */
214 > minimap?: IEditorMinimapOptions;
215 > /**
216 > * Control the behavior of the find widget.
217 > */
218 > find?: IEditorFindOptions;
219 > /**
220 > * Display overflow widgets as `fixed`.
221 > * Defaults to `false`.
222 > */
223 > fixedOverflowWidgets?: boolean;
224 > /**
225 > * Allow content widgets and overflow widgets to overflow the editor viewport.
226 > * Defaults to `true`.
227 > */
228 > allowOverflow?: boolean;
229 > /**
230 > * The number of vertical lanes the overview ruler should render.
231 > * Defaults to 3.
232 > */
233 > overviewRulerLanes?: number;
234 > /**
235 > * Controls if a border should be drawn around the overview ruler.
236 > * Defaults to `true`.
237 > */
238 > overviewRulerBorder?: boolean;
239 > /**
240 > * Control the cursor animation style, possible values are 'blink', 'smooth', 'phase', 'expand' and 'solid'.
241 > * Defaults to 'blink'.
242 > */
243 > cursorBlinking?: 'blink' | 'smooth' | 'phase' | 'expand' | 'solid';
244 > /**
245 > * Zoom the font in the editor when using the mouse wheel in combination with holding Ctrl.
246 > * Defaults to false.
247 > */
248 > mouseWheelZoom?: boolean;
249 > /**
250 > * Control the mouse pointer style, either 'text' or 'default' or 'copy'
251 > * Defaults to 'text'
252 > */
253 > mouseStyle?: 'text' | 'default' | 'copy';
254 > /**
255 > * Enable smooth caret animation.
256 > * Defaults to 'off'.
257 > */
258 > cursorSmoothCaretAnimation?: 'off' | 'explicit' | 'on';
259 > /**
260 > * Control the cursor style in insert mode.
261 > * Defaults to 'line'.
262 > */
263 > cursorStyle?: 'line' | 'block' | 'underline' | 'line-thin' | 'block-outline' | 'underline-thin';
264 > /**
265 > * Control the cursor style in overtype mode.
266 > * Defaults to 'block'.
267 > */
268 > overtypeCursorStyle?: 'line' | 'block' | 'underline' | 'line-thin' | 'block-outline' | 'underline-thin';
269 > /**
270 > * Controls whether paste in overtype mode should overwrite or insert.
271 > */
272 > overtypeOnPaste?: boolean;
273 > /**
274 > * Control the width of the cursor when cursorStyle is set to 'line'
275 > */
276 > cursorWidth?: number;
277 > /**
278 > * Control the height of the cursor when cursorStyle is set to 'line'
279 > */
280 > cursorHeight?: number;
281 > /**
282 > * Enable font ligatures.
283 > * Defaults to false.
284 > */
285 > fontLigatures?: boolean | string;
286 > /**
287 > * Enable font variations.
288 > * Defaults to false.
289 > */
290 > fontVariations?: boolean | string;
291 > /**
292 > * Controls whether to use default color decorations or not using the default document color provider
293 > */
294 > defaultColorDecorators?: 'auto' | 'always' | 'never';
295 > /**
296 > * Disable the use of `transform: translate3d(0px, 0px, 0px)` for the editor margin and lines layers.
297 > * The usage of `transform: translate3d(0px, 0px, 0px)` acts as a hint for browsers to create an extra layer.
298 > * Defaults to false.
299 > */
300 > disableLayerHinting?: boolean;
301 > /**
302 > * Disable the optimizations for monospace fonts.
303 > * Defaults to false.
304 > */
305 > disableMonospaceOptimizations?: boolean;
306 > /**
307 > * Should the cursor be hidden in the overview ruler.
308 > * Defaults to false.
309 > */
310 > hideCursorInOverviewRuler?: boolean;
311 > /**
312 > * Enable that scrolling can go one screen size after the last line.
313 > * Defaults to true.
314 > */
315 > scrollBeyondLastLine?: boolean;
316 > /**
317 > * Scroll editor on middle click
318 > */
319 > scrollOnMiddleClick?: boolean;
320 > /**
321 > * Enable that scrolling can go beyond the last column by a number of columns.
322 > * Defaults to 5.
323 > */
324 > scrollBeyondLastColumn?: number;
325 > /**
326 > * Enable that the editor animates scrolling to a position.
327 > * Defaults to false.
328 > */
329 > smoothScrolling?: boolean;
330 > /**
331 > * Enable that the editor will install a ResizeObserver to check if its container dom node size has changed.
332 > * Defaults to false.
333 > */
334 > automaticLayout?: boolean;
335 > /**
336 > * Control the wrapping of the editor.
337 > * When `wordWrap` = "off", the lines will never wrap.
338 > * When `wordWrap` = "on", the lines will wrap at the viewport width.
339 > * When `wordWrap` = "wordWrapColumn", the lines will wrap at `wordWrapColumn`.
340 > * When `wordWrap` = "bounded", the lines will wrap at min(viewport width, wordWrapColumn).
341 > * Defaults to "off".
342 > */
343 > wordWrap?: 'off' | 'on' | 'wordWrapColumn' | 'bounded';
344 > /**
345 > * Override the `wordWrap` setting.
346 > */
347 > wordWrapOverride1?: 'off' | 'on' | 'inherit';
348 > /**
349 > * Override the `wordWrapOverride1` setting.
350 > */
351 > wordWrapOverride2?: 'off' | 'on' | 'inherit';
352 > /**
353 > * Control the wrapping of the editor.
354 > * When `wordWrap` = "off", the lines will never wrap.
355 > * When `wordWrap` = "on", the lines will wrap at the viewport width.
356 > * When `wordWrap` = "wordWrapColumn", the lines will wrap at `wordWrapColumn`.
357 > * When `wordWrap` = "bounded", the lines will wrap at min(viewport width, wordWrapColumn).
358 > * Defaults to 80.
359 > */
360 > wordWrapColumn?: number;
361 > /**
362 > * Control indentation of wrapped lines. Can be: 'none', 'same', 'indent' or 'deepIndent'.
363 > * Defaults to 'same' in vscode and to 'none' in monaco-editor.
364 > */
365 > wrappingIndent?: 'none' | 'same' | 'indent' | 'deepIndent';
366 > /**
367 > * Controls the wrapping strategy to use.
368 > * Defaults to 'simple'.
369 > */
370 > wrappingStrategy?: 'simple' | 'advanced';
371 > /**
372 > * Create a softwrap on every quoted "\n" literal.
373 > * Defaults to false.
374 > */
375 > wrapOnEscapedLineFeeds?: boolean;
376 > /**
377 > * Configure word wrapping characters. A break will be introduced before these characters.
378 > */
379 > wordWrapBreakBeforeCharacters?: string;
380 > /**
381 > * Configure word wrapping characters. A break will be introduced after these characters.
382 > */
383 > wordWrapBreakAfterCharacters?: string;
384 > /**
385 > * Sets whether line breaks appear wherever the text would otherwise overflow its content box.
386 > * When wordBreak = 'normal', Use the default line break rule.
387 > * 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.
388 > */
389 > wordBreak?: 'normal' | 'keepAll';
390 > /**
391 > * Performance guard: Stop rendering a line after x characters.
392 > * Defaults to 10000.
393 > * Use -1 to never stop rendering
394 > */
395 > stopRenderingLineAfter?: number;
396 > /**
397 > * Configure the editor's hover.
398 > */
399 > hover?: IEditorHoverOptions;
400 > /**
401 > * Enable detecting links and making them clickable.
402 > * Defaults to true.
403 > */
404 > links?: boolean;
405 > /**
406 > * Enable inline color decorators and color picker rendering.
407 > */
408 > colorDecorators?: boolean;
409 > /**
410 > * Controls what is the condition to spawn a color picker from a color dectorator
411 > */
412 > colorDecoratorsActivatedOn?: 'clickAndHover' | 'click' | 'hover';
413 > /**
414 > * Controls the max number of color decorators that can be rendered in an editor at once.
415 > */
416 > colorDecoratorsLimit?: number;
417 > /**
418 > * Control the behaviour of comments in the editor.
419 > */
420 > comments?: IEditorCommentsOptions;
421 > /**
422 > * Enable custom contextmenu.
423 > * Defaults to true.
424 > */
425 > contextmenu?: boolean;
426 > /**
427 > * A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.
428 > * Defaults to 1.
429 > */
430 > mouseWheelScrollSensitivity?: number;
431 > /**
432 > * FastScrolling mulitplier speed when pressing `Alt`
433 > * Defaults to 5.
434 > */
435 > fastScrollSensitivity?: number;
436 > /**
437 > * Enable that the editor scrolls only the predominant axis. Prevents horizontal drift when scrolling vertically on a trackpad.
438 > * Defaults to true.
439 > */
440 > scrollPredominantAxis?: boolean;
441 > /**
442 > * Make scrolling inertial - mostly useful with touchpad on linux.
443 > */
444 > inertialScroll?: boolean;
445 > /**
446 > * Enable that the selection with the mouse and keys is doing column selection.
447 > * Defaults to false.
448 > */
449 > columnSelection?: boolean;
450 > /**
451 > * The modifier to be used to add multiple cursors with the mouse.
452 > * Defaults to 'alt'
453 > */
454 > multiCursorModifier?: 'ctrlCmd' | 'alt';
455 > /**
456 > * Merge overlapping selections.
457 > * Defaults to true
458 > */
459 > multiCursorMergeOverlapping?: boolean;
460 > /**
461 > * Configure the behaviour when pasting a text with the line count equal to the cursor count.
462 > * Defaults to 'spread'.
463 > */
464 > multiCursorPaste?: 'spread' | 'full';
465 > /**
466 > * Controls the max number of text cursors that can be in an active editor at once.
467 > */
468 > multiCursorLimit?: number;
469 > /**
470 > * Enables middle mouse button to open links and Go To Definition
471 > */
472 > mouseMiddleClickAction?: MouseMiddleClickAction;
473 > /**
474 > * Configure the editor's accessibility support.
475 > * Defaults to 'auto'. It is best to leave this to 'auto'.
476 > */
477 > accessibilitySupport?: 'auto' | 'off' | 'on';
478 > /**
479 > * Controls the number of lines in the editor that can be read out by a screen reader
480 > */
481 > accessibilityPageSize?: number;
482 > /**
483 > * Suggest options.
484 > */
485 > suggest?: ISuggestOptions;
486 > inlineSuggest?: IInlineSuggestOptions;
487 > /**
488 > * Smart select options.
489 > */
490 > smartSelect?: ISmartSelectOptions;
491 > /**
492 > *
493 > */
494 > gotoLocation?: IGotoLocationOptions;
495 > /**
496 > * Enable quick suggestions (shadow suggestions)
497 > * Defaults to true.
498 > */
499 > quickSuggestions?: boolean | QuickSuggestionsValue | IQuickSuggestionsOptions;
500 > /**
501 > * Quick suggestions show delay (in ms)
502 > * Defaults to 10 (ms)
503 > */
504 > quickSuggestionsDelay?: number;
505 > /**
506 > * Controls the spacing around the editor.
507 > */
508 > padding?: IEditorPaddingOptions;
509 > /**
510 > * Parameter hint options.
511 > */
512 > parameterHints?: IEditorParameterHintOptions;
513 > /**
514 > * Options for auto closing brackets.
515 > * Defaults to language defined behavior.
516 > */
517 > autoClosingBrackets?: EditorAutoClosingStrategy;
518 > /**
519 > * Options for auto closing comments.
520 > * Defaults to language defined behavior.
521 > */
522 > autoClosingComments?: EditorAutoClosingStrategy;
523 > /**
524 > * Options for auto closing quotes.
525 > * Defaults to language defined behavior.
526 > */
527 > autoClosingQuotes?: EditorAutoClosingStrategy;
528 > /**
529 > * Options for pressing backspace near quotes or bracket pairs.
530 > */
531 > autoClosingDelete?: EditorAutoClosingEditStrategy;
532 > /**
533 > * Options for typing over closing quotes or brackets.
534 > */
535 > autoClosingOvertype?: EditorAutoClosingEditStrategy;
536 > /**
537 > * Options for auto surrounding.
538 > * Defaults to always allowing auto surrounding.
539 > */
540 > autoSurround?: EditorAutoSurroundStrategy;
541 > /**
542 > * Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.
543 > * Defaults to advanced.
544 > */
545 > autoIndent?: 'none' | 'keep' | 'brackets' | 'advanced' | 'full';
546 > /**
547 > * Boolean which controls whether to autoindent on paste
548 > */
549 > autoIndentOnPaste?: boolean;
550 > /**
551 > * Boolean which controls whether to autoindent on paste within a string when autoIndentOnPaste is enabled.
552 > */
553 > autoIndentOnPasteWithinString?: boolean;
554 > /**
555 > * Emulate selection behaviour of tab characters when using spaces for indentation.
556 > * This means selection will stick to tab stops.
557 > */
558 > stickyTabStops?: boolean;
559 > /**
560 > * Enable format on type.
561 > * Defaults to false.
562 > */
563 > formatOnType?: boolean;
564 > /**
565 > * Enable format on paste.
566 > * Defaults to false.
567 > */
568 > formatOnPaste?: boolean;
569 > /**
570 > * Controls whether double-clicking next to a bracket or quote selects the content inside.
571 > * Defaults to true.
572 > */
573 > doubleClickSelectsBlock?: boolean;
574 > /**
575 > * Controls if the editor should allow to move selections via drag and drop.
576 > * Defaults to false.
577 > */
578 > dragAndDrop?: boolean;
579 > /**
580 > * Enable the suggestion box to pop-up on trigger characters.
581 > * Defaults to true.
582 > */
583 > suggestOnTriggerCharacters?: boolean;
584 > /**
585 > * Accept suggestions on ENTER.
586 > * Defaults to 'on'.
587 > */
588 > acceptSuggestionOnEnter?: 'on' | 'smart' | 'off';
589 > /**
590 > * Accept suggestions on provider defined characters.
591 > * Defaults to true.
592 > */
593 > acceptSuggestionOnCommitCharacter?: boolean;
594 > /**
595 > * Enable snippet suggestions. Default to 'true'.
596 > */
597 > snippetSuggestions?: 'top' | 'bottom' | 'inline' | 'none';
598 > /**
599 > * Copying without a selection copies the current line.
600 > */
601 > emptySelectionClipboard?: boolean;
602 > /**
603 > * Syntax highlighting is copied.
604 > */
605 > copyWithSyntaxHighlighting?: boolean;
606 > /**
607 > * The history mode for suggestions.
608 > */
609 > suggestSelection?: 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix';
610 > /**
611 > * The font size for the suggest widget.
612 > * Defaults to the editor font size.
613 > */
614 > suggestFontSize?: number;
615 > /**
616 > * The line height for the suggest widget.
617 > * Defaults to the editor line height.
618 > */
619 > suggestLineHeight?: number;
620 > /**
621 > * Enable tab completion.
622 > */
623 > tabCompletion?: 'on' | 'off' | 'onlySnippets';
624 > /**
625 > * Enable selection highlight.
626 > * Defaults to true.
627 > */
628 > selectionHighlight?: boolean;
629 > /**
630 > * Enable selection highlight for multiline selections.
631 > * Defaults to false.
632 > */
633 > selectionHighlightMultiline?: boolean;
634 > /**
635 > * Maximum length (in characters) for selection highlights.
636 > * Set to 0 to have an unlimited length.
637 > */
638 > selectionHighlightMaxLength?: number;
639 > /**
640 > * Enable semantic occurrences highlight.
641 > * Defaults to 'singleFile'.
642 > * 'off' disables occurrence highlighting
643 > * 'singleFile' triggers occurrence highlighting in the current document
644 > * 'multiFile' triggers occurrence highlighting across valid open documents
645 > */
646 > occurrencesHighlight?: 'off' | 'singleFile' | 'multiFile';
647 > /**
648 > * Controls delay for occurrences highlighting
649 > * Defaults to 250.
650 > * Minimum value is 0
651 > * Maximum value is 2000
652 > */
653 > occurrencesHighlightDelay?: number;
654 > /**
655 > * Show code lens
656 > * Defaults to true.
657 > */
658 > codeLens?: boolean;
659 > /**
660 > * Code lens font family. Defaults to editor font family.
661 > */
662 > codeLensFontFamily?: string;
663 > /**
664 > * Code lens font size. Default to 90% of the editor font size
665 > */
666 > codeLensFontSize?: number;
667 > /**
668 > * Control the behavior and rendering of the code action lightbulb.
669 > */
670 > lightbulb?: IEditorLightbulbOptions;
671 > /**
672 > * Timeout for running code actions on save.
673 > */
674 > codeActionsOnSaveTimeout?: number;
675 > /**
676 > * Enable code folding.
677 > * Defaults to true.
678 > */
679 > folding?: boolean;
680 > /**
681 > * Selects the folding strategy. 'auto' uses the strategies contributed for the current document, 'indentation' uses the indentation based folding strategy.
682 > * Defaults to 'auto'.
683 > */
684 > foldingStrategy?: 'auto' | 'indentation';
685 > /**
686 > * Enable highlight for folded regions.
687 > * Defaults to true.
688 > */
689 > foldingHighlight?: boolean;
690 > /**
691 > * Auto fold imports folding regions.
692 > * Defaults to true.
693 > */
694 > foldingImportsByDefault?: boolean;
695 > /**
696 > * Maximum number of foldable regions.
697 > * Defaults to 5000.
698 > */
699 > foldingMaximumRegions?: number;
700 > /**
701 > * Controls whether the fold actions in the gutter stay always visible or hide unless the mouse is over the gutter.
702 > * Defaults to 'mouseover'.
703 > */
704 > showFoldingControls?: 'always' | 'never' | 'mouseover';
705 > /**
706 > * Controls whether clicking on the empty content after a folded line will unfold the line.
707 > * Defaults to false.
708 > */
709 > unfoldOnClickAfterEndOfLine?: boolean;
710 > /**
711 > * Enable highlighting of matching brackets.
712 > * Defaults to 'always'.
713 > */
714 > matchBrackets?: 'never' | 'near' | 'always';
715 > /**
716 > * Enable experimental rendering using WebGPU.
717 > * Defaults to 'off'.
718 > */
719 > experimentalGpuAcceleration?: 'on' | 'off';
720 > /**
721 > * Enable experimental whitespace rendering.
722 > * Defaults to 'svg'.
723 > */
724 > experimentalWhitespaceRendering?: 'svg' | 'font' | 'off';
725 > /**
726 > * Enable rendering of whitespace.
727 > * Defaults to 'selection'.
728 > */
729 > renderWhitespace?: 'none' | 'boundary' | 'selection' | 'trailing' | 'all';
730 > /**
731 > * Enable rendering of control characters.
732 > * Defaults to true.
733 > */
734 > renderControlCharacters?: boolean;
735 > /**
736 > * Enable rendering of current line highlight.
737 > * Defaults to all.
738 > */
739 > renderLineHighlight?: 'none' | 'gutter' | 'line' | 'all';
740 > /**
741 > * Control if the current line highlight should be rendered only the editor is focused.
742 > * Defaults to false.
743 > */
744 > renderLineHighlightOnlyWhenFocus?: boolean;
745 > /**
746 > * Inserting and deleting whitespace follows tab stops.
747 > */
748 > useTabStops?: boolean;
749 > /**
750 > * Controls whether the editor should automatically remove indentation whitespace when joining lines with Delete.
751 > * Defaults to false.
752 > */
753 > trimWhitespaceOnDelete?: boolean;
754 > /**
755 > * The font family
756 > */
757 > fontFamily?: string;
758 > /**
759 > * The font weight
760 > */
761 > fontWeight?: string;
762 > /**
763 > * The font size
764 > */
765 > fontSize?: number;
766 > /**
767 > * The line height
768 > */
769 > lineHeight?: number;
770 > /**
771 > * The letter spacing
772 > */
773 > letterSpacing?: number;
774 > /**
775 > * Controls fading out of unused variables.
776 > */
777 > showUnused?: boolean;
778 > /**
779 > * Controls whether to focus the inline editor in the peek widget by default.
780 > * Defaults to false.
781 > */
782 > peekWidgetDefaultFocus?: 'tree' | 'editor';
783 >
784 > /**
785 > * Sets a placeholder for the editor.
786 > * If set, the placeholder is shown if the editor is empty.
787 > */
788 > placeholder?: string | undefined;
789 >
790 > /**
791 > * Controls whether the definition link opens element in the peek widget.
792 > * Defaults to false.
793 > */
794 > definitionLinkOpensInPeek?: boolean;
795 > /**
796 > * Controls strikethrough deprecated variables.
797 > */
798 > showDeprecated?: boolean;
799 > /**
800 > * Controls whether suggestions allow matches in the middle of the word instead of only at the beginning
801 > */
802 > matchOnWordStartOnly?: boolean;
803 > /**
804 > * Control the behavior and rendering of the inline hints.
805 > */
806 > inlayHints?: IEditorInlayHintsOptions;
807 > /**
808 > * Control if the editor should use shadow DOM.
809 > */
810 > useShadowDOM?: boolean;
811 > /**
812 > * Controls the behavior of editor guides.
813 > */
814 > guides?: IGuidesOptions;
815 >
816 > /**
817 > * Controls the behavior of the unicode highlight feature
818 > * (by default, ambiguous and invisible characters are highlighted).
819 > */
820 > unicodeHighlight?: IUnicodeHighlightOptions;
821 >
822 > /**
823 > * Configures bracket pair colorization (disabled by default).
824 > */
825 > bracketPairColorization?: IBracketPairColorizationOptions;
826 >
827 > /**
828 > * Controls dropping into the editor from an external source.
829 > *
830 > * When enabled, this shows a preview of the drop location and triggers an `onDropIntoEditor` event.
831 > */
832 > dropIntoEditor?: IDropIntoEditorOptions;
833 >
834 > /**
835 > * Sets whether the new experimental edit context should be used instead of the text area.
836 > */
837 > editContext?: boolean;
838 >
839 > /**
840 > * Controls whether to render rich HTML screen reader content when the EditContext is enabled
841 > */
842 > renderRichScreenReaderContent?: boolean;
843 >
844 > /**
845 > * Controls support for changing how content is pasted into the editor.
846 > */
847 > pasteAs?: IPasteAsOptions;
848 >
849 > /**
850 > * Controls whether the editor / terminal receives tabs or defers them to the workbench for navigation.
851 > */
852 > tabFocusMode?: boolean;
853 >
854 > /**
855 > * Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.
856 > */
857 > inlineCompletionsAccessibilityVerbose?: boolean;
858 > }
859 >
860 > /**
861 > * @internal
862 > * The width of the minimap gutter, in pixels.
863 > */
864 > export const MINIMAP_GUTTER_WIDTH = 8;
865 >
866 > export interface IDiffEditorBaseOptions {
867 > /**
868 > * Allow the user to resize the diff editor split view.
869 > * Defaults to true.
870 > */
871 > enableSplitViewResizing?: boolean;
872 >
873 > /**
874 > * The default ratio when rendering side-by-side editors.
875 > * Must be a number between 0 and 1, min sizes apply.
876 > * Defaults to 0.5
877 > */
878 > splitViewDefaultRatio?: number;
879 >
880 > /**
881 > * Render the differences in two side-by-side editors.
882 > * Defaults to true.
883 > */
884 > renderSideBySide?: boolean;
885 >
886 > /**
887 > * When `renderSideBySide` is enabled, `useInlineViewWhenSpaceIsLimited` is set,
888 > * and the diff editor has a width less than `renderSideBySideInlineBreakpoint`, the inline view is used.
889 > */
890 > renderSideBySideInlineBreakpoint?: number | undefined;
891 >
892 > /**
893 > * When `renderSideBySide` is enabled, `useInlineViewWhenSpaceIsLimited` is set,
894 > * and the diff editor has a width less than `renderSideBySideInlineBreakpoint`, the inline view is used.
895 > */
896 > useInlineViewWhenSpaceIsLimited?: boolean;
897 >
898 > /**
899 > * If set, the diff editor is optimized for small views.
900 > * Defaults to `false`.
901 > */
902 > compactMode?: boolean;
903 >
904 > /**
905 > * If set, the original editor's line numbers are hidden in the inline view.
906 > * Defaults to `false`.
907 > * @internal
908 > */
909 > hideOriginalLineNumbers?: boolean;
910 >
911 > /**
912 > * Timeout in milliseconds after which diff computation is cancelled.
913 > * Defaults to 5000.
914 > */
915 > maxComputationTime?: number;
916 >
917 > /**
918 > * Maximum supported file size in MB.
919 > * Defaults to 50.
920 > */
921 > maxFileSize?: number;
922 >
923 > /**
924 > * Compute the diff by ignoring leading/trailing whitespace
925 > * Defaults to true.
926 > */
927 > ignoreTrimWhitespace?: boolean;
928 >
929 > /**
930 > * Render +/- indicators for added/deleted changes.
931 > * Defaults to true.
932 > */
933 > renderIndicators?: boolean;
934 >
935 > /**
936 > * Shows icons in the glyph margin to revert changes.
937 > * Default to true.
938 > */
939 > renderMarginRevertIcon?: boolean;
940 >
941 > /**
942 > * Indicates if the gutter menu should be rendered.
943 > */
944 > renderGutterMenu?: boolean;
945 >
946 > /**
947 > * Original model should be editable?
948 > * Defaults to false.
949 > */
950 > originalEditable?: boolean;
951 >
952 > /**
953 > * Should the diff editor enable code lens?
954 > * Defaults to false.
955 > */
956 > diffCodeLens?: boolean;
957 >
958 > /**
959 > * Is the diff editor should render overview ruler
960 > * Defaults to true
961 > */
962 > renderOverviewRuler?: boolean;
963 >
964 > /**
965 > * Control the wrapping of the diff editor.
966 > */
967 > diffWordWrap?: 'off' | 'on' | 'inherit';
968 >
969 > /**
970 > * Diff Algorithm
971 > */
972 > diffAlgorithm?: 'legacy' | 'advanced' | 'advanced-external' | 'advanced-wasm';
973 >
974 > /**
975 > * Whether the diff editor aria label should be verbose.
976 > */
977 > accessibilityVerbose?: boolean;
978 >
979 > experimental?: {
980 > /**
981 > * Defaults to false.
982 > */
983 > showMoves?: boolean;
984 >
985 > showEmptyDecorations?: boolean;
986 >
987 > /**
988 > * Only applies when `renderSideBySide` is set to false.
989 > */
990 > useTrueInlineView?: boolean;
991 > };
992 >
993 > /**
994 > * Is the diff editor inside another editor
995 > * Defaults to false
996 > */
997 > isInEmbeddedEditor?: boolean;
998 >
999 > /**
1000 > * If the diff editor should only show the difference review mode.
1001 > */
1002 > onlyShowAccessibleDiffViewer?: boolean;
1003 >
1004 > hideUnchangedRegions?: {
1005 > enabled?: boolean;
1006 > revealLineCount?: number;
1007 > minimumLineCount?: number;
1008 > contextLineCount?: number;
1009 > };
1010 > }
1011 >
1012 > /**
1013 > * Configuration options for the diff editor.
1014 > */
1015 > export interface IDiffEditorOptions extends IEditorOptions, IDiffEditorBaseOptions {
1016 > }
1017 >
1018 > /**
1019 > * @internal
1020 > */
1021 > export type ValidDiffEditorBaseOptions = Readonly<Required<IDiffEditorBaseOptions>>;
1022 >
1023 > //#endregion
1024 >
1025 > /**
1026 > * An event describing that the configuration of the editor has changed.
1027 > */
1028 > export class ConfigurationChangedEvent {
1029 > private readonly _values: boolean[];
1030 > /**
1031 > * @internal
1032 > */
1033 > constructor(values: boolean[]) {
1034 this._values = values;
1035 }
1036 > public hasChanged(id: EditorOption): boolean { editorOptions.ts
1037 return this._values[id];
1038 }
1039 > } editorOptions.ts
1040 >
1041 > /**
1042 > * All computed editor options.
1043 > */
1044 > export interface IComputedEditorOptions {
1045 > get<T extends EditorOption>(id: T): FindComputedEditorOptionValueById<T>;
1046 > }
1047 >
1048 > //#region IEditorOption
1049 >
1050 > /**
1051 > * @internal
1052 > */
1053 > export interface IEnvironmentalOptions {
1054 > readonly memory: ComputeOptionsMemory | null;
1055 > readonly outerWidth: number;
1056 > readonly outerHeight: number;
1057 > readonly fontInfo: FontInfo;
1058 > readonly extraEditorClassName: string;
1059 > readonly isDominatedByLongLines: boolean;
1060 > readonly viewLineCount: number;
1061 > readonly lineNumbersDigitCount: number;
1062 > readonly emptySelectionClipboard: boolean;
1063 > readonly pixelRatio: number;
1064 > readonly tabFocusMode: boolean;
1065 > readonly inputMode: 'insert' | 'overtype';
1066 > readonly accessibilitySupport: AccessibilitySupport;
1067 > readonly glyphMarginDecorationLaneCount: number;
1068 > readonly editContextSupported: boolean;
1069 > }
1070 >
1071 > /**
1072 > * @internal
1073 > */
1074 > export class ComputeOptionsMemory {
1075 >
1076 > public stableMinimapLayoutInput: IMinimapLayoutInput | null;
1077 > public stableFitMaxMinimapScale: number;
1078 > public stableFitRemainingWidth: number;
1079 >
1080 > constructor() {
1081 this.stableMinimapLayoutInput = null;
1082 this.stableFitMaxMinimapScale = 0;
1083 this.stableFitRemainingWidth = 0;
1084 }
1085 > } editorOptions.ts
1086 >
1087 > export interface IEditorOption<K extends EditorOption, V> {
1088 > readonly id: K;
1089 > readonly name: string;
1090 > defaultValue: V;
1091 > /**
1092 > * @internal
1093 > */
1094 > readonly schema: IConfigurationPropertySchema | { [path: string]: IConfigurationPropertySchema } | undefined;
1095 > /**
1096 > * @internal
1097 > */
1098 > validate(input: unknown): V;
1099 > /**
1100 > * @internal
1101 > */
1102 > compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: V): V;
1103 >
1104 > /**
1105 > * Might modify `value`.
1106 > */
1107 > applyUpdate(value: V | undefined, update: V): ApplyUpdateResult<V>;
1108 > }
1109 >
1110 > /**
1111 > * @internal
1112 > */
1113 > type PossibleKeyName0<V> = { [K in keyof IEditorOptions]: IEditorOptions[K] extends V | undefined ? K : never }[keyof IEditorOptions];
1114 > /**
1115 > * @internal
1116 > */
1117 > type PossibleKeyName<V> = NonNullable<PossibleKeyName0<V>>;
1118 >
1119 > /**
1120 > * @internal
1121 > */
1122 > abstract class BaseEditorOption<K extends EditorOption, T, V> implements IEditorOption<K, V> {
1123 >
1124 > public readonly id: K;
1125 > public readonly name: string;
1126 > public readonly defaultValue: V;
1127 > public readonly schema: IConfigurationPropertySchema | { [path: string]: IConfigurationPropertySchema } | undefined;
1128 >
1129 > constructor(id: K, name: PossibleKeyName<T>, defaultValue: V, schema?: IConfigurationPropertySchema | { [path: string]: IConfigurationPropertySchema }) {
1130 > this.id = id;
1131 > this.name = name;
1132 > this.defaultValue = defaultValue;
1133 > this.schema = schema;
1134 > }
1135 >
1136 > public applyUpdate(value: V | undefined, update: V): ApplyUpdateResult<V> {
1137 return applyUpdate(value, update);
1138 }
1140 > public abstract validate(input: unknown): V;
1141 >
1142 > public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: V): V {
1143 return value;
1144 }
1145 > } editorOptions.ts
1146 >
1147 > export class ApplyUpdateResult<T> {
1148 > constructor(
1149 public readonly newValue: T,
1150 public readonly didChange: boolean
1151 ) { }
1152 > } editorOptions.ts
1153 >
1154 function applyUpdate<T>(value: T | undefined, update: T): ApplyUpdateResult<T> {
1155 if (typeof value !== 'object' || typeof update !== 'object' || !value || !update) {
1172 return new ApplyUpdateResult(value, didChange);
1173 }
1175 > /**
1176 > * @internal
1177 > */
1178 > abstract class ComputedEditorOption<K extends EditorOption, V> implements IEditorOption<K, V> {
1179 >
1180 > public readonly id: K;
1181 > public readonly name: '_never_';
1182 > public readonly defaultValue: V;
1183 > public readonly schema: IConfigurationPropertySchema | undefined = undefined;
1184 >
1185 > constructor(id: K, defaultValue: V) {
1186 > this.id = id;
1187 > this.name = '_never_';
1188 > this.defaultValue = defaultValue;
1189 > }
1190 >
1191 > public applyUpdate(value: V | undefined, update: V): ApplyUpdateResult<V> {
1192 return applyUpdate(value, update);
1193 }
1195 > public validate(input: unknown): V {
1196 return this.defaultValue;
1197 }
1199 > public abstract compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: V): V;
1200 > }
1201 >
1202 > abstract class SimpleEditorOption<K extends EditorOption, V> implements IEditorOption<K, V> {
1203 >
1204 > public readonly id: K;
1205 > public readonly name: PossibleKeyName<V>;
1206 > public readonly defaultValue: V;
1207 > public readonly schema: IConfigurationPropertySchema | undefined;
1208 >
1209 > constructor(id: K, name: PossibleKeyName<V>, defaultValue: V, schema?: IConfigurationPropertySchema) {
1210 > this.id = id;
1211 > this.name = name;
1212 > this.defaultValue = defaultValue;
1213 > this.schema = schema;
1214 > }
1215 >
1216 > public applyUpdate(value: V | undefined, update: V): ApplyUpdateResult<V> {
1217 return applyUpdate(value, update);
1218 }
1220 > public abstract validate(input: unknown): V;
1221 >
1222 > public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: V): V {
1223 return value;
1224 }
1225 > } editorOptions.ts
1226 >
1227 > /**
1228 > * @internal
1229 > */
1230 > export function boolean(value: unknown, defaultValue: boolean): boolean {
1231 if (typeof value === 'undefined') {
1232 return defaultValue;
1238 return Boolean(value);
1239 }
1241 > class EditorBooleanOption<K extends EditorOption> extends SimpleEditorOption<K, boolean> {
1242 >
1243 > constructor(id: K, name: PossibleKeyName<boolean>, defaultValue: boolean, schema: IConfigurationPropertySchema | undefined = undefined) {
1244 > if (typeof schema !== 'undefined') {
1245 > schema.type = 'boolean';
1246 > schema.default = defaultValue;
1247 > }
1248 > super(id, name, defaultValue, schema);
1249 > }
1250 >
1251 > public override validate(input: unknown): boolean {
1252 return boolean(input, this.defaultValue);
1253 }
1254 > } editorOptions.ts
1255 >
1256 > /**
1257 > * @internal
1258 > */
1259 > export function clampedInt<T = number>(value: unknown, defaultValue: T, minimum: number, maximum: number): number | T {
1260 if (typeof value === 'string') {
1261 value = parseInt(value, 10);
1269 return r | 0;
1270 }
1272 > class EditorIntOption<K extends EditorOption> extends SimpleEditorOption<K, number> {
1273 >
1274 > public static clampedInt<T>(value: unknown, defaultValue: T, minimum: number, maximum: number): number | T {
1275 return clampedInt(value, defaultValue, minimum, maximum);
1276 }
1278 > public readonly minimum: number;
1279 > public readonly maximum: number;
1280 >
1281 > constructor(id: K, name: PossibleKeyName<number>, defaultValue: number, minimum: number, maximum: number, schema: IConfigurationPropertySchema | undefined = undefined) {
1282 > if (typeof schema !== 'undefined') {
1283 > schema.type = 'integer';
1284 > schema.default = defaultValue;
1285 > schema.minimum = minimum;
1286 > schema.maximum = maximum;
1287 > }
1288 > super(id, name, defaultValue, schema);
1289 > this.minimum = minimum;
1290 > this.maximum = maximum;
1291 > }
1292 >
1293 > public override validate(input: unknown): number {
1294 return EditorIntOption.clampedInt(input, this.defaultValue, this.minimum, this.maximum);
1295 }
1296 > } editorOptions.ts
1297 > /**
1298 > * @internal
1299 > */
1300 > export function clampedFloat<T extends number>(value: unknown, defaultValue: T, minimum: number, maximum: number): number | T {
1301 if (typeof value === 'undefined') {
1302 return defaultValue;
1305 return EditorFloatOption.clamp(r, minimum, maximum);
1306 }
1308 > class EditorFloatOption<K extends EditorOption> extends SimpleEditorOption<K, number> {
1309 >
1310 > public readonly minimum: number | undefined;
1311 > public readonly maximum: number | undefined;
1312 >
1313 > public static clamp(n: number, min: number, max: number): number {
1314 if (n < min) {
1315 return min;
1320 return n;
1321 }
1323 > public static float(value: unknown, defaultValue: number): number {
1324 if (typeof value === 'string') {
1325 value = parseFloat(value);
1330 return value;
1331 }
1333 > public readonly validationFn: (value: number) => number;
1334 >
1335 > constructor(id: K, name: PossibleKeyName<number>, defaultValue: number, validationFn: (value: number) => number, schema?: IConfigurationPropertySchema, minimum?: number, maximum?: number) {
1336 > if (typeof schema !== 'undefined') {
1337 > schema.type = 'number';
1338 > schema.default = defaultValue;
1339 > schema.minimum = minimum;
1340 > schema.maximum = maximum;
1341 > }
1342 > super(id, name, defaultValue, schema);
1343 > this.validationFn = validationFn;
1344 > this.minimum = minimum;
1345 > this.maximum = maximum;
1346 > }
1347 >
1348 > public override validate(input: unknown): number {
1349 return this.validationFn(EditorFloatOption.float(input, this.defaultValue));
1350 }
1351 > } editorOptions.ts
1352 >
1353 > class EditorStringOption<K extends EditorOption> extends SimpleEditorOption<K, string> {
1354 >
1355 > public static string(value: unknown, defaultValue: string): string {
1356 if (typeof value !== 'string') {
1357 return defaultValue;
1359 return value;
1360 }
1362 > constructor(id: K, name: PossibleKeyName<string>, defaultValue: string, schema: IConfigurationPropertySchema | undefined = undefined) {
1363 > if (typeof schema !== 'undefined') {
1364 > schema.type = 'string';
1365 > schema.default = defaultValue;
1366 > }
1367 > super(id, name, defaultValue, schema);
1368 > }
1369 >
1370 > public override validate(input: unknown): string {
1371 return EditorStringOption.string(input, this.defaultValue);
1372 }
1373 > } editorOptions.ts
1374 >
1375 > /**
1376 > * @internal
1377 > */
1378 > export function stringSet<T extends string>(value: unknown, defaultValue: T, allowedValues: ReadonlyArray<T>, renamedValues?: Record<string, T>): T {
1379 if (typeof value !== 'string') {
1380 return defaultValue;
1388 return value as T;
1389 }
1391 > class EditorStringEnumOption<K extends EditorOption, V extends string> extends SimpleEditorOption<K, V> {
1392 >
1393 > private readonly _allowedValues: ReadonlyArray<V>;
1394 >
1395 > constructor(id: K, name: PossibleKeyName<V>, defaultValue: V, allowedValues: ReadonlyArray<V>, schema: IConfigurationPropertySchema | undefined = undefined) {
1396 > if (typeof schema !== 'undefined') {
1397 > schema.type = 'string';
1398 > schema.enum = allowedValues.slice(0);
1399 > schema.default = defaultValue;
1400 > }
1401 > super(id, name, defaultValue, schema);
1402 > this._allowedValues = allowedValues;
1403 > }
1404 >
1405 > public override validate(input: unknown): V {
1406 return stringSet<V>(input, this.defaultValue, this._allowedValues);
1407 }
1408 > } editorOptions.ts
1409 >
1410 > class EditorEnumOption<K extends EditorOption, T extends string, V> extends BaseEditorOption<K, T, V> {
1411 >
1412 > private readonly _allowedValues: T[];
1413 > private readonly _convert: (value: T) => V;
1414 >
1415 > constructor(id: K, name: PossibleKeyName<T>, defaultValue: V, defaultStringValue: string, allowedValues: T[], convert: (value: T) => V, schema: IConfigurationPropertySchema | undefined = undefined) {
1416 > if (typeof schema !== 'undefined') {
1417 > schema.type = 'string';
1418 > schema.enum = allowedValues;
1419 > schema.default = defaultStringValue;
1420 > }
1421 > super(id, name, defaultValue, schema);
1422 > this._allowedValues = allowedValues;
1423 > this._convert = convert;
1424 > }
1425 >
1426 > public validate(input: unknown): V {
1427 if (typeof input !== 'string') {
1428 return this.defaultValue;
1433 return this._convert(<T>input);
1434 }
1435 > } editorOptions.ts
1436 >
1437 > //#endregion
1438 >
1439 > //#region autoIndent
1440 >
1441 function _autoIndentFromString(autoIndent: 'none' | 'keep' | 'brackets' | 'advanced' | 'full'): EditorAutoIndentStrategy {
1442 switch (autoIndent) {
1448 }
1449 }
1451 > //#endregion
1452 >
1453 > //#region accessibilitySupport
1454 >
1455 > class EditorAccessibilitySupport extends BaseEditorOption<EditorOption.accessibilitySupport, 'auto' | 'off' | 'on', AccessibilitySupport> {
1456 >
1457 > constructor() {
1458 > super(
1459 > EditorOption.accessibilitySupport, 'accessibilitySupport', AccessibilitySupport.Unknown,
1460 > {
1461 > type: 'string',
1462 > enum: ['auto', 'on', 'off'],
1463 > enumDescriptions: [
1464 > nls.localize('accessibilitySupport.auto', "Use platform APIs to detect when a Screen Reader is attached."),
1465 > nls.localize('accessibilitySupport.on', "Optimize for usage with a Screen Reader."),
1466 > nls.localize('accessibilitySupport.off', "Assume a screen reader is not attached."),
1467 > ],
1468 > default: 'auto',
1469 > tags: ['accessibility'],
1470 > description: nls.localize('accessibilitySupport', "Controls if the UI should run in a mode where it is optimized for screen readers.")
1471 > }
1472 > );
1473 > }
1474 >
1475 > public validate(input: unknown): AccessibilitySupport {
1476 switch (input) {
1477 case 'auto': return AccessibilitySupport.Unknown;
1481 return this.defaultValue;
1482 }
1484 > public override compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: AccessibilitySupport): AccessibilitySupport {
1485 if (value === AccessibilitySupport.Unknown) {
1486 // The editor reads the `accessibilitySupport` from the environment
1489 return value;
1490 }
1491 > } editorOptions.ts
1492 >
1493 > //#endregion
1494 >
1495 > //#region comments
1496 >
1497 > /**
1498 > * Configuration options for editor comments
1499 > */
1500 > export interface IEditorCommentsOptions {
1501 > /**
1502 > * Insert a space after the line comment token and inside the block comments tokens.
1503 > * Defaults to true.
1504 > */
1505 > insertSpace?: boolean;
1506 > /**
1507 > * Ignore empty lines when inserting line comments.
1508 > * Defaults to true.
1509 > */
1510 > ignoreEmptyLines?: boolean;
1511 > }
1512 >
1513 > /**
1514 > * @internal
1515 > */
1516 > export type EditorCommentsOptions = Readonly<Required<IEditorCommentsOptions>>;
1517 >
1518 > class EditorComments extends BaseEditorOption<EditorOption.comments, IEditorCommentsOptions, EditorCommentsOptions> {
1519 >
1520 > constructor() {
1521 > const defaults: EditorCommentsOptions = {
1522 > insertSpace: true,
1523 > ignoreEmptyLines: true,
1524 > };
1525 > super(
1526 > EditorOption.comments, 'comments', defaults,
1527 > {
1528 > 'editor.comments.insertSpace': {
1529 > type: 'boolean',
1530 > default: defaults.insertSpace,
1531 > description: nls.localize('comments.insertSpace', "Controls whether a space character is inserted when commenting.")
1532 > },
1533 > 'editor.comments.ignoreEmptyLines': {
1534 > type: 'boolean',
1535 > default: defaults.ignoreEmptyLines,
1536 > description: nls.localize('comments.ignoreEmptyLines', 'Controls if empty lines should be ignored with toggle, add or remove actions for line comments.')
1537 > },
1538 > }
1539 > );
1540 > }
1541 >
1542 > public validate(_input: unknown): EditorCommentsOptions {
1543 if (!_input || typeof _input !== 'object') {
1544 return this.defaultValue;
1550 };
1551 }
1552 > } editorOptions.ts
1553 >
1554 > //#endregion
1555 >
1556 > //#region cursorBlinking
1557 >
1558 > /**
1559 > * The kind of animation in which the editor's cursor should be rendered.
1560 > */
1561 > export const enum TextEditorCursorBlinkingStyle {
1562 > /**
1563 > * Hidden
1564 > */
1565 > Hidden = 0,
1566 > /**
1567 > * Blinking
1568 > */
1569 > Blink = 1,
1570 > /**
1571 > * Blinking with smooth fading
1572 > */
1573 > Smooth = 2,
1574 > /**
1575 > * Blinking with prolonged filled state and smooth fading
1576 > */
1577 > Phase = 3,
1578 > /**
1579 > * Expand collapse animation on the y axis
1580 > */
1581 > Expand = 4,
1582 > /**
1583 > * No-Blinking
1584 > */
1585 > Solid = 5
1586 > }
1587 >
1588 > /**
1589 > * @internal
1590 > */
1591 > export function cursorBlinkingStyleFromString(cursorBlinkingStyle: 'blink' | 'smooth' | 'phase' | 'expand' | 'solid'): TextEditorCursorBlinkingStyle {
1592 switch (cursorBlinkingStyle) {
1593 case 'blink': return TextEditorCursorBlinkingStyle.Blink;
1598 }
1599 }
1601 > //#endregion
1602 >
1603 > //#region cursorStyle
1604 >
1605 > /**
1606 > * The style in which the editor's cursor should be rendered.
1607 > */
1608 > export enum TextEditorCursorStyle {
1609 > /**
1610 > * As a vertical line (sitting between two characters).
1611 > */
1612 > Line = 1,
1613 > /**
1614 > * As a block (sitting on top of a character).
1615 > */
1616 > Block = 2,
1617 > /**
1618 > * As a horizontal line (sitting under a character).
1619 > */
1620 > Underline = 3,
1621 > /**
1622 > * As a thin vertical line (sitting between two characters).
1623 > */
1624 > LineThin = 4,
1625 > /**
1626 > * As an outlined block (sitting on top of a character).
1627 > */
1628 > BlockOutline = 5,
1629 > /**
1630 > * As a thin horizontal line (sitting under a character).
1631 > */
1632 > UnderlineThin = 6
1633 > }
1634 >
1635 > /**
1636 > * @internal
1637 > */
1638 > export function cursorStyleToString(cursorStyle: TextEditorCursorStyle): 'line' | 'block' | 'underline' | 'line-thin' | 'block-outline' | 'underline-thin' {
1639 switch (cursorStyle) {
1640 case TextEditorCursorStyle.Line: return 'line';
1646 }
1647 }
1649 > /**
1650 > * @internal
1651 > */
1652 > export function cursorStyleFromString(cursorStyle: 'line' | 'block' | 'underline' | 'line-thin' | 'block-outline' | 'underline-thin'): TextEditorCursorStyle {
1653 switch (cursorStyle) {
1654 case 'line': return TextEditorCursorStyle.Line;
1660 }
1661 }
1663 > //#endregion
1664 >
1665 > //#region editorClassName
1666 >
1667 > class EditorClassName extends ComputedEditorOption<EditorOption.editorClassName, string> {
1668 >
1669 > constructor() {
1670 > super(EditorOption.editorClassName, '');
1671 > }
1672 >
1673 > public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, _: string): string {
1674 const classNames = ['monaco-editor'];
1675 if (options.get(EditorOption.extraEditorClassName)) {
1695 return classNames.join(' ');
1696 }
1697 > } editorOptions.ts
1698 >
1699 > //#endregion
1700 >
1701 > //#region emptySelectionClipboard
1702 >
1703 > class EditorEmptySelectionClipboard extends EditorBooleanOption<EditorOption.emptySelectionClipboard> {
1704 >
1705 > constructor() {
1706 > super(
1707 > EditorOption.emptySelectionClipboard, 'emptySelectionClipboard', true,
1708 > { description: nls.localize('emptySelectionClipboard', "Controls whether copying without a selection copies the current line.") }
1709 > );
1710 > }
1711 >
1712 > public override compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: boolean): boolean {
1713 return value && env.emptySelectionClipboard;
1714 }
1715 > } editorOptions.ts
1716 >
1717 > //#endregion
1718 >
1719 > //#region find
1720 >
1721 > /**
1722 > * Configuration options for editor find widget
1723 > */
1724 > export interface IEditorFindOptions {
1725 > /**
1726 > * Controls whether the cursor should move to find matches while typing.
1727 > */
1728 > cursorMoveOnType?: boolean;
1729 > /**
1730 > * Controls whether the find widget should search as you type.
1731 > */
1732 > findOnType?: boolean;
1733 > /**
1734 > * Controls if we seed search string in the Find Widget with editor selection.
1735 > */
1736 > seedSearchStringFromSelection?: 'never' | 'always' | 'selection';
1737 > /**
1738 > * Controls if Find in Selection flag is turned on in the editor.
1739 > */
1740 > autoFindInSelection?: 'never' | 'always' | 'multiline';
1741 > /*
1742 > * Controls whether the Find Widget should add extra lines on top of the editor.
1743 > */
1744 > addExtraSpaceOnTop?: boolean;
1745 > /**
1746 > * @internal
1747 > * Controls if the Find Widget should read or modify the shared find clipboard on macOS
1748 > */
1749 > globalFindClipboard?: boolean;
1750 > /**
1751 > * Controls whether the search result and diff result automatically restarts from the beginning (or the end) when no further matches can be found
1752 > */
1753 > loop?: boolean;
1754 > /**
1755 > * Controls whether to close the Find Widget after an explicit find navigation command lands on a match.
1756 > */
1757 > closeOnResult?: boolean;
1758 > /**
1759 > * @internal
1760 > * Controls how the find widget search history should be stored
1761 > */
1762 > history?: 'never' | 'workspace';
1763 > /**
1764 > * @internal
1765 > * Controls how the replace widget search history should be stored
1766 > */
1767 > replaceHistory?: 'never' | 'workspace';
1768 > }
1769 >
1770 > /**
1771 > * @internal
1772 > */
1773 > export type EditorFindOptions = Readonly<Required<IEditorFindOptions>>;
1774 >
1775 > class EditorFind extends BaseEditorOption<EditorOption.find, IEditorFindOptions, EditorFindOptions> {
1776 >
1777 > constructor() {
1778 > const defaults: EditorFindOptions = {
1779 > cursorMoveOnType: true,
1780 > findOnType: true,
1781 > seedSearchStringFromSelection: 'always',
1782 > autoFindInSelection: 'never',
1783 > globalFindClipboard: false,
1784 > addExtraSpaceOnTop: true,
1785 > loop: true,
1786 > closeOnResult: false,
1787 > history: 'workspace',
1788 > replaceHistory: 'workspace',
1789 > };
1790 > super(
1791 > EditorOption.find, 'find', defaults,
1792 > {
1793 > 'editor.find.cursorMoveOnType': {
1794 > type: 'boolean',
1795 > default: defaults.cursorMoveOnType,
1796 > description: nls.localize('find.cursorMoveOnType', "Controls whether the cursor should jump to find matches while typing.")
1797 > },
1798 > 'editor.find.seedSearchStringFromSelection': {
1799 > type: 'string',
1800 > enum: ['never', 'always', 'selection'],
1801 > default: defaults.seedSearchStringFromSelection,
1802 > enumDescriptions: [
1803 > nls.localize('editor.find.seedSearchStringFromSelection.never', 'Never seed search string from the editor selection.'),
1804 > nls.localize('editor.find.seedSearchStringFromSelection.always', 'Always seed search string from the editor selection, including word at cursor position.'),
1805 > nls.localize('editor.find.seedSearchStringFromSelection.selection', 'Only seed search string from the editor selection.')
1806 > ],
1807 > description: nls.localize('find.seedSearchStringFromSelection', "Controls whether the search string in the Find Widget is seeded from the editor selection.")
1808 > },
1809 > 'editor.find.autoFindInSelection': {
1810 > type: 'string',
1811 > enum: ['never', 'always', 'multiline'],
1812 > default: defaults.autoFindInSelection,
1813 > enumDescriptions: [
1814 > nls.localize('editor.find.autoFindInSelection.never', 'Never turn on Find in Selection automatically (default).'),
1815 > nls.localize('editor.find.autoFindInSelection.always', 'Always turn on Find in Selection automatically.'),
1816 > nls.localize('editor.find.autoFindInSelection.multiline', 'Turn on Find in Selection automatically when multiple lines of content are selected.')
1817 > ],
1818 > description: nls.localize('find.autoFindInSelection', "Controls the condition for turning on Find in Selection automatically.")
1819 > },
1820 > 'editor.find.globalFindClipboard': {
1821 > type: 'boolean',
1822 > default: defaults.globalFindClipboard,
1823 > description: nls.localize('find.globalFindClipboard', "Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),
1824 > included: platform.isMacintosh
1825 > },
1826 > 'editor.find.addExtraSpaceOnTop': {
1827 > type: 'boolean',
1828 > default: defaults.addExtraSpaceOnTop,
1829 > description: 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.")
1830 > },
1831 > 'editor.find.loop': {
1832 > type: 'boolean',
1833 > default: defaults.loop,
1834 > description: nls.localize('find.loop', "Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")
1835 > },
1836 > 'editor.find.closeOnResult': {
1837 > type: 'boolean',
1838 > default: defaults.closeOnResult,
1839 > description: nls.localize('find.closeOnResult', "Controls whether the Find Widget closes after an explicit find navigation command lands on a result.")
1840 > },
1841 > 'editor.find.history': {
1842 > type: 'string',
1843 > enum: ['never', 'workspace'],
1844 > default: 'workspace',
1845 > enumDescriptions: [
1846 > nls.localize('editor.find.history.never', 'Do not store search history from the find widget.'),
1847 > nls.localize('editor.find.history.workspace', 'Store search history across the active workspace'),
1848 > ],
1849 > description: nls.localize('find.history', "Controls how the find widget history should be stored")
1850 > },
1851 > 'editor.find.replaceHistory': {
1852 > type: 'string',
1853 > enum: ['never', 'workspace'],
1854 > default: 'workspace',
1855 > enumDescriptions: [
1856 > nls.localize('editor.find.replaceHistory.never', 'Do not store history from the replace widget.'),
1857 > nls.localize('editor.find.replaceHistory.workspace', 'Store replace history across the active workspace'),
1858 > ],
1859 > description: nls.localize('find.replaceHistory', "Controls how the replace widget history should be stored")
1860 > },
1861 > 'editor.find.findOnType': {
1862 > type: 'boolean',
1863 > default: defaults.findOnType,
1864 > description: nls.localize('find.findOnType', "Controls whether the Find Widget should search as you type.")
1865 > },
1866 > }
1867 > );
1868 > }
1869 >
1870 > public validate(_input: unknown): EditorFindOptions {
1871 if (!_input || typeof _input !== 'object') {
1872 return this.defaultValue;
1890 };
1891 }
1892 > } editorOptions.ts
1893 >
1894 > //#endregion
1895 >
1896 > //#region fontLigatures
1897 >
1898 > /**
1899 > * @internal
1900 > */
1901 > export class EditorFontLigatures extends BaseEditorOption<EditorOption.fontLigatures, boolean | string, string> {
1902 >
1903 > public static OFF = '"liga" off, "calt" off';
1904 > public static ON = '"liga" on, "calt" on';
1905 >
1906 > constructor() {
1907 > super(
1908 > EditorOption.fontLigatures, 'fontLigatures', EditorFontLigatures.OFF,
1909 > {
1910 > anyOf: [
1911 > {
1912 > type: 'boolean',
1913 > description: 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."),
1914 > },
1915 > {
1916 > type: 'string',
1917 > description: nls.localize('fontFeatureSettings', "Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")
1918 > }
1919 > ],
1920 > description: 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."),
1921 > default: false
1922 > }
1923 > );
1924 > }
1925 >
1926 > public validate(input: unknown): string {
1927 if (typeof input === 'undefined') {
1928 return this.defaultValue;
1942 return EditorFontLigatures.OFF;
1943 }
1944 > } editorOptions.ts
1945 >
1946 > //#endregion
1947 >
1948 > //#region fontVariations
1949 >
1950 > /**
1951 > * @internal
1952 > */
1953 > export class EditorFontVariations extends BaseEditorOption<EditorOption.fontVariations, boolean | string, string> {
1954 > // Text is laid out using default settings.
1955 > public static OFF = FONT_VARIATION_OFF;
1956 >
1957 > // Translate `fontWeight` config to the `font-variation-settings` CSS property.
1958 > public static TRANSLATE = FONT_VARIATION_TRANSLATE;
1959 >
1960 > constructor() {
1961 > super(
1962 > EditorOption.fontVariations, 'fontVariations', EditorFontVariations.OFF,
1963 > {
1964 > anyOf: [
1965 > {
1966 > type: 'boolean',
1967 > description: 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."),
1968 > },
1969 > {
1970 > type: 'string',
1971 > description: 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.")
1972 > }
1973 > ],
1974 > description: 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."),
1975 > default: false
1976 > }
1977 > );
1978 > }
1979 >
1980 > public validate(input: unknown): string {
1981 if (typeof input === 'undefined') {
1982 return this.defaultValue;
1996 return EditorFontVariations.OFF;
1997 }
1999 > public override compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: string): string {
2000 // The value is computed from the fontWeight if it is true.
2001 // So take the result from env.fontInfo
2002 return env.fontInfo.fontVariationSettings;
2003 }
2004 > } editorOptions.ts
2005 >
2006 > //#endregion
2007 >
2008 > //#region fontInfo
2009 >
2010 > class EditorFontInfo extends ComputedEditorOption<EditorOption.fontInfo, FontInfo> {
2011 >
2012 > constructor() {
2013 > super(EditorOption.fontInfo, new FontInfo({
2014 > pixelRatio: 0,
2015 > fontFamily: '',
2016 > fontWeight: '',
2017 > fontSize: 0,
2018 > fontFeatureSettings: '',
2019 > fontVariationSettings: '',
2020 > lineHeight: 0,
2021 > letterSpacing: 0,
2022 > isMonospace: false,
2023 > typicalHalfwidthCharacterWidth: 0,
2024 > typicalFullwidthCharacterWidth: 0,
2025 > canUseHalfwidthRightwardsArrow: false,
2026 > spaceWidth: 0,
2027 > middotWidth: 0,
2028 > wsmiddotWidth: 0,
2029 > maxDigitWidth: 0,
2030 > }, false));
2031 > }
2032 >
2033 > public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, _: FontInfo): FontInfo {
2034 return env.fontInfo;
2035 }
2036 > } editorOptions.ts
2037 >
2038 > //#endregion
2039 >
2040 > //#region effectiveCursorStyle
2041 >
2042 > class EffectiveCursorStyle extends ComputedEditorOption<EditorOption.effectiveCursorStyle, TextEditorCursorStyle> {
2043 >
2044 > constructor() {
2045 > super(EditorOption.effectiveCursorStyle, TextEditorCursorStyle.Line);
2046 > }
2047 >
2048 > public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, _: TextEditorCursorStyle): TextEditorCursorStyle {
2049 return env.inputMode === 'overtype' ?
2050 options.get(EditorOption.overtypeCursorStyle) :
2051 options.get(EditorOption.cursorStyle);
2052 }
2053 > } editorOptions.ts
2054 >
2055 > //#endregion
2056 >
2057 > //#region effectiveExperimentalEditContext
2058 >
2059 > class EffectiveEditContextEnabled extends ComputedEditorOption<EditorOption.effectiveEditContext, boolean> {
2060 >
2061 > constructor() {
2062 > super(EditorOption.effectiveEditContext, false);
2063 > }
2064 >
2065 > public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions): boolean {
2066 return env.editContextSupported && options.get(EditorOption.editContext);
2067 }
2068 > } editorOptions.ts
2069 >
2070 > //#endregion
2071 >
2072 > //#region effectiveAllowVariableFonts
2073 >
2074 > class EffectiveAllowVariableFonts extends ComputedEditorOption<EditorOption.effectiveAllowVariableFonts, boolean> {
2075 >
2076 > constructor() {
2077 > super(EditorOption.effectiveAllowVariableFonts, false);
2078 > }
2079 >
2080 > public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions): boolean {
2081 const accessibilitySupport = env.accessibilitySupport;
2082 if (accessibilitySupport === AccessibilitySupport.Enabled) {
2086 }
2087 }
2088 > } editorOptions.ts
2089 >
2090 > //#engregion
2091 >
2092 > //#region fontSize
2093 >
2094 > class EditorFontSize extends SimpleEditorOption<EditorOption.fontSize, number> {
2095 >
2096 > constructor() {
2097 > super(
2098 > EditorOption.fontSize, 'fontSize', EDITOR_FONT_DEFAULTS.fontSize,
2099 > {
2100 > type: 'number',
2101 > minimum: 6,
2102 > maximum: 100,
2103 > default: EDITOR_FONT_DEFAULTS.fontSize,
2104 > description: nls.localize('fontSize', "Controls the font size in pixels.")
2105 > }
2106 > );
2107 > }
2108 >
2109 > public override validate(input: unknown): number {
2110 const r = EditorFloatOption.float(input, this.defaultValue);
2111 if (r === 0) {
2114 return EditorFloatOption.clamp(r, 6, 100);
2115 }
2116 > public override compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: number): number { editorOptions.ts
2117 // The final fontSize respects the editor zoom level.
2118 // So take the result from env.fontInfo
2119 return env.fontInfo.fontSize;
2120 }
2121 > } editorOptions.ts
2122 >
2123 > //#endregion
2124 >
2125 > //#region fontWeight
2126 >
2127 > class EditorFontWeight extends BaseEditorOption<EditorOption.fontWeight, string, string> {
2128 > private static SUGGESTION_VALUES = ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'];
2129 > private static MINIMUM_VALUE = 1;
2130 > private static MAXIMUM_VALUE = 1000;
2131 >
2132 > constructor() {
2133 > super(
2134 > EditorOption.fontWeight, 'fontWeight', EDITOR_FONT_DEFAULTS.fontWeight,
2135 > {
2136 > anyOf: [
2137 > {
2138 > type: 'number',
2139 > minimum: EditorFontWeight.MINIMUM_VALUE,
2140 > maximum: EditorFontWeight.MAXIMUM_VALUE,
2141 > errorMessage: nls.localize('fontWeightErrorMessage', "Only \"normal\" and \"bold\" keywords or numbers between 1 and 1000 are allowed.")
2142 > },
2143 > {
2144 > type: 'string',
2145 > pattern: '^(normal|bold|1000|[1-9][0-9]{0,2})$'
2146 > },
2147 > {
2148 > enum: EditorFontWeight.SUGGESTION_VALUES
2149 > }
2150 > ],
2151 > default: EDITOR_FONT_DEFAULTS.fontWeight,
2152 > description: nls.localize('fontWeight', "Controls the font weight. Accepts \"normal\" and \"bold\" keywords or numbers between 1 and 1000.")
2153 > }
2154 > );
2155 > }
2156 >
2157 > public validate(input: unknown): string {
2158 if (input === 'normal' || input === 'bold') {
2159 return input;
2161 return String(EditorIntOption.clampedInt(input, EDITOR_FONT_DEFAULTS.fontWeight, EditorFontWeight.MINIMUM_VALUE, EditorFontWeight.MAXIMUM_VALUE));
2162 }
2163 > } editorOptions.ts
2164 >
2165 > //#endregion
2166 >
2167 > //#region gotoLocation
2168 >
2169 > export type GoToLocationValues = 'peek' | 'gotoAndPeek' | 'goto';
2170 >
2171 > /**
2172 > * Configuration options for go to location
2173 > */
2174 > export interface IGotoLocationOptions {
2175 >
2176 > multiple?: GoToLocationValues;
2177 >
2178 > multipleDefinitions?: GoToLocationValues;
2179 > multipleTypeDefinitions?: GoToLocationValues;
2180 > multipleDeclarations?: GoToLocationValues;
2181 > multipleImplementations?: GoToLocationValues;
2182 > multipleReferences?: GoToLocationValues;
2183 > multipleTests?: GoToLocationValues;
2184 >
2185 > alternativeDefinitionCommand?: string;
2186 > alternativeTypeDefinitionCommand?: string;
2187 > alternativeDeclarationCommand?: string;
2188 > alternativeImplementationCommand?: string;
2189 > alternativeReferenceCommand?: string;
2190 > alternativeTestsCommand?: string;
2191 > }
2192 >
2193 > /**
2194 > * @internal
2195 > */
2196 > export type GoToLocationOptions = Readonly<Required<IGotoLocationOptions>>;
2197 >
2198 > class EditorGoToLocation extends BaseEditorOption<EditorOption.gotoLocation, IGotoLocationOptions, GoToLocationOptions> {
2199 >
2200 > constructor() {
2201 > const defaults: GoToLocationOptions = {
2202 > multiple: 'peek',
2203 > multipleDefinitions: 'peek',
2204 > multipleTypeDefinitions: 'peek',
2205 > multipleDeclarations: 'peek',
2206 > multipleImplementations: 'peek',
2207 > multipleReferences: 'peek',
2208 > multipleTests: 'peek',
2209 > alternativeDefinitionCommand: 'editor.action.goToReferences',
2210 > alternativeTypeDefinitionCommand: 'editor.action.goToReferences',
2211 > alternativeDeclarationCommand: 'editor.action.goToReferences',
2212 > alternativeImplementationCommand: '',
2213 > alternativeReferenceCommand: '',
2214 > alternativeTestsCommand: '',
2215 > };
2216 > const jsonSubset: IJSONSchema = {
2217 > type: 'string',
2218 > enum: ['peek', 'gotoAndPeek', 'goto'],
2219 > default: defaults.multiple,
2220 > enumDescriptions: [
2221 > nls.localize('editor.gotoLocation.multiple.peek', 'Show Peek view of the results (default)'),
2222 > nls.localize('editor.gotoLocation.multiple.gotoAndPeek', 'Go to the primary result and show a Peek view'),
2223 > nls.localize('editor.gotoLocation.multiple.goto', 'Go to the primary result and enable Peek-less navigation to others')
2224 > ]
2225 > };
2226 > const 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'];
2227 > super(
2228 > EditorOption.gotoLocation, 'gotoLocation', defaults,
2229 > {
2230 > 'editor.gotoLocation.multiple': {
2231 > deprecationMessage: 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."),
2232 > },
2233 > 'editor.gotoLocation.multipleDefinitions': {
2234 > description: nls.localize('editor.editor.gotoLocation.multipleDefinitions', "Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),
2235 > ...jsonSubset,
2236 > },
2237 > 'editor.gotoLocation.multipleTypeDefinitions': {
2238 > description: nls.localize('editor.editor.gotoLocation.multipleTypeDefinitions', "Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),
2239 > ...jsonSubset,
2240 > },
2241 > 'editor.gotoLocation.multipleDeclarations': {
2242 > description: nls.localize('editor.editor.gotoLocation.multipleDeclarations', "Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),
2243 > ...jsonSubset,
2244 > },
2245 > 'editor.gotoLocation.multipleImplementations': {
2246 > description: nls.localize('editor.editor.gotoLocation.multipleImplemenattions', "Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),
2247 > ...jsonSubset,
2248 > },
2249 > 'editor.gotoLocation.multipleReferences': {
2250 > description: nls.localize('editor.editor.gotoLocation.multipleReferences', "Controls the behavior the 'Go to References'-command when multiple target locations exist."),
2251 > ...jsonSubset,
2252 > },
2253 > 'editor.gotoLocation.alternativeDefinitionCommand': {
2254 > type: 'string',
2255 > default: defaults.alternativeDefinitionCommand,
2256 > enum: alternativeCommandOptions,
2257 > description: nls.localize('alternativeDefinitionCommand', "Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")
2258 > },
2259 > 'editor.gotoLocation.alternativeTypeDefinitionCommand': {
2260 > type: 'string',
2261 > default: defaults.alternativeTypeDefinitionCommand,
2262 > enum: alternativeCommandOptions,
2263 > description: nls.localize('alternativeTypeDefinitionCommand', "Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")
2264 > },
2265 > 'editor.gotoLocation.alternativeDeclarationCommand': {
2266 > type: 'string',
2267 > default: defaults.alternativeDeclarationCommand,
2268 > enum: alternativeCommandOptions,
2269 > description: nls.localize('alternativeDeclarationCommand', "Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")
2270 > },
2271 > 'editor.gotoLocation.alternativeImplementationCommand': {
2272 > type: 'string',
2273 > default: defaults.alternativeImplementationCommand,
2274 > enum: alternativeCommandOptions,
2275 > description: nls.localize('alternativeImplementationCommand', "Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")
2276 > },
2277 > 'editor.gotoLocation.alternativeReferenceCommand': {
2278 > type: 'string',
2279 > default: defaults.alternativeReferenceCommand,
2280 > enum: alternativeCommandOptions,
2281 > description: nls.localize('alternativeReferenceCommand', "Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")
2282 > },
2283 > }
2284 > );
2285 > }
2286 >
2287 > public validate(_input: unknown): GoToLocationOptions {
2288 if (!_input || typeof _input !== 'object') {
2289 return this.defaultValue;
2306 };
2307 }
2308 > } editorOptions.ts
2309 >
2310 > //#endregion
2311 >
2312 > //#region hover
2313 >
2314 > /**
2315 > * Configuration options for editor hover
2316 > */
2317 > export interface IEditorHoverOptions {
2318 > /**
2319 > * Enable the hover.
2320 > * Defaults to 'on'.
2321 > */
2322 > enabled?: 'on' | 'off' | 'onKeyboardModifier';
2323 > /**
2324 > * Delay for showing the hover.
2325 > * Defaults to 300.
2326 > */
2327 > delay?: number;
2328 > /**
2329 > * Is the hover sticky such that it can be clicked and its contents selected?
2330 > * Defaults to true.
2331 > */
2332 > sticky?: boolean;
2333 > /**
2334 > * Controls how long the hover is visible after you hovered out of it.
2335 > * Require sticky setting to be true.
2336 > */
2337 > hidingDelay?: number;
2338 > /**
2339 > * Should the hover be shown above the line if possible?
2340 > * Defaults to false.
2341 > */
2342 > above?: boolean;
2343 > /**
2344 > * Should long line warning hovers be shown (tokenization skipped, rendering paused)?
2345 > * Defaults to true.
2346 > */
2347 > showLongLineWarning?: boolean;
2348 > }
2349 >
2350 > /**
2351 > * @internal
2352 > */
2353 > export type EditorHoverOptions = Readonly<Required<IEditorHoverOptions>>;
2354 >
2355 > class EditorHover extends BaseEditorOption<EditorOption.hover, IEditorHoverOptions, EditorHoverOptions> {
2356 >
2357 > constructor() {
2358 > const defaults: EditorHoverOptions = {
2359 > enabled: 'on',
2360 > delay: 300,
2361 > hidingDelay: 300,
2362 > sticky: true,
2363 > above: true,
2364 > showLongLineWarning: true,
2365 > };
2366 > super(
2367 > EditorOption.hover, 'hover', defaults,
2368 > {
2369 > 'editor.hover.enabled': {
2370 > type: 'string',
2371 > enum: ['on', 'off', 'onKeyboardModifier'],
2372 > default: defaults.enabled,
2373 > markdownEnumDescriptions: [
2374 > nls.localize('hover.enabled.on', "Hover is enabled."),
2375 > nls.localize('hover.enabled.off', "Hover is disabled."),
2376 > nls.localize('hover.enabled.onKeyboardModifier', "Hover is shown when holding `{0}` or `Alt` (the opposite modifier of `#editor.multiCursorModifier#`)", platform.isMacintosh ? `Command` : `Control`)
2377 > ],
2378 > description: nls.localize('hover.enabled', "Controls whether the hover is shown."),
2379 > keywords: ['hint', 'info', 'tooltip']
2380 > },
2381 > 'editor.hover.delay': {
2382 > type: 'number',
2383 > default: defaults.delay,
2384 > minimum: 0,
2385 > maximum: 10000,
2386 > description: nls.localize('hover.delay', "Controls the delay in milliseconds after which the hover is shown.")
2387 > },
2388 > 'editor.hover.sticky': {
2389 > type: 'boolean',
2390 > default: defaults.sticky,
2391 > description: nls.localize('hover.sticky', "Controls whether the hover should remain visible when mouse is moved over it.")
2392 > },
2393 > 'editor.hover.hidingDelay': {
2394 > type: 'integer',
2395 > minimum: 0,
2396 > default: defaults.hidingDelay,
2397 > markdownDescription: nls.localize('hover.hidingDelay', "Controls the delay in milliseconds after which the hover is hidden. Requires `#editor.hover.sticky#` to be enabled.")
2398 > },
2399 > 'editor.hover.above': {
2400 > type: 'boolean',
2401 > default: defaults.above,
2402 > description: nls.localize('hover.above', "Prefer showing hovers above the line, if there's space.")
2403 > },
2404 > 'editor.hover.showLongLineWarning': {
2405 > type: 'boolean',
2406 > default: defaults.showLongLineWarning,
2407 > description: nls.localize('hover.showLongLineWarning', "Controls whether long line warning hovers are shown, such as when tokenization is skipped or rendering is paused.")
2408 > },
2409 > }
2410 > );
2411 > }
2412 >
2413 > public validate(_input: unknown): EditorHoverOptions {
2414 if (!_input || typeof _input !== 'object') {
2415 return this.defaultValue;
2425 };
2426 }
2427 > } editorOptions.ts
2428 >
2429 > //#endregion
2430 >
2431 > //#region layoutInfo
2432 >
2433 > /**
2434 > * A description for the overview ruler position.
2435 > */
2436 > export interface OverviewRulerPosition {
2437 > /**
2438 > * Width of the overview ruler
2439 > */
2440 > readonly width: number;
2441 > /**
2442 > * Height of the overview ruler
2443 > */
2444 > readonly height: number;
2445 > /**
2446 > * Top position for the overview ruler
2447 > */
2448 > readonly top: number;
2449 > /**
2450 > * Right position for the overview ruler
2451 > */
2452 > readonly right: number;
2453 > }
2454 >
2455 > export const enum RenderMinimap {
2456 > None = 0,
2457 > Text = 1,
2458 > Blocks = 2,
2459 > }
2460 >
2461 > /**
2462 > * The internal layout details of the editor.
2463 > */
2464 > export interface EditorLayoutInfo {
2465 >
2466 > /**
2467 > * Full editor width.
2468 > */
2469 > readonly width: number;
2470 > /**
2471 > * Full editor height.
2472 > */
2473 > readonly height: number;
2474 >
2475 > /**
2476 > * Left position for the glyph margin.
2477 > */
2478 > readonly glyphMarginLeft: number;
2479 > /**
2480 > * The width of the glyph margin.
2481 > */
2482 > readonly glyphMarginWidth: number;
2483 >
2484 > /**
2485 > * The number of decoration lanes to render in the glyph margin.
2486 > */
2487 > readonly glyphMarginDecorationLaneCount: number;
2488 >
2489 > /**
2490 > * Left position for the line numbers.
2491 > */
2492 > readonly lineNumbersLeft: number;
2493 > /**
2494 > * The width of the line numbers.
2495 > */
2496 > readonly lineNumbersWidth: number;
2497 >
2498 > /**
2499 > * Left position for the line decorations.
2500 > */
2501 > readonly decorationsLeft: number;
2502 > /**
2503 > * The width of the line decorations.
2504 > */
2505 > readonly decorationsWidth: number;
2506 >
2507 > /**
2508 > * Left position for the content (actual text)
2509 > */
2510 > readonly contentLeft: number;
2511 > /**
2512 > * The width of the content (actual text)
2513 > */
2514 > readonly contentWidth: number;
2515 >
2516 > /**
2517 > * Layout information for the minimap
2518 > */
2519 > readonly minimap: EditorMinimapLayoutInfo;
2520 >
2521 > /**
2522 > * The number of columns (of typical characters) fitting on a viewport line.
2523 > */
2524 > readonly viewportColumn: number;
2525 >
2526 > readonly isWordWrapMinified: boolean;
2527 > readonly isViewportWrapping: boolean;
2528 > readonly wrappingColumn: number;
2529 >
2530 > /**
2531 > * The width of the vertical scrollbar.
2532 > */
2533 > readonly verticalScrollbarWidth: number;
2534 > /**
2535 > * The height of the horizontal scrollbar.
2536 > */
2537 > readonly horizontalScrollbarHeight: number;
2538 >
2539 > /**
2540 > * The position of the overview ruler.
2541 > */
2542 > readonly overviewRuler: OverviewRulerPosition;
2543 > }
2544 >
2545 > /**
2546 > * The internal layout details of the editor.
2547 > */
2548 > export interface EditorMinimapLayoutInfo {
2549 > readonly renderMinimap: RenderMinimap;
2550 > readonly minimapLeft: number;
2551 > readonly minimapWidth: number;
2552 > readonly minimapHeightIsEditorHeight: boolean;
2553 > readonly minimapIsSampling: boolean;
2554 > readonly minimapScale: number;
2555 > readonly minimapLineHeight: number;
2556 > readonly minimapCanvasInnerWidth: number;
2557 > readonly minimapCanvasInnerHeight: number;
2558 > readonly minimapCanvasOuterWidth: number;
2559 > readonly minimapCanvasOuterHeight: number;
2560 > }
2561 >
2562 > /**
2563 > * @internal
2564 > */
2565 > export interface EditorLayoutInfoComputerEnv {
2566 > readonly memory: ComputeOptionsMemory | null;
2567 > readonly outerWidth: number;
2568 > readonly outerHeight: number;
2569 > readonly isDominatedByLongLines: boolean;
2570 > readonly lineHeight: number;
2571 > readonly viewLineCount: number;
2572 > readonly lineNumbersDigitCount: number;
2573 > readonly typicalHalfwidthCharacterWidth: number;
2574 > readonly maxDigitWidth: number;
2575 > readonly pixelRatio: number;
2576 > readonly glyphMarginDecorationLaneCount: number;
2577 > }
2578 >
2579 > /**
2580 > * @internal
2581 > */
2582 > export interface IEditorLayoutComputerInput {
2583 > readonly outerWidth: number;
2584 > readonly outerHeight: number;
2585 > readonly isDominatedByLongLines: boolean;
2586 > readonly lineHeight: number;
2587 > readonly lineNumbersDigitCount: number;
2588 > readonly typicalHalfwidthCharacterWidth: number;
2589 > readonly maxDigitWidth: number;
2590 > readonly pixelRatio: number;
2591 > readonly glyphMargin: boolean;
2592 > readonly lineDecorationsWidth: string | number;
2593 > readonly folding: boolean;
2594 > readonly minimap: Readonly<Required<IEditorMinimapOptions>>;
2595 > readonly scrollbar: InternalEditorScrollbarOptions;
2596 > readonly lineNumbers: InternalEditorRenderLineNumbersOptions;
2597 > readonly lineNumbersMinChars: number;
2598 > readonly scrollBeyondLastLine: boolean;
2599 > readonly wordWrap: 'wordWrapColumn' | 'on' | 'off' | 'bounded';
2600 > readonly wordWrapColumn: number;
2601 > readonly wordWrapMinified: boolean;
2602 > readonly accessibilitySupport: AccessibilitySupport;
2603 > }
2604 >
2605 > /**
2606 > * @internal
2607 > */
2608 > export interface IMinimapLayoutInput {
2609 > readonly outerWidth: number;
2610 > readonly outerHeight: number;
2611 > readonly lineHeight: number;
2612 > readonly typicalHalfwidthCharacterWidth: number;
2613 > readonly pixelRatio: number;
2614 > readonly scrollBeyondLastLine: boolean;
2615 > readonly paddingTop: number;
2616 > readonly paddingBottom: number;
2617 > readonly minimap: Readonly<Required<IEditorMinimapOptions>>;
2618 > readonly verticalScrollbarWidth: number;
2619 > readonly viewLineCount: number;
2620 > readonly remainingWidth: number;
2621 > readonly isViewportWrapping: boolean;
2622 > }
2623 >
2624 > /**
2625 > * @internal
2626 > */
2627 > export class EditorLayoutInfoComputer extends ComputedEditorOption<EditorOption.layoutInfo, EditorLayoutInfo> {
2628 >
2629 > constructor() {
2630 > super(EditorOption.layoutInfo, {
2631 > width: 0,
2632 > height: 0,
2633 > glyphMarginLeft: 0,
2634 > glyphMarginWidth: 0,
2635 > glyphMarginDecorationLaneCount: 0,
2636 > lineNumbersLeft: 0,
2637 > lineNumbersWidth: 0,
2638 > decorationsLeft: 0,
2639 > decorationsWidth: 0,
2640 > contentLeft: 0,
2641 > contentWidth: 0,
2642 > minimap: {
2643 > renderMinimap: RenderMinimap.None,
2644 > minimapLeft: 0,
2645 > minimapWidth: 0,
2646 > minimapHeightIsEditorHeight: false,
2647 > minimapIsSampling: false,
2648 > minimapScale: 1,
2649 > minimapLineHeight: 1,
2650 > minimapCanvasInnerWidth: 0,
2651 > minimapCanvasInnerHeight: 0,
2652 > minimapCanvasOuterWidth: 0,
2653 > minimapCanvasOuterHeight: 0,
2654 > },
2655 > viewportColumn: 0,
2656 > isWordWrapMinified: false,
2657 > isViewportWrapping: false,
2658 > wrappingColumn: -1,
2659 > verticalScrollbarWidth: 0,
2660 > horizontalScrollbarHeight: 0,
2661 > overviewRuler: {
2662 > top: 0,
2663 > width: 0,
2664 > height: 0,
2665 > right: 0
2666 > }
2667 > });
2668 > }
2669 >
2670 > public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, _: EditorLayoutInfo): EditorLayoutInfo {
2671 return EditorLayoutInfoComputer.computeLayout(options, {
2672 memory: env.memory,
2683 });
2684 }
2686 > public static computeContainedMinimapLineCount(input: {
2687 viewLineCount: number;
2688 scrollBeyondLastLine: boolean;
2703 return { typicalViewportLineCount, extraLinesBeforeFirstLine, extraLinesBeyondLastLine, desiredRatio, minimapLineCount };
2704 }
2706 > private static _computeMinimapLayout(input: IMinimapLayoutInput, memory: ComputeOptionsMemory): EditorMinimapLayoutInfo {
2707 const outerWidth = input.outerWidth;
2708 const outerHeight = input.outerHeight;
2879 };
2880 }
2882 > public static computeLayout(options: IComputedEditorOptions, env: EditorLayoutInfoComputerEnv): EditorLayoutInfo {
2883 const outerWidth = env.outerWidth | 0;
2884 const outerHeight = env.outerHeight | 0;
3024 };
3025 }
3026 > } editorOptions.ts
3027 >
3028 > //#endregion
3029 >
3030 > //#region WrappingStrategy
3031 > class WrappingStrategy extends BaseEditorOption<EditorOption.wrappingStrategy, 'simple' | 'advanced', 'simple' | 'advanced'> {
3032 >
3033 > constructor() {
3034 > super(EditorOption.wrappingStrategy, 'wrappingStrategy', 'simple',
3035 > {
3036 > 'editor.wrappingStrategy': {
3037 > enumDescriptions: [
3038 > nls.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."),
3039 > nls.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.")
3040 > ],
3041 > type: 'string',
3042 > enum: ['simple', 'advanced'],
3043 > default: 'simple',
3044 > description: nls.localize('wrappingStrategy', "Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")
3045 > }
3046 > }
3047 > );
3048 > }
3049 >
3050 > public validate(input: unknown): 'simple' | 'advanced' {
3051 return stringSet<'simple' | 'advanced'>(input, 'simple', ['simple', 'advanced']);
3052 }
3054 > public override compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: 'simple' | 'advanced'): 'simple' | 'advanced' {
3055 const accessibilitySupport = options.get(EditorOption.accessibilitySupport);
3056 if (accessibilitySupport === AccessibilitySupport.Enabled) {
3061 return value;
3062 }
3063 > } editorOptions.ts
3064 > //#endregion
3065 >
3066 > //#region lightbulb
3067 >
3068 > export enum ShowLightbulbIconMode {
3069 > Off = 'off',
3070 > OnCode = 'onCode',
3071 > On = 'on'
3072 > }
3073 >
3074 > /**
3075 > * Configuration options for editor lightbulb
3076 > */
3077 > export interface IEditorLightbulbOptions {
3078 > /**
3079 > * Enable the lightbulb code action.
3080 > * The three possible values are `off`, `on` and `onCode` and the default is `onCode`.
3081 > * `off` disables the code action menu.
3082 > * `on` shows the code action menu on code and on empty lines.
3083 > * `onCode` shows the code action menu on code only.
3084 > */
3085 > enabled?: ShowLightbulbIconMode;
3086 > }
3087 >
3088 > /**
3089 > * @internal
3090 > */
3091 > export type EditorLightbulbOptions = Readonly<Required<IEditorLightbulbOptions>>;
3092 >
3093 > class EditorLightbulb extends BaseEditorOption<EditorOption.lightbulb, IEditorLightbulbOptions, EditorLightbulbOptions> {
3094 >
3095 > constructor() {
3096 > const defaults: EditorLightbulbOptions = { enabled: ShowLightbulbIconMode.OnCode };
3097 > super(
3098 > EditorOption.lightbulb, 'lightbulb', defaults,
3099 > {
3100 > 'editor.lightbulb.enabled': {
3101 > type: 'string',
3102 > enum: [ShowLightbulbIconMode.Off, ShowLightbulbIconMode.OnCode, ShowLightbulbIconMode.On],
3103 > default: defaults.enabled,
3104 > enumDescriptions: [
3105 > nls.localize('editor.lightbulb.enabled.off', 'Disable the code action menu.'),
3106 > nls.localize('editor.lightbulb.enabled.onCode', 'Show the code action menu when the cursor is on lines with code.'),
3107 > nls.localize('editor.lightbulb.enabled.on', 'Show the code action menu when the cursor is on lines with code or on empty lines.'),
3108 > ],
3109 > description: nls.localize('enabled', "Enables the Code Action lightbulb in the editor.")
3110 > }
3111 > }
3112 > );
3113 > }
3114 >
3115 > public validate(_input: unknown): EditorLightbulbOptions {
3116 if (!_input || typeof _input !== 'object') {
3117 return this.defaultValue;
3122 };
3123 }
3124 > } editorOptions.ts
3125 >
3126 > //#endregion
3127 >
3128 > //#region stickyScroll
3129 >
3130 > export interface IEditorStickyScrollOptions {
3131 > /**
3132 > * Enable the sticky scroll
3133 > */
3134 > enabled?: boolean;
3135 > /**
3136 > * Maximum number of sticky lines to show
3137 > */
3138 > maxLineCount?: number;
3139 > /**
3140 > * Model to choose for sticky scroll by default
3141 > */
3142 > defaultModel?: 'outlineModel' | 'foldingProviderModel' | 'indentationModel';
3143 > /**
3144 > * Define whether to scroll sticky scroll with editor horizontal scrollbae
3145 > */
3146 > scrollWithEditor?: boolean;
3147 > }
3148 >
3149 > /**
3150 > * @internal
3151 > */
3152 > export type EditorStickyScrollOptions = Readonly<Required<IEditorStickyScrollOptions>>;
3153 >
3154 > class EditorStickyScroll extends BaseEditorOption<EditorOption.stickyScroll, IEditorStickyScrollOptions, EditorStickyScrollOptions> {
3155 >
3156 > constructor() {
3157 > const defaults: EditorStickyScrollOptions = { enabled: true, maxLineCount: 5, defaultModel: 'outlineModel', scrollWithEditor: true };
3158 > super(
3159 > EditorOption.stickyScroll, 'stickyScroll', defaults,
3160 > {
3161 > 'editor.stickyScroll.enabled': {
3162 > type: 'boolean',
3163 > default: defaults.enabled,
3164 > description: nls.localize('editor.stickyScroll.enabled', "Shows the nested current scopes during the scroll at the top of the editor.")
3165 > },
3166 > 'editor.stickyScroll.maxLineCount': {
3167 > type: 'number',
3168 > default: defaults.maxLineCount,
3169 > minimum: 1,
3170 > maximum: 20,
3171 > description: nls.localize('editor.stickyScroll.maxLineCount', "Defines the maximum number of sticky lines to show.")
3172 > },
3173 > 'editor.stickyScroll.defaultModel': {
3174 > type: 'string',
3175 > enum: ['outlineModel', 'foldingProviderModel', 'indentationModel'],
3176 > default: defaults.defaultModel,
3177 > description: 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.")
3178 > },
3179 > 'editor.stickyScroll.scrollWithEditor': {
3180 > type: 'boolean',
3181 > default: defaults.scrollWithEditor,
3182 > description: nls.localize('editor.stickyScroll.scrollWithEditor', "Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")
3183 > },
3184 > }
3185 > );
3186 > }
3187 >
3188 > public validate(_input: unknown): EditorStickyScrollOptions {
3189 if (!_input || typeof _input !== 'object') {
3190 return this.defaultValue;
3198 };
3199 }
3200 > } editorOptions.ts
3201 >
3202 > //#endregion
3203 >
3204 > //#region inlayHints
3205 >
3206 > /**
3207 > * Configuration options for editor inlayHints
3208 > */
3209 > export interface IEditorInlayHintsOptions {
3210 > /**
3211 > * Enable the inline hints.
3212 > * Defaults to true.
3213 > */
3214 > enabled?: 'on' | 'off' | 'offUnlessPressed' | 'onUnlessPressed';
3215 >
3216 > /**
3217 > * Font size of inline hints.
3218 > * Default to 90% of the editor font size.
3219 > */
3220 > fontSize?: number;
3221 >
3222 > /**
3223 > * Font family of inline hints.
3224 > * Defaults to editor font family.
3225 > */
3226 > fontFamily?: string;
3227 >
3228 > /**
3229 > * Enables the padding around the inlay hint.
3230 > * Defaults to false.
3231 > */
3232 > padding?: boolean;
3233 >
3234 > /**
3235 > * Maximum length for inlay hints per line
3236 > * Set to 0 to have an unlimited length.
3237 > */
3238 > maximumLength?: number;
3239 > }
3240 >
3241 > /**
3242 > * @internal
3243 > */
3244 > export type EditorInlayHintsOptions = Readonly<Required<IEditorInlayHintsOptions>>;
3245 >
3246 > class EditorInlayHints extends BaseEditorOption<EditorOption.inlayHints, IEditorInlayHintsOptions, EditorInlayHintsOptions> {
3247 >
3248 > constructor() {
3249 > const defaults: EditorInlayHintsOptions = { enabled: 'on', fontSize: 0, fontFamily: '', padding: false, maximumLength: 43 };
3250 > super(
3251 > EditorOption.inlayHints, 'inlayHints', defaults,
3252 > {
3253 > 'editor.inlayHints.enabled': {
3254 > type: 'string',
3255 > default: defaults.enabled,
3256 > description: nls.localize('inlayHints.enable', "Enables the inlay hints in the editor."),
3257 > enum: ['on', 'onUnlessPressed', 'offUnlessPressed', 'off'],
3258 > markdownEnumDescriptions: [
3259 > nls.localize('editor.inlayHints.on', "Inlay hints are enabled"),
3260 > nls.localize('editor.inlayHints.onUnlessPressed', "Inlay hints are showing by default and hide when holding {0}", platform.isMacintosh ? `Ctrl+Option` : `Ctrl+Alt`),
3261 > nls.localize('editor.inlayHints.offUnlessPressed', "Inlay hints are hidden by default and show when holding {0}", platform.isMacintosh ? `Ctrl+Option` : `Ctrl+Alt`),
3262 > nls.localize('editor.inlayHints.off', "Inlay hints are disabled"),
3263 > ],
3264 > },
3265 > 'editor.inlayHints.fontSize': {
3266 > type: 'number',
3267 > default: defaults.fontSize,
3268 > markdownDescription: 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`')
3269 > },
3270 > 'editor.inlayHints.fontFamily': {
3271 > type: 'string',
3272 > default: defaults.fontFamily,
3273 > markdownDescription: nls.localize('inlayHints.fontFamily', "Controls font family of inlay hints in the editor. When set to empty, the {0} is used.", '`#editor.fontFamily#`')
3274 > },
3275 > 'editor.inlayHints.padding': {
3276 > type: 'boolean',
3277 > default: defaults.padding,
3278 > description: nls.localize('inlayHints.padding', "Enables the padding around the inlay hints in the editor.")
3279 > },
3280 > 'editor.inlayHints.maximumLength': {
3281 > type: 'number',
3282 > default: defaults.maximumLength,
3283 > markdownDescription: 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")
3284 > }
3285 > }
3286 > );
3287 > }
3288 >
3289 > public validate(_input: unknown): EditorInlayHintsOptions {
3290 if (!_input || typeof _input !== 'object') {
3291 return this.defaultValue;
3303 };
3304 }
3305 > } editorOptions.ts
3306 >
3307 > //#endregion
3308 >
3309 > //#region lineDecorationsWidth
3310 >
3311 > class EditorLineDecorationsWidth extends BaseEditorOption<EditorOption.lineDecorationsWidth, number | string, number> {
3312 >
3313 > constructor() {
3314 > super(EditorOption.lineDecorationsWidth, 'lineDecorationsWidth', 10);
3315 > }
3316 >
3317 > public validate(input: unknown): number {
3318 if (typeof input === 'string' && /^\d+(\.\d+)?ch$/.test(input)) {
3319 const multiple = parseFloat(input.substring(0, input.length - 2));
3323 }
3324 }
3326 > public override compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: number): number {
3327 if (value < 0) {
3328 // negative numbers signal a multiple
3332 }
3333 }
3334 > } editorOptions.ts
3335 >
3336 > //#endregion
3337 >
3338 > //#region lineHeight
3339 >
3340 > class EditorLineHeight extends EditorFloatOption<EditorOption.lineHeight> {
3341 >
3342 > constructor() {
3343 > super(
3344 > EditorOption.lineHeight, 'lineHeight',
3345 > EDITOR_FONT_DEFAULTS.lineHeight,
3346 > x => EditorFloatOption.clamp(x, 0, 150),
3347 > { 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.") },
3348 > 0,
3349 > 150
3350 > );
3351 > }
3352 >
3353 > public override compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: number): number {
3354 // The lineHeight is computed from the fontSize if it is 0.
3355 // Moreover, the final lineHeight respects the editor zoom level.
3357 return env.fontInfo.lineHeight;
3358 }
3359 > } editorOptions.ts
3360 >
3361 > //#endregion
3362 >
3363 > //#region minimap
3364 >
3365 > /**
3366 > * Configuration options for editor minimap
3367 > */
3368 > export interface IEditorMinimapOptions {
3369 > /**
3370 > * Enable the rendering of the minimap.
3371 > * Defaults to true.
3372 > */
3373 > enabled?: boolean;
3374 > /**
3375 > * Control the rendering of minimap.
3376 > */
3377 > autohide?: 'none' | 'mouseover' | 'scroll';
3378 > /**
3379 > * Control the side of the minimap in editor.
3380 > * Defaults to 'right'.
3381 > */
3382 > side?: 'right' | 'left';
3383 > /**
3384 > * Control the minimap rendering mode.
3385 > * Defaults to 'actual'.
3386 > */
3387 > size?: 'proportional' | 'fill' | 'fit';
3388 > /**
3389 > * Control the rendering of the minimap slider.
3390 > * Defaults to 'mouseover'.
3391 > */
3392 > showSlider?: 'always' | 'mouseover';
3393 > /**
3394 > * Render the actual text on a line (as opposed to color blocks).
3395 > * Defaults to true.
3396 > */
3397 > renderCharacters?: boolean;
3398 > /**
3399 > * Limit the width of the minimap to render at most a certain number of columns.
3400 > * Defaults to 120.
3401 > */
3402 > maxColumn?: number;
3403 > /**
3404 > * Relative size of the font in the minimap. Defaults to 1.
3405 > */
3406 > scale?: number;
3407 > /**
3408 > * Whether to show named regions as section headers. Defaults to true.
3409 > */
3410 > showRegionSectionHeaders?: boolean;
3411 > /**
3412 > * Whether to show MARK: comments as section headers. Defaults to true.
3413 > */
3414 > showMarkSectionHeaders?: boolean;
3415 > /**
3416 > * When specified, is used to create a custom section header parser regexp.
3417 > * Must contain a match group named 'label' (written as (?<label>.+)) that encapsulates the section header.
3418 > * Optionally can include another match group named 'separator'.
3419 > * To match multi-line headers like:
3420 > * // ==========
3421 > * // My Section
3422 > * // ==========
3423 > * Use a pattern like: ^={3,}\n^\/\/ *(?<label>[^\n]*?)\n^={3,}$
3424 > */
3425 > markSectionHeaderRegex?: string;
3426 > /**
3427 > * Font size of section headers. Defaults to 9.
3428 > */
3429 > sectionHeaderFontSize?: number;
3430 > /**
3431 > * Spacing between the section header characters (in CSS px). Defaults to 1.
3432 > */
3433 > sectionHeaderLetterSpacing?: number;
3434 > }
3435 >
3436 > /**
3437 > * @internal
3438 > */
3439 > export type EditorMinimapOptions = Readonly<Required<IEditorMinimapOptions>>;
3440 >
3441 > class EditorMinimap extends BaseEditorOption<EditorOption.minimap, IEditorMinimapOptions, EditorMinimapOptions> {
3442 >
3443 > constructor() {
3444 > const defaults: EditorMinimapOptions = {
3445 > enabled: true,
3446 > size: 'proportional',
3447 > side: 'right',
3448 > showSlider: 'mouseover',
3449 > autohide: 'none',
3450 > renderCharacters: true,
3451 > maxColumn: 120,
3452 > scale: 1,
3453 > showRegionSectionHeaders: true,
3454 > showMarkSectionHeaders: true,
3455 > markSectionHeaderRegex: '\\bMARK:\\s*(?<separator>\-?)\\s*(?<label>.*)$',
3456 > sectionHeaderFontSize: 9,
3457 > sectionHeaderLetterSpacing: 1,
3458 > };
3459 > super(
3460 > EditorOption.minimap, 'minimap', defaults,
3461 > {
3462 > 'editor.minimap.enabled': {
3463 > type: 'boolean',
3464 > default: defaults.enabled,
3465 > description: nls.localize('minimap.enabled', "Controls whether the minimap is shown.")
3466 > },
3467 > 'editor.minimap.autohide': {
3468 > type: 'string',
3469 > enum: ['none', 'mouseover', 'scroll'],
3470 > enumDescriptions: [
3471 > nls.localize('minimap.autohide.none', "The minimap is always shown."),
3472 > nls.localize('minimap.autohide.mouseover', "The minimap is hidden when mouse is not over the minimap and shown when mouse is over the minimap."),
3473 > nls.localize('minimap.autohide.scroll', "The minimap is only shown when the editor is scrolled"),
3474 > ],
3475 > default: defaults.autohide,
3476 > description: nls.localize('minimap.autohide', "Controls whether the minimap is hidden automatically.")
3477 > },
3478 > 'editor.minimap.size': {
3479 > type: 'string',
3480 > enum: ['proportional', 'fill', 'fit'],
3481 > enumDescriptions: [
3482 > nls.localize('minimap.size.proportional', "The minimap has the same size as the editor contents (and might scroll)."),
3483 > nls.localize('minimap.size.fill', "The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),
3484 > nls.localize('minimap.size.fit', "The minimap will shrink as necessary to never be larger than the editor (no scrolling)."),
3485 > ],
3486 > default: defaults.size,
3487 > description: nls.localize('minimap.size', "Controls the size of the minimap.")
3488 > },
3489 > 'editor.minimap.side': {
3490 > type: 'string',
3491 > enum: ['left', 'right'],
3492 > default: defaults.side,
3493 > description: nls.localize('minimap.side', "Controls the side where to render the minimap.")
3494 > },
3495 > 'editor.minimap.showSlider': {
3496 > type: 'string',
3497 > enum: ['always', 'mouseover'],
3498 > default: defaults.showSlider,
3499 > description: nls.localize('minimap.showSlider', "Controls when the minimap slider is shown.")
3500 > },
3501 > 'editor.minimap.scale': {
3502 > type: 'number',
3503 > default: defaults.scale,
3504 > minimum: 1,
3505 > maximum: 3,
3506 > enum: [1, 2, 3],
3507 > description: nls.localize('minimap.scale', "Scale of content drawn in the minimap: 1, 2 or 3.")
3508 > },
3509 > 'editor.minimap.renderCharacters': {
3510 > type: 'boolean',
3511 > default: defaults.renderCharacters,
3512 > description: nls.localize('minimap.renderCharacters', "Render the actual characters on a line as opposed to color blocks.")
3513 > },
3514 > 'editor.minimap.maxColumn': {
3515 > type: 'number',
3516 > default: defaults.maxColumn,
3517 > description: nls.localize('minimap.maxColumn', "Limit the width of the minimap to render at most a certain number of columns.")
3518 > },
3519 > 'editor.minimap.showRegionSectionHeaders': {
3520 > type: 'boolean',
3521 > default: defaults.showRegionSectionHeaders,
3522 > description: nls.localize('minimap.showRegionSectionHeaders', "Controls whether named regions are shown as section headers in the minimap.")
3523 > },
3524 > 'editor.minimap.showMarkSectionHeaders': {
3525 > type: 'boolean',
3526 > default: defaults.showMarkSectionHeaders,
3527 > description: nls.localize('minimap.showMarkSectionHeaders', "Controls whether MARK: comments are shown as section headers in the minimap.")
3528 > },
3529 > 'editor.minimap.markSectionHeaderRegex': {
3530 > type: 'string',
3531 > default: defaults.markSectionHeaderRegex,
3532 > description: 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."),
3533 > },
3534 > 'editor.minimap.sectionHeaderFontSize': {
3535 > type: 'number',
3536 > default: defaults.sectionHeaderFontSize,
3537 > description: nls.localize('minimap.sectionHeaderFontSize', "Controls the font size of section headers in the minimap.")
3538 > },
3539 > 'editor.minimap.sectionHeaderLetterSpacing': {
3540 > type: 'number',
3541 > default: defaults.sectionHeaderLetterSpacing,
3542 > description: 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.")
3543 > }
3544 > }
3545 > );
3546 > }
3547 >
3548 > public validate(_input: unknown): EditorMinimapOptions {
3549 if (!_input || typeof _input !== 'object') {
3550 return this.defaultValue;
3578 };
3579 }
3580 > } editorOptions.ts
3581 >
3582 > //#endregion
3583 >
3584 > //#region multiCursorModifier
3585 >
3586 function _multiCursorModifierFromString(multiCursorModifier: 'ctrlCmd' | 'alt'): 'altKey' | 'metaKey' | 'ctrlKey' {
3587 if (multiCursorModifier === 'ctrlCmd') {
3590 return 'altKey';
3591 }
3593 > //#endregion
3594 >
3595 > //#region padding
3596 >
3597 > /**
3598 > * Configuration options for editor padding
3599 > */
3600 > export interface IEditorPaddingOptions {
3601 > /**
3602 > * Spacing between top edge of editor and first line.
3603 > */
3604 > top?: number;
3605 > /**
3606 > * Spacing between bottom edge of editor and last line.
3607 > */
3608 > bottom?: number;
3609 > }
3610 >
3611 > /**
3612 > * @internal
3613 > */
3614 > export type InternalEditorPaddingOptions = Readonly<Required<IEditorPaddingOptions>>;
3615 >
3616 > class EditorPadding extends BaseEditorOption<EditorOption.padding, IEditorPaddingOptions, InternalEditorPaddingOptions> {
3617 >
3618 > constructor() {
3619 > super(
3620 > EditorOption.padding, 'padding', { top: 0, bottom: 0 },
3621 > {
3622 > 'editor.padding.top': {
3623 > type: 'number',
3624 > default: 0,
3625 > minimum: 0,
3626 > maximum: 1000,
3627 > description: nls.localize('padding.top', "Controls the amount of space between the top edge of the editor and the first line.")
3628 > },
3629 > 'editor.padding.bottom': {
3630 > type: 'number',
3631 > default: 0,
3632 > minimum: 0,
3633 > maximum: 1000,
3634 > description: nls.localize('padding.bottom', "Controls the amount of space between the bottom edge of the editor and the last line.")
3635 > }
3636 > }
3637 > );
3638 > }
3639 >
3640 > public validate(_input: unknown): InternalEditorPaddingOptions {
3641 if (!_input || typeof _input !== 'object') {
3642 return this.defaultValue;
3649 };
3650 }
3651 > } editorOptions.ts
3652 > //#endregion
3653 >
3654 > //#region parameterHints
3655 >
3656 > /**
3657 > * Configuration options for parameter hints
3658 > */
3659 > export interface IEditorParameterHintOptions {
3660 > /**
3661 > * Enable parameter hints.
3662 > * Defaults to true.
3663 > */
3664 > enabled?: boolean;
3665 > /**
3666 > * Enable cycling of parameter hints.
3667 > * Defaults to false.
3668 > */
3669 > cycle?: boolean;
3670 > }
3671 >
3672 > /**
3673 > * @internal
3674 > */
3675 > export type InternalParameterHintOptions = Readonly<Required<IEditorParameterHintOptions>>;
3676 >
3677 > class EditorParameterHints extends BaseEditorOption<EditorOption.parameterHints, IEditorParameterHintOptions, InternalParameterHintOptions> {
3678 >
3679 > constructor() {
3680 > const defaults: InternalParameterHintOptions = {
3681 > enabled: true,
3682 > cycle: true
3683 > };
3684 > super(
3685 > EditorOption.parameterHints, 'parameterHints', defaults,
3686 > {
3687 > 'editor.parameterHints.enabled': {
3688 > type: 'boolean',
3689 > default: defaults.enabled,
3690 > description: nls.localize('parameterHints.enabled', "Enables a pop-up that shows parameter documentation and type information as you type.")
3691 > },
3692 > 'editor.parameterHints.cycle': {
3693 > type: 'boolean',
3694 > default: defaults.cycle,
3695 > description: nls.localize('parameterHints.cycle', "Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")
3696 > },
3697 > }
3698 > );
3699 > }
3700 >
3701 > public validate(_input: unknown): InternalParameterHintOptions {
3702 if (!_input || typeof _input !== 'object') {
3703 return this.defaultValue;
3709 };
3710 }
3711 > } editorOptions.ts
3712 >
3713 > //#endregion
3714 >
3715 > //#region pixelRatio
3716 >
3717 > class EditorPixelRatio extends ComputedEditorOption<EditorOption.pixelRatio, number> {
3718 >
3719 > constructor() {
3720 > super(EditorOption.pixelRatio, 1);
3721 > }
3722 >
3723 > public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, _: number): number {
3724 return env.pixelRatio;
3725 }
3726 > } editorOptions.ts
3727 >
3728 > //#endregion
3729 >
3730 > //#region
3731 >
3732 > class PlaceholderOption extends BaseEditorOption<EditorOption.placeholder, string | undefined, string | undefined> {
3733 > constructor() {
3734 > super(EditorOption.placeholder, 'placeholder', undefined);
3735 > }
3736 >
3737 > public validate(input: unknown): string | undefined {
3738 if (typeof input === 'undefined') {
3739 return this.defaultValue;
3744 return this.defaultValue;
3745 }
3746 > } editorOptions.ts
3747 > //#endregion
3748 >
3749 > //#region quickSuggestions
3750 >
3751 > export type QuickSuggestionsValue = 'on' | 'inline' | 'off' | 'offWhenInlineCompletions';
3752 >
3753 > /**
3754 > * Configuration options for quick suggestions
3755 > */
3756 > export interface IQuickSuggestionsOptions {
3757 > other?: boolean | QuickSuggestionsValue;
3758 > comments?: boolean | QuickSuggestionsValue;
3759 > strings?: boolean | QuickSuggestionsValue;
3760 > }
3761 >
3762 > export interface InternalQuickSuggestionsOptions {
3763 > readonly other: QuickSuggestionsValue;
3764 > readonly comments: QuickSuggestionsValue;
3765 > readonly strings: QuickSuggestionsValue;
3766 > }
3767 >
3768 > class EditorQuickSuggestions extends BaseEditorOption<EditorOption.quickSuggestions, boolean | QuickSuggestionsValue | IQuickSuggestionsOptions, InternalQuickSuggestionsOptions> {
3769 >
3770 > public override readonly defaultValue: InternalQuickSuggestionsOptions;
3771 >
3772 > constructor() {
3773 > const defaults: InternalQuickSuggestionsOptions = {
3774 > other: 'offWhenInlineCompletions',
3775 > comments: 'off',
3776 > strings: 'off'
3777 > };
3778 > const types: IJSONSchema[] = [
3779 > { type: 'boolean' },
3780 > {
3781 > type: 'string',
3782 > enum: ['on', 'inline', 'off', 'offWhenInlineCompletions'],
3783 > enumDescriptions: [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"), nls.localize('offWhenInlineCompletions', "Quick suggestions are disabled when inline completions are showing")]
3784 > }
3785 > ];
3786 > super(EditorOption.quickSuggestions, 'quickSuggestions', defaults, {
3787 > anyOf: [
3788 > { type: 'boolean' },
3789 > {
3790 > type: 'string',
3791 > enum: ['on', 'inline', 'off', 'offWhenInlineCompletions'],
3792 > enumDescriptions: [nls.localize('quickSuggestions.topLevel.on', "Quick suggestions are enabled for all token types"), nls.localize('quickSuggestions.topLevel.inline', "Quick suggestions show as ghost text for all token types"), nls.localize('quickSuggestions.topLevel.off', "Quick suggestions are disabled for all token types"), nls.localize('quickSuggestions.topLevel.offWhenInlineCompletions', "Quick suggestions are disabled for all token types when inline completions are showing")]
3793 > },
3794 > {
3795 > type: 'object',
3796 > additionalProperties: false,
3797 > properties: {
3798 > strings: {
3799 > anyOf: types,
3800 > default: defaults.strings,
3801 > description: nls.localize('quickSuggestions.strings', "Enable quick suggestions inside strings.")
3802 > },
3803 > comments: {
3804 > anyOf: types,
3805 > default: defaults.comments,
3806 > description: nls.localize('quickSuggestions.comments', "Enable quick suggestions inside comments.")
3807 > },
3808 > other: {
3809 > anyOf: types,
3810 > default: defaults.other,
3811 > description: nls.localize('quickSuggestions.other', "Enable quick suggestions outside of strings and comments.")
3812 > },
3813 > },
3814 > }
3815 > ],
3816 > default: defaults,
3817 > markdownDescription: 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#`'),
3818 > experiment: {
3819 > mode: 'auto'
3820 > }
3821 > });
3822 > this.defaultValue = defaults;
3823 > }
3824 >
3825 > public validate(input: unknown): InternalQuickSuggestionsOptions {
3826 if (typeof input === 'boolean') {
3827 // boolean -> all on/off
3867 };
3868 }
3869 > } editorOptions.ts
3870 >
3871 > //#endregion
3872 >
3873 > //#region renderLineNumbers
3874 >
3875 > export type LineNumbersType = 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string);
3876 >
3877 > export const enum RenderLineNumbersType {
3878 > Off = 0,
3879 > On = 1,
3880 > Relative = 2,
3881 > Interval = 3,
3882 > Custom = 4
3883 > }
3884 >
3885 > export interface InternalEditorRenderLineNumbersOptions {
3886 > readonly renderType: RenderLineNumbersType;
3887 > readonly renderFn: ((lineNumber: number) => string) | null;
3888 > }
3889 >
3890 > class EditorRenderLineNumbersOption extends BaseEditorOption<EditorOption.lineNumbers, LineNumbersType, InternalEditorRenderLineNumbersOptions> {
3891 >
3892 > constructor() {
3893 > super(
3894 > EditorOption.lineNumbers, 'lineNumbers', { renderType: RenderLineNumbersType.On, renderFn: null },
3895 > {
3896 > type: 'string',
3897 > enum: ['off', 'on', 'relative', 'interval'],
3898 > enumDescriptions: [
3899 > nls.localize('lineNumbers.off', "Line numbers are not rendered."),
3900 > nls.localize('lineNumbers.on', "Line numbers are rendered as absolute number."),
3901 > nls.localize('lineNumbers.relative', "Line numbers are rendered as distance in lines to cursor position."),
3902 > nls.localize('lineNumbers.interval', "Line numbers are rendered every 10 lines.")
3903 > ],
3904 > default: 'on',
3905 > description: nls.localize('lineNumbers', "Controls the display of line numbers.")
3906 > }
3907 > );
3908 > }
3909 >
3910 > public validate(lineNumbers: unknown): InternalEditorRenderLineNumbersOptions {
3911 let renderType: RenderLineNumbersType = this.defaultValue.renderType;
3912 let renderFn: ((lineNumber: number) => string) | null = this.defaultValue.renderFn;
3932 };
3933 }
3934 > } editorOptions.ts
3935 >
3936 > //#endregion
3937 >
3938 > //#region renderValidationDecorations
3939 >
3940 > /**
3941 > * @internal
3942 > */
3943 > export function filterValidationDecorations(options: IComputedEditorOptions): boolean {
3944 const renderValidationDecorations = options.get(EditorOption.renderValidationDecorations);
3945 if (renderValidationDecorations === 'editable') {
3948 return renderValidationDecorations === 'on' ? false : true;
3949 }
3951 > //#endregion
3952 >
3953 > //#region filterFontDecorations
3954 >
3955 > /**
3956 > * @internal
3957 > */
3958 > export function filterFontDecorations(options: IComputedEditorOptions): boolean {
3959 return !options.get(EditorOption.effectiveAllowVariableFonts);
3960 }
3962 > //#endregion
3963 >
3964 > //#region rulers
3965 >
3966 > export interface IRulerOption {
3967 > readonly column: number;
3968 > readonly color: string | null;
3969 > }
3970 >
3971 > class EditorRulers extends BaseEditorOption<EditorOption.rulers, (number | IRulerOption)[], IRulerOption[]> {
3972 >
3973 > constructor() {
3974 > const defaults: IRulerOption[] = [];
3975 > const columnSchema: IJSONSchema = { type: 'number', description: nls.localize('rulers.size', "Number of monospace characters at which this editor ruler will render.") };
3976 > super(
3977 > EditorOption.rulers, 'rulers', defaults,
3978 > {
3979 > type: 'array',
3980 > items: {
3981 > anyOf: [
3982 > columnSchema,
3983 > {
3984 > type: [
3985 > 'object'
3986 > ],
3987 > properties: {
3988 > column: columnSchema,
3989 > color: {
3990 > type: 'string',
3991 > description: nls.localize('rulers.color', "Color of this editor ruler."),
3992 > format: 'color-hex'
3993 > }
3994 > }
3995 > }
3996 > ]
3997 > },
3998 > default: defaults,
3999 > description: 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.")
4000 > }
4001 > );
4002 > }
4003 >
4004 > public validate(input: unknown): IRulerOption[] {
4005 if (Array.isArray(input)) {
4006 const rulers: IRulerOption[] = [];
4024 return this.defaultValue;
4025 }
4026 > } editorOptions.ts
4027 >
4028 > //#endregion
4029 >
4030 > //#region readonly
4031 >
4032 > /**
4033 > * Configuration options for readonly message
4034 > */
4035 > class ReadonlyMessage extends BaseEditorOption<EditorOption.readOnlyMessage, IMarkdownString | undefined, IMarkdownString | undefined> {
4036 > constructor() {
4037 > const defaults = undefined;
4038 >
4039 > super(
4040 > EditorOption.readOnlyMessage, 'readOnlyMessage', defaults
4041 > );
4042 > }
4043 >
4044 > public validate(_input: unknown): IMarkdownString | undefined {
4045 if (!_input || typeof _input !== 'object') {
4046 return this.defaultValue;
4048 return _input as IMarkdownString;
4049 }
4050 > } editorOptions.ts
4051 >
4052 > //#endregion
4053 >
4054 > //#region scrollbar
4055 >
4056 > /**
4057 > * Configuration options for editor scrollbars
4058 > */
4059 > export interface IEditorScrollbarOptions {
4060 > /**
4061 > * The size of arrows (if displayed).
4062 > * Defaults to 11.
4063 > * **NOTE**: This option cannot be updated using `updateOptions()`
4064 > */
4065 > arrowSize?: number;
4066 > /**
4067 > * Render vertical scrollbar.
4068 > * Defaults to 'auto'.
4069 > */
4070 > vertical?: 'auto' | 'visible' | 'hidden';
4071 > /**
4072 > * Render horizontal scrollbar.
4073 > * Defaults to 'auto'.
4074 > */
4075 > horizontal?: 'auto' | 'visible' | 'hidden';
4076 > /**
4077 > * Cast horizontal and vertical shadows when the content is scrolled.
4078 > * Defaults to true.
4079 > * **NOTE**: This option cannot be updated using `updateOptions()`
4080 > */
4081 > useShadows?: boolean;
4082 > /**
4083 > * Render arrows at the top and bottom of the vertical scrollbar.
4084 > * Defaults to false.
4085 > * **NOTE**: This option cannot be updated using `updateOptions()`
4086 > */
4087 > verticalHasArrows?: boolean;
4088 > /**
4089 > * Render arrows at the left and right of the horizontal scrollbar.
4090 > * Defaults to false.
4091 > * **NOTE**: This option cannot be updated using `updateOptions()`
4092 > */
4093 > horizontalHasArrows?: boolean;
4094 > /**
4095 > * Listen to mouse wheel events and react to them by scrolling.
4096 > * Defaults to true.
4097 > */
4098 > handleMouseWheel?: boolean;
4099 > /**
4100 > * Always consume mouse wheel events (always call preventDefault() and stopPropagation() on the browser events).
4101 > * Defaults to true.
4102 > * **NOTE**: This option cannot be updated using `updateOptions()`
4103 > */
4104 > alwaysConsumeMouseWheel?: boolean;
4105 > /**
4106 > * Height in pixels for the horizontal scrollbar.
4107 > * Defaults to 12 (px).
4108 > */
4109 > horizontalScrollbarSize?: number;
4110 > /**
4111 > * Width in pixels for the vertical scrollbar.
4112 > * Defaults to 14 (px).
4113 > */
4114 > verticalScrollbarSize?: number;
4115 > /**
4116 > * Width in pixels for the vertical slider.
4117 > * Defaults to `verticalScrollbarSize`.
4118 > * **NOTE**: This option cannot be updated using `updateOptions()`
4119 > */
4120 > verticalSliderSize?: number;
4121 > /**
4122 > * Height in pixels for the horizontal slider.
4123 > * Defaults to `horizontalScrollbarSize`.
4124 > * **NOTE**: This option cannot be updated using `updateOptions()`
4125 > */
4126 > horizontalSliderSize?: number;
4127 > /**
4128 > * Scroll gutter clicks move by page vs jump to position.
4129 > * Defaults to false.
4130 > */
4131 > scrollByPage?: boolean;
4132 >
4133 > /**
4134 > * When set, the horizontal scrollbar will not increase content height.
4135 > * Defaults to false.
4136 > */
4137 > ignoreHorizontalScrollbarInContentHeight?: boolean;
4138 > }
4139 >
4140 > export interface InternalEditorScrollbarOptions {
4141 > readonly arrowSize: number;
4142 > readonly vertical: ScrollbarVisibility;
4143 > readonly horizontal: ScrollbarVisibility;
4144 > readonly useShadows: boolean;
4145 > readonly verticalHasArrows: boolean;
4146 > readonly horizontalHasArrows: boolean;
4147 > readonly handleMouseWheel: boolean;
4148 > readonly alwaysConsumeMouseWheel: boolean;
4149 > readonly horizontalScrollbarSize: number;
4150 > readonly horizontalSliderSize: number;
4151 > readonly verticalScrollbarSize: number;
4152 > readonly verticalSliderSize: number;
4153 > readonly scrollByPage: boolean;
4154 > readonly ignoreHorizontalScrollbarInContentHeight: boolean;
4155 > }
4156 >
4157 function _scrollbarVisibilityFromString(visibility: unknown, defaultValue: ScrollbarVisibility): ScrollbarVisibility {
4158 if (typeof visibility !== 'string') {
4165 }
4166 }
4168 > class EditorScrollbar extends BaseEditorOption<EditorOption.scrollbar, IEditorScrollbarOptions, InternalEditorScrollbarOptions> {
4169 >
4170 > constructor() {
4171 > const defaults: InternalEditorScrollbarOptions = {
4172 > vertical: ScrollbarVisibility.Auto,
4173 > horizontal: ScrollbarVisibility.Auto,
4174 > arrowSize: 11,
4175 > useShadows: true,
4176 > verticalHasArrows: false,
4177 > horizontalHasArrows: false,
4178 > horizontalScrollbarSize: 12,
4179 > horizontalSliderSize: 12,
4180 > verticalScrollbarSize: 14,
4181 > verticalSliderSize: 14,
4182 > handleMouseWheel: true,
4183 > alwaysConsumeMouseWheel: true,
4184 > scrollByPage: false,
4185 > ignoreHorizontalScrollbarInContentHeight: false,
4186 > };
4187 > super(
4188 > EditorOption.scrollbar, 'scrollbar', defaults,
4189 > {
4190 > 'editor.scrollbar.vertical': {
4191 > type: 'string',
4192 > enum: ['auto', 'visible', 'hidden'],
4193 > enumDescriptions: [
4194 > nls.localize('scrollbar.vertical.auto', "The vertical scrollbar will be visible only when necessary."),
4195 > nls.localize('scrollbar.vertical.visible', "The vertical scrollbar will always be visible."),
4196 > nls.localize('scrollbar.vertical.fit', "The vertical scrollbar will always be hidden."),
4197 > ],
4198 > default: 'auto',
4199 > description: nls.localize('scrollbar.vertical', "Controls the visibility of the vertical scrollbar.")
4200 > },
4201 > 'editor.scrollbar.horizontal': {
4202 > type: 'string',
4203 > enum: ['auto', 'visible', 'hidden'],
4204 > enumDescriptions: [
4205 > nls.localize('scrollbar.horizontal.auto', "The horizontal scrollbar will be visible only when necessary."),
4206 > nls.localize('scrollbar.horizontal.visible', "The horizontal scrollbar will always be visible."),
4207 > nls.localize('scrollbar.horizontal.fit', "The horizontal scrollbar will always be hidden."),
4208 > ],
4209 > default: 'auto',
4210 > description: nls.localize('scrollbar.horizontal', "Controls the visibility of the horizontal scrollbar.")
4211 > },
4212 > 'editor.scrollbar.verticalScrollbarSize': {
4213 > type: 'number',
4214 > default: defaults.verticalScrollbarSize,
4215 > description: nls.localize('scrollbar.verticalScrollbarSize', "The width of the vertical scrollbar.")
4216 > },
4217 > 'editor.scrollbar.horizontalScrollbarSize': {
4218 > type: 'number',
4219 > default: defaults.horizontalScrollbarSize,
4220 > description: nls.localize('scrollbar.horizontalScrollbarSize', "The height of the horizontal scrollbar.")
4221 > },
4222 > 'editor.scrollbar.scrollByPage': {
4223 > type: 'boolean',
4224 > default: defaults.scrollByPage,
4225 > description: nls.localize('scrollbar.scrollByPage', "Controls whether clicks scroll by page or jump to click position.")
4226 > },
4227 > 'editor.scrollbar.ignoreHorizontalScrollbarInContentHeight': {
4228 > type: 'boolean',
4229 > default: defaults.ignoreHorizontalScrollbarInContentHeight,
4230 > description: nls.localize('scrollbar.ignoreHorizontalScrollbarInContentHeight', "When set, the horizontal scrollbar will not increase the size of the editor's content.")
4231 > }
4232 > }
4233 > );
4234 > }
4235 >
4236 > public validate(_input: unknown): InternalEditorScrollbarOptions {
4237 if (!_input || typeof _input !== 'object') {
4238 return this.defaultValue;
4258 };
4259 }
4260 > } editorOptions.ts
4261 >
4262 > //#endregion
4263 >
4264 > //#region UnicodeHighlight
4265 >
4266 > export type InUntrustedWorkspace = 'inUntrustedWorkspace';
4267 >
4268 > /**
4269 > * @internal
4270 > */
4271 > export const inUntrustedWorkspace: InUntrustedWorkspace = 'inUntrustedWorkspace';
4272 >
4273 > /**
4274 > * Configuration options for unicode highlighting.
4275 > */
4276 > export interface IUnicodeHighlightOptions {
4277 >
4278 > /**
4279 > * 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.
4280 > */
4281 > nonBasicASCII?: boolean | InUntrustedWorkspace;
4282 >
4283 > /**
4284 > * Controls whether characters that just reserve space or have no width at all are highlighted.
4285 > */
4286 > invisibleCharacters?: boolean;
4287 >
4288 > /**
4289 > * Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.
4290 > */
4291 > ambiguousCharacters?: boolean;
4292 >
4293 > /**
4294 > * Controls whether characters in comments should also be subject to unicode highlighting.
4295 > */
4296 > includeComments?: boolean | InUntrustedWorkspace;
4297 >
4298 > /**
4299 > * Controls whether characters in strings should also be subject to unicode highlighting.
4300 > */
4301 > includeStrings?: boolean | InUntrustedWorkspace;
4302 >
4303 > /**
4304 > * Defines allowed characters that are not being highlighted.
4305 > */
4306 > allowedCharacters?: Record<string, true>;
4307 >
4308 > /**
4309 > * Unicode characters that are common in allowed locales are not being highlighted.
4310 > */
4311 > allowedLocales?: Record<string | '_os' | '_vscode', true>;
4312 > }
4313 >
4314 > /**
4315 > * @internal
4316 > */
4317 > export type InternalUnicodeHighlightOptions = Required<Readonly<IUnicodeHighlightOptions>>;
4318 >
4319 > /**
4320 > * @internal
4321 > */
4322 > export const unicodeHighlightConfigKeys = {
4323 > allowedCharacters: 'editor.unicodeHighlight.allowedCharacters',
4324 > invisibleCharacters: 'editor.unicodeHighlight.invisibleCharacters',
4325 > nonBasicASCII: 'editor.unicodeHighlight.nonBasicASCII',
4326 > ambiguousCharacters: 'editor.unicodeHighlight.ambiguousCharacters',
4327 > includeComments: 'editor.unicodeHighlight.includeComments',
4328 > includeStrings: 'editor.unicodeHighlight.includeStrings',
4329 > allowedLocales: 'editor.unicodeHighlight.allowedLocales',
4330 > };
4331 >
4332 > class UnicodeHighlight extends BaseEditorOption<EditorOption.unicodeHighlighting, IUnicodeHighlightOptions, InternalUnicodeHighlightOptions> {
4333 > constructor() {
4334 > const defaults: InternalUnicodeHighlightOptions = {
4335 > nonBasicASCII: inUntrustedWorkspace,
4336 > invisibleCharacters: true,
4337 > ambiguousCharacters: true,
4338 > includeComments: inUntrustedWorkspace,
4339 > includeStrings: true,
4340 > allowedCharacters: {},
4341 > allowedLocales: { _os: true, _vscode: true },
4342 > };
4343 >
4344 > super(
4345 > EditorOption.unicodeHighlighting, 'unicodeHighlight', defaults,
4346 > {
4347 > [unicodeHighlightConfigKeys.nonBasicASCII]: {
4348 > restricted: true,
4349 > type: ['boolean', 'string'],
4350 > enum: [true, false, inUntrustedWorkspace],
4351 > default: defaults.nonBasicASCII,
4352 > description: 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.")
4353 > },
4354 > [unicodeHighlightConfigKeys.invisibleCharacters]: {
4355 > restricted: true,
4356 > type: 'boolean',
4357 > default: defaults.invisibleCharacters,
4358 > description: nls.localize('unicodeHighlight.invisibleCharacters', "Controls whether characters that just reserve space or have no width at all are highlighted.")
4359 > },
4360 > [unicodeHighlightConfigKeys.ambiguousCharacters]: {
4361 > restricted: true,
4362 > type: 'boolean',
4363 > default: defaults.ambiguousCharacters,
4364 > description: 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.")
4365 > },
4366 > [unicodeHighlightConfigKeys.includeComments]: {
4367 > restricted: true,
4368 > type: ['boolean', 'string'],
4369 > enum: [true, false, inUntrustedWorkspace],
4370 > default: defaults.includeComments,
4371 > description: nls.localize('unicodeHighlight.includeComments', "Controls whether characters in comments should also be subject to Unicode highlighting.")
4372 > },
4373 > [unicodeHighlightConfigKeys.includeStrings]: {
4374 > restricted: true,
4375 > type: ['boolean', 'string'],
4376 > enum: [true, false, inUntrustedWorkspace],
4377 > default: defaults.includeStrings,
4378 > description: nls.localize('unicodeHighlight.includeStrings', "Controls whether characters in strings should also be subject to Unicode highlighting.")
4379 > },
4380 > [unicodeHighlightConfigKeys.allowedCharacters]: {
4381 > restricted: true,
4382 > type: 'object',
4383 > default: defaults.allowedCharacters,
4384 > description: nls.localize('unicodeHighlight.allowedCharacters', "Defines allowed characters that are not being highlighted."),
4385 > additionalProperties: {
4386 > type: 'boolean'
4387 > }
4388 > },
4389 > [unicodeHighlightConfigKeys.allowedLocales]: {
4390 > restricted: true,
4391 > type: 'object',
4392 > additionalProperties: {
4393 > type: 'boolean'
4394 > },
4395 > default: defaults.allowedLocales,
4396 > description: nls.localize('unicodeHighlight.allowedLocales', "Unicode characters that are common in allowed locales are not being highlighted.")
4397 > },
4398 > }
4399 > );
4400 > }
4401 >
4402 > public override applyUpdate(value: Required<Readonly<IUnicodeHighlightOptions>> | undefined, update: Required<Readonly<IUnicodeHighlightOptions>>): ApplyUpdateResult<Required<Readonly<IUnicodeHighlightOptions>>> {
4403 let didChange = false;
4404 if (update.allowedCharacters && value) {
4423 return result;
4424 }
4426 > public validate(_input: unknown): InternalUnicodeHighlightOptions {
4427 if (!_input || typeof _input !== 'object') {
4428 return this.defaultValue;
4439 };
4440 }
4442 > private validateBooleanMap(map: unknown, defaultValue: Record<string, true>): Record<string, true> {
4443 if ((typeof map !== 'object') || !map) {
4444 return defaultValue;
4452 return result;
4453 }
4454 > } editorOptions.ts
4455 >
4456 > //#endregion
4457 >
4458 > //#region inlineSuggest
4459 >
4460 > export interface IInlineSuggestOptions {
4461 > /**
4462 > * Enable or disable the rendering of automatic inline completions.
4463 > */
4464 > enabled?: boolean;
4465 >
4466 > /**
4467 > * Configures the mode.
4468 > * Use `prefix` to only show ghost text if the text to replace is a prefix of the suggestion text.
4469 > * Use `subword` to only show ghost text if the replace text is a subword of the suggestion text.
4470 > * 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.
4471 > * Defaults to `prefix`.
4472 > */
4473 > mode?: 'prefix' | 'subword' | 'subwordSmart';
4474 >
4475 > showToolbar?: 'always' | 'onHover' | 'never';
4476 >
4477 > syntaxHighlightingEnabled?: boolean;
4478 >
4479 > suppressSuggestions?: boolean;
4480 >
4481 > minShowDelay?: number;
4482 > suppressInSnippetMode?: boolean;
4483 > /**
4484 > * Does not clear active inline suggestions when the editor loses focus.
4485 > */
4486 > keepOnBlur?: boolean;
4487 >
4488 > /**
4489 > * Font family for inline suggestions.
4490 > */
4491 > fontFamily?: string | 'default';
4492 >
4493 > edits?: {
4494 > allowCodeShifting?: 'always' | 'horizontal' | 'never';
4495 >
4496 > renderSideBySide?: 'never' | 'auto';
4497 >
4498 > showCollapsed?: boolean;
4499 >
4500 > showLongDistanceHint?: boolean;
4501 >
4502 > /**
4503 > * Controls how many lines of surrounding context are shown above and below the target line
4504 > * in the long distance inline suggestion hint preview. `0` shows only the target line.
4505 > */
4506 > longDistanceHintContextLineCount?: number;
4507 >
4508 > /**
4509 > * @internal
4510 > */
4511 > enabled?: boolean;
4512 > };
4513 >
4514 > /**
4515 > * @internal
4516 > */
4517 > triggerCommandOnProviderChange?: boolean;
4518 >
4519 > /**
4520 > * @internal
4521 > */
4522 > experimental?: {
4523 > /**
4524 > * @internal
4525 > */
4526 > suppressInlineSuggestions?: string;
4527 >
4528 > /**
4529 > * @internal
4530 > */
4531 > emptyResponseInformation?: boolean;
4532 >
4533 > showOnSuggestConflict?: 'always' | 'never' | 'whenSuggestListIsIncomplete';
4534 > };
4535 > }
4536 >
4537 > type RequiredRecursive<T> = {
4538 > [P in keyof T]-?: T[P] extends object | undefined ? RequiredRecursive<T[P]> : T[P];
4539 > };
4540 >
4541 > /**
4542 > * @internal
4543 > */
4544 > export type InternalInlineSuggestOptions = Readonly<RequiredRecursive<IInlineSuggestOptions>>;
4545 >
4546 > /**
4547 > * Configuration options for inline suggestions
4548 > */
4549 > class InlineEditorSuggest extends BaseEditorOption<EditorOption.inlineSuggest, IInlineSuggestOptions, InternalInlineSuggestOptions> {
4550 > constructor() {
4551 > const defaults: InternalInlineSuggestOptions = {
4552 > enabled: true,
4553 > mode: 'subwordSmart',
4554 > showToolbar: 'onHover',
4555 > suppressSuggestions: false,
4556 > keepOnBlur: false,
4557 > fontFamily: 'default',
4558 > syntaxHighlightingEnabled: true,
4559 > minShowDelay: 0,
4560 > suppressInSnippetMode: true,
4561 > edits: {
4562 > enabled: true,
4563 > showCollapsed: false,
4564 > renderSideBySide: 'auto',
4565 > allowCodeShifting: 'always',
4566 > showLongDistanceHint: true,
4567 > longDistanceHintContextLineCount: 0,
4568 > },
4569 > triggerCommandOnProviderChange: false,
4570 > experimental: {
4571 > suppressInlineSuggestions: '',
4572 > showOnSuggestConflict: 'never',
4573 > emptyResponseInformation: true,
4574 > },
4575 > };
4576 >
4577 > super(
4578 > EditorOption.inlineSuggest, 'inlineSuggest', defaults,
4579 > {
4580 > 'editor.inlineSuggest.enabled': {
4581 > type: 'boolean',
4582 > default: defaults.enabled,
4583 > description: nls.localize('inlineSuggest.enabled', "Controls whether to automatically show inline suggestions in the editor.")
4584 > },
4585 > 'editor.inlineSuggest.showToolbar': {
4586 > type: 'string',
4587 > default: defaults.showToolbar,
4588 > enum: ['always', 'onHover', 'never'],
4589 > enumDescriptions: [
4590 > nls.localize('inlineSuggest.showToolbar.always', "Show the inline suggestion toolbar whenever an inline suggestion is shown."),
4591 > nls.localize('inlineSuggest.showToolbar.onHover', "Show the inline suggestion toolbar when hovering over an inline suggestion."),
4592 > nls.localize('inlineSuggest.showToolbar.never', "Never show the inline suggestion toolbar."),
4593 > ],
4594 > description: nls.localize('inlineSuggest.showToolbar', "Controls when to show the inline suggestion toolbar."),
4595 > },
4596 > 'editor.inlineSuggest.syntaxHighlightingEnabled': {
4597 > type: 'boolean',
4598 > default: defaults.syntaxHighlightingEnabled,
4599 > description: nls.localize('inlineSuggest.syntaxHighlightingEnabled', "Controls whether to show syntax highlighting for inline suggestions in the editor."),
4600 > },
4601 > 'editor.inlineSuggest.suppressSuggestions': {
4602 > type: 'boolean',
4603 > default: defaults.suppressSuggestions,
4604 > description: 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.")
4605 > },
4606 > 'editor.inlineSuggest.suppressInSnippetMode': {
4607 > type: 'boolean',
4608 > default: defaults.suppressInSnippetMode,
4609 > description: nls.localize('inlineSuggest.suppressInSnippetMode', "Controls whether inline suggestions are suppressed when in snippet mode."),
4610 > },
4611 > 'editor.inlineSuggest.minShowDelay': {
4612 > type: 'number',
4613 > default: 0,
4614 > minimum: 0,
4615 > maximum: 10000,
4616 > description: nls.localize('inlineSuggest.minShowDelay', "Controls the minimal delay in milliseconds after which inline suggestions are shown after typing."),
4617 > },
4618 > 'editor.inlineSuggest.experimental.suppressInlineSuggestions': {
4619 > type: 'string',
4620 > default: defaults.experimental.suppressInlineSuggestions,
4621 > tags: ['experimental'],
4622 > description: nls.localize('inlineSuggest.suppressInlineSuggestions', "Suppresses inline completions for specified extension IDs -- comma separated."),
4623 > experiment: {
4624 > mode: 'auto'
4625 > }
4626 > },
4627 > 'editor.inlineSuggest.experimental.emptyResponseInformation': {
4628 > type: 'boolean',
4629 > default: defaults.experimental.emptyResponseInformation,
4630 > tags: ['experimental'],
4631 > description: nls.localize('inlineSuggest.emptyResponseInformation', "Controls whether to send request information from the inline suggestion provider."),
4632 > experiment: {
4633 > mode: 'auto'
4634 > }
4635 > },
4636 > 'editor.inlineSuggest.triggerCommandOnProviderChange': {
4637 > type: 'boolean',
4638 > default: defaults.triggerCommandOnProviderChange,
4639 > tags: ['experimental'],
4640 > description: nls.localize('inlineSuggest.triggerCommandOnProviderChange', "Controls whether to trigger a command when the inline suggestion provider changes."),
4641 > experiment: {
4642 > mode: 'auto'
4643 > }
4644 > },
4645 > 'editor.inlineSuggest.experimental.showOnSuggestConflict': {
4646 > type: 'string',
4647 > default: defaults.experimental.showOnSuggestConflict,
4648 > tags: ['experimental'],
4649 > enum: ['always', 'never', 'whenSuggestListIsIncomplete'],
4650 > description: nls.localize('inlineSuggest.showOnSuggestConflict', "Controls whether to show inline suggestions when there is a suggest conflict."),
4651 > experiment: {
4652 > mode: 'auto'
4653 > }
4654 > },
4655 > 'editor.inlineSuggest.fontFamily': {
4656 > type: 'string',
4657 > default: defaults.fontFamily,
4658 > description: nls.localize('inlineSuggest.fontFamily', "Controls the font family of the inline suggestions.")
4659 > },
4660 > 'editor.inlineSuggest.edits.allowCodeShifting': {
4661 > type: 'string',
4662 > default: defaults.edits.allowCodeShifting,
4663 > description: nls.localize('inlineSuggest.edits.allowCodeShifting', "Controls whether showing a suggestion will shift the code to make space for the suggestion inline."),
4664 > enum: ['always', 'horizontal', 'never'],
4665 > tags: ['nextEditSuggestions']
4666 > },
4667 > 'editor.inlineSuggest.edits.showLongDistanceHint': {
4668 > type: 'boolean',
4669 > default: defaults.edits.showLongDistanceHint,
4670 > description: nls.localize('inlineSuggest.edits.showLongDistanceHint', "Controls whether long distance inline suggestions are shown."),
4671 > tags: ['nextEditSuggestions', 'experimental']
4672 > },
4673 > 'editor.inlineSuggest.edits.longDistanceHintContextLineCount': {
4674 > type: 'number',
4675 > default: defaults.edits.longDistanceHintContextLineCount,
4676 > minimum: 0,
4677 > maximum: 10,
4678 > description: nls.localize('inlineSuggest.edits.longDistanceHintContextLineCount', "Controls how many lines of surrounding context are shown above and below the target line in the long distance inline suggestion preview. Set to 0 to only show the target line."),
4679 > tags: ['nextEditSuggestions', 'experimental'],
4680 > experiment: {
4681 > mode: 'auto'
4682 > }
4683 > },
4684 > 'editor.inlineSuggest.edits.renderSideBySide': {
4685 > type: 'string',
4686 > default: defaults.edits.renderSideBySide,
4687 > description: nls.localize('inlineSuggest.edits.renderSideBySide', "Controls whether larger suggestions can be shown side by side."),
4688 > enum: ['auto', 'never'],
4689 > enumDescriptions: [
4690 > nls.localize('editor.inlineSuggest.edits.renderSideBySide.auto', "Larger suggestions will show side by side if there is enough space, otherwise they will be shown below."),
4691 > nls.localize('editor.inlineSuggest.edits.renderSideBySide.never', "Larger suggestions are never shown side by side and will always be shown below."),
4692 > ],
4693 > tags: ['nextEditSuggestions']
4694 > },
4695 > 'editor.inlineSuggest.edits.showCollapsed': {
4696 > type: 'boolean',
4697 > default: defaults.edits.showCollapsed,
4698 > description: nls.localize('inlineSuggest.edits.showCollapsed', "Controls whether the suggestion will show as collapsed until jumping to it."),
4699 > tags: ['nextEditSuggestions']
4700 > },
4701 > }
4702 > );
4703 > }
4704 >
4705 > public validate(_input: unknown): InternalInlineSuggestOptions {
4706 if (!_input || typeof _input !== 'object') {
4707 return this.defaultValue;
4723 };
4724 }
4726 > private _validateEdits(_input: unknown): InternalInlineSuggestOptions['edits'] {
4727 if (!_input || typeof _input !== 'object') {
4728 return this.defaultValue.edits;
4738 };
4739 }
4741 > private _validateExperimental(_input: unknown): InternalInlineSuggestOptions['experimental'] {
4742 if (!_input || typeof _input !== 'object') {
4743 return this.defaultValue.experimental;
4750 };
4751 }
4752 > } editorOptions.ts
4753 >
4754 > //#endregion
4755 >
4756 > //#region bracketPairColorization
4757 >
4758 > export interface IBracketPairColorizationOptions {
4759 > /**
4760 > * Enable or disable bracket pair colorization.
4761 > */
4762 > enabled?: boolean;
4763 >
4764 > /**
4765 > * Use independent color pool per bracket type.
4766 > */
4767 > independentColorPoolPerBracketType?: boolean;
4768 > }
4769 >
4770 > /**
4771 > * @internal
4772 > */
4773 > export type InternalBracketPairColorizationOptions = Readonly<Required<IBracketPairColorizationOptions>>;
4774 >
4775 > /**
4776 > * Configuration options for inline suggestions
4777 > */
4778 > class BracketPairColorization extends BaseEditorOption<EditorOption.bracketPairColorization, IBracketPairColorizationOptions, InternalBracketPairColorizationOptions> {
4779 > constructor() {
4780 > const defaults: InternalBracketPairColorizationOptions = {
4781 > enabled: EDITOR_MODEL_DEFAULTS.bracketPairColorizationOptions.enabled,
4782 > independentColorPoolPerBracketType: EDITOR_MODEL_DEFAULTS.bracketPairColorizationOptions.independentColorPoolPerBracketType,
4783 > };
4784 >
4785 > super(
4786 > EditorOption.bracketPairColorization, 'bracketPairColorization', defaults,
4787 > {
4788 > 'editor.bracketPairColorization.enabled': {
4789 > type: 'boolean',
4790 > default: defaults.enabled,
4791 > markdownDescription: nls.localize('bracketPairColorization.enabled', "Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.", '`#workbench.colorCustomizations#`')
4792 > },
4793 > 'editor.bracketPairColorization.independentColorPoolPerBracketType': {
4794 > type: 'boolean',
4795 > default: defaults.independentColorPoolPerBracketType,
4796 > description: nls.localize('bracketPairColorization.independentColorPoolPerBracketType', "Controls whether each bracket type has its own independent color pool.")
4797 > },
4798 > }
4799 > );
4800 > }
4801 >
4802 > public validate(_input: unknown): InternalBracketPairColorizationOptions {
4803 if (!_input || typeof _input !== 'object') {
4804 return this.defaultValue;
4810 };
4811 }
4812 > } editorOptions.ts
4813 >
4814 > //#endregion
4815 >
4816 > //#region guides
4817 >
4818 > export interface IGuidesOptions {
4819 > /**
4820 > * Enable rendering of bracket pair guides.
4821 > * Defaults to false.
4822 > */
4823 > bracketPairs?: boolean | 'active';
4824 >
4825 > /**
4826 > * Enable rendering of vertical bracket pair guides.
4827 > * Defaults to 'active'.
4828 > */
4829 > bracketPairsHorizontal?: boolean | 'active';
4830 >
4831 > /**
4832 > * Enable highlighting of the active bracket pair.
4833 > * Defaults to true.
4834 > */
4835 > highlightActiveBracketPair?: boolean;
4836 >
4837 > /**
4838 > * Enable rendering of indent guides.
4839 > * Defaults to true.
4840 > */
4841 > indentation?: boolean;
4842 >
4843 > /**
4844 > * Enable highlighting of the active indent guide.
4845 > * Defaults to true.
4846 > */
4847 > highlightActiveIndentation?: boolean | 'always';
4848 > }
4849 >
4850 > /**
4851 > * @internal
4852 > */
4853 > export type InternalGuidesOptions = Readonly<Required<IGuidesOptions>>;
4854 >
4855 > /**
4856 > * Configuration options for inline suggestions
4857 > */
4858 > class GuideOptions extends BaseEditorOption<EditorOption.guides, IGuidesOptions, InternalGuidesOptions> {
4859 > constructor() {
4860 > const defaults: InternalGuidesOptions = {
4861 > bracketPairs: false,
4862 > bracketPairsHorizontal: 'active',
4863 > highlightActiveBracketPair: true,
4864 >
4865 > indentation: true,
4866 > highlightActiveIndentation: true
4867 > };
4868 >
4869 > super(
4870 > EditorOption.guides, 'guides', defaults,
4871 > {
4872 > 'editor.guides.bracketPairs': {
4873 > type: ['boolean', 'string'],
4874 > enum: [true, 'active', false],
4875 > enumDescriptions: [
4876 > nls.localize('editor.guides.bracketPairs.true', "Enables bracket pair guides."),
4877 > nls.localize('editor.guides.bracketPairs.active', "Enables bracket pair guides only for the active bracket pair."),
4878 > nls.localize('editor.guides.bracketPairs.false', "Disables bracket pair guides."),
4879 > ],
4880 > default: defaults.bracketPairs,
4881 > description: nls.localize('editor.guides.bracketPairs', "Controls whether bracket pair guides are enabled or not.")
4882 > },
4883 > 'editor.guides.bracketPairsHorizontal': {
4884 > type: ['boolean', 'string'],
4885 > enum: [true, 'active', false],
4886 > enumDescriptions: [
4887 > nls.localize('editor.guides.bracketPairsHorizontal.true', "Enables horizontal guides as addition to vertical bracket pair guides."),
4888 > nls.localize('editor.guides.bracketPairsHorizontal.active', "Enables horizontal guides only for the active bracket pair."),
4889 > nls.localize('editor.guides.bracketPairsHorizontal.false', "Disables horizontal bracket pair guides."),
4890 > ],
4891 > default: defaults.bracketPairsHorizontal,
4892 > description: nls.localize('editor.guides.bracketPairsHorizontal', "Controls whether horizontal bracket pair guides are enabled or not.")
4893 > },
4894 > 'editor.guides.highlightActiveBracketPair': {
4895 > type: 'boolean',
4896 > default: defaults.highlightActiveBracketPair,
4897 > description: nls.localize('editor.guides.highlightActiveBracketPair', "Controls whether the editor should highlight the active bracket pair.")
4898 > },
4899 > 'editor.guides.indentation': {
4900 > type: 'boolean',
4901 > default: defaults.indentation,
4902 > description: nls.localize('editor.guides.indentation', "Controls whether the editor should render indent guides.")
4903 > },
4904 > 'editor.guides.highlightActiveIndentation': {
4905 > type: ['boolean', 'string'],
4906 > enum: [true, 'always', false],
4907 > enumDescriptions: [
4908 > nls.localize('editor.guides.highlightActiveIndentation.true', "Highlights the active indent guide."),
4909 > nls.localize('editor.guides.highlightActiveIndentation.always', "Highlights the active indent guide even if bracket guides are highlighted."),
4910 > nls.localize('editor.guides.highlightActiveIndentation.false', "Do not highlight the active indent guide."),
4911 > ],
4912 > default: defaults.highlightActiveIndentation,
4913 >
4914 > description: nls.localize('editor.guides.highlightActiveIndentation', "Controls whether the editor should highlight the active indent guide.")
4915 > }
4916 > }
4917 > );
4918 > }
4919 >
4920 > public validate(_input: unknown): InternalGuidesOptions {
4921 if (!_input || typeof _input !== 'object') {
4922 return this.defaultValue;
4932 };
4933 }
4934 > } editorOptions.ts
4935 >
4936 function primitiveSet<T extends string | boolean>(value: unknown, defaultValue: T, allowedValues: T[]): T {
4937 const idx = allowedValues.indexOf(value as T);
4941 return allowedValues[idx];
4942 }
4944 > //#endregion
4945 >
4946 > //#region suggest
4947 >
4948 > /**
4949 > * Configuration options for editor suggest widget
4950 > */
4951 > export interface ISuggestOptions {
4952 > /**
4953 > * Overwrite word ends on accept. Default to false.
4954 > */
4955 > insertMode?: 'insert' | 'replace';
4956 > /**
4957 > * Enable graceful matching. Defaults to true.
4958 > */
4959 > filterGraceful?: boolean;
4960 > /**
4961 > * Prevent quick suggestions when a snippet is active. Defaults to true.
4962 > */
4963 > snippetsPreventQuickSuggestions?: boolean;
4964 > /**
4965 > * Favors words that appear close to the cursor.
4966 > */
4967 > localityBonus?: boolean;
4968 > /**
4969 > * Enable using global storage for remembering suggestions.
4970 > */
4971 > shareSuggestSelections?: boolean;
4972 > /**
4973 > * Select suggestions when triggered via quick suggest or trigger characters
4974 > */
4975 > selectionMode?: 'always' | 'never' | 'whenTriggerCharacter' | 'whenQuickSuggestion';
4976 > /**
4977 > * Enable or disable icons in suggestions. Defaults to true.
4978 > */
4979 > showIcons?: boolean;
4980 > /**
4981 > * Enable or disable the suggest status bar.
4982 > */
4983 > showStatusBar?: boolean;
4984 > /**
4985 > * Enable or disable the rendering of the suggestion preview.
4986 > */
4987 > preview?: boolean;
4988 > /**
4989 > * Configures the mode of the preview.
4990 > */
4991 > previewMode?: 'prefix' | 'subword' | 'subwordSmart';
4992 > /**
4993 > * Show details inline with the label. Defaults to true.
4994 > */
4995 > showInlineDetails?: boolean;
4996 > /**
4997 > * Show method-suggestions.
4998 > */
4999 > showMethods?: boolean;
5000 > /**
5001 > * Show function-suggestions.
5002 > */
5003 > showFunctions?: boolean;
5004 > /**
5005 > * Show constructor-suggestions.
5006 > */
5007 > showConstructors?: boolean;
5008 > /**
5009 > * Show deprecated-suggestions.
5010 > */
5011 > showDeprecated?: boolean;
5012 > /**
5013 > * Controls whether suggestions allow matches in the middle of the word instead of only at the beginning
5014 > */
5015 > matchOnWordStartOnly?: boolean;
5016 > /**
5017 > * Show field-suggestions.
5018 > */
5019 > showFields?: boolean;
5020 > /**
5021 > * Show variable-suggestions.
5022 > */
5023 > showVariables?: boolean;
5024 > /**
5025 > * Show class-suggestions.
5026 > */
5027 > showClasses?: boolean;
5028 > /**
5029 > * Show struct-suggestions.
5030 > */
5031 > showStructs?: boolean;
5032 > /**
5033 > * Show interface-suggestions.
5034 > */
5035 > showInterfaces?: boolean;
5036 > /**
5037 > * Show module-suggestions.
5038 > */
5039 > showModules?: boolean;
5040 > /**
5041 > * Show property-suggestions.
5042 > */
5043 > showProperties?: boolean;
5044 > /**
5045 > * Show event-suggestions.
5046 > */
5047 > showEvents?: boolean;
5048 > /**
5049 > * Show operator-suggestions.
5050 > */
5051 > showOperators?: boolean;
5052 > /**
5053 > * Show unit-suggestions.
5054 > */
5055 > showUnits?: boolean;
5056 > /**
5057 > * Show value-suggestions.
5058 > */
5059 > showValues?: boolean;
5060 > /**
5061 > * Show constant-suggestions.
5062 > */
5063 > showConstants?: boolean;
5064 > /**
5065 > * Show enum-suggestions.
5066 > */
5067 > showEnums?: boolean;
5068 > /**
5069 > * Show enumMember-suggestions.
5070 > */
5071 > showEnumMembers?: boolean;
5072 > /**
5073 > * Show keyword-suggestions.
5074 > */
5075 > showKeywords?: boolean;
5076 > /**
5077 > * Show text-suggestions.
5078 > */
5079 > showWords?: boolean;
5080 > /**
5081 > * Show color-suggestions.
5082 > */
5083 > showColors?: boolean;
5084 > /**
5085 > * Show file-suggestions.
5086 > */
5087 > showFiles?: boolean;
5088 > /**
5089 > * Show reference-suggestions.
5090 > */
5091 > showReferences?: boolean;
5092 > /**
5093 > * Show folder-suggestions.
5094 > */
5095 > showFolders?: boolean;
5096 > /**
5097 > * Show typeParameter-suggestions.
5098 > */
5099 > showTypeParameters?: boolean;
5100 > /**
5101 > * Show issue-suggestions.
5102 > */
5103 > showIssues?: boolean;
5104 > /**
5105 > * Show user-suggestions.
5106 > */
5107 > showUsers?: boolean;
5108 > /**
5109 > * Show snippet-suggestions.
5110 > */
5111 > showSnippets?: boolean;
5112 > }
5113 >
5114 > /**
5115 > * @internal
5116 > */
5117 > export type InternalSuggestOptions = Readonly<Required<ISuggestOptions>>;
5118 >
5119 > class EditorSuggest extends BaseEditorOption<EditorOption.suggest, ISuggestOptions, InternalSuggestOptions> {
5120 >
5121 > constructor() {
5122 > const defaults: InternalSuggestOptions = {
5123 > insertMode: 'insert',
5124 > filterGraceful: true,
5125 > snippetsPreventQuickSuggestions: false,
5126 > localityBonus: false,
5127 > shareSuggestSelections: false,
5128 > selectionMode: 'always',
5129 > showIcons: true,
5130 > showStatusBar: false,
5131 > preview: false,
5132 > previewMode: 'subwordSmart',
5133 > showInlineDetails: true,
5134 > showMethods: true,
5135 > showFunctions: true,
5136 > showConstructors: true,
5137 > showDeprecated: true,
5138 > matchOnWordStartOnly: true,
5139 > showFields: true,
5140 > showVariables: true,
5141 > showClasses: true,
5142 > showStructs: true,
5143 > showInterfaces: true,
5144 > showModules: true,
5145 > showProperties: true,
5146 > showEvents: true,
5147 > showOperators: true,
5148 > showUnits: true,
5149 > showValues: true,
5150 > showConstants: true,
5151 > showEnums: true,
5152 > showEnumMembers: true,
5153 > showKeywords: true,
5154 > showWords: true,
5155 > showColors: true,
5156 > showFiles: true,
5157 > showReferences: true,
5158 > showFolders: true,
5159 > showTypeParameters: true,
5160 > showSnippets: true,
5161 > showUsers: true,
5162 > showIssues: true,
5163 > };
5164 > super(
5165 > EditorOption.suggest, 'suggest', defaults,
5166 > {
5167 > 'editor.suggest.insertMode': {
5168 > type: 'string',
5169 > enum: ['insert', 'replace'],
5170 > enumDescriptions: [
5171 > nls.localize('suggest.insertMode.insert', "Insert suggestion without overwriting text right of the cursor."),
5172 > nls.localize('suggest.insertMode.replace', "Insert suggestion and overwrite text right of the cursor."),
5173 > ],
5174 > default: defaults.insertMode,
5175 > description: nls.localize('suggest.insertMode', "Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")
5176 > },
5177 > 'editor.suggest.filterGraceful': {
5178 > type: 'boolean',
5179 > default: defaults.filterGraceful,
5180 > description: nls.localize('suggest.filterGraceful', "Controls whether filtering and sorting suggestions accounts for small typos.")
5181 > },
5182 > 'editor.suggest.localityBonus': {
5183 > type: 'boolean',
5184 > default: defaults.localityBonus,
5185 > description: nls.localize('suggest.localityBonus', "Controls whether sorting favors words that appear close to the cursor.")
5186 > },
5187 > 'editor.suggest.shareSuggestSelections': {
5188 > type: 'boolean',
5189 > default: defaults.shareSuggestSelections,
5190 > markdownDescription: nls.localize('suggest.shareSuggestSelections', "Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")
5191 > },
5192 > 'editor.suggest.selectionMode': {
5193 > type: 'string',
5194 > enum: ['always', 'never', 'whenTriggerCharacter', 'whenQuickSuggestion'],
5195 > enumDescriptions: [
5196 > nls.localize('suggest.insertMode.always', "Always select a suggestion when automatically triggering IntelliSense."),
5197 > nls.localize('suggest.insertMode.never', "Never select a suggestion when automatically triggering IntelliSense."),
5198 > nls.localize('suggest.insertMode.whenTriggerCharacter', "Select a suggestion only when triggering IntelliSense from a trigger character."),
5199 > nls.localize('suggest.insertMode.whenQuickSuggestion', "Select a suggestion only when triggering IntelliSense as you type."),
5200 > ],
5201 > default: defaults.selectionMode,
5202 > markdownDescription: 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#`')
5203 > },
5204 > 'editor.suggest.snippetsPreventQuickSuggestions': {
5205 > type: 'boolean',
5206 > default: defaults.snippetsPreventQuickSuggestions,
5207 > description: nls.localize('suggest.snippetsPreventQuickSuggestions', "Controls whether an active snippet prevents quick suggestions.")
5208 > },
5209 > 'editor.suggest.showIcons': {
5210 > type: 'boolean',
5211 > default: defaults.showIcons,
5212 > description: nls.localize('suggest.showIcons', "Controls whether to show or hide icons in suggestions.")
5213 > },
5214 > 'editor.suggest.showStatusBar': {
5215 > type: 'boolean',
5216 > default: defaults.showStatusBar,
5217 > description: nls.localize('suggest.showStatusBar', "Controls the visibility of the status bar at the bottom of the suggest widget.")
5218 > },
5219 > 'editor.suggest.preview': {
5220 > type: 'boolean',
5221 > default: defaults.preview,
5222 > description: nls.localize('suggest.preview', "Controls whether to preview the suggestion outcome in the editor.")
5223 > },
5224 > 'editor.suggest.showInlineDetails': {
5225 > type: 'boolean',
5226 > default: defaults.showInlineDetails,
5227 > description: nls.localize('suggest.showInlineDetails', "Controls whether suggest details show inline with the label or only in the details widget.")
5228 > },
5229 > 'editor.suggest.filteredTypes': {
5230 > type: 'object',
5231 > deprecationMessage: nls.localize('deprecated', "This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")
5232 > },
5233 > 'editor.suggest.showMethods': {
5234 > type: 'boolean',
5235 > default: true,
5236 > markdownDescription: nls.localize('editor.suggest.showMethods', "When enabled IntelliSense shows `method`-suggestions.")
5237 > },
5238 > 'editor.suggest.showFunctions': {
5239 > type: 'boolean',
5240 > default: true,
5241 > markdownDescription: nls.localize('editor.suggest.showFunctions', "When enabled IntelliSense shows `function`-suggestions.")
5242 > },
5243 > 'editor.suggest.showConstructors': {
5244 > type: 'boolean',
5245 > default: true,
5246 > markdownDescription: nls.localize('editor.suggest.showConstructors', "When enabled IntelliSense shows `constructor`-suggestions.")
5247 > },
5248 > 'editor.suggest.showDeprecated': {
5249 > type: 'boolean',
5250 > default: true,
5251 > markdownDescription: nls.localize('editor.suggest.showDeprecated', "When enabled IntelliSense shows `deprecated`-suggestions.")
5252 > },
5253 > 'editor.suggest.matchOnWordStartOnly': {
5254 > type: 'boolean',
5255 > default: true,
5256 > markdownDescription: 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.")
5257 > },
5258 > 'editor.suggest.showFields': {
5259 > type: 'boolean',
5260 > default: true,
5261 > markdownDescription: nls.localize('editor.suggest.showFields', "When enabled IntelliSense shows `field`-suggestions.")
5262 > },
5263 > 'editor.suggest.showVariables': {
5264 > type: 'boolean',
5265 > default: true,
5266 > markdownDescription: nls.localize('editor.suggest.showVariables', "When enabled IntelliSense shows `variable`-suggestions.")
5267 > },
5268 > 'editor.suggest.showClasses': {
5269 > type: 'boolean',
5270 > default: true,
5271 > markdownDescription: nls.localize('editor.suggest.showClasss', "When enabled IntelliSense shows `class`-suggestions.")
5272 > },
5273 > 'editor.suggest.showStructs': {
5274 > type: 'boolean',
5275 > default: true,
5276 > markdownDescription: nls.localize('editor.suggest.showStructs', "When enabled IntelliSense shows `struct`-suggestions.")
5277 > },
5278 > 'editor.suggest.showInterfaces': {
5279 > type: 'boolean',
5280 > default: true,
5281 > markdownDescription: nls.localize('editor.suggest.showInterfaces', "When enabled IntelliSense shows `interface`-suggestions.")
5282 > },
5283 > 'editor.suggest.showModules': {
5284 > type: 'boolean',
5285 > default: true,
5286 > markdownDescription: nls.localize('editor.suggest.showModules', "When enabled IntelliSense shows `module`-suggestions.")
5287 > },
5288 > 'editor.suggest.showProperties': {
5289 > type: 'boolean',
5290 > default: true,
5291 > markdownDescription: nls.localize('editor.suggest.showPropertys', "When enabled IntelliSense shows `property`-suggestions.")
5292 > },
5293 > 'editor.suggest.showEvents': {
5294 > type: 'boolean',
5295 > default: true,
5296 > markdownDescription: nls.localize('editor.suggest.showEvents', "When enabled IntelliSense shows `event`-suggestions.")
5297 > },
5298 > 'editor.suggest.showOperators': {
5299 > type: 'boolean',
5300 > default: true,
5301 > markdownDescription: nls.localize('editor.suggest.showOperators', "When enabled IntelliSense shows `operator`-suggestions.")
5302 > },
5303 > 'editor.suggest.showUnits': {
5304 > type: 'boolean',
5305 > default: true,
5306 > markdownDescription: nls.localize('editor.suggest.showUnits', "When enabled IntelliSense shows `unit`-suggestions.")
5307 > },
5308 > 'editor.suggest.showValues': {
5309 > type: 'boolean',
5310 > default: true,
5311 > markdownDescription: nls.localize('editor.suggest.showValues', "When enabled IntelliSense shows `value`-suggestions.")
5312 > },
5313 > 'editor.suggest.showConstants': {
5314 > type: 'boolean',
5315 > default: true,
5316 > markdownDescription: nls.localize('editor.suggest.showConstants', "When enabled IntelliSense shows `constant`-suggestions.")
5317 > },
5318 > 'editor.suggest.showEnums': {
5319 > type: 'boolean',
5320 > default: true,
5321 > markdownDescription: nls.localize('editor.suggest.showEnums', "When enabled IntelliSense shows `enum`-suggestions.")
5322 > },
5323 > 'editor.suggest.showEnumMembers': {
5324 > type: 'boolean',
5325 > default: true,
5326 > markdownDescription: nls.localize('editor.suggest.showEnumMembers', "When enabled IntelliSense shows `enumMember`-suggestions.")
5327 > },
5328 > 'editor.suggest.showKeywords': {
5329 > type: 'boolean',
5330 > default: true,
5331 > markdownDescription: nls.localize('editor.suggest.showKeywords', "When enabled IntelliSense shows `keyword`-suggestions.")
5332 > },
5333 > 'editor.suggest.showWords': {
5334 > type: 'boolean',
5335 > default: true,
5336 > markdownDescription: nls.localize('editor.suggest.showTexts', "When enabled IntelliSense shows `text`-suggestions.")
5337 > },
5338 > 'editor.suggest.showColors': {
5339 > type: 'boolean',
5340 > default: true,
5341 > markdownDescription: nls.localize('editor.suggest.showColors', "When enabled IntelliSense shows `color`-suggestions.")
5342 > },
5343 > 'editor.suggest.showFiles': {
5344 > type: 'boolean',
5345 > default: true,
5346 > markdownDescription: nls.localize('editor.suggest.showFiles', "When enabled IntelliSense shows `file`-suggestions.")
5347 > },
5348 > 'editor.suggest.showReferences': {
5349 > type: 'boolean',
5350 > default: true,
5351 > markdownDescription: nls.localize('editor.suggest.showReferences', "When enabled IntelliSense shows `reference`-suggestions.")
5352 > },
5353 > 'editor.suggest.showCustomcolors': {
5354 > type: 'boolean',
5355 > default: true,
5356 > markdownDescription: nls.localize('editor.suggest.showCustomcolors', "When enabled IntelliSense shows `customcolor`-suggestions.")
5357 > },
5358 > 'editor.suggest.showFolders': {
5359 > type: 'boolean',
5360 > default: true,
5361 > markdownDescription: nls.localize('editor.suggest.showFolders', "When enabled IntelliSense shows `folder`-suggestions.")
5362 > },
5363 > 'editor.suggest.showTypeParameters': {
5364 > type: 'boolean',
5365 > default: true,
5366 > markdownDescription: nls.localize('editor.suggest.showTypeParameters', "When enabled IntelliSense shows `typeParameter`-suggestions.")
5367 > },
5368 > 'editor.suggest.showSnippets': {
5369 > type: 'boolean',
5370 > default: true,
5371 > markdownDescription: nls.localize('editor.suggest.showSnippets', "When enabled IntelliSense shows `snippet`-suggestions.")
5372 > },
5373 > 'editor.suggest.showUsers': {
5374 > type: 'boolean',
5375 > default: true,
5376 > markdownDescription: nls.localize('editor.suggest.showUsers', "When enabled IntelliSense shows `user`-suggestions.")
5377 > },
5378 > 'editor.suggest.showIssues': {
5379 > type: 'boolean',
5380 > default: true,
5381 > markdownDescription: nls.localize('editor.suggest.showIssues', "When enabled IntelliSense shows `issues`-suggestions.")
5382 > }
5383 > }
5384 > );
5385 > }
5386 >
5387 > public validate(_input: unknown): InternalSuggestOptions {
5388 if (!_input || typeof _input !== 'object') {
5389 return this.defaultValue;
5433 };
5434 }
5435 > } editorOptions.ts
5436 >
5437 > //#endregion
5438 >
5439 > //#region smart select
5440 >
5441 > export interface ISmartSelectOptions {
5442 > selectLeadingAndTrailingWhitespace?: boolean;
5443 > selectSubwords?: boolean;
5444 > }
5445 >
5446 > /**
5447 > * @internal
5448 > */
5449 > export type SmartSelectOptions = Readonly<Required<ISmartSelectOptions>>;
5450 >
5451 > class SmartSelect extends BaseEditorOption<EditorOption.smartSelect, ISmartSelectOptions, SmartSelectOptions> {
5452 >
5453 > constructor() {
5454 > super(
5455 > EditorOption.smartSelect, 'smartSelect',
5456 > {
5457 > selectLeadingAndTrailingWhitespace: true,
5458 > selectSubwords: true,
5459 > },
5460 > {
5461 > 'editor.smartSelect.selectLeadingAndTrailingWhitespace': {
5462 > description: nls.localize('selectLeadingAndTrailingWhitespace', "Whether leading and trailing whitespace should always be selected."),
5463 > default: true,
5464 > type: 'boolean'
5465 > },
5466 > 'editor.smartSelect.selectSubwords': {
5467 > description: nls.localize('selectSubwords', "Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),
5468 > default: true,
5469 > type: 'boolean'
5470 > }
5471 > }
5472 > );
5473 > }
5474 >
5475 > public validate(input: unknown): Readonly<Required<ISmartSelectOptions>> {
5476 if (!input || typeof input !== 'object') {
5477 return this.defaultValue;
5482 };
5483 }
5484 > } editorOptions.ts
5485 >
5486 > //#endregion
5487 >
5488 > //#region wordSegmenterLocales
5489 >
5490 > /**
5491 > * Locales used for segmenting lines into words when doing word related navigations or operations.
5492 > *
5493 > * Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.).
5494 > */
5495 > class WordSegmenterLocales extends BaseEditorOption<EditorOption.wordSegmenterLocales, string | string[], string[]> {
5496 > constructor() {
5497 > const defaults: string[] = [];
5498 >
5499 > super(
5500 > EditorOption.wordSegmenterLocales, 'wordSegmenterLocales', defaults,
5501 > {
5502 > anyOf: [
5503 > {
5504 > type: 'string',
5505 > }, {
5506 > type: 'array',
5507 > items: {
5508 > type: 'string'
5509 > }
5510 > }
5511 > ],
5512 > description: 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.)."),
5513 > type: 'array',
5514 > items: {
5515 > type: 'string',
5516 > },
5517 > default: defaults,
5518 > },
5519 > );
5520 > }
5521 >
5522 > public validate(input: unknown): string[] {
5523 if (typeof input === 'string') {
5524 input = [input];
5542 return this.defaultValue;
5543 }
5544 > } editorOptions.ts
5545 >
5546 >
5547 > //#endregion
5548 >
5549 > //#region wrappingIndent
5550 >
5551 > /**
5552 > * Describes how to indent wrapped lines.
5553 > */
5554 > export const enum WrappingIndent {
5555 > /**
5556 > * No indentation => wrapped lines begin at column 1.
5557 > */
5558 > None = 0,
5559 > /**
5560 > * Same => wrapped lines get the same indentation as the parent.
5561 > */
5562 > Same = 1,
5563 > /**
5564 > * Indent => wrapped lines get +1 indentation toward the parent.
5565 > */
5566 > Indent = 2,
5567 > /**
5568 > * DeepIndent => wrapped lines get +2 indentation toward the parent.
5569 > */
5570 > DeepIndent = 3
5571 > }
5572 >
5573 > class WrappingIndentOption extends BaseEditorOption<EditorOption.wrappingIndent, 'none' | 'same' | 'indent' | 'deepIndent', WrappingIndent> {
5574 >
5575 > constructor() {
5576 > super(EditorOption.wrappingIndent, 'wrappingIndent', WrappingIndent.Same,
5577 > {
5578 > 'editor.wrappingIndent': {
5579 > type: 'string',
5580 > enum: ['none', 'same', 'indent', 'deepIndent'],
5581 > enumDescriptions: [
5582 > nls.localize('wrappingIndent.none', "No indentation. Wrapped lines begin at column 1."),
5583 > nls.localize('wrappingIndent.same', "Wrapped lines get the same indentation as the parent."),
5584 > nls.localize('wrappingIndent.indent', "Wrapped lines get +1 indentation toward the parent."),
5585 > nls.localize('wrappingIndent.deepIndent', "Wrapped lines get +2 indentation toward the parent."),
5586 > ],
5587 > description: nls.localize('wrappingIndent', "Controls the indentation of wrapped lines."),
5588 > default: 'same'
5589 > }
5590 > }
5591 > );
5592 > }
5593 >
5594 > public validate(input: unknown): WrappingIndent {
5595 switch (input) {
5596 case 'none': return WrappingIndent.None;
5601 return WrappingIndent.Same;
5602 }
5604 > public override compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: WrappingIndent): WrappingIndent {
5605 const accessibilitySupport = options.get(EditorOption.accessibilitySupport);
5606 if (accessibilitySupport === AccessibilitySupport.Enabled) {
5611 return value;
5612 }
5613 > } editorOptions.ts
5614 >
5615 > //#endregion
5616 >
5617 > //#region wrappingInfo
5618 >
5619 > export interface EditorWrappingInfo {
5620 > readonly isDominatedByLongLines: boolean;
5621 > readonly isWordWrapMinified: boolean;
5622 > readonly isViewportWrapping: boolean;
5623 > readonly wrappingColumn: number;
5624 > }
5625 >
5626 > class EditorWrappingInfoComputer extends ComputedEditorOption<EditorOption.wrappingInfo, EditorWrappingInfo> {
5627 >
5628 > constructor() {
5629 > super(EditorOption.wrappingInfo, {
5630 > isDominatedByLongLines: false,
5631 > isWordWrapMinified: false,
5632 > isViewportWrapping: false,
5633 > wrappingColumn: -1
5634 > });
5635 > }
5636 >
5637 > public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, _: EditorWrappingInfo): EditorWrappingInfo {
5638 const layoutInfo = options.get(EditorOption.layoutInfo);
5639
5645 };
5646 }
5647 > } editorOptions.ts
5648 >
5649 > //#endregion
5650 >
5651 > //#region dropIntoEditor
5652 >
5653 > /**
5654 > * Configuration options for editor drop into behavior
5655 > */
5656 > export interface IDropIntoEditorOptions {
5657 > /**
5658 > * Enable dropping into editor.
5659 > * Defaults to true.
5660 > */
5661 > enabled?: boolean;
5662 >
5663 > /**
5664 > * Controls if a widget is shown after a drop.
5665 > * Defaults to 'afterDrop'.
5666 > */
5667 > showDropSelector?: 'afterDrop' | 'never';
5668 > }
5669 >
5670 > /**
5671 > * @internal
5672 > */
5673 > export type EditorDropIntoEditorOptions = Readonly<Required<IDropIntoEditorOptions>>;
5674 >
5675 > class EditorDropIntoEditor extends BaseEditorOption<EditorOption.dropIntoEditor, IDropIntoEditorOptions, EditorDropIntoEditorOptions> {
5676 >
5677 > constructor() {
5678 > const defaults: EditorDropIntoEditorOptions = { enabled: true, showDropSelector: 'afterDrop' };
5679 > super(
5680 > EditorOption.dropIntoEditor, 'dropIntoEditor', defaults,
5681 > {
5682 > 'editor.dropIntoEditor.enabled': {
5683 > type: 'boolean',
5684 > default: defaults.enabled,
5685 > markdownDescription: 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)."),
5686 > },
5687 > 'editor.dropIntoEditor.showDropSelector': {
5688 > type: 'string',
5689 > markdownDescription: 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."),
5690 > enum: [
5691 > 'afterDrop',
5692 > 'never'
5693 > ],
5694 > enumDescriptions: [
5695 > nls.localize('dropIntoEditor.showDropSelector.afterDrop', "Show the drop selector widget after a file is dropped into the editor."),
5696 > nls.localize('dropIntoEditor.showDropSelector.never', "Never show the drop selector widget. Instead the default drop provider is always used."),
5697 > ],
5698 > default: 'afterDrop',
5699 > },
5700 > }
5701 > );
5702 > }
5703 >
5704 > public validate(_input: unknown): EditorDropIntoEditorOptions {
5705 if (!_input || typeof _input !== 'object') {
5706 return this.defaultValue;
5712 };
5713 }
5714 > } editorOptions.ts
5715 >
5716 > //#endregion
5717 >
5718 > //#region pasteAs
5719 >
5720 > /**
5721 > * Configuration options for editor pasting as into behavior
5722 > */
5723 > export interface IPasteAsOptions {
5724 > /**
5725 > * Enable paste as functionality in editors.
5726 > * Defaults to true.
5727 > */
5728 > enabled?: boolean;
5729 >
5730 > /**
5731 > * Controls if a widget is shown after a drop.
5732 > * Defaults to 'afterPaste'.
5733 > */
5734 > showPasteSelector?: 'afterPaste' | 'never';
5735 > }
5736 >
5737 > /**
5738 > * @internal
5739 > */
5740 > export type EditorPasteAsOptions = Readonly<Required<IPasteAsOptions>>;
5741 >
5742 > class EditorPasteAs extends BaseEditorOption<EditorOption.pasteAs, IPasteAsOptions, EditorPasteAsOptions> {
5743 >
5744 > constructor() {
5745 > const defaults: EditorPasteAsOptions = { enabled: true, showPasteSelector: 'afterPaste' };
5746 > super(
5747 > EditorOption.pasteAs, 'pasteAs', defaults,
5748 > {
5749 > 'editor.pasteAs.enabled': {
5750 > type: 'boolean',
5751 > default: defaults.enabled,
5752 > markdownDescription: nls.localize('pasteAs.enabled', "Controls whether you can paste content in different ways."),
5753 > },
5754 > 'editor.pasteAs.showPasteSelector': {
5755 > type: 'string',
5756 > markdownDescription: 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."),
5757 > enum: [
5758 > 'afterPaste',
5759 > 'never'
5760 > ],
5761 > enumDescriptions: [
5762 > nls.localize('pasteAs.showPasteSelector.afterPaste', "Show the paste selector widget after content is pasted into the editor."),
5763 > nls.localize('pasteAs.showPasteSelector.never', "Never show the paste selector widget. Instead the default pasting behavior is always used."),
5764 > ],
5765 > default: 'afterPaste',
5766 > },
5767 > }
5768 > );
5769 > }
5770 >
5771 > public validate(_input: unknown): EditorPasteAsOptions {
5772 if (!_input || typeof _input !== 'object') {
5773 return this.defaultValue;
5779 };
5780 }
5781 > } editorOptions.ts
5782 >
5783 > //#endregion
5784 >
5785 > /**
5786 > * @internal
5787 > */
5788 > export const editorOptionsRegistry: IEditorOption<EditorOption, unknown>[] = [];
5789 >
5790 > function register<K extends EditorOption, V>(option: IEditorOption<K, V>): IEditorOption<K, V> {
5791 > editorOptionsRegistry[option.id] = option;
5792 > return option;
5793 > }
5794 >
5795 > export const enum EditorOption {
5796 > acceptSuggestionOnCommitCharacter,
5797 > acceptSuggestionOnEnter,
5798 > accessibilitySupport,
5799 > accessibilityPageSize,
5800 > allowOverflow,
5801 > allowVariableLineHeights,
5802 > allowVariableFonts,
5803 > allowVariableFontsInAccessibilityMode,
5804 > ariaLabel,
5805 > ariaRequired,
5806 > autoClosingBrackets,
5807 > autoClosingComments,
5808 > screenReaderAnnounceInlineSuggestion,
5809 > autoClosingDelete,
5810 > autoClosingOvertype,
5811 > autoClosingQuotes,
5812 > autoIndent,
5813 > autoIndentOnPaste,
5814 > autoIndentOnPasteWithinString,
5815 > automaticLayout,
5816 > autoSurround,
5817 > bracketPairColorization,
5818 > guides,
5819 > codeLens,
5820 > codeLensFontFamily,
5821 > codeLensFontSize,
5822 > colorDecorators,
5823 > colorDecoratorsLimit,
5824 > columnSelection,
5825 > comments,
5826 > contextmenu,
5827 > copyWithSyntaxHighlighting,
5828 > cursorBlinking,
5829 > cursorSmoothCaretAnimation,
5830 > cursorStyle,
5831 > cursorSurroundingLines,
5832 > cursorSurroundingLinesStyle,
5833 > cursorWidth,
5834 > cursorHeight,
5835 > disableLayerHinting,
5836 > disableMonospaceOptimizations,
5837 > domReadOnly,
5838 > dragAndDrop,
5839 > dropIntoEditor,
5840 > editContext,
5841 > emptySelectionClipboard,
5842 > experimentalGpuAcceleration,
5843 > experimentalWhitespaceRendering,
5844 > extraEditorClassName,
5845 > fastScrollSensitivity,
5846 > find,
5847 > fixedOverflowWidgets,
5848 > folding,
5849 > foldingStrategy,
5850 > foldingHighlight,
5851 > foldingImportsByDefault,
5852 > foldingMaximumRegions,
5853 > unfoldOnClickAfterEndOfLine,
5854 > fontFamily,
5855 > fontInfo,
5856 > fontLigatures,
5857 > fontSize,
5858 > fontWeight,
5859 > fontVariations,
5860 > formatOnPaste,
5861 > formatOnType,
5862 > glyphMargin,
5863 > gotoLocation,
5864 > hideCursorInOverviewRuler,
5865 > hover,
5866 > inDiffEditor,
5867 > inlineSuggest,
5868 > letterSpacing,
5869 > lightbulb,
5870 > lineDecorationsWidth,
5871 > lineHeight,
5872 > lineNumbers,
5873 > lineNumbersMinChars,
5874 > linkedEditing,
5875 > links,
5876 > matchBrackets,
5877 > minimap,
5878 > mouseStyle,
5879 > mouseWheelScrollSensitivity,
5880 > mouseWheelZoom,
5881 > multiCursorMergeOverlapping,
5882 > multiCursorModifier,
5883 > mouseMiddleClickAction,
5884 > multiCursorPaste,
5885 > multiCursorLimit,
5886 > occurrencesHighlight,
5887 > occurrencesHighlightDelay,
5888 > overtypeCursorStyle,
5889 > overtypeOnPaste,
5890 > overviewRulerBorder,
5891 > overviewRulerLanes,
5892 > padding,
5893 > pasteAs,
5894 > parameterHints,
5895 > peekWidgetDefaultFocus,
5896 > placeholder,
5897 > definitionLinkOpensInPeek,
5898 > quickSuggestions,
5899 > quickSuggestionsDelay,
5900 > readOnly,
5901 > readOnlyMessage,
5902 > renameOnType,
5903 > renderRichScreenReaderContent,
5904 > renderControlCharacters,
5905 > renderFinalNewline,
5906 > renderLineHighlight,
5907 > renderLineHighlightOnlyWhenFocus,
5908 > renderValidationDecorations,
5909 > renderWhitespace,
5910 > revealHorizontalRightPadding,
5911 > roundedSelection,
5912 > rulers,
5913 > scrollbar,
5914 > scrollBeyondLastColumn,
5915 > scrollBeyondLastLine,
5916 > scrollPredominantAxis,
5917 > selectionClipboard,
5918 > selectionHighlight,
5919 > selectionHighlightMaxLength,
5920 > selectionHighlightMultiline,
5921 > selectOnLineNumbers,
5922 > showFoldingControls,
5923 > showUnused,
5924 > snippetSuggestions,
5925 > smartSelect,
5926 > smoothScrolling,
5927 > stickyScroll,
5928 > stickyTabStops,
5929 > stopRenderingLineAfter,
5930 > suggest,
5931 > suggestFontSize,
5932 > suggestLineHeight,
5933 > suggestOnTriggerCharacters,
5934 > suggestSelection,
5935 > tabCompletion,
5936 > tabIndex,
5937 > trimWhitespaceOnDelete,
5938 > unicodeHighlighting,
5939 > unusualLineTerminators,
5940 > useShadowDOM,
5941 > useTabStops,
5942 > wordBreak,
5943 > wordSegmenterLocales,
5944 > wordSeparators,
5945 > wordWrap,
5946 > wordWrapBreakAfterCharacters,
5947 > wordWrapBreakBeforeCharacters,
5948 > wordWrapColumn,
5949 > wordWrapOverride1,
5950 > wordWrapOverride2,
5951 > wrappingIndent,
5952 > wrappingStrategy,
5953 > showDeprecated,
5954 > inertialScroll,
5955 > inlayHints,
5956 > wrapOnEscapedLineFeeds,
5957 > // Leave these at the end (because they have dependencies!)
5958 > effectiveCursorStyle,
5959 > editorClassName,
5960 > pixelRatio,
5961 > tabFocusMode,
5962 > layoutInfo,
5963 > wrappingInfo,
5964 > defaultColorDecorators,
5965 > colorDecoratorsActivatedOn,
5966 > inlineCompletionsAccessibilityVerbose,
5967 > effectiveEditContext,
5968 > scrollOnMiddleClick,
5969 > effectiveAllowVariableFonts,
5970 > doubleClickSelectsBlock
5971 > }
5972 >
5973 > export const EditorOptions = {
5974 > acceptSuggestionOnCommitCharacter: register(new EditorBooleanOption(
5975 > EditorOption.acceptSuggestionOnCommitCharacter, 'acceptSuggestionOnCommitCharacter', true,
5976 > { 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.") }
5977 > )),
5978 > acceptSuggestionOnEnter: register(new EditorStringEnumOption(
5979 > EditorOption.acceptSuggestionOnEnter, 'acceptSuggestionOnEnter',
5980 > 'on' as 'on' | 'smart' | 'off',
5981 > ['on', 'smart', 'off'] as const,
5982 > {
5983 > markdownEnumDescriptions: [
5984 > '',
5985 > nls.localize('acceptSuggestionOnEnterSmart', "Only accept a suggestion with `Enter` when it makes a textual change."),
5986 > ''
5987 > ],
5988 > markdownDescription: 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.")
5989 > }
5990 > )),
5991 > accessibilitySupport: register(new EditorAccessibilitySupport()),
5992 > accessibilityPageSize: register(new EditorIntOption(EditorOption.accessibilityPageSize, 'accessibilityPageSize', 500, 1, Constants.MAX_SAFE_SMALL_INTEGER,
5993 > {
5994 > description: 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."),
5995 > tags: ['accessibility']
5996 > }
5997 > )),
5998 > allowOverflow: register(new EditorBooleanOption(
5999 > EditorOption.allowOverflow, 'allowOverflow', true,
6000 > )),
6001 > allowVariableLineHeights: register(new EditorBooleanOption(
6002 > EditorOption.allowVariableLineHeights, 'allowVariableLineHeights', true,
6003 > {
6004 > description: nls.localize('allowVariableLineHeights', "Controls whether to allow using variable line heights in the editor.")
6005 > }
6006 > )),
6007 > allowVariableFonts: register(new EditorBooleanOption(
6008 > EditorOption.allowVariableFonts, 'allowVariableFonts', true,
6009 > {
6010 > description: nls.localize('allowVariableFonts', "Controls whether to allow using variable fonts in the editor.")
6011 > }
6012 > )),
6013 > allowVariableFontsInAccessibilityMode: register(new EditorBooleanOption(
6014 > EditorOption.allowVariableFontsInAccessibilityMode, 'allowVariableFontsInAccessibilityMode', false,
6015 > {
6016 > description: nls.localize('allowVariableFontsInAccessibilityMode', "Controls whether to allow using variable fonts in the editor in the accessibility mode."),
6017 > tags: ['accessibility']
6018 > }
6019 > )),
6020 > ariaLabel: register(new EditorStringOption(
6021 > EditorOption.ariaLabel, 'ariaLabel', nls.localize('editorViewAccessibleLabel', "Editor content")
6022 > )),
6023 > ariaRequired: register(new EditorBooleanOption(
6024 > EditorOption.ariaRequired, 'ariaRequired', false, undefined
6025 > )),
6026 > screenReaderAnnounceInlineSuggestion: register(new EditorBooleanOption(
6027 > EditorOption.screenReaderAnnounceInlineSuggestion, 'screenReaderAnnounceInlineSuggestion', true,
6028 > {
6029 > description: nls.localize('screenReaderAnnounceInlineSuggestion', "Control whether inline suggestions are announced by a screen reader."),
6030 > tags: ['accessibility']
6031 > }
6032 > )),
6033 > autoClosingBrackets: register(new EditorStringEnumOption(
6034 > EditorOption.autoClosingBrackets, 'autoClosingBrackets',
6035 > 'languageDefined' as 'always' | 'languageDefined' | 'beforeWhitespace' | 'never',
6036 > ['always', 'languageDefined', 'beforeWhitespace', 'never'] as const,
6037 > {
6038 > enumDescriptions: [
6039 > '',
6040 > nls.localize('editor.autoClosingBrackets.languageDefined', "Use language configurations to determine when to autoclose brackets."),
6041 > nls.localize('editor.autoClosingBrackets.beforeWhitespace', "Autoclose brackets only when the cursor is to the left of whitespace."),
6042 > '',
6043 > ],
6044 > description: nls.localize('autoClosingBrackets', "Controls whether the editor should automatically close brackets after the user adds an opening bracket.")
6045 > }
6046 > )),
6047 > autoClosingComments: register(new EditorStringEnumOption(
6048 > EditorOption.autoClosingComments, 'autoClosingComments',
6049 > 'languageDefined' as 'always' | 'languageDefined' | 'beforeWhitespace' | 'never',
6050 > ['always', 'languageDefined', 'beforeWhitespace', 'never'] as const,
6051 > {
6052 > enumDescriptions: [
6053 > '',
6054 > nls.localize('editor.autoClosingComments.languageDefined', "Use language configurations to determine when to autoclose comments."),
6055 > nls.localize('editor.autoClosingComments.beforeWhitespace', "Autoclose comments only when the cursor is to the left of whitespace."),
6056 > '',
6057 > ],
6058 > description: nls.localize('autoClosingComments', "Controls whether the editor should automatically close comments after the user adds an opening comment.")
6059 > }
6060 > )),
6061 > autoClosingDelete: register(new EditorStringEnumOption(
6062 > EditorOption.autoClosingDelete, 'autoClosingDelete',
6063 > 'auto' as 'always' | 'auto' | 'never',
6064 > ['always', 'auto', 'never'] as const,
6065 > {
6066 > enumDescriptions: [
6067 > '',
6068 > nls.localize('editor.autoClosingDelete.auto', "Remove adjacent closing quotes or brackets only if they were automatically inserted."),
6069 > '',
6070 > ],
6071 > description: nls.localize('autoClosingDelete', "Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")
6072 > }
6073 > )),
6074 > autoClosingOvertype: register(new EditorStringEnumOption(
6075 > EditorOption.autoClosingOvertype, 'autoClosingOvertype',
6076 > 'auto' as 'always' | 'auto' | 'never',
6077 > ['always', 'auto', 'never'] as const,
6078 > {
6079 > enumDescriptions: [
6080 > '',
6081 > nls.localize('editor.autoClosingOvertype.auto', "Type over closing quotes or brackets only if they were automatically inserted."),
6082 > '',
6083 > ],
6084 > description: nls.localize('autoClosingOvertype', "Controls whether the editor should type over closing quotes or brackets.")
6085 > }
6086 > )),
6087 > autoClosingQuotes: register(new EditorStringEnumOption(
6088 > EditorOption.autoClosingQuotes, 'autoClosingQuotes',
6089 > 'languageDefined' as 'always' | 'languageDefined' | 'beforeWhitespace' | 'never',
6090 > ['always', 'languageDefined', 'beforeWhitespace', 'never'] as const,
6091 > {
6092 > enumDescriptions: [
6093 > '',
6094 > nls.localize('editor.autoClosingQuotes.languageDefined', "Use language configurations to determine when to autoclose quotes."),
6095 > nls.localize('editor.autoClosingQuotes.beforeWhitespace', "Autoclose quotes only when the cursor is to the left of whitespace."),
6096 > '',
6097 > ],
6098 > description: nls.localize('autoClosingQuotes', "Controls whether the editor should automatically close quotes after the user adds an opening quote.")
6099 > }
6100 > )),
6101 > autoIndent: register(new EditorEnumOption(
6102 > EditorOption.autoIndent, 'autoIndent',
6103 > EditorAutoIndentStrategy.Full, 'full',
6104 > ['none', 'keep', 'brackets', 'advanced', 'full'],
6105 > _autoIndentFromString,
6106 > {
6107 > enumDescriptions: [
6108 > nls.localize('editor.autoIndent.none', "The editor will not insert indentation automatically."),
6109 > nls.localize('editor.autoIndent.keep', "The editor will keep the current line's indentation."),
6110 > nls.localize('editor.autoIndent.brackets', "The editor will keep the current line's indentation and honor language defined brackets."),
6111 > nls.localize('editor.autoIndent.advanced', "The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),
6112 > nls.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."),
6113 > ],
6114 > description: nls.localize('autoIndent', "Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")
6115 > }
6116 > )),
6117 > autoIndentOnPaste: register(new EditorBooleanOption(
6118 > EditorOption.autoIndentOnPaste, 'autoIndentOnPaste', false,
6119 > { description: nls.localize('autoIndentOnPaste', "Controls whether the editor should automatically auto-indent the pasted content.") }
6120 > )),
6121 > autoIndentOnPasteWithinString: register(new EditorBooleanOption(
6122 > EditorOption.autoIndentOnPasteWithinString, 'autoIndentOnPasteWithinString', true,
6123 > { 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.") }
6124 > )),
6125 > automaticLayout: register(new EditorBooleanOption(
6126 > EditorOption.automaticLayout, 'automaticLayout', false,
6127 > )),
6128 > autoSurround: register(new EditorStringEnumOption(
6129 > EditorOption.autoSurround, 'autoSurround',
6130 > 'languageDefined' as 'languageDefined' | 'quotes' | 'brackets' | 'never',
6131 > ['languageDefined', 'quotes', 'brackets', 'never'] as const,
6132 > {
6133 > enumDescriptions: [
6134 > nls.localize('editor.autoSurround.languageDefined', "Use language configurations to determine when to automatically surround selections."),
6135 > nls.localize('editor.autoSurround.quotes', "Surround with quotes but not brackets."),
6136 > nls.localize('editor.autoSurround.brackets', "Surround with brackets but not quotes."),
6137 > ''
6138 > ],
6139 > description: nls.localize('autoSurround', "Controls whether the editor should automatically surround selections when typing quotes or brackets.")
6140 > }
6141 > )),
6142 > bracketPairColorization: register(new BracketPairColorization()),
6143 > bracketPairGuides: register(new GuideOptions()),
6144 > stickyTabStops: register(new EditorBooleanOption(
6145 > EditorOption.stickyTabStops, 'stickyTabStops', false,
6146 > { description: nls.localize('stickyTabStops', "Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.") }
6147 > )),
6148 > codeLens: register(new EditorBooleanOption(
6149 > EditorOption.codeLens, 'codeLens', true,
6150 > { description: nls.localize('codeLens', "Controls whether the editor shows CodeLens.") }
6151 > )),
6152 > codeLensFontFamily: register(new EditorStringOption(
6153 > EditorOption.codeLensFontFamily, 'codeLensFontFamily', '',
6154 > { description: nls.localize('codeLensFontFamily', "Controls the font family for CodeLens.") }
6155 > )),
6156 > codeLensFontSize: register(new EditorIntOption(EditorOption.codeLensFontSize, 'codeLensFontSize', 0, 0, 100, {
6157 > type: 'number',
6158 > default: 0,
6159 > minimum: 0,
6160 > maximum: 100,
6161 > markdownDescription: nls.localize('codeLensFontSize', "Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")
6162 > })),
6163 > colorDecorators: register(new EditorBooleanOption(
6164 > EditorOption.colorDecorators, 'colorDecorators', true,
6165 > { description: nls.localize('colorDecorators', "Controls whether the editor should render the inline color decorators and color picker.") }
6166 > )),
6167 > colorDecoratorActivatedOn: register(new EditorStringEnumOption(EditorOption.colorDecoratorsActivatedOn, 'colorDecoratorsActivatedOn', 'clickAndHover' as 'clickAndHover' | 'hover' | 'click', ['clickAndHover', 'hover', 'click'] as const, {
6168 > enumDescriptions: [
6169 > nls.localize('editor.colorDecoratorActivatedOn.clickAndHover', "Make the color picker appear both on click and hover of the color decorator"),
6170 > nls.localize('editor.colorDecoratorActivatedOn.hover', "Make the color picker appear on hover of the color decorator"),
6171 > nls.localize('editor.colorDecoratorActivatedOn.click', "Make the color picker appear on click of the color decorator")
6172 > ],
6173 > description: nls.localize('colorDecoratorActivatedOn', "Controls the condition to make a color picker appear from a color decorator.")
6174 > })),
6175 > colorDecoratorsLimit: register(new EditorIntOption(
6176 > EditorOption.colorDecoratorsLimit, 'colorDecoratorsLimit', 500, 1, 1000000,
6177 > {
6178 > markdownDescription: nls.localize('colorDecoratorsLimit', "Controls the max number of color decorators that can be rendered in an editor at once.")
6179 > }
6180 > )),
6181 > columnSelection: register(new EditorBooleanOption(
6182 > EditorOption.columnSelection, 'columnSelection', false,
6183 > { description: nls.localize('columnSelection', "Enable that the selection with the mouse and keys is doing column selection.") }
6184 > )),
6185 > comments: register(new EditorComments()),
6186 > contextmenu: register(new EditorBooleanOption(
6187 > EditorOption.contextmenu, 'contextmenu', true,
6188 > )),
6189 > copyWithSyntaxHighlighting: register(new EditorBooleanOption(
6190 > EditorOption.copyWithSyntaxHighlighting, 'copyWithSyntaxHighlighting', true,
6191 > { description: nls.localize('copyWithSyntaxHighlighting', "Controls whether syntax highlighting should be copied into the clipboard.") }
6192 > )),
6193 > cursorBlinking: register(new EditorEnumOption(
6194 > EditorOption.cursorBlinking, 'cursorBlinking',
6195 > TextEditorCursorBlinkingStyle.Blink, 'blink',
6196 > ['blink', 'smooth', 'phase', 'expand', 'solid'],
6197 > cursorBlinkingStyleFromString,
6198 > { description: nls.localize('cursorBlinking', "Control the cursor animation style.") }
6199 > )),
6200 > cursorSmoothCaretAnimation: register(new EditorStringEnumOption(
6201 > EditorOption.cursorSmoothCaretAnimation, 'cursorSmoothCaretAnimation',
6202 > 'off' as 'off' | 'explicit' | 'on',
6203 > ['off', 'explicit', 'on'] as const,
6204 > {
6205 > enumDescriptions: [
6206 > nls.localize('cursorSmoothCaretAnimation.off', "Smooth caret animation is disabled."),
6207 > nls.localize('cursorSmoothCaretAnimation.explicit', "Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),
6208 > nls.localize('cursorSmoothCaretAnimation.on', "Smooth caret animation is always enabled.")
6209 > ],
6210 > description: nls.localize('cursorSmoothCaretAnimation', "Controls whether the smooth caret animation should be enabled.")
6211 > }
6212 > )),
6213 > cursorStyle: register(new EditorEnumOption(
6214 > EditorOption.cursorStyle, 'cursorStyle',
6215 > TextEditorCursorStyle.Line, 'line',
6216 > ['line', 'block', 'underline', 'line-thin', 'block-outline', 'underline-thin'],
6217 > cursorStyleFromString,
6218 > { description: nls.localize('cursorStyle', "Controls the cursor style in insert input mode.") }
6219 > )),
6220 > overtypeCursorStyle: register(new EditorEnumOption(
6221 > EditorOption.overtypeCursorStyle, 'overtypeCursorStyle',
6222 > TextEditorCursorStyle.Block, 'block',
6223 > ['line', 'block', 'underline', 'line-thin', 'block-outline', 'underline-thin'],
6224 > cursorStyleFromString,
6225 > { description: nls.localize('overtypeCursorStyle', "Controls the cursor style in overtype input mode.") }
6226 > )),
6227 > cursorSurroundingLines: register(new EditorIntOption(
6228 > EditorOption.cursorSurroundingLines, 'cursorSurroundingLines',
6229 > 0, 0, Constants.MAX_SAFE_SMALL_INTEGER,
6230 > { 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.") }
6231 > )),
6232 > cursorSurroundingLinesStyle: register(new EditorStringEnumOption(
6233 > EditorOption.cursorSurroundingLinesStyle, 'cursorSurroundingLinesStyle',
6234 > 'default' as 'default' | 'all',
6235 > ['default', 'all'] as const,
6236 > {
6237 > enumDescriptions: [
6238 > nls.localize('cursorSurroundingLinesStyle.default', "`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),
6239 > nls.localize('cursorSurroundingLinesStyle.all', "`cursorSurroundingLines` is enforced always.")
6240 > ],
6241 > markdownDescription: nls.localize('cursorSurroundingLinesStyle', "Controls when `#editor.cursorSurroundingLines#` should be enforced.")
6242 > }
6243 > )),
6244 > cursorWidth: register(new EditorIntOption(
6245 > EditorOption.cursorWidth, 'cursorWidth',
6246 > 0, 0, Constants.MAX_SAFE_SMALL_INTEGER,
6247 > { markdownDescription: nls.localize('cursorWidth', "Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.") }
6248 > )),
6249 > cursorHeight: register(new EditorIntOption(
6250 > EditorOption.cursorHeight, 'cursorHeight',
6251 > 0, 0, Constants.MAX_SAFE_SMALL_INTEGER,
6252 > { 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.") }
6253 > )),
6254 > disableLayerHinting: register(new EditorBooleanOption(
6255 > EditorOption.disableLayerHinting, 'disableLayerHinting', false,
6256 > )),
6257 > disableMonospaceOptimizations: register(new EditorBooleanOption(
6258 > EditorOption.disableMonospaceOptimizations, 'disableMonospaceOptimizations', false
6259 > )),
6260 > domReadOnly: register(new EditorBooleanOption(
6261 > EditorOption.domReadOnly, 'domReadOnly', false,
6262 > )),
6263 > doubleClickSelectsBlock: register(new EditorBooleanOption(
6264 > EditorOption.doubleClickSelectsBlock, 'doubleClickSelectsBlock', true,
6265 > { description: nls.localize('doubleClickSelectsBlock', "Controls whether double-clicking next to a bracket or quote selects the content inside.") }
6266 > )),
6267 > dragAndDrop: register(new EditorBooleanOption(
6268 > EditorOption.dragAndDrop, 'dragAndDrop', true,
6269 > { description: nls.localize('dragAndDrop', "Controls whether the editor should allow moving selections via drag and drop.") }
6270 > )),
6271 > emptySelectionClipboard: register(new EditorEmptySelectionClipboard()),
6272 > dropIntoEditor: register(new EditorDropIntoEditor()),
6273 > editContext: register(new EditorBooleanOption(
6274 > EditorOption.editContext, 'editContext', true,
6275 > {
6276 > description: nls.localize('editContext', "Sets whether the EditContext API should be used instead of the text area to power input in the editor."),
6277 > included: platform.isChrome || platform.isEdge || platform.isNative
6278 > }
6279 > )),
6280 > renderRichScreenReaderContent: register(new EditorBooleanOption(
6281 > EditorOption.renderRichScreenReaderContent, 'renderRichScreenReaderContent', false,
6282 > {
6283 > markdownDescription: nls.localize('renderRichScreenReaderContent', "Whether to render rich screen reader content when the `#editor.editContext#` setting is enabled."),
6284 > }
6285 > )),
6286 > stickyScroll: register(new EditorStickyScroll()),
6287 > experimentalGpuAcceleration: register(new EditorStringEnumOption(
6288 > EditorOption.experimentalGpuAcceleration, 'experimentalGpuAcceleration',
6289 > 'off' as 'off' | 'on',
6290 > ['off', 'on'] as const,
6291 > {
6292 > tags: ['experimental'],
6293 > enumDescriptions: [
6294 > nls.localize('experimentalGpuAcceleration.off', "Use regular DOM-based rendering."),
6295 > nls.localize('experimentalGpuAcceleration.on', "Use GPU acceleration."),
6296 > ],
6297 > description: nls.localize('experimentalGpuAcceleration', "Controls whether to use the experimental GPU acceleration to render the editor.")
6298 > }
6299 > )),
6300 > experimentalWhitespaceRendering: register(new EditorStringEnumOption(
6301 > EditorOption.experimentalWhitespaceRendering, 'experimentalWhitespaceRendering',
6302 > 'svg' as 'svg' | 'font' | 'off',
6303 > ['svg', 'font', 'off'] as const,
6304 > {
6305 > enumDescriptions: [
6306 > nls.localize('experimentalWhitespaceRendering.svg', "Use a new rendering method with svgs."),
6307 > nls.localize('experimentalWhitespaceRendering.font', "Use a new rendering method with font characters."),
6308 > nls.localize('experimentalWhitespaceRendering.off', "Use the stable rendering method."),
6309 > ],
6310 > description: nls.localize('experimentalWhitespaceRendering', "Controls whether whitespace is rendered with a new, experimental method.")
6311 > }
6312 > )),
6313 > extraEditorClassName: register(new EditorStringOption(
6314 > EditorOption.extraEditorClassName, 'extraEditorClassName', '',
6315 > )),
6316 > fastScrollSensitivity: register(new EditorFloatOption(
6317 > EditorOption.fastScrollSensitivity, 'fastScrollSensitivity',
6318 > 5, x => (x <= 0 ? 5 : x),
6319 > { markdownDescription: nls.localize('fastScrollSensitivity', "Scrolling speed multiplier when pressing `Alt`.") }
6320 > )),
6321 > find: register(new EditorFind()),
6322 > fixedOverflowWidgets: register(new EditorBooleanOption(
6323 > EditorOption.fixedOverflowWidgets, 'fixedOverflowWidgets', false,
6324 > )),
6325 > folding: register(new EditorBooleanOption(
6326 > EditorOption.folding, 'folding', true,
6327 > { description: nls.localize('folding', "Controls whether the editor has code folding enabled.") }
6328 > )),
6329 > foldingStrategy: register(new EditorStringEnumOption(
6330 > EditorOption.foldingStrategy, 'foldingStrategy',
6331 > 'auto' as 'auto' | 'indentation',
6332 > ['auto', 'indentation'] as const,
6333 > {
6334 > enumDescriptions: [
6335 > nls.localize('foldingStrategy.auto', "Use a language-specific folding strategy if available, else the indentation-based one."),
6336 > nls.localize('foldingStrategy.indentation', "Use the indentation-based folding strategy."),
6337 > ],
6338 > description: nls.localize('foldingStrategy', "Controls the strategy for computing folding ranges.")
6339 > }
6340 > )),
6341 > foldingHighlight: register(new EditorBooleanOption(
6342 > EditorOption.foldingHighlight, 'foldingHighlight', true,
6343 > { description: nls.localize('foldingHighlight', "Controls whether the editor should highlight folded ranges.") }
6344 > )),
6345 > foldingImportsByDefault: register(new EditorBooleanOption(
6346 > EditorOption.foldingImportsByDefault, 'foldingImportsByDefault', false,
6347 > { description: nls.localize('foldingImportsByDefault', "Controls whether the editor automatically collapses import ranges.") }
6348 > )),
6349 > foldingMaximumRegions: register(new EditorIntOption(
6350 > EditorOption.foldingMaximumRegions, 'foldingMaximumRegions',
6351 > 5000, 10, 65000, // limit must be less than foldingRanges MAX_FOLDING_REGIONS
6352 > { 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.") }
6353 > )),
6354 > unfoldOnClickAfterEndOfLine: register(new EditorBooleanOption(
6355 > EditorOption.unfoldOnClickAfterEndOfLine, 'unfoldOnClickAfterEndOfLine', false,
6356 > { description: nls.localize('unfoldOnClickAfterEndOfLine', "Controls whether clicking on the empty content after a folded line will unfold the line.") }
6357 > )),
6358 > fontFamily: register(new EditorStringOption(
6359 > EditorOption.fontFamily, 'fontFamily', EDITOR_FONT_DEFAULTS.fontFamily,
6360 > { description: nls.localize('fontFamily', "Controls the font family.") }
6361 > )),
6362 > fontInfo: register(new EditorFontInfo()),
6363 > fontLigatures2: register(new EditorFontLigatures()),
6364 > fontSize: register(new EditorFontSize()),
6365 > fontWeight: register(new EditorFontWeight()),
6366 > fontVariations: register(new EditorFontVariations()),
6367 > formatOnPaste: register(new EditorBooleanOption(
6368 > EditorOption.formatOnPaste, 'formatOnPaste', false,
6369 > { 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.") }
6370 > )),
6371 > formatOnType: register(new EditorBooleanOption(
6372 > EditorOption.formatOnType, 'formatOnType', false,
6373 > { description: nls.localize('formatOnType', "Controls whether the editor should automatically format the line after typing.") }
6374 > )),
6375 > glyphMargin: register(new EditorBooleanOption(
6376 > EditorOption.glyphMargin, 'glyphMargin', true,
6377 > { description: nls.localize('glyphMargin', "Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.") }
6378 > )),
6379 > gotoLocation: register(new EditorGoToLocation()),
6380 > hideCursorInOverviewRuler: register(new EditorBooleanOption(
6381 > EditorOption.hideCursorInOverviewRuler, 'hideCursorInOverviewRuler', false,
6382 > { description: nls.localize('hideCursorInOverviewRuler', "Controls whether the cursor should be hidden in the overview ruler.") }
6383 > )),
6384 > hover: register(new EditorHover()),
6385 > inDiffEditor: register(new EditorBooleanOption(
6386 > EditorOption.inDiffEditor, 'inDiffEditor', false
6387 > )),
6388 > inertialScroll: register(new EditorBooleanOption(
6389 > EditorOption.inertialScroll, 'inertialScroll', false,
6390 > { description: nls.localize('inertialScroll', "Make scrolling inertial - mostly useful with touchpad on linux.") }
6391 > )),
6392 > letterSpacing: register(new EditorFloatOption(
6393 > EditorOption.letterSpacing, 'letterSpacing',
6394 > EDITOR_FONT_DEFAULTS.letterSpacing, x => EditorFloatOption.clamp(x, -5, 20),
6395 > { description: nls.localize('letterSpacing', "Controls the letter spacing in pixels.") }
6396 > )),
6397 > lightbulb: register(new EditorLightbulb()),
6398 > lineDecorationsWidth: register(new EditorLineDecorationsWidth()),
6399 > lineHeight: register(new EditorLineHeight()),
6400 > lineNumbers: register(new EditorRenderLineNumbersOption()),
6401 > lineNumbersMinChars: register(new EditorIntOption(
6402 > EditorOption.lineNumbersMinChars, 'lineNumbersMinChars',
6403 > 5, 1, 300
6404 > )),
6405 > linkedEditing: register(new EditorBooleanOption(
6406 > EditorOption.linkedEditing, 'linkedEditing', false,
6407 > { 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.") }
6408 > )),
6409 > links: register(new EditorBooleanOption(
6410 > EditorOption.links, 'links', true,
6411 > { description: nls.localize('links', "Controls whether the editor should detect links and make them clickable.") }
6412 > )),
6413 > matchBrackets: register(new EditorStringEnumOption(
6414 > EditorOption.matchBrackets, 'matchBrackets',
6415 > 'always' as 'never' | 'near' | 'always',
6416 > ['always', 'near', 'never'] as const,
6417 > { description: nls.localize('matchBrackets', "Highlight matching brackets.") }
6418 > )),
6419 > minimap: register(new EditorMinimap()),
6420 > mouseStyle: register(new EditorStringEnumOption(
6421 > EditorOption.mouseStyle, 'mouseStyle',
6422 > 'text' as 'text' | 'default' | 'copy',
6423 > ['text', 'default', 'copy'] as const,
6424 > )),
6425 > mouseWheelScrollSensitivity: register(new EditorFloatOption(
6426 > EditorOption.mouseWheelScrollSensitivity, 'mouseWheelScrollSensitivity',
6427 > 1, x => (x === 0 ? 1 : x),
6428 > { markdownDescription: nls.localize('mouseWheelScrollSensitivity', "A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.") }
6429 > )),
6430 > mouseWheelZoom: register(new EditorBooleanOption(
6431 > EditorOption.mouseWheelZoom, 'mouseWheelZoom', false,
6432 > {
6433 > markdownDescription: platform.isMacintosh
6434 ? nls.localize('mouseWheelZoom.mac', "Zoom the font of the editor when using mouse wheel and holding `Cmd`.")
6435 > : nls.localize('mouseWheelZoom', "Zoom the font of the editor when using mouse wheel and holding `Ctrl`.") editorOptions.ts
6436 > }
6437 > )),
6438 > multiCursorMergeOverlapping: register(new EditorBooleanOption(
6439 > EditorOption.multiCursorMergeOverlapping, 'multiCursorMergeOverlapping', true,
6440 > { description: nls.localize('multiCursorMergeOverlapping', "Merge multiple cursors when they are overlapping.") }
6441 > )),
6442 > multiCursorModifier: register(new EditorEnumOption(
6443 > EditorOption.multiCursorModifier, 'multiCursorModifier',
6444 > 'altKey', 'alt',
6445 > ['ctrlCmd', 'alt'],
6446 > _multiCursorModifierFromString,
6447 > {
6448 > markdownEnumDescriptions: [
6449 > nls.localize('multiCursorModifier.ctrlCmd', "Maps to `Control` on Windows and Linux and to `Command` on macOS."),
6450 > nls.localize('multiCursorModifier.alt', "Maps to `Alt` on Windows and Linux and to `Option` on macOS.")
6451 > ],
6452 > markdownDescription: nls.localize({
6453 > key: 'multiCursorModifier',
6454 > comment: [
6455 > '- `ctrlCmd` refers to a value the setting can take and should not be localized.',
6456 > '- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized.'
6457 > ]
6458 > }, "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).")
6459 > }
6460 > )),
6461 > mouseMiddleClickAction: register(new EditorStringEnumOption(
6462 > EditorOption.mouseMiddleClickAction, 'mouseMiddleClickAction', 'default' as MouseMiddleClickAction,
6463 > ['default', 'openLink', 'ctrlLeftClick'] as MouseMiddleClickAction[],
6464 > { description: nls.localize('mouseMiddleClickAction', "Controls what happens when middle mouse button is clicked in the editor.") }
6465 > )),
6466 > multiCursorPaste: register(new EditorStringEnumOption(
6467 > EditorOption.multiCursorPaste, 'multiCursorPaste',
6468 > 'spread' as 'spread' | 'full',
6469 > ['spread', 'full'] as const,
6470 > {
6471 > markdownEnumDescriptions: [
6472 > nls.localize('multiCursorPaste.spread', "Each cursor pastes a single line of the text."),
6473 > nls.localize('multiCursorPaste.full', "Each cursor pastes the full text.")
6474 > ],
6475 > markdownDescription: nls.localize('multiCursorPaste', "Controls pasting when the line count of the pasted text matches the cursor count.")
6476 > }
6477 > )),
6478 > multiCursorLimit: register(new EditorIntOption(
6479 > EditorOption.multiCursorLimit, 'multiCursorLimit', 10000, 1, 100000,
6480 > {
6481 > markdownDescription: nls.localize('multiCursorLimit', "Controls the max number of cursors that can be in an active editor at once.")
6482 > }
6483 > )),
6484 > occurrencesHighlight: register(new EditorStringEnumOption(
6485 > EditorOption.occurrencesHighlight, 'occurrencesHighlight',
6486 > 'singleFile' as 'off' | 'singleFile' | 'multiFile',
6487 > ['off', 'singleFile', 'multiFile'] as const,
6488 > {
6489 > markdownEnumDescriptions: [
6490 > nls.localize('occurrencesHighlight.off', "Does not highlight occurrences."),
6491 > nls.localize('occurrencesHighlight.singleFile', "Highlights occurrences only in the current file."),
6492 > nls.localize('occurrencesHighlight.multiFile', "Experimental: Highlights occurrences across all valid open files.")
6493 > ],
6494 > markdownDescription: nls.localize('occurrencesHighlight', "Controls whether occurrences should be highlighted across open files.")
6495 > }
6496 > )),
6497 > occurrencesHighlightDelay: register(new EditorIntOption(
6498 > EditorOption.occurrencesHighlightDelay, 'occurrencesHighlightDelay',
6499 > 0, 0, 2000,
6500 > {
6501 > description: nls.localize('occurrencesHighlightDelay', "Controls the delay in milliseconds after which occurrences are highlighted."),
6502 > tags: ['preview']
6503 > }
6504 > )),
6505 > overtypeOnPaste: register(new EditorBooleanOption(
6506 > EditorOption.overtypeOnPaste, 'overtypeOnPaste', true,
6507 > { description: nls.localize('overtypeOnPaste', "Controls whether pasting should overtype.") }
6508 > )),
6509 > overviewRulerBorder: register(new EditorBooleanOption(
6510 > EditorOption.overviewRulerBorder, 'overviewRulerBorder', true,
6511 > { description: nls.localize('overviewRulerBorder', "Controls whether a border should be drawn around the overview ruler.") }
6512 > )),
6513 > overviewRulerLanes: register(new EditorIntOption(
6514 > EditorOption.overviewRulerLanes, 'overviewRulerLanes',
6515 > 3, 0, 3
6516 > )),
6517 > padding: register(new EditorPadding()),
6518 > pasteAs: register(new EditorPasteAs()),
6519 > parameterHints: register(new EditorParameterHints()),
6520 > peekWidgetDefaultFocus: register(new EditorStringEnumOption(
6521 > EditorOption.peekWidgetDefaultFocus, 'peekWidgetDefaultFocus',
6522 > 'tree' as 'tree' | 'editor',
6523 > ['tree', 'editor'] as const,
6524 > {
6525 > enumDescriptions: [
6526 > nls.localize('peekWidgetDefaultFocus.tree', "Focus the tree when opening peek"),
6527 > nls.localize('peekWidgetDefaultFocus.editor', "Focus the editor when opening peek")
6528 > ],
6529 > description: nls.localize('peekWidgetDefaultFocus', "Controls whether to focus the inline editor or the tree in the peek widget.")
6530 > }
6531 > )),
6532 > placeholder: register(new PlaceholderOption()),
6533 > definitionLinkOpensInPeek: register(new EditorBooleanOption(
6534 > EditorOption.definitionLinkOpensInPeek, 'definitionLinkOpensInPeek', false,
6535 > { description: nls.localize('definitionLinkOpensInPeek', "Controls whether the Go to Definition mouse gesture always opens the peek widget.") }
6536 > )),
6537 > quickSuggestions: register(new EditorQuickSuggestions()),
6538 > quickSuggestionsDelay: register(new EditorIntOption(
6539 > EditorOption.quickSuggestionsDelay, 'quickSuggestionsDelay',
6540 > 10, 0, Constants.MAX_SAFE_SMALL_INTEGER,
6541 > {
6542 > description: nls.localize('quickSuggestionsDelay', "Controls the delay in milliseconds after which quick suggestions will show up."),
6543 > experiment: {
6544 > mode: 'auto'
6545 > }
6546 > }
6547 > )),
6548 > readOnly: register(new EditorBooleanOption(
6549 > EditorOption.readOnly, 'readOnly', false,
6550 > )),
6551 > readOnlyMessage: register(new ReadonlyMessage()),
6552 > renameOnType: register(new EditorBooleanOption(
6553 > EditorOption.renameOnType, 'renameOnType', false,
6554 > { description: nls.localize('renameOnType', "Controls whether the editor auto renames on type."), markdownDeprecationMessage: nls.localize('renameOnTypeDeprecate', "Deprecated, use `#editor.linkedEditing#` instead.") }
6555 > )),
6556 > renderControlCharacters: register(new EditorBooleanOption(
6557 > EditorOption.renderControlCharacters, 'renderControlCharacters', true,
6558 > { description: nls.localize('renderControlCharacters', "Controls whether the editor should render control characters."), restricted: true }
6559 > )),
6560 > renderFinalNewline: register(new EditorStringEnumOption(
6561 > EditorOption.renderFinalNewline, 'renderFinalNewline',
6562 > (platform.isLinux ? 'dimmed' : 'on') as 'off' | 'on' | 'dimmed',
6563 > ['off', 'on', 'dimmed'] as const,
6564 > { description: nls.localize('renderFinalNewline', "Render last line number when the file ends with a newline.") }
6565 > )),
6566 > renderLineHighlight: register(new EditorStringEnumOption(
6567 > EditorOption.renderLineHighlight, 'renderLineHighlight',
6568 > 'line' as 'none' | 'gutter' | 'line' | 'all',
6569 > ['none', 'gutter', 'line', 'all'] as const,
6570 > {
6571 > enumDescriptions: [
6572 > '',
6573 > '',
6574 > '',
6575 > nls.localize('renderLineHighlight.all', "Highlights both the gutter and the current line."),
6576 > ],
6577 > description: nls.localize('renderLineHighlight', "Controls how the editor should render the current line highlight.")
6578 > }
6579 > )),
6580 > renderLineHighlightOnlyWhenFocus: register(new EditorBooleanOption(
6581 > EditorOption.renderLineHighlightOnlyWhenFocus, 'renderLineHighlightOnlyWhenFocus', false,
6582 > { description: nls.localize('renderLineHighlightOnlyWhenFocus', "Controls if the editor should render the current line highlight only when the editor is focused.") }
6583 > )),
6584 > renderValidationDecorations: register(new EditorStringEnumOption(
6585 > EditorOption.renderValidationDecorations, 'renderValidationDecorations',
6586 > 'editable' as 'editable' | 'on' | 'off',
6587 > ['editable', 'on', 'off'] as const
6588 > )),
6589 > renderWhitespace: register(new EditorStringEnumOption(
6590 > EditorOption.renderWhitespace, 'renderWhitespace',
6591 > 'selection' as 'selection' | 'none' | 'boundary' | 'trailing' | 'all',
6592 > ['none', 'boundary', 'selection', 'trailing', 'all'] as const,
6593 > {
6594 > enumDescriptions: [
6595 > '',
6596 > nls.localize('renderWhitespace.boundary', "Render whitespace characters except for single spaces between words."),
6597 > nls.localize('renderWhitespace.selection', "Render whitespace characters only on selected text."),
6598 > nls.localize('renderWhitespace.trailing', "Render only trailing whitespace characters."),
6599 > ''
6600 > ],
6601 > description: nls.localize('renderWhitespace', "Controls how the editor should render whitespace characters.")
6602 > }
6603 > )),
6604 > revealHorizontalRightPadding: register(new EditorIntOption(
6605 > EditorOption.revealHorizontalRightPadding, 'revealHorizontalRightPadding',
6606 > 15, 0, 1000,
6607 > )),
6608 > roundedSelection: register(new EditorBooleanOption(
6609 > EditorOption.roundedSelection, 'roundedSelection', true,
6610 > { description: nls.localize('roundedSelection', "Controls whether selections should have rounded corners.") }
6611 > )),
6612 > rulers: register(new EditorRulers()),
6613 > scrollbar: register(new EditorScrollbar()),
6614 > scrollBeyondLastColumn: register(new EditorIntOption(
6615 > EditorOption.scrollBeyondLastColumn, 'scrollBeyondLastColumn',
6616 > 4, 0, Constants.MAX_SAFE_SMALL_INTEGER,
6617 > { description: nls.localize('scrollBeyondLastColumn', "Controls the number of extra characters beyond which the editor will scroll horizontally.") }
6618 > )),
6619 > scrollBeyondLastLine: register(new EditorBooleanOption(
6620 > EditorOption.scrollBeyondLastLine, 'scrollBeyondLastLine', true,
6621 > { description: nls.localize('scrollBeyondLastLine', "Controls whether the editor will scroll beyond the last line.") }
6622 > )),
6623 > scrollOnMiddleClick: register(new EditorBooleanOption(
6624 > EditorOption.scrollOnMiddleClick, 'scrollOnMiddleClick', false,
6625 > { description: nls.localize('scrollOnMiddleClick', "Controls whether the editor will scroll when the middle button is pressed.") }
6626 > )),
6627 > scrollPredominantAxis: register(new EditorBooleanOption(
6628 > EditorOption.scrollPredominantAxis, 'scrollPredominantAxis', true,
6629 > { 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.") }
6630 > )),
6631 > selectionClipboard: register(new EditorBooleanOption(
6632 > EditorOption.selectionClipboard, 'selectionClipboard', true,
6633 > {
6634 > description: nls.localize('selectionClipboard', "Controls whether the Linux primary clipboard should be supported."),
6635 > included: platform.isLinux
6636 > }
6637 > )),
6638 > selectionHighlight: register(new EditorBooleanOption(
6639 > EditorOption.selectionHighlight, 'selectionHighlight', true,
6640 > { description: nls.localize('selectionHighlight', "Controls whether the editor should highlight matches similar to the selection.") }
6641 > )),
6642 > selectionHighlightMaxLength: register(new EditorIntOption(
6643 > EditorOption.selectionHighlightMaxLength, 'selectionHighlightMaxLength',
6644 > 200, 0, Constants.MAX_SAFE_SMALL_INTEGER,
6645 > { description: nls.localize('selectionHighlightMaxLength', "Controls how many characters can be in the selection before similiar matches are not highlighted. Set to zero for unlimited.") }
6646 > )),
6647 > selectionHighlightMultiline: register(new EditorBooleanOption(
6648 > EditorOption.selectionHighlightMultiline, 'selectionHighlightMultiline', false,
6649 > { description: nls.localize('selectionHighlightMultiline', "Controls whether the editor should highlight selection matches that span multiple lines.") }
6650 > )),
6651 > selectOnLineNumbers: register(new EditorBooleanOption(
6652 > EditorOption.selectOnLineNumbers, 'selectOnLineNumbers', true,
6653 > )),
6654 > showFoldingControls: register(new EditorStringEnumOption(
6655 > EditorOption.showFoldingControls, 'showFoldingControls',
6656 > 'mouseover' as 'always' | 'never' | 'mouseover',
6657 > ['always', 'never', 'mouseover'] as const,
6658 > {
6659 > enumDescriptions: [
6660 > nls.localize('showFoldingControls.always', "Always show the folding controls."),
6661 > nls.localize('showFoldingControls.never', "Never show the folding controls and reduce the gutter size."),
6662 > nls.localize('showFoldingControls.mouseover', "Only show the folding controls when the mouse is over the gutter."),
6663 > ],
6664 > description: nls.localize('showFoldingControls', "Controls when the folding controls on the gutter are shown.")
6665 > }
6666 > )),
6667 > showUnused: register(new EditorBooleanOption(
6668 > EditorOption.showUnused, 'showUnused', true,
6669 > { description: nls.localize('showUnused', "Controls fading out of unused code.") }
6670 > )),
6671 > showDeprecated: register(new EditorBooleanOption(
6672 > EditorOption.showDeprecated, 'showDeprecated', true,
6673 > { description: nls.localize('showDeprecated', "Controls strikethrough deprecated variables.") }
6674 > )),
6675 > inlayHints: register(new EditorInlayHints()),
6676 > snippetSuggestions: register(new EditorStringEnumOption(
6677 > EditorOption.snippetSuggestions, 'snippetSuggestions',
6678 > 'inline' as 'top' | 'bottom' | 'inline' | 'none',
6679 > ['top', 'bottom', 'inline', 'none'] as const,
6680 > {
6681 > enumDescriptions: [
6682 > nls.localize('snippetSuggestions.top', "Show snippet suggestions on top of other suggestions."),
6683 > nls.localize('snippetSuggestions.bottom', "Show snippet suggestions below other suggestions."),
6684 > nls.localize('snippetSuggestions.inline', "Show snippets suggestions with other suggestions."),
6685 > nls.localize('snippetSuggestions.none', "Do not show snippet suggestions."),
6686 > ],
6687 > description: nls.localize('snippetSuggestions', "Controls whether snippets are shown with other suggestions and how they are sorted.")
6688 > }
6689 > )),
6690 > smartSelect: register(new SmartSelect()),
6691 > smoothScrolling: register(new EditorBooleanOption(
6692 > EditorOption.smoothScrolling, 'smoothScrolling', false,
6693 > { description: nls.localize('smoothScrolling', "Controls whether the editor will scroll using an animation.") }
6694 > )),
6695 > stopRenderingLineAfter: register(new EditorIntOption(
6696 > EditorOption.stopRenderingLineAfter, 'stopRenderingLineAfter',
6697 > 10000, -1, Constants.MAX_SAFE_SMALL_INTEGER,
6698 > )),
6699 > suggest: register(new EditorSuggest()),
6700 > inlineSuggest: register(new InlineEditorSuggest()),
6701 > inlineCompletionsAccessibilityVerbose: register(new EditorBooleanOption(EditorOption.inlineCompletionsAccessibilityVerbose, 'inlineCompletionsAccessibilityVerbose', false,
6702 > { description: nls.localize('inlineCompletionsAccessibilityVerbose', "Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.") })),
6703 > suggestFontSize: register(new EditorIntOption(
6704 > EditorOption.suggestFontSize, 'suggestFontSize',
6705 > 0, 0, 1000,
6706 > { markdownDescription: nls.localize('suggestFontSize', "Font size for the suggest widget. When set to {0}, the value of {1} is used.", '`0`', '`#editor.fontSize#`') }
6707 > )),
6708 > suggestLineHeight: register(new EditorIntOption(
6709 > EditorOption.suggestLineHeight, 'suggestLineHeight',
6710 > 0, 0, 1000,
6711 > { 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#`') }
6712 > )),
6713 > suggestOnTriggerCharacters: register(new EditorBooleanOption(
6714 > EditorOption.suggestOnTriggerCharacters, 'suggestOnTriggerCharacters', true,
6715 > { description: nls.localize('suggestOnTriggerCharacters', "Controls whether suggestions should automatically show up when typing trigger characters.") }
6716 > )),
6717 > suggestSelection: register(new EditorStringEnumOption(
6718 > EditorOption.suggestSelection, 'suggestSelection',
6719 > 'first' as 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix',
6720 > ['first', 'recentlyUsed', 'recentlyUsedByPrefix'] as const,
6721 > {
6722 > markdownEnumDescriptions: [
6723 > nls.localize('suggestSelection.first', "Always select the first suggestion."),
6724 > nls.localize('suggestSelection.recentlyUsed', "Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),
6725 > nls.localize('suggestSelection.recentlyUsedByPrefix', "Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`."),
6726 > ],
6727 > description: nls.localize('suggestSelection', "Controls how suggestions are pre-selected when showing the suggest list.")
6728 > }
6729 > )),
6730 > tabCompletion: register(new EditorStringEnumOption(
6731 > EditorOption.tabCompletion, 'tabCompletion',
6732 > 'off' as 'on' | 'off' | 'onlySnippets',
6733 > ['on', 'off', 'onlySnippets'] as const,
6734 > {
6735 > enumDescriptions: [
6736 > nls.localize('tabCompletion.on', "Tab complete will insert the best matching suggestion when pressing tab."),
6737 > nls.localize('tabCompletion.off', "Disable tab completions."),
6738 > nls.localize('tabCompletion.onlySnippets', "Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled."),
6739 > ],
6740 > description: nls.localize('tabCompletion', "Enables tab completions.")
6741 > }
6742 > )),
6743 > tabIndex: register(new EditorIntOption(
6744 > EditorOption.tabIndex, 'tabIndex',
6745 > 0, -1, Constants.MAX_SAFE_SMALL_INTEGER
6746 > )),
6747 > trimWhitespaceOnDelete: register(new EditorBooleanOption(
6748 > EditorOption.trimWhitespaceOnDelete, 'trimWhitespaceOnDelete', false,
6749 > { description: nls.localize('trimWhitespaceOnDelete', "Controls whether the editor will also delete the next line's indentation whitespace when deleting a newline.") }
6750 > )),
6751 > unicodeHighlight: register(new UnicodeHighlight()),
6752 > unusualLineTerminators: register(new EditorStringEnumOption(
6753 > EditorOption.unusualLineTerminators, 'unusualLineTerminators',
6754 > 'prompt' as 'auto' | 'off' | 'prompt',
6755 > ['auto', 'off', 'prompt'] as const,
6756 > {
6757 > enumDescriptions: [
6758 > nls.localize('unusualLineTerminators.auto', "Unusual line terminators are automatically removed."),
6759 > nls.localize('unusualLineTerminators.off', "Unusual line terminators are ignored."),
6760 > nls.localize('unusualLineTerminators.prompt', "Unusual line terminators prompt to be removed."),
6761 > ],
6762 > description: nls.localize('unusualLineTerminators', "Remove unusual line terminators that might cause problems.")
6763 > }
6764 > )),
6765 > useShadowDOM: register(new EditorBooleanOption(
6766 > EditorOption.useShadowDOM, 'useShadowDOM', true
6767 > )),
6768 > useTabStops: register(new EditorBooleanOption(
6769 > EditorOption.useTabStops, 'useTabStops', true,
6770 > { description: nls.localize('useTabStops', "Spaces and tabs are inserted and deleted in alignment with tab stops.") }
6771 > )),
6772 > wordBreak: register(new EditorStringEnumOption(
6773 > EditorOption.wordBreak, 'wordBreak',
6774 > 'normal' as 'normal' | 'keepAll',
6775 > ['normal', 'keepAll'] as const,
6776 > {
6777 > markdownEnumDescriptions: [
6778 > nls.localize('wordBreak.normal', "Use the default line break rule."),
6779 > nls.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."),
6780 > ],
6781 > description: nls.localize('wordBreak', "Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")
6782 > }
6783 > )),
6784 > wordSegmenterLocales: register(new WordSegmenterLocales()),
6785 > wordSeparators: register(new EditorStringOption(
6786 > EditorOption.wordSeparators, 'wordSeparators', USUAL_WORD_SEPARATORS,
6787 > { description: nls.localize('wordSeparators', "Characters that will be used as word separators when doing word related navigations or operations.") }
6788 > )),
6789 > wordWrap: register(new EditorStringEnumOption(
6790 > EditorOption.wordWrap, 'wordWrap',
6791 > 'off' as 'off' | 'on' | 'wordWrapColumn' | 'bounded',
6792 > ['off', 'on', 'wordWrapColumn', 'bounded'] as const,
6793 > {
6794 > markdownEnumDescriptions: [
6795 > nls.localize('wordWrap.off', "Lines will never wrap."),
6796 > nls.localize('wordWrap.on', "Lines will wrap at the viewport width."),
6797 > nls.localize({
6798 > key: 'wordWrap.wordWrapColumn',
6799 > comment: [
6800 > '- `editor.wordWrapColumn` refers to a different setting and should not be localized.'
6801 > ]
6802 > }, "Lines will wrap at `#editor.wordWrapColumn#`."),
6803 > nls.localize({
6804 > key: 'wordWrap.bounded',
6805 > comment: [
6806 > '- viewport means the edge of the visible window size.',
6807 > '- `editor.wordWrapColumn` refers to a different setting and should not be localized.'
6808 > ]
6809 > }, "Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`."),
6810 > ],
6811 > description: nls.localize({
6812 > key: 'wordWrap',
6813 > comment: [
6814 > '- \'off\', \'on\', \'wordWrapColumn\' and \'bounded\' refer to values the setting can take and should not be localized.',
6815 > '- `editor.wordWrapColumn` refers to a different setting and should not be localized.'
6816 > ]
6817 > }, "Controls how lines should wrap.")
6818 > }
6819 > )),
6820 > wordWrapBreakAfterCharacters: register(new EditorStringOption(
6821 > EditorOption.wordWrapBreakAfterCharacters, 'wordWrapBreakAfterCharacters',
6822 > // allow-any-unicode-next-line
6823 > ' \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」',
6824 > )),
6825 > wordWrapBreakBeforeCharacters: register(new EditorStringOption(
6826 > EditorOption.wordWrapBreakBeforeCharacters, 'wordWrapBreakBeforeCharacters',
6827 > // allow-any-unicode-next-line
6828 > '([{‘“〈《「『【〔([{「£¥$£¥++'
6829 > )),
6830 > wordWrapColumn: register(new EditorIntOption(
6831 > EditorOption.wordWrapColumn, 'wordWrapColumn',
6832 > 80, 1, Constants.MAX_SAFE_SMALL_INTEGER,
6833 > {
6834 > markdownDescription: nls.localize({
6835 > key: 'wordWrapColumn',
6836 > comment: [
6837 > '- `editor.wordWrap` refers to a different setting and should not be localized.',
6838 > '- \'wordWrapColumn\' and \'bounded\' refer to values the different setting can take and should not be localized.'
6839 > ]
6840 > }, "Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")
6841 > }
6842 > )),
6843 > wordWrapOverride1: register(new EditorStringEnumOption(
6844 > EditorOption.wordWrapOverride1, 'wordWrapOverride1',
6845 > 'inherit' as 'off' | 'on' | 'inherit',
6846 > ['off', 'on', 'inherit'] as const
6847 > )),
6848 > wordWrapOverride2: register(new EditorStringEnumOption(
6849 > EditorOption.wordWrapOverride2, 'wordWrapOverride2',
6850 > 'inherit' as 'off' | 'on' | 'inherit',
6851 > ['off', 'on', 'inherit'] as const
6852 > )),
6853 > wrapOnEscapedLineFeeds: register(new EditorBooleanOption(
6854 > EditorOption.wrapOnEscapedLineFeeds, 'wrapOnEscapedLineFeeds', false,
6855 > { 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```") }
6856 > )),
6857 >
6858 > // Leave these at the end (because they have dependencies!)
6859 > effectiveCursorStyle: register(new EffectiveCursorStyle()),
6860 > editorClassName: register(new EditorClassName()),
6861 > defaultColorDecorators: register(new EditorStringEnumOption(
6862 > EditorOption.defaultColorDecorators, 'defaultColorDecorators', 'auto' as 'auto' | 'always' | 'never',
6863 > ['auto', 'always', 'never'] as const,
6864 > {
6865 > enumDescriptions: [
6866 > nls.localize('editor.defaultColorDecorators.auto', "Show default color decorators only when no extension provides colors decorators."),
6867 > nls.localize('editor.defaultColorDecorators.always', "Always show default color decorators."),
6868 > nls.localize('editor.defaultColorDecorators.never', "Never show default color decorators."),
6869 > ],
6870 > description: nls.localize('defaultColorDecorators', "Controls whether inline color decorations should be shown using the default document color provider.")
6871 > }
6872 > )),
6873 > pixelRatio: register(new EditorPixelRatio()),
6874 > tabFocusMode: register(new EditorBooleanOption(EditorOption.tabFocusMode, 'tabFocusMode', false,
6875 > { markdownDescription: nls.localize('tabFocusMode', "Controls whether the editor receives tabs or defers them to the workbench for navigation.") }
6876 > )),
6877 > layoutInfo: register(new EditorLayoutInfoComputer()),
6878 > wrappingInfo: register(new EditorWrappingInfoComputer()),
6879 > wrappingIndent: register(new WrappingIndentOption()),
6880 > wrappingStrategy: register(new WrappingStrategy()),
6881 > effectiveEditContextEnabled: register(new EffectiveEditContextEnabled()),
6882 > effectiveAllowVariableFonts: register(new EffectiveAllowVariableFonts())
6883 > };
6884 >
6885 > type EditorOptionsType = typeof EditorOptions;
6886 > type FindEditorOptionsKeyById<T extends EditorOption> = { [K in keyof EditorOptionsType]: EditorOptionsType[K]['id'] extends T ? K : never }[keyof EditorOptionsType];
6887 > // eslint-disable-next-line @typescript-eslint/no-explicit-any
6888 > type ComputedEditorOptionValue<T extends IEditorOption<any, any>> = T extends IEditorOption<any, infer R> ? R : never;
6889 > export type FindComputedEditorOptionValueById<T extends EditorOption> = NonNullable<ComputedEditorOptionValue<EditorOptionsType[FindEditorOptionsKeyById<T>]>>;
6890 >
6891 > export type MouseMiddleClickAction = 'default' | 'openLink' | 'ctrlLeftClick';
src/vs/editor/common/config/fontInfo.ts 208 introduced LOC · 5 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- fontInfo.ts
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import * as platform from '../../../base/common/platform.js';
7 > import { EditorOption, FindComputedEditorOptionValueById } from './editorOptions.js';
8 > import { EditorZoom } from './editorZoom.js';
9 >
10 > /**
11 > * Determined from empirical observations.
12 > * @internal
13 > */
14 > export const GOLDEN_LINE_HEIGHT_RATIO = platform.isMacintosh ? 1.5 : 1.35;
15 >
16 > /**
17 > * @internal
18 > */
19 > export const MINIMUM_LINE_HEIGHT = 8;
20 >
21 > /**
22 > * @internal
23 > */
24 > export interface IValidatedEditorOptions {
25 > get<T extends EditorOption>(id: T): FindComputedEditorOptionValueById<T>;
26 > }
27 >
28 > export class BareFontInfo {
29 > readonly _bareFontInfoBrand: void = undefined;
30 >
31 > /**
32 > * @internal
33 > */
34 > public static _create(fontFamily: string, fontWeight: string, fontSize: number, fontFeatureSettings: string, fontVariationSettings: string, lineHeight: number, letterSpacing: number, pixelRatio: number, ignoreEditorZoom: boolean): BareFontInfo {
35 > if (lineHeight === 0) {
36 > lineHeight = GOLDEN_LINE_HEIGHT_RATIO * fontSize;
37 > } else if (lineHeight < MINIMUM_LINE_HEIGHT) {
38 > // Values too small to be line heights in pixels are in ems.
39 > lineHeight = lineHeight * fontSize;
40 > }
41 >
42 > // Enforce integer, minimum constraints
43 > lineHeight = Math.round(lineHeight);
44 > if (lineHeight < MINIMUM_LINE_HEIGHT) {
45 > lineHeight = MINIMUM_LINE_HEIGHT;
46 > }
47 >
48 > const editorZoomLevelMultiplier = 1 + (ignoreEditorZoom ? 0 : EditorZoom.getZoomLevel() * 0.1);
49 > fontSize *= editorZoomLevelMultiplier;
50 > lineHeight *= editorZoomLevelMultiplier;
51 >
52 > if (fontVariationSettings === FONT_VARIATION_TRANSLATE) {
53 > if (fontWeight === 'normal' || fontWeight === 'bold') {
54 > fontVariationSettings = FONT_VARIATION_OFF;
55 > } else {
56 > const fontWeightAsNumber = parseInt(fontWeight, 10);
57 > fontVariationSettings = `'wght' ${fontWeightAsNumber}`;
58 > fontWeight = 'normal';
59 > }
60 > }
61 >
62 > return new BareFontInfo({
63 > pixelRatio: pixelRatio,
64 > fontFamily: fontFamily,
65 > fontWeight: fontWeight,
66 > fontSize: fontSize,
67 > fontFeatureSettings: fontFeatureSettings,
68 > fontVariationSettings,
69 > lineHeight: lineHeight,
70 > letterSpacing: letterSpacing
71 > });
72 > }
73 >
74 > readonly pixelRatio: number;
75 > readonly fontFamily: string;
76 > readonly fontWeight: string;
77 > readonly fontSize: number;
78 > readonly fontFeatureSettings: string;
79 > readonly fontVariationSettings: string;
80 > readonly lineHeight: number;
81 > readonly letterSpacing: number;
82 >
83 > /**
84 > * @internal
85 > */
86 > protected constructor(opts: {
87 > pixelRatio: number;
88 > fontFamily: string;
89 > fontWeight: string;
90 > fontSize: number;
91 > fontFeatureSettings: string;
92 > fontVariationSettings: string;
93 > lineHeight: number;
94 > letterSpacing: number;
95 > }) {
96 > this.pixelRatio = opts.pixelRatio;
97 > this.fontFamily = String(opts.fontFamily);
98 > this.fontWeight = String(opts.fontWeight);
99 > this.fontSize = opts.fontSize;
100 > this.fontFeatureSettings = opts.fontFeatureSettings;
101 > this.fontVariationSettings = opts.fontVariationSettings;
102 > this.lineHeight = opts.lineHeight | 0;
103 > this.letterSpacing = opts.letterSpacing;
104 > }
105 >
106 > /**
107 > * @internal
108 > */
109 > public getId(): string {
110 return `${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`;
111 }
112 > fontInfo.ts
113 > /**
114 > * @internal
115 > */
116 > public getMassagedFontFamily(): string {
117 const fallbackFontFamily = EDITOR_FONT_DEFAULTS.fontFamily;
118 const fontFamily = BareFontInfo._wrapInQuotes(this.fontFamily);
122 return fontFamily;
123 }
124 > fontInfo.ts
125 > private static _wrapInQuotes(fontFamily: string): string {
126 if (/[,"']/.test(fontFamily)) {
127 // Looks like the font family might be already escaped
134 return fontFamily;
135 }
136 > } fontInfo.ts
137 >
138 > // change this whenever `FontInfo` members are changed
139 > export const SERIALIZED_FONT_INFO_VERSION = 2;
140 >
141 > export class FontInfo extends BareFontInfo {
142 > readonly _editorStylingBrand: void = undefined;
143 >
144 > readonly version: number = SERIALIZED_FONT_INFO_VERSION;
145 > readonly isTrusted: boolean;
146 > readonly isMonospace: boolean;
147 > readonly typicalHalfwidthCharacterWidth: number;
148 > readonly typicalFullwidthCharacterWidth: number;
149 > readonly canUseHalfwidthRightwardsArrow: boolean;
150 > readonly spaceWidth: number;
151 > readonly middotWidth: number;
152 > readonly wsmiddotWidth: number;
153 > readonly maxDigitWidth: number;
154 >
155 > /**
156 > * @internal
157 > */
158 > constructor(opts: {
159 > pixelRatio: number;
160 > fontFamily: string;
161 > fontWeight: string;
162 > fontSize: number;
163 > fontFeatureSettings: string;
164 > fontVariationSettings: string;
165 > lineHeight: number;
166 > letterSpacing: number;
167 > isMonospace: boolean;
168 > typicalHalfwidthCharacterWidth: number;
169 > typicalFullwidthCharacterWidth: number;
170 > canUseHalfwidthRightwardsArrow: boolean;
171 > spaceWidth: number;
172 > middotWidth: number;
173 > wsmiddotWidth: number;
174 > maxDigitWidth: number;
175 > }, isTrusted: boolean) {
176 > super(opts);
177 > this.isTrusted = isTrusted;
178 > this.isMonospace = opts.isMonospace;
179 > this.typicalHalfwidthCharacterWidth = opts.typicalHalfwidthCharacterWidth;
180 > this.typicalFullwidthCharacterWidth = opts.typicalFullwidthCharacterWidth;
181 > this.canUseHalfwidthRightwardsArrow = opts.canUseHalfwidthRightwardsArrow;
182 > this.spaceWidth = opts.spaceWidth;
183 > this.middotWidth = opts.middotWidth;
184 > this.wsmiddotWidth = opts.wsmiddotWidth;
185 > this.maxDigitWidth = opts.maxDigitWidth;
186 > }
187 >
188 > /**
189 > * @internal
190 > */
191 > public equals(other: FontInfo): boolean {
192 return (
193 this.fontFamily === other.fontFamily
207 );
208 }
209 > } fontInfo.ts
210 > /**
211 > * @internal
212 > */
213 > export const FONT_VARIATION_OFF = 'normal';
214 > /**
215 > * @internal
216 > */
217 > export const FONT_VARIATION_TRANSLATE = 'translate';
218 >
219 > /**
220 > * @internal
221 > */
222 > export const DEFAULT_WINDOWS_FONT_FAMILY = 'Consolas, \'Courier New\', monospace';
223 > /**
224 > * @internal
225 > */
226 > export const DEFAULT_MAC_FONT_FAMILY = 'Menlo, Monaco, \'Courier New\', monospace';
227 > /**
228 > * @internal
229 > */
230 > export const DEFAULT_LINUX_FONT_FAMILY = '\'Droid Sans Mono\', monospace';
231 > /**
232 > * @internal
233 > */
234 > export const EDITOR_FONT_DEFAULTS = {
235 > fontFamily: (
236 > platform.isMacintosh ? DEFAULT_MAC_FONT_FAMILY : (platform.isWindows ? DEFAULT_WINDOWS_FONT_FAMILY : DEFAULT_LINUX_FONT_FAMILY)
237 > ),
238 > fontWeight: 'normal',
239 > fontSize: (
240 > platform.isMacintosh ? 12 : 14
241 > ),
242 > lineHeight: 0,
243 > letterSpacing: 0,
244 > };
src/vs/platform/accessibility/common/accessibility.ts 49 introduced LOC · 2 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- accessibility.ts
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import { Event } from '../../../base/common/event.js';
7 > import { RawContextKey } from '../../contextkey/common/contextkey.js';
8 > import { createDecorator } from '../../instantiation/common/instantiation.js';
9 >
10 > export const IAccessibilityService = createDecorator<IAccessibilityService>('accessibilityService');
11 >
12 > export interface IAccessibilityService {
13 > readonly _serviceBrand: undefined;
14 >
15 > readonly onDidChangeScreenReaderOptimized: Event<void>;
16 > readonly onDidChangeReducedMotion: Event<void>;
17 > readonly onDidChangeReducedTransparency: Event<void>;
18 >
19 > alwaysUnderlineAccessKeys(): Promise<boolean>;
20 > isScreenReaderOptimized(): boolean;
21 > isMotionReduced(): boolean;
22 > isTransparencyReduced(): boolean;
23 > getAccessibilitySupport(): AccessibilitySupport;
24 > setAccessibilitySupport(accessibilitySupport: AccessibilitySupport): void;
25 > alert(message: string): void;
26 > status(message: string): void;
27 > }
28 >
29 > export const enum AccessibilitySupport {
30 > /**
31 > * This should be the browser case where it is not known if a screen reader is attached or no.
32 > */
33 > Unknown = 0,
34 >
35 > Disabled = 1,
36 >
37 > Enabled = 2
38 > }
39 >
40 > export const CONTEXT_ACCESSIBILITY_MODE_ENABLED = new RawContextKey<boolean>('accessibilityModeEnabled', false);
41 >
42 > export interface IAccessibilityInformation {
43 > label: string;
44 > role?: string;
45 > }
46 >
47 > export function isAccessibilityInformation(obj: unknown): obj is IAccessibilityInformation {
48 if (!obj || typeof obj !== 'object') {
49 return false;
54 && (typeof candidate.role === 'undefined' || typeof candidate.role === 'string');
55 }
57 > export const ACCESSIBLE_VIEW_SHOWN_STORAGE_PREFIX = 'ACCESSIBLE_VIEW_SHOWN_';
src/vs/editor/common/config/editorZoom.ts 24 introduced LOC · 3 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- editorZoom.ts
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import { Emitter, Event } from '../../../base/common/event.js';
7 >
8 > export interface IEditorZoom {
9 > readonly onDidChangeZoomLevel: Event<number>;
10 > getZoomLevel(): number;
11 > setZoomLevel(zoomLevel: number): void;
12 > }
13 >
14 > export const EditorZoom: IEditorZoom = new class implements IEditorZoom {
15 >
16 > private _zoomLevel: number = 0;
17 >
18 > private readonly _onDidChangeZoomLevel = new Emitter<number>();
19 > public readonly onDidChangeZoomLevel: Event<number> = this._onDidChangeZoomLevel.event;
20 >
21 > public getZoomLevel(): number {
22 return this._zoomLevel;
23 }
25 > public setZoomLevel(zoomLevel: number): void {
26 zoomLevel = Math.min(Math.max(-5, zoomLevel), 20);
27 if (this._zoomLevel === zoomLevel) {
32 this._onDidChangeZoomLevel.fire(this._zoomLevel);
33 }
34 > }; editorZoom.ts
src/vs/editor/common/core/misc/textModelDefaults.ts 17 introduced LOC · 1 range

Open complete file

1 > /*--------------------------------------------------------------------------------------------- textModelDefaults.ts
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > export const EDITOR_MODEL_DEFAULTS = {
7 > tabSize: 4,
8 > indentSize: 4,
9 > insertSpaces: true,
10 > detectIndentation: true,
11 > trimAutoWhitespace: true,
12 > largeFileOptimizations: true,
13 > bracketPairColorizationOptions: {
14 > enabled: true,
15 > independentColorPoolPerBracketType: false,
16 > },
17 > };