5779
};
5780
}
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';