commonEditorConfig.ts 37.5 KB
Newer Older
E
Erich Gamma 已提交
1 2 3 4 5 6
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
'use strict';

A
Alex Dima 已提交
7
import * as nls from 'vs/nls';
M
Matt Bierner 已提交
8
import { Event, Emitter } from 'vs/base/common/event';
J
Johannes Rieken 已提交
9
import { Disposable } from 'vs/base/common/lifecycle';
A
Alex Dima 已提交
10
import * as objects from 'vs/base/common/objects';
A
Alex Dima 已提交
11
import * as platform from 'vs/base/common/platform';
12
import { Extensions, IConfigurationRegistry, IConfigurationNode, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry';
13
import { Registry } from 'vs/platform/registry/common/platform';
A
Alex Dima 已提交
14
import * as editorCommon from 'vs/editor/common/editorCommon';
15
import { FontInfo, BareFontInfo } from 'vs/editor/common/config/fontInfo';
A
Alex Dima 已提交
16
import { EditorZoom } from 'vs/editor/common/config/editorZoom';
17
import * as editorOptions from 'vs/editor/common/config/editorOptions';
18 19 20
import EDITOR_DEFAULTS = editorOptions.EDITOR_DEFAULTS;
import EDITOR_FONT_DEFAULTS = editorOptions.EDITOR_FONT_DEFAULTS;
import EDITOR_MODEL_DEFAULTS = editorOptions.EDITOR_MODEL_DEFAULTS;
E
Erich Gamma 已提交
21

22 23 24 25 26 27 28
/**
 * Control what pressing Tab does.
 * If it is false, pressing Tab or Shift-Tab will be handled by the editor.
 * If it is true, pressing Tab or Shift-Tab will move the browser focus.
 * Defaults to false.
 */
export interface ITabFocus {
J
Johannes Rieken 已提交
29
	onDidChangeTabFocus: Event<boolean>;
30
	getTabFocusMode(): boolean;
J
Johannes Rieken 已提交
31
	setTabFocusMode(tabFocusMode: boolean): void;
32 33
}

A
Alex Dima 已提交
34
export const TabFocus: ITabFocus = new class implements ITabFocus {
35 36
	private _tabFocus: boolean = false;

M
Matt Bierner 已提交
37
	private readonly _onDidChangeTabFocus: Emitter<boolean> = new Emitter<boolean>();
38
	public readonly onDidChangeTabFocus: Event<boolean> = this._onDidChangeTabFocus.event;
39 40 41 42 43

	public getTabFocusMode(): boolean {
		return this._tabFocus;
	}

J
Johannes Rieken 已提交
44
	public setTabFocusMode(tabFocusMode: boolean): void {
45 46 47 48 49 50 51 52 53
		if (this._tabFocus === tabFocusMode) {
			return;
		}

		this._tabFocus = tabFocusMode;
		this._onDidChangeTabFocus.fire(this._tabFocus);
	}
};

A
Alex Dima 已提交
54 55 56 57
export interface IEnvConfiguration {
	extraEditorClassName: string;
	outerWidth: number;
	outerHeight: number;
58
	emptySelectionClipboard: boolean;
A
Alex Dima 已提交
59 60
	pixelRatio: number;
	zoomLevel: number;
61
	accessibilitySupport: platform.AccessibilitySupport;
62 63
}

64 65
const hasOwnProperty = Object.hasOwnProperty;

A
Alex Dima 已提交
66
export abstract class CommonEditorConfiguration extends Disposable implements editorCommon.IConfiguration {
E
Erich Gamma 已提交
67

68 69
	protected _rawOptions: editorOptions.IEditorOptions;
	protected _validatedOptions: editorOptions.IValidatedEditorOptions;
70
	public editor: editorOptions.InternalEditorOptions;
J
Johannes Rieken 已提交
71
	private _isDominatedByLongLines: boolean;
72
	private _lineNumbersDigitCount: number;
E
Erich Gamma 已提交
73

74
	private _onDidChange = this._register(new Emitter<editorOptions.IConfigurationChangedEvent>());
75
	public readonly onDidChange: Event<editorOptions.IConfigurationChangedEvent> = this._onDidChange.event;
A
Alex Dima 已提交
76

A
Alex Dima 已提交
77
	constructor(options: editorOptions.IEditorOptions) {
A
Alex Dima 已提交
78
		super();
79

80 81 82 83 84
		// Do a "deep clone of sorts" on the incoming options
		this._rawOptions = objects.mixin({}, options || {});
		this._rawOptions.scrollbar = objects.mixin({}, this._rawOptions.scrollbar || {});
		this._rawOptions.minimap = objects.mixin({}, this._rawOptions.minimap || {});
		this._rawOptions.find = objects.mixin({}, this._rawOptions.find || {});
A
Alex Dima 已提交
85
		this._rawOptions.hover = objects.mixin({}, this._rawOptions.hover || {});
86
		this._rawOptions.parameterHints = objects.mixin({}, this._rawOptions.parameterHints || {});
87

88
		this._validatedOptions = editorOptions.EditorOptionsValidator.validate(this._rawOptions, EDITOR_DEFAULTS);
A
Alex Dima 已提交
89
		this.editor = null;
E
Erich Gamma 已提交
90
		this._isDominatedByLongLines = false;
91
		this._lineNumbersDigitCount = 1;
A
Alex Dima 已提交
92

93
		this._register(EditorZoom.onDidChangeZoomLevel(_ => this._recomputeOptions()));
94
		this._register(TabFocus.onDidChangeTabFocus(_ => this._recomputeOptions()));
E
Erich Gamma 已提交
95 96
	}

A
Alex Dima 已提交
97 98 99
	public observeReferenceElement(dimension?: editorCommon.IDimension): void {
	}

E
Erich Gamma 已提交
100 101 102 103 104
	public dispose(): void {
		super.dispose();
	}

	protected _recomputeOptions(): void {
A
Alex Dima 已提交
105 106
		const oldOptions = this.editor;
		const newOptions = this._computeInternalOptions();
107

A
Alex Dima 已提交
108
		if (oldOptions && oldOptions.equals(newOptions)) {
109
			return;
E
Erich Gamma 已提交
110 111
		}

112
		this.editor = newOptions;
E
Erich Gamma 已提交
113

A
Alex Dima 已提交
114 115
		if (oldOptions) {
			this._onDidChange.fire(oldOptions.createChangeEvent(newOptions));
116
		}
E
Erich Gamma 已提交
117
	}
118

119
	public getRawOptions(): editorOptions.IEditorOptions {
120
		return this._rawOptions;
E
Erich Gamma 已提交
121
	}
122

123
	private _computeInternalOptions(): editorOptions.InternalEditorOptions {
124
		const opts = this._validatedOptions;
A
Alex Dima 已提交
125 126
		const partialEnv = this._getEnvConfiguration();
		const bareFontInfo = BareFontInfo.createFromRawSettings(this._rawOptions, partialEnv.zoomLevel);
A
Alex Dima 已提交
127
		const env: editorOptions.IEnvironmentalOptions = {
A
Alex Dima 已提交
128 129
			outerWidth: partialEnv.outerWidth,
			outerHeight: partialEnv.outerHeight,
130
			fontInfo: this.readConfiguration(bareFontInfo),
131
			extraEditorClassName: partialEnv.extraEditorClassName,
132 133
			isDominatedByLongLines: this._isDominatedByLongLines,
			lineNumbersDigitCount: this._lineNumbersDigitCount,
134
			emptySelectionClipboard: partialEnv.emptySelectionClipboard,
A
Alex Dima 已提交
135
			pixelRatio: partialEnv.pixelRatio,
136 137
			tabFocusMode: TabFocus.getTabFocusMode(),
			accessibilitySupport: partialEnv.accessibilitySupport
A
Alex Dima 已提交
138
		};
139
		return editorOptions.InternalEditorOptionsFactory.createInternalEditorOptions(env, opts);
E
Erich Gamma 已提交
140 141
	}

142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
	private static _primitiveArrayEquals(a: any[], b: any[]): boolean {
		if (a.length !== b.length) {
			return false;
		}
		for (let i = 0; i < a.length; i++) {
			if (a[i] !== b[i]) {
				return false;
			}
		}
		return true;
	}

	private static _subsetEquals(base: object, subset: object): boolean {
		for (let key in subset) {
			if (hasOwnProperty.call(subset, key)) {
				const subsetValue = subset[key];
				const baseValue = base[key];

				if (baseValue === subsetValue) {
					continue;
				}
				if (Array.isArray(baseValue) && Array.isArray(subsetValue)) {
					if (!this._primitiveArrayEquals(baseValue, subsetValue)) {
						return false;
					}
					continue;
				}
				if (typeof baseValue === 'object' && typeof subsetValue === 'object') {
					if (!this._subsetEquals(baseValue, subsetValue)) {
						return false;
					}
					continue;
				}

				return false;
			}
		}
		return true;
	}

182
	public updateOptions(newOptions: editorOptions.IEditorOptions): void {
183 184 185 186 187 188
		if (typeof newOptions === 'undefined') {
			return;
		}
		if (CommonEditorConfiguration._subsetEquals(this._rawOptions, newOptions)) {
			return;
		}
189
		this._rawOptions = objects.mixin(this._rawOptions, newOptions || {});
190
		this._validatedOptions = editorOptions.EditorOptionsValidator.validate(this._rawOptions, EDITOR_DEFAULTS);
E
Erich Gamma 已提交
191 192 193
		this._recomputeOptions();
	}

J
Johannes Rieken 已提交
194
	public setIsDominatedByLongLines(isDominatedByLongLines: boolean): void {
E
Erich Gamma 已提交
195 196 197 198
		this._isDominatedByLongLines = isDominatedByLongLines;
		this._recomputeOptions();
	}

J
Johannes Rieken 已提交
199
	public setMaxLineNumber(maxLineNumber: number): void {
200
		let digitCount = CommonEditorConfiguration._digitCount(maxLineNumber);
201
		if (this._lineNumbersDigitCount === digitCount) {
A
Alex Dima 已提交
202 203
			return;
		}
204
		this._lineNumbersDigitCount = digitCount;
E
Erich Gamma 已提交
205 206 207
		this._recomputeOptions();
	}

208
	private static _digitCount(n: number): number {
A
Alex Dima 已提交
209
		let r = 0;
210 211 212 213 214 215
		while (n) {
			n = Math.floor(n / 10);
			r++;
		}
		return r ? r : 1;
	}
A
Alex Dima 已提交
216
	protected abstract _getEnvConfiguration(): IEnvConfiguration;
217

218
	protected abstract readConfiguration(styling: BareFontInfo): FontInfo;
219

E
Erich Gamma 已提交
220 221
}

222
const configurationRegistry = Registry.as<IConfigurationRegistry>(Extensions.Configuration);
223
const editorConfiguration: IConfigurationNode = {
E
Erich Gamma 已提交
224 225 226
	'id': 'editor',
	'order': 5,
	'type': 'object',
227
	'title': nls.localize('editorConfigurationTitle', "Editor"),
228
	'overridable': true,
S
Sandeep Somavarapu 已提交
229
	'scope': ConfigurationScope.RESOURCE,
J
Johannes Rieken 已提交
230 231
	'properties': {
		'editor.fontFamily': {
E
Erich Gamma 已提交
232
			'type': 'string',
233
			'default': EDITOR_FONT_DEFAULTS.fontFamily,
E
Erich Gamma 已提交
234 235
			'description': nls.localize('fontFamily', "Controls the font family.")
		},
J
Johannes Rieken 已提交
236
		'editor.fontWeight': {
237
			'type': 'string',
238
			'enum': ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
239
			'default': EDITOR_FONT_DEFAULTS.fontWeight,
240 241
			'description': nls.localize('fontWeight', "Controls the font weight.")
		},
J
Johannes Rieken 已提交
242
		'editor.fontSize': {
E
Erich Gamma 已提交
243
			'type': 'number',
244
			'default': EDITOR_FONT_DEFAULTS.fontSize,
245
			'description': nls.localize('fontSize', "Controls the font size in pixels.")
E
Erich Gamma 已提交
246
		},
J
Johannes Rieken 已提交
247
		'editor.lineHeight': {
E
Erich Gamma 已提交
248
			'type': 'number',
249
			'default': EDITOR_FONT_DEFAULTS.lineHeight,
S
SteVen Batten 已提交
250
			'description': nls.localize('lineHeight', "Controls the line height. Use 0 to compute the line height from the font size.")
E
Erich Gamma 已提交
251
		},
252 253
		'editor.letterSpacing': {
			'type': 'number',
254
			'default': EDITOR_FONT_DEFAULTS.letterSpacing,
255 256
			'description': nls.localize('letterSpacing', "Controls the letter spacing in pixels.")
		},
J
Johannes Rieken 已提交
257
		'editor.lineNumbers': {
258
			'type': 'string',
259
			'enum': ['off', 'on', 'relative', 'interval'],
260 261 262
			'enumDescriptions': [
				nls.localize('lineNumbers.off', "Line numbers are not rendered."),
				nls.localize('lineNumbers.on', "Line numbers are rendered as absolute number."),
263 264
				nls.localize('lineNumbers.relative', "Line numbers are rendered as distance in lines to cursor position."),
				nls.localize('lineNumbers.interval', "Line numbers are rendered every 10 lines.")
265
			],
266
			'default': 'on',
A
Alex Dima 已提交
267
			'description': nls.localize('lineNumbers', "Controls the display of line numbers.")
E
Erich Gamma 已提交
268
		},
J
Johannes Rieken 已提交
269
		'editor.rulers': {
270 271 272 273
			'type': 'array',
			'items': {
				'type': 'number'
			},
A
Alex Dima 已提交
274
			'default': EDITOR_DEFAULTS.viewInfo.rulers,
S
SteVen Batten 已提交
275
			'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.")
276
		},
J
Johannes Rieken 已提交
277
		'editor.wordSeparators': {
A
Alex Dima 已提交
278
			'type': 'string',
279
			'default': EDITOR_DEFAULTS.wordSeparators,
M
Matt Bierner 已提交
280
			'description': nls.localize('wordSeparators', "Characters that will be used as word separators when doing word related navigations or operations.")
A
Alex Dima 已提交
281
		},
J
Johannes Rieken 已提交
282
		'editor.tabSize': {
283
			'type': 'number',
284
			'default': EDITOR_MODEL_DEFAULTS.tabSize,
E
Erich Gamma 已提交
285
			'minimum': 1,
286
			'markdownDescription': nls.localize('tabSize', "The number of spaces a tab is equal to. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on."),
287
			'errorMessage': nls.localize('tabSize.errorMessage', "Expected 'number'. Note that the value \"auto\" has been replaced by the `editor.detectIndentation` setting.")
E
Erich Gamma 已提交
288
		},
J
Johannes Rieken 已提交
289
		'editor.insertSpaces': {
290
			'type': 'boolean',
291
			'default': EDITOR_MODEL_DEFAULTS.insertSpaces,
292
			'markdownDescription': nls.localize('insertSpaces', "Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on."),
293
			'errorMessage': nls.localize('insertSpaces.errorMessage', "Expected 'boolean'. Note that the value \"auto\" has been replaced by the `editor.detectIndentation` setting.")
E
Erich Gamma 已提交
294
		},
J
Johannes Rieken 已提交
295
		'editor.detectIndentation': {
296
			'type': 'boolean',
297
			'default': EDITOR_MODEL_DEFAULTS.detectIndentation,
298
			'markdownDescription': nls.localize('detectIndentation', "Controls whether `#editor.tabSize#` and `#editor.insertSpaces#` will be automatically detected when a file is opened based on the file contents.")
299
		},
J
Johannes Rieken 已提交
300
		'editor.roundedSelection': {
E
Erich Gamma 已提交
301
			'type': 'boolean',
A
Alex Dima 已提交
302
			'default': EDITOR_DEFAULTS.viewInfo.roundedSelection,
303
			'description': nls.localize('roundedSelection', "Controls whether selections should have rounded corners.")
E
Erich Gamma 已提交
304
		},
J
Johannes Rieken 已提交
305
		'editor.scrollBeyondLastLine': {
E
Erich Gamma 已提交
306
			'type': 'boolean',
A
Alex Dima 已提交
307
			'default': EDITOR_DEFAULTS.viewInfo.scrollBeyondLastLine,
S
SteVen Batten 已提交
308
			'description': nls.localize('scrollBeyondLastLine', "Controls whether the editor will scroll beyond the last line.")
E
Erich Gamma 已提交
309
		},
310 311 312
		'editor.scrollBeyondLastColumn': {
			'type': 'number',
			'default': EDITOR_DEFAULTS.viewInfo.scrollBeyondLastColumn,
S
SteVen Batten 已提交
313
			'description': nls.localize('scrollBeyondLastColumn', "Controls the number of extra characters beyond which the editor will scroll horizontally.")
314
		},
315 316 317
		'editor.smoothScrolling': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.viewInfo.smoothScrolling,
318
			'description': nls.localize('smoothScrolling', "Controls whether the editor will scroll using an animation.")
319
		},
320 321
		'editor.minimap.enabled': {
			'type': 'boolean',
A
Alex Dima 已提交
322
			'default': EDITOR_DEFAULTS.viewInfo.minimap.enabled,
S
SteVen Batten 已提交
323
			'description': nls.localize('minimap.enabled', "Controls whether the minimap is shown.")
324
		},
325 326 327 328
		'editor.minimap.side': {
			'type': 'string',
			'enum': ['left', 'right'],
			'default': EDITOR_DEFAULTS.viewInfo.minimap.side,
A
Alex Dima 已提交
329
			'description': nls.localize('minimap.side', "Controls the side where to render the minimap.")
330
		},
331 332 333 334
		'editor.minimap.showSlider': {
			'type': 'string',
			'enum': ['always', 'mouseover'],
			'default': EDITOR_DEFAULTS.viewInfo.minimap.showSlider,
A
Alex Dima 已提交
335
			'description': nls.localize('minimap.showSlider', "Controls whether the minimap slider is automatically hidden.")
336
		},
337
		'editor.minimap.renderCharacters': {
338
			'type': 'boolean',
A
Alex Dima 已提交
339
			'default': EDITOR_DEFAULTS.viewInfo.minimap.renderCharacters,
S
SteVen Batten 已提交
340
			'description': nls.localize('minimap.renderCharacters', "Render the actual characters on a line as opposed to color blocks.")
341
		},
A
Alex Dima 已提交
342 343
		'editor.minimap.maxColumn': {
			'type': 'number',
A
Alex Dima 已提交
344
			'default': EDITOR_DEFAULTS.viewInfo.minimap.maxColumn,
S
SteVen Batten 已提交
345
			'description': nls.localize('minimap.maxColumn', "Limit the width of the minimap to render at most a certain number of columns.")
A
Alex Dima 已提交
346
		},
A
Alex Dima 已提交
347 348 349
		'editor.hover.enabled': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.contribInfo.hover.enabled,
350
			'description': nls.localize('hover.enabled', "Controls whether the hover is shown.")
A
Alex Dima 已提交
351
		},
352 353 354
		'editor.hover.delay': {
			'type': 'number',
			'default': EDITOR_DEFAULTS.contribInfo.hover.delay,
355
			'description': nls.localize('hover.delay', "Time delay in milliseconds after which to the hover is shown.")
356
		},
357 358 359
		'editor.hover.sticky': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.contribInfo.hover.sticky,
360
			'description': nls.localize('hover.sticky', "Controls whether the hover should remain visible when mouse is moved over it.")
361
		},
362 363 364
		'editor.find.seedSearchStringFromSelection': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.contribInfo.find.seedSearchStringFromSelection,
365
			'description': nls.localize('find.seedSearchStringFromSelection', "Controls whether the search string in the Find Widget is seeded from the editor selection.")
366
		},
R
rebornix 已提交
367 368 369
		'editor.find.autoFindInSelection': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.contribInfo.find.autoFindInSelection,
370
			'description': nls.localize('find.autoFindInSelection', "Controls whether the find operation is carried on selected text or the entire file in the editor.")
R
rebornix 已提交
371
		},
372 373 374
		'editor.find.globalFindClipboard': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.contribInfo.find.globalFindClipboard,
375
			'description': nls.localize('find.globalFindClipboard', "Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),
376
			'included': platform.isMacintosh
377
		},
J
Johannes Rieken 已提交
378
		'editor.wordWrap': {
379
			'type': 'string',
A
Alex Dima 已提交
380
			'enum': ['off', 'on', 'wordWrapColumn', 'bounded'],
381
			'markdownEnumDescriptions': [
382 383
				nls.localize('wordWrap.off', "Lines will never wrap."),
				nls.localize('wordWrap.on', "Lines will wrap at the viewport width."),
A
Alex Dima 已提交
384 385 386 387 388
				nls.localize({
					key: 'wordWrap.wordWrapColumn',
					comment: [
						'- `editor.wordWrapColumn` refers to a different setting and should not be localized.'
					]
389
				}, "Lines will wrap at `#editor.wordWrapColumn#`."),
A
Alex Dima 已提交
390 391 392 393
				nls.localize({
					key: 'wordWrap.bounded',
					comment: [
						'- viewport means the edge of the visible window size.',
A
Alex Dima 已提交
394
						'- `editor.wordWrapColumn` refers to a different setting and should not be localized.'
A
Alex Dima 已提交
395
					]
396
				}, "Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`."),
397
			],
398
			'default': EDITOR_DEFAULTS.wordWrap,
A
Alex Dima 已提交
399 400 401 402 403 404
			'description': nls.localize({
				key: 'wordWrap',
				comment: [
					'- \'off\', \'on\', \'wordWrapColumn\' and \'bounded\' refer to values the setting can take and should not be localized.',
					'- `editor.wordWrapColumn` refers to a different setting and should not be localized.'
				]
405
			}, "Controls how lines should wrap.")
406 407 408
		},
		'editor.wordWrapColumn': {
			'type': 'integer',
409
			'default': EDITOR_DEFAULTS.wordWrapColumn,
410
			'minimum': 1,
411
			'markdownDescription': nls.localize({
A
Alex Dima 已提交
412 413 414 415 416
				key: 'wordWrapColumn',
				comment: [
					'- `editor.wordWrap` refers to a different setting and should not be localized.',
					'- \'wordWrapColumn\' and \'bounded\' refer to values the different setting can take and should not be localized.'
				]
417
			}, "Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")
418
		},
J
Johannes Rieken 已提交
419
		'editor.wrappingIndent': {
E
Erich Gamma 已提交
420
			'type': 'string',
421
			'enum': ['none', 'same', 'indent', 'deepIndent'],
M
Matt Bierner 已提交
422 423 424 425 426 427
			enumDescriptions: [
				nls.localize('wrappingIndent.none', "No indentation. Wrapped lines begin at column 1."),
				nls.localize('wrappingIndent.same', "Wrapped lines get the same indentation as the parent."),
				nls.localize('wrappingIndent.indent', "Wrapped lines get +1 indentation toward the parent."),
				nls.localize('wrappingIndent.deepIndent', "Wrapped lines get +2 indentation toward the parent."),
			],
428
			'default': 'same',
M
Matt Bierner 已提交
429
			'description': nls.localize('wrappingIndent', "Controls the indentation of wrapped lines."),
E
Erich Gamma 已提交
430
		},
J
Johannes Rieken 已提交
431
		'editor.mouseWheelScrollSensitivity': {
E
Erich Gamma 已提交
432
			'type': 'number',
A
Alex Dima 已提交
433
			'default': EDITOR_DEFAULTS.viewInfo.scrollbar.mouseWheelScrollSensitivity,
434
			'markdownDescription': nls.localize('mouseWheelScrollSensitivity', "A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")
E
Erich Gamma 已提交
435
		},
436
		'editor.multiCursorModifier': {
437
			'type': 'string',
438 439
			'enum': ['ctrlCmd', 'alt'],
			'enumDescriptions': [
440 441
				nls.localize('multiCursorModifier.ctrlCmd', "Maps to `Control` on Windows and Linux and to `Command` on macOS."),
				nls.localize('multiCursorModifier.alt', "Maps to `Alt` on Windows and Linux and to `Option` on macOS.")
442
			],
443
			'default': 'alt',
444
			'markdownDescription': nls.localize({
445 446 447 448 449
				key: 'multiCursorModifier',
				comment: [
					'- `ctrlCmd` refers to a value the setting can take and should not be localized.',
					'- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized.'
				]
450
			}, "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. [Read more](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")
451
		},
A
Alex Dima 已提交
452
		'editor.multiCursorMergeOverlapping': {
453
			'type': 'boolean',
A
Alex Dima 已提交
454 455
			'default': EDITOR_DEFAULTS.multiCursorMergeOverlapping,
			'description': nls.localize('multiCursorMergeOverlapping', "Merge multiple cursors when they are overlapping.")
456
		},
J
Johannes Rieken 已提交
457
		'editor.quickSuggestions': {
458
			'anyOf': [
459 460 461
				{
					type: 'boolean',
				},
462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482
				{
					type: 'object',
					properties: {
						strings: {
							type: 'boolean',
							default: false,
							description: nls.localize('quickSuggestions.strings', "Enable quick suggestions inside strings.")
						},
						comments: {
							type: 'boolean',
							default: false,
							description: nls.localize('quickSuggestions.comments', "Enable quick suggestions inside comments.")
						},
						other: {
							type: 'boolean',
							default: true,
							description: nls.localize('quickSuggestions.other', "Enable quick suggestions outside of strings and comments.")
						},
					}
				}
			],
A
Alex Dima 已提交
483
			'default': EDITOR_DEFAULTS.contribInfo.quickSuggestions,
S
SteVen Batten 已提交
484
			'description': nls.localize('quickSuggestions', "Controls whether suggestions should automatically show up while typing.")
E
Erich Gamma 已提交
485
		},
J
Johannes Rieken 已提交
486
		'editor.quickSuggestionsDelay': {
E
Erich Gamma 已提交
487
			'type': 'integer',
A
Alex Dima 已提交
488
			'default': EDITOR_DEFAULTS.contribInfo.quickSuggestionsDelay,
E
Erich Gamma 已提交
489
			'minimum': 0,
S
SteVen Batten 已提交
490
			'description': nls.localize('quickSuggestionsDelay', "Controls the delay in milliseconds after which quick suggestions will show up.")
E
Erich Gamma 已提交
491
		},
492
		'editor.parameterHints.enabled': {
J
Joao Moreno 已提交
493
			'type': 'boolean',
494 495 496 497 498 499 500
			'default': EDITOR_DEFAULTS.contribInfo.parameterHints.enabled,
			'description': nls.localize('parameterHints.enabled', "Enables a pop-up that shows parameter documentation and type information as you type.")
		},
		'editor.parameterHints.cycle': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.contribInfo.parameterHints.cycle,
			'description': nls.localize('parameterHints.cycle', "Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")
J
Joao Moreno 已提交
501
		},
J
Johannes Rieken 已提交
502
		'editor.autoClosingBrackets': {
J
Jackson Kearl 已提交
503 504
			type: 'string',
			enum: ['always', 'languageDefined', 'beforeWhitespace', 'never'],
505
			enumDescriptions: [
506 507 508 509
				'',
				nls.localize('editor.autoClosingBrackets.languageDefined', "Use language configurations to determine when to autoclose brackets."),
				nls.localize('editor.autoClosingBrackets.beforeWhitespace', "Autoclose brackets only when the cursor is to the left of whitespace."),
				'',
510 511

			],
512
			'default': EDITOR_DEFAULTS.autoClosingBrackets,
513
			'description': nls.localize('autoClosingBrackets', "Controls whether the editor should automatically close brackets after the user adds an opening bracket.")
E
Erich Gamma 已提交
514
		},
J
Jackson Kearl 已提交
515
		'editor.autoClosingQuotes': {
J
Jackson Kearl 已提交
516 517
			type: 'string',
			enum: ['always', 'languageDefined', 'beforeWhitespace', 'never'],
518
			enumDescriptions: [
519 520 521 522
				'',
				nls.localize('editor.autoClosingQuotes.languageDefined', "Use language configurations to determine when to autoclose quotes."),
				nls.localize('editor.autoClosingQuotes.beforeWhitespace', "Autoclose quotes only when the cursor is to the left of whitespace."),
				'',
523
			],
J
Jackson Kearl 已提交
524
			'default': EDITOR_DEFAULTS.autoClosingQuotes,
A
Aldo Donetti 已提交
525
			'description': nls.localize('autoClosingQuotes', "Controls whether the editor should automatically close quotes after the user adds an opening quote.")
J
Jackson Kearl 已提交
526 527 528 529
		},
		'editor.autoWrapping': {
			type: 'string',
			enum: ['always', 'brackets', 'quotes', 'never'],
530
			enumDescriptions: [
531 532 533 534
				'',
				nls.localize('editor.autoWrapping.brackets', "Wrap with brackets but not quotes."),
				nls.localize('editor.autoWrapping.quotes', "Wrap with quotes but not brackets."),
				''
535
			],
J
Jackson Kearl 已提交
536
			'default': EDITOR_DEFAULTS.autoWrapping,
537
			'description': nls.localize('autoWrapping', "Controls whether the editor should automatically wrap selections.")
538
		},
J
Johannes Rieken 已提交
539
		'editor.formatOnType': {
E
Erich Gamma 已提交
540
			'type': 'boolean',
A
Alex Dima 已提交
541
			'default': EDITOR_DEFAULTS.contribInfo.formatOnType,
542
			'description': nls.localize('formatOnType', "Controls whether the editor should automatically format the line after typing.")
E
Erich Gamma 已提交
543
		},
544 545
		'editor.formatOnPaste': {
			'type': 'boolean',
A
Alex Dima 已提交
546
			'default': EDITOR_DEFAULTS.contribInfo.formatOnPaste,
547
			'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.")
548
		},
549 550 551
		'editor.autoIndent': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.autoIndent,
552
			'description': nls.localize('autoIndent', "Controls whether the editor should automatically adjust the indentation when users type, paste or move lines. Extensions with indentation rules of the language must be available.")
553
		},
J
Johannes Rieken 已提交
554
		'editor.suggestOnTriggerCharacters': {
E
Erich Gamma 已提交
555
			'type': 'boolean',
A
Alex Dima 已提交
556
			'default': EDITOR_DEFAULTS.contribInfo.suggestOnTriggerCharacters,
557
			'description': nls.localize('suggestOnTriggerCharacters', "Controls whether suggestions should automatically show up when typing trigger characters.")
E
Erich Gamma 已提交
558
		},
J
Johannes Rieken 已提交
559
		'editor.acceptSuggestionOnEnter': {
560 561
			'type': 'string',
			'enum': ['on', 'smart', 'off'],
A
Alex Dima 已提交
562
			'default': EDITOR_DEFAULTS.contribInfo.acceptSuggestionOnEnter,
563 564 565 566 567
			'enumDescriptions': [
				'',
				nls.localize('acceptSuggestionOnEnterSmart', "Only accept a suggestion with `Enter` when it makes a textual change."),
				''
			],
568
			'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.")
569 570 571
		},
		'editor.acceptSuggestionOnCommitCharacter': {
			'type': 'boolean',
A
Alex Dima 已提交
572
			'default': EDITOR_DEFAULTS.contribInfo.acceptSuggestionOnCommitCharacter,
573
			'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.")
574
		},
575
		'editor.snippetSuggestions': {
576
			'type': 'string',
577
			'enum': ['top', 'bottom', 'inline', 'none'],
J
Johannes Rieken 已提交
578 579 580 581 582 583
			'enumDescriptions': [
				nls.localize('snippetSuggestions.top', "Show snippet suggestions on top of other suggestions."),
				nls.localize('snippetSuggestions.bottom', "Show snippet suggestions below other suggestions."),
				nls.localize('snippetSuggestions.inline', "Show snippets suggestions with other suggestions."),
				nls.localize('snippetSuggestions.none', "Do not show snippet suggestions."),
			],
584
			'default': EDITOR_DEFAULTS.contribInfo.suggest.snippets,
585
			'description': nls.localize('snippetSuggestions', "Controls whether snippets are shown with other suggestions and how they are sorted.")
586
		},
587 588
		'editor.emptySelectionClipboard': {
			'type': 'boolean',
589
			'default': EDITOR_DEFAULTS.emptySelectionClipboard,
590 591
			'description': nls.localize('emptySelectionClipboard', "Controls whether copying without a selection copies the current line.")
		},
592
		'editor.wordBasedSuggestions': {
593
			'type': 'boolean',
A
Alex Dima 已提交
594
			'default': EDITOR_DEFAULTS.contribInfo.wordBasedSuggestions,
J
Johannes Rieken 已提交
595
			'description': nls.localize('wordBasedSuggestions', "Controls whether completions should be computed based on words in the document.")
596
		},
J
Johannes Rieken 已提交
597
		'editor.suggestSelection': {
598
			'type': 'string',
J
Johannes Rieken 已提交
599
			'enum': ['first', 'recentlyUsed', 'recentlyUsedByPrefix'],
J
Johannes Rieken 已提交
600
			'enumDescriptions': [
J
Johannes Rieken 已提交
601 602 603
				nls.localize('suggestSelection.first', "Always select the first suggestion."),
				nls.localize('suggestSelection.recentlyUsed', "Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),
				nls.localize('suggestSelection.recentlyUsedByPrefix', "Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`."),
J
Johannes Rieken 已提交
604
			],
J
Johannes Rieken 已提交
605 606
			'default': 'recentlyUsed',
			'description': nls.localize('suggestSelection', "Controls how suggestions are pre-selected when showing the suggest list.")
607
		},
J
Johannes Rieken 已提交
608
		'editor.suggestFontSize': {
J
Joao Moreno 已提交
609 610 611
			'type': 'integer',
			'default': 0,
			'minimum': 0,
612
			'description': nls.localize('suggestFontSize', "Font size for the suggest widget.")
J
Joao Moreno 已提交
613
		},
J
Johannes Rieken 已提交
614
		'editor.suggestLineHeight': {
J
Joao Moreno 已提交
615 616 617
			'type': 'integer',
			'default': 0,
			'minimum': 0,
618
			'description': nls.localize('suggestLineHeight', "Line height for the suggest widget.")
J
Joao Moreno 已提交
619
		},
620 621 622 623 624
		'editor.suggest.filterGraceful': {
			type: 'boolean',
			default: true,
			description: nls.localize('suggest.filterGraceful', "Controls whether filtering and sorting suggestions accounts for small typos.")
		},
625 626 627 628 629
		'editor.suggest.snippetsPreventQuickSuggestions': {
			type: 'boolean',
			default: true,
			description: nls.localize('suggest.snippetsPreventQuickSuggestions', "Control whether an active snippet prevents quick suggestions.")
		},
J
Johannes Rieken 已提交
630
		'editor.selectionHighlight': {
E
Erich Gamma 已提交
631
			'type': 'boolean',
A
Alex Dima 已提交
632
			'default': EDITOR_DEFAULTS.contribInfo.selectionHighlight,
P
Pine Wu 已提交
633
			'description': nls.localize('selectionHighlight', "Controls whether the editor should highlight matches similar to the selection")
E
Erich Gamma 已提交
634
		},
635 636
		'editor.occurrencesHighlight': {
			'type': 'boolean',
A
Alex Dima 已提交
637
			'default': EDITOR_DEFAULTS.contribInfo.occurrencesHighlight,
638
			'description': nls.localize('occurrencesHighlight', "Controls whether the editor should highlight semantic symbol occurrences.")
639
		},
J
Johannes Rieken 已提交
640
		'editor.overviewRulerLanes': {
E
Erich Gamma 已提交
641 642
			'type': 'integer',
			'default': 3,
643
			'description': nls.localize('overviewRulerLanes', "Controls the number of decorations that can show up at the same position in the overview ruler.")
E
Erich Gamma 已提交
644
		},
645
		'editor.overviewRulerBorder': {
646
			'type': 'boolean',
A
Alex Dima 已提交
647
			'default': EDITOR_DEFAULTS.viewInfo.overviewRulerBorder,
S
SteVen Batten 已提交
648
			'description': nls.localize('overviewRulerBorder', "Controls whether a border should be drawn around the overview ruler.")
649
		},
J
Johannes Rieken 已提交
650
		'editor.cursorBlinking': {
651
			'type': 'string',
652
			'enum': ['blink', 'smooth', 'phase', 'expand', 'solid'],
653
			'default': editorOptions.blinkingStyleToString(EDITOR_DEFAULTS.viewInfo.cursorBlinking),
A
Alex Dima 已提交
654
			'description': nls.localize('cursorBlinking', "Control the cursor animation style.")
655
		},
656 657
		'editor.mouseWheelZoom': {
			'type': 'boolean',
A
Alex Dima 已提交
658
			'default': EDITOR_DEFAULTS.viewInfo.mouseWheelZoom,
659
			'markdownDescription': nls.localize('mouseWheelZoom', "Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")
660
		},
J
Johannes Rieken 已提交
661
		'editor.cursorStyle': {
M
markrendle 已提交
662
			'type': 'string',
663
			'enum': ['block', 'block-outline', 'line', 'line-thin', 'underline', 'underline-thin'],
664
			'default': editorOptions.cursorStyleToString(EDITOR_DEFAULTS.viewInfo.cursorStyle),
665
			'description': nls.localize('cursorStyle', "Controls the cursor style.")
M
markrendle 已提交
666
		},
667
		'editor.cursorWidth': {
668
			'type': 'integer',
669
			'default': EDITOR_DEFAULTS.viewInfo.cursorWidth,
670
			'markdownDescription': nls.localize('cursorWidth', "Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")
671
		},
J
Johannes Rieken 已提交
672
		'editor.fontLigatures': {
673
			'type': 'boolean',
A
Alex Dima 已提交
674
			'default': EDITOR_DEFAULTS.viewInfo.fontLigatures,
675
			'description': nls.localize('fontLigatures', "Enables/Disables font ligatures.")
676
		},
J
Johannes Rieken 已提交
677
		'editor.hideCursorInOverviewRuler': {
E
Erich Gamma 已提交
678
			'type': 'boolean',
A
Alex Dima 已提交
679
			'default': EDITOR_DEFAULTS.viewInfo.hideCursorInOverviewRuler,
680
			'description': nls.localize('hideCursorInOverviewRuler', "Controls whether the cursor should be hidden in the overview ruler.")
E
Erich Gamma 已提交
681 682
		},
		'editor.renderWhitespace': {
683 684
			'type': 'string',
			'enum': ['none', 'boundary', 'all'],
685 686 687 688 689
			'enumDescriptions': [
				'',
				nls.localize('renderWhiteSpace.boundary', "Render whitespace characters except for single spaces between words."),
				''
			],
A
Alex Dima 已提交
690
			default: EDITOR_DEFAULTS.viewInfo.renderWhitespace,
691
			description: nls.localize('renderWhitespace', "Controls how the editor should render whitespace characters.")
E
Erich Gamma 已提交
692
		},
693 694
		'editor.renderControlCharacters': {
			'type': 'boolean',
A
Alex Dima 已提交
695
			default: EDITOR_DEFAULTS.viewInfo.renderControlCharacters,
696
			description: nls.localize('renderControlCharacters', "Controls whether the editor should render control characters.")
697
		},
698 699
		'editor.renderIndentGuides': {
			'type': 'boolean',
A
Alex Dima 已提交
700
			default: EDITOR_DEFAULTS.viewInfo.renderIndentGuides,
701
			description: nls.localize('renderIndentGuides', "Controls whether the editor should render indent guides.")
702
		},
703 704 705
		'editor.highlightActiveIndentGuide': {
			'type': 'boolean',
			default: EDITOR_DEFAULTS.viewInfo.highlightActiveIndentGuide,
706
			description: nls.localize('highlightActiveIndentGuide', "Controls whether the editor should highlight the active indent guide.")
707
		},
708
		'editor.renderLineHighlight': {
709 710
			'type': 'string',
			'enum': ['none', 'gutter', 'line', 'all'],
S
SteVen Batten 已提交
711 712 713 714 715 716
			'enumDescriptions': [
				'',
				'',
				'',
				nls.localize('renderLineHighlight.all', "Highlights both the gutter and the current line."),
			],
A
Alex Dima 已提交
717
			default: EDITOR_DEFAULTS.viewInfo.renderLineHighlight,
S
SteVen Batten 已提交
718
			description: nls.localize('renderLineHighlight', "Controls how the editor should render the current line highlight.")
719
		},
J
Johannes Rieken 已提交
720
		'editor.codeLens': {
E
Erich Gamma 已提交
721
			'type': 'boolean',
A
Alex Dima 已提交
722
			'default': EDITOR_DEFAULTS.contribInfo.codeLens,
723
			'description': nls.localize('codeLens', "Controls whether the editor shows CodeLens")
E
Erich Gamma 已提交
724
		},
J
Johannes Rieken 已提交
725
		'editor.folding': {
M
Martin Aeschlimann 已提交
726
			'type': 'boolean',
A
Alex Dima 已提交
727
			'default': EDITOR_DEFAULTS.contribInfo.folding,
728
			'description': nls.localize('folding', "Controls whether the editor has code folding enabled")
M
Martin Aeschlimann 已提交
729
		},
730 731 732 733
		'editor.foldingStrategy': {
			'type': 'string',
			'enum': ['auto', 'indentation'],
			'default': EDITOR_DEFAULTS.contribInfo.foldingStrategy,
734
			'markdownDescription': nls.localize('foldingStrategy', "Controls the strategy for computing folding ranges. `auto` uses a language specific folding strategy, if available. `indentation` uses the indentation based folding strategy.")
735
		},
736 737 738 739 740
		'editor.showFoldingControls': {
			'type': 'string',
			'enum': ['always', 'mouseover'],
			'default': EDITOR_DEFAULTS.contribInfo.showFoldingControls,
			'description': nls.localize('showFoldingControls', "Controls whether the fold controls on the gutter are automatically hidden.")
741
		},
742
		'editor.matchBrackets': {
743
			'type': 'boolean',
A
Alex Dima 已提交
744
			'default': EDITOR_DEFAULTS.contribInfo.matchBrackets,
745
			'description': nls.localize('matchBrackets', "Highlight matching brackets when one of them is selected.")
746
		},
I
isidor 已提交
747 748
		'editor.glyphMargin': {
			'type': 'boolean',
A
Alex Dima 已提交
749
			'default': EDITOR_DEFAULTS.viewInfo.glyphMargin,
I
isidor 已提交
750 751
			'description': nls.localize('glyphMargin', "Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")
		},
J
Johannes Rieken 已提交
752
		'editor.useTabStops': {
753
			'type': 'boolean',
754
			'default': EDITOR_DEFAULTS.useTabStops,
M
Matt Bierner 已提交
755
			'description': nls.localize('useTabStops', "Inserting and deleting whitespace follows tab stops.")
756
		},
J
Johannes Rieken 已提交
757
		'editor.trimAutoWhitespace': {
758
			'type': 'boolean',
759
			'default': EDITOR_MODEL_DEFAULTS.trimAutoWhitespace,
M
Matt Bierner 已提交
760
			'description': nls.localize('trimAutoWhitespace', "Remove trailing auto inserted whitespace.")
761
		},
J
Johannes Rieken 已提交
762
		'editor.stablePeek': {
763
			'type': 'boolean',
764
			'default': false,
765
			'markdownDescription': nls.localize('stablePeek', "Keep peek editors open even when double clicking their content or when hitting `Escape`.")
766
		},
767
		'editor.dragAndDrop': {
768
			'type': 'boolean',
769
			'default': EDITOR_DEFAULTS.dragAndDrop,
770
			'description': nls.localize('dragAndDrop', "Controls whether the editor should allow moving selections via drag and drop.")
771
		},
772 773 774 775 776 777 778 779 780 781 782
		'editor.accessibilitySupport': {
			'type': 'string',
			'enum': ['auto', 'on', 'off'],
			'enumDescriptions': [
				nls.localize('accessibilitySupport.auto', "The editor will use platform APIs to detect when a Screen Reader is attached."),
				nls.localize('accessibilitySupport.on', "The editor will be permanently optimized for usage with a Screen Reader."),
				nls.localize('accessibilitySupport.off', "The editor will never be optimized for usage with a Screen Reader."),
			],
			'default': EDITOR_DEFAULTS.accessibilitySupport,
			'description': nls.localize('accessibilitySupport', "Controls whether the editor should run in a mode where it is optimized for screen readers.")
		},
783 784 785 786 787
		'editor.showUnused': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.showUnused,
			'description': nls.localize('showUnused', "Controls fading out of unused code.")
		},
788
		'editor.links': {
789
			'type': 'boolean',
790
			'default': EDITOR_DEFAULTS.contribInfo.links,
S
SteVen Batten 已提交
791
			'description': nls.localize('links', "Controls whether the editor should detect links and make them clickable.")
792
		},
R
rebornix 已提交
793
		'editor.colorDecorators': {
794
			'type': 'boolean',
R
rebornix 已提交
795
			'default': EDITOR_DEFAULTS.contribInfo.colorDecorators,
796
			'description': nls.localize('colorDecorators', "Controls whether the editor should render the inline color decorators and color picker.")
797
		},
798 799 800
		'editor.lightbulb.enabled': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.contribInfo.lightbulbEnabled,
S
SteVen Batten 已提交
801
			'description': nls.localize('codeActions', "Enables the code action lightbulb in the editor.")
802
		},
803 804 805 806 807
		'editor.codeActionsOnSave': {
			'type': 'object',
			'properties': {
				'source.organizeImports': {
					'type': 'boolean',
808
					'description': nls.localize('codeActionsOnSave.organizeImports', "Controls whether organize imports action should be run on file save.")
809 810 811 812 813 814
				}
			},
			'additionalProperties': {
				'type': 'boolean'
			},
			'default': EDITOR_DEFAULTS.contribInfo.codeActionsOnSave,
M
Matt Bierner 已提交
815
			'description': nls.localize('codeActionsOnSave', "Code action kinds to be run on save.")
816 817 818 819
		},
		'editor.codeActionsOnSaveTimeout': {
			'type': 'number',
			'default': EDITOR_DEFAULTS.contribInfo.codeActionsOnSaveTimeout,
820
			'description': nls.localize('codeActionsOnSaveTimeout', "Timeout in milliseconds after which the code actions that are run on save are cancelled.")
821
		},
822 823 824
		'editor.selectionClipboard': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.contribInfo.selectionClipboard,
S
SteVen Batten 已提交
825
			'description': nls.localize('selectionClipboard', "Controls whether the Linux primary clipboard should be supported."),
826
			'included': platform.isLinux
827
		},
J
Johannes Rieken 已提交
828
		'diffEditor.renderSideBySide': {
E
Erich Gamma 已提交
829 830
			'type': 'boolean',
			'default': true,
831
			'description': nls.localize('sideBySide', "Controls whether the diff editor shows the diff side by side or inline.")
E
Erich Gamma 已提交
832
		},
J
Johannes Rieken 已提交
833
		'diffEditor.ignoreTrimWhitespace': {
E
Erich Gamma 已提交
834 835
			'type': 'boolean',
			'default': true,
836
			'description': nls.localize('ignoreTrimWhitespace', "Controls whether the diff editor shows changes in leading or trailing whitespace as diffs.")
837
		},
838 839 840 841
		'editor.largeFileOptimizations': {
			'type': 'boolean',
			'default': EDITOR_MODEL_DEFAULTS.largeFileOptimizations,
			'description': nls.localize('largeFileOptimizations', "Special handling for large files to disable certain memory intensive features.")
842
		},
843 844 845
		'diffEditor.renderIndicators': {
			'type': 'boolean',
			'default': true,
846
			'description': nls.localize('renderIndicators', "Controls whether the diff editor shows +/- indicators for added/removed changes.")
E
Erich Gamma 已提交
847 848
		}
	}
A
Alex Dima 已提交
849 850
};

851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870
let cachedEditorConfigurationKeys: { [key: string]: boolean; } = null;
function getEditorConfigurationKeys(): { [key: string]: boolean; } {
	if (cachedEditorConfigurationKeys === null) {
		cachedEditorConfigurationKeys = Object.create(null);
		Object.keys(editorConfiguration.properties).forEach((prop) => {
			cachedEditorConfigurationKeys[prop] = true;
		});
	}
	return cachedEditorConfigurationKeys;
}

export function isEditorConfigurationKey(key: string): boolean {
	const editorConfigurationKeys = getEditorConfigurationKeys();
	return (editorConfigurationKeys[`editor.${key}`] || false);
}
export function isDiffEditorConfigurationKey(key: string): boolean {
	const editorConfigurationKeys = getEditorConfigurationKeys();
	return (editorConfigurationKeys[`diffEditor.${key}`] || false);
}

871
configurationRegistry.registerConfiguration(editorConfiguration);