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

A
Alex Dima 已提交
6
import * as nls from 'vs/nls';
A
Alex Dima 已提交
7
import { Emitter, Event } from 'vs/base/common/event';
J
Johannes Rieken 已提交
8
import { Disposable } from 'vs/base/common/lifecycle';
A
Alex Dima 已提交
9
import * as objects from 'vs/base/common/objects';
A
Alex Dima 已提交
10
import * as platform from 'vs/base/common/platform';
A
Alex Dima 已提交
11
import { IEditorOptions, RawEditorOptions, editorOptionsRegistry, ValidatedEditorOptions, IEnvironmentalOptions, ComputedEditorOptions, ChangedEditorOptions, IValidatedEditorOptions, InternalEditorOptions, IConfigurationChangedEvent, EditorOptionsValidator, EDITOR_DEFAULTS, InternalEditorOptionsFactory, EDITOR_FONT_DEFAULTS, EditorOptions, EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/config/editorOptions';
A
Alex Dima 已提交
12 13 14 15 16
import { EditorZoom } from 'vs/editor/common/config/editorZoom';
import { BareFontInfo, FontInfo } from 'vs/editor/common/config/fontInfo';
import * as editorCommon from 'vs/editor/common/editorCommon';
import { ConfigurationScope, Extensions, IConfigurationNode, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
import { Registry } from 'vs/platform/registry/common/platform';
17
import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';
E
Erich Gamma 已提交
18

19 20 21 22 23 24 25
/**
 * 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 已提交
26
	onDidChangeTabFocus: Event<boolean>;
27
	getTabFocusMode(): boolean;
J
Johannes Rieken 已提交
28
	setTabFocusMode(tabFocusMode: boolean): void;
29 30
}

A
Alex Dima 已提交
31
export const TabFocus: ITabFocus = new class implements ITabFocus {
32 33
	private _tabFocus: boolean = false;

34
	private readonly _onDidChangeTabFocus = new Emitter<boolean>();
35
	public readonly onDidChangeTabFocus: Event<boolean> = this._onDidChangeTabFocus.event;
36 37 38 39 40

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

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

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

A
Alex Dima 已提交
51 52 53 54
export interface IEnvConfiguration {
	extraEditorClassName: string;
	outerWidth: number;
	outerHeight: number;
55
	emptySelectionClipboard: boolean;
A
Alex Dima 已提交
56 57
	pixelRatio: number;
	zoomLevel: number;
58
	accessibilitySupport: AccessibilitySupport;
59 60
}

61 62
const hasOwnProperty = Object.hasOwnProperty;

63
export class EditorConfiguration2 {
64
	public static readOptions(options: IEditorOptions): RawEditorOptions {
65
		// console.log(`parseOptions`, options);
66 67
		const result = new RawEditorOptions();
		for (const editorOption of editorOptionsRegistry) {
68 69 70 71 72
			result._write(editorOption.id, editorOption.read(options));
		}
		return result;
	}

73
	public static mixOptions(a: RawEditorOptions, b: IEditorOptions): RawEditorOptions {
74
		// console.log(`mixOptions`, a, b);
75 76
		const result = new RawEditorOptions();
		for (const editorOption of editorOptionsRegistry) {
77 78 79 80 81
			result._write(editorOption.id, editorOption.mix(a._read(editorOption.id), editorOption.read(b)));
		}
		return result;
	}

82
	public static validateOptions(options: RawEditorOptions): ValidatedEditorOptions {
83
		// console.log(`validateOptions`, options);
84 85
		const result = new ValidatedEditorOptions();
		for (const editorOption of editorOptionsRegistry) {
86 87 88 89 90
			result._write(editorOption.id, editorOption.validate(options._read(editorOption.id)));
		}
		return result;
	}

91
	public static computeOptions(options: ValidatedEditorOptions, env: IEnvironmentalOptions): ComputedEditorOptions {
92
		// console.log(`computeOptions`, options, env);
93 94
		const result = new ComputedEditorOptions();
		for (const editorOption of editorOptionsRegistry) {
A
Alex Dima 已提交
95
			result._write(editorOption.id, editorOption.compute(env, result, options._read(editorOption.id)));
96 97 98 99
		}
		return result;
	}

100
	public static checkEquals(a: ComputedEditorOptions, b: ComputedEditorOptions): ChangedEditorOptions | null {
101
		// console.log(`equals`, a, b);
102
		const result = new ChangedEditorOptions();
103
		let somethingChanged = false;
104
		for (const editorOption of editorOptionsRegistry) {
A
Alex Dima 已提交
105 106 107
			const changed = !editorOption.equals(a._read(editorOption.id), b._read(editorOption.id));
			result._write(editorOption.id, changed);
			if (changed) {
108 109 110 111 112 113 114
				somethingChanged = true;
			}
		}
		return (somethingChanged ? result : null);
	}
}

A
Alex Dima 已提交
115 116 117
/**
 * Compatibility with old options
 */
118
function migrateOptions(options: IEditorOptions): void {
A
Alex Dima 已提交
119 120 121 122 123 124 125 126 127 128 129 130 131
	let wordWrap = options.wordWrap;
	if (<any>wordWrap === true) {
		options.wordWrap = 'on';
	} else if (<any>wordWrap === false) {
		options.wordWrap = 'off';
	}

	let lineNumbers = options.lineNumbers;
	if (<any>lineNumbers === true) {
		options.lineNumbers = 'on';
	} else if (<any>lineNumbers === false) {
		options.lineNumbers = 'off';
	}
A
Alex Dima 已提交
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157

	let autoClosingBrackets = options.autoClosingBrackets;
	if (<any>autoClosingBrackets === false) {
		options.autoClosingBrackets = 'never';
		options.autoClosingQuotes = 'never';
		options.autoSurround = 'never';
	}

	let cursorBlinking = options.cursorBlinking;
	if (<any>cursorBlinking === 'visible') {
		options.cursorBlinking = 'solid';
	}

	let renderWhitespace = options.renderWhitespace;
	if (<any>renderWhitespace === true) {
		options.renderWhitespace = 'boundary';
	} else if (<any>renderWhitespace === false) {
		options.renderWhitespace = 'none';
	}

	let renderLineHighlight = options.renderLineHighlight;
	if (<any>renderLineHighlight === true) {
		options.renderLineHighlight = 'line';
	} else if (<any>renderLineHighlight === false) {
		options.renderLineHighlight = 'none';
	}
A
Alex Dima 已提交
158 159
}

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

A
Alex Dima 已提交
162
	public readonly isSimpleWidget: boolean;
163 164 165
	protected _rawOptions: IEditorOptions;
	protected _validatedOptions: IValidatedEditorOptions;
	public editor!: InternalEditorOptions;
J
Johannes Rieken 已提交
166
	private _isDominatedByLongLines: boolean;
167
	private _lineNumbersDigitCount: number;
E
Erich Gamma 已提交
168

169 170
	private _onDidChange = this._register(new Emitter<IConfigurationChangedEvent>());
	public readonly onDidChange: Event<IConfigurationChangedEvent> = this._onDidChange.event;
A
Alex Dima 已提交
171

172
	private _rawOptions2: RawEditorOptions;
A
Alex Dima 已提交
173
	protected _validatedOptions2: ValidatedEditorOptions;
174
	public options!: ComputedEditorOptions;
175

176
	constructor(isSimpleWidget: boolean, options: IEditorOptions) {
A
Alex Dima 已提交
177
		super();
A
Alex Dima 已提交
178
		migrateOptions(options);
179

A
Alex Dima 已提交
180 181
		this.isSimpleWidget = isSimpleWidget;

182 183 184 185 186
		// 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 已提交
187
		this._rawOptions.hover = objects.mixin({}, this._rawOptions.hover || {});
188
		this._rawOptions.parameterHints = objects.mixin({}, this._rawOptions.parameterHints || {});
189

190
		this._validatedOptions = EditorOptionsValidator.validate(this._rawOptions, EDITOR_DEFAULTS);
191 192 193 194

		this._rawOptions2 = EditorConfiguration2.readOptions(options);
		this._validatedOptions2 = EditorConfiguration2.validateOptions(this._rawOptions2);

E
Erich Gamma 已提交
195
		this._isDominatedByLongLines = false;
196
		this._lineNumbersDigitCount = 1;
A
Alex Dima 已提交
197

198
		this._register(EditorZoom.onDidChangeZoomLevel(_ => this._recomputeOptions()));
199
		this._register(TabFocus.onDidChangeTabFocus(_ => this._recomputeOptions()));
E
Erich Gamma 已提交
200 201
	}

A
Alex Dima 已提交
202 203 204
	public observeReferenceElement(dimension?: editorCommon.IDimension): void {
	}

E
Erich Gamma 已提交
205 206 207 208 209
	public dispose(): void {
		super.dispose();
	}

	protected _recomputeOptions(): void {
A
Alex Dima 已提交
210
		const oldOptions = this.editor;
211 212 213 214
		const oldOptions2 = this.options;
		const [newOptions, newOptions2] = this._computeInternalOptions();

		const changeEvent = (oldOptions2 ? EditorConfiguration2.checkEquals(oldOptions2, newOptions2) : null);
215

216
		if (oldOptions && oldOptions.equals(newOptions) && oldOptions2 && changeEvent === null) {
217
			return;
E
Erich Gamma 已提交
218 219
		}

220
		this.editor = newOptions;
221
		this.options = newOptions2;
E
Erich Gamma 已提交
222

A
Alex Dima 已提交
223
		if (oldOptions) {
224
			this._onDidChange.fire(oldOptions.createChangeEvent(newOptions, changeEvent));
225
		}
E
Erich Gamma 已提交
226
	}
227

228
	public getRawOptions(): IEditorOptions {
229
		return this._rawOptions;
E
Erich Gamma 已提交
230
	}
231

232
	private _computeInternalOptions(): [InternalEditorOptions, ComputedEditorOptions] {
233
		const opts = this._validatedOptions;
A
Alex Dima 已提交
234
		const partialEnv = this._getEnvConfiguration();
A
Alex Dima 已提交
235
		const bareFontInfo = BareFontInfo.createFromRawSettings(this._rawOptions, partialEnv.zoomLevel, this.isSimpleWidget);
236
		const env: IEnvironmentalOptions = {
A
Alex Dima 已提交
237 238
			outerWidth: partialEnv.outerWidth,
			outerHeight: partialEnv.outerHeight,
239
			fontInfo: this.readConfiguration(bareFontInfo),
240
			extraEditorClassName: partialEnv.extraEditorClassName,
241 242
			isDominatedByLongLines: this._isDominatedByLongLines,
			lineNumbersDigitCount: this._lineNumbersDigitCount,
243
			emptySelectionClipboard: partialEnv.emptySelectionClipboard,
A
Alex Dima 已提交
244
			pixelRatio: partialEnv.pixelRatio,
245 246
			tabFocusMode: TabFocus.getTabFocusMode(),
			accessibilitySupport: partialEnv.accessibilitySupport
A
Alex Dima 已提交
247
		};
248
		const r = InternalEditorOptionsFactory.createInternalEditorOptions(env, opts);
249 250
		const r2 = EditorConfiguration2.computeOptions(this._validatedOptions2, env);
		return [r, r2];
E
Erich Gamma 已提交
251 252
	}

253 254 255 256 257 258 259 260 261 262 263 264
	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;
	}

M
Matt Bierner 已提交
265 266
	private static _subsetEquals(base: { [key: string]: any }, subset: { [key: string]: any }): boolean {
		for (const key in subset) {
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
			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;
	}

293
	public updateOptions(newOptions: IEditorOptions): void {
294 295 296
		if (typeof newOptions === 'undefined') {
			return;
		}
A
Alex Dima 已提交
297
		migrateOptions(newOptions);
298 299 300
		if (CommonEditorConfiguration._subsetEquals(this._rawOptions, newOptions)) {
			return;
		}
301
		this._rawOptions = objects.mixin(this._rawOptions, newOptions || {});
302 303
		this._rawOptions2 = EditorConfiguration2.mixOptions(this._rawOptions2, newOptions);

304
		this._validatedOptions = EditorOptionsValidator.validate(this._rawOptions, EDITOR_DEFAULTS);
305 306
		this._validatedOptions2 = EditorConfiguration2.validateOptions(this._rawOptions2);

E
Erich Gamma 已提交
307 308 309
		this._recomputeOptions();
	}

J
Johannes Rieken 已提交
310
	public setIsDominatedByLongLines(isDominatedByLongLines: boolean): void {
E
Erich Gamma 已提交
311 312 313 314
		this._isDominatedByLongLines = isDominatedByLongLines;
		this._recomputeOptions();
	}

J
Johannes Rieken 已提交
315
	public setMaxLineNumber(maxLineNumber: number): void {
316
		let digitCount = CommonEditorConfiguration._digitCount(maxLineNumber);
317
		if (this._lineNumbersDigitCount === digitCount) {
A
Alex Dima 已提交
318 319
			return;
		}
320
		this._lineNumbersDigitCount = digitCount;
E
Erich Gamma 已提交
321 322 323
		this._recomputeOptions();
	}

324
	private static _digitCount(n: number): number {
A
Alex Dima 已提交
325
		let r = 0;
326 327 328 329 330 331
		while (n) {
			n = Math.floor(n / 10);
			r++;
		}
		return r ? r : 1;
	}
A
Alex Dima 已提交
332
	protected abstract _getEnvConfiguration(): IEnvConfiguration;
333

334
	protected abstract readConfiguration(styling: BareFontInfo): FontInfo;
335

E
Erich Gamma 已提交
336 337
}

338
const configurationRegistry = Registry.as<IConfigurationRegistry>(Extensions.Configuration);
339
const editorConfiguration: IConfigurationNode = {
E
Erich Gamma 已提交
340 341 342
	'id': 'editor',
	'order': 5,
	'type': 'object',
343
	'title': nls.localize('editorConfigurationTitle', "Editor"),
344
	'overridable': true,
S
Sandeep Somavarapu 已提交
345
	'scope': ConfigurationScope.RESOURCE,
J
Johannes Rieken 已提交
346 347
	'properties': {
		'editor.fontFamily': {
E
Erich Gamma 已提交
348
			'type': 'string',
349
			'default': EDITOR_FONT_DEFAULTS.fontFamily,
E
Erich Gamma 已提交
350 351
			'description': nls.localize('fontFamily', "Controls the font family.")
		},
J
Johannes Rieken 已提交
352
		'editor.fontWeight': {
353
			'type': 'string',
354
			'enum': ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
355
			'default': EDITOR_FONT_DEFAULTS.fontWeight,
356 357
			'description': nls.localize('fontWeight', "Controls the font weight.")
		},
J
Johannes Rieken 已提交
358
		'editor.fontSize': {
E
Erich Gamma 已提交
359
			'type': 'number',
360
			'default': EDITOR_FONT_DEFAULTS.fontSize,
361
			'description': nls.localize('fontSize', "Controls the font size in pixels.")
E
Erich Gamma 已提交
362
		},
J
Johannes Rieken 已提交
363
		'editor.lineHeight': {
E
Erich Gamma 已提交
364
			'type': 'number',
365
			'default': EDITOR_FONT_DEFAULTS.lineHeight,
S
SteVen Batten 已提交
366
			'description': nls.localize('lineHeight', "Controls the line height. Use 0 to compute the line height from the font size.")
E
Erich Gamma 已提交
367
		},
368 369
		'editor.letterSpacing': {
			'type': 'number',
370
			'default': EDITOR_FONT_DEFAULTS.letterSpacing,
371 372
			'description': nls.localize('letterSpacing', "Controls the letter spacing in pixels.")
		},
J
Johannes Rieken 已提交
373
		'editor.lineNumbers': {
374
			'type': 'string',
375
			'enum': ['off', 'on', 'relative', 'interval'],
376 377 378
			'enumDescriptions': [
				nls.localize('lineNumbers.off', "Line numbers are not rendered."),
				nls.localize('lineNumbers.on', "Line numbers are rendered as absolute number."),
379 380
				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.")
381
			],
382
			'default': 'on',
A
Alex Dima 已提交
383
			'description': nls.localize('lineNumbers', "Controls the display of line numbers.")
E
Erich Gamma 已提交
384
		},
385
		'editor.cursorSurroundingLines': {
P
Peng Lyu 已提交
386
			'type': 'number',
A
Alex Dima 已提交
387
			'default': EditorOptions.cursorSurroundingLines.defaultValue,
388
			'description': nls.localize('cursorSurroundingLines', "Controls the minimal number of visible leading and trailing lines surrounding the cursor. Known as 'scrollOff' or `scrollOffset` in some other editors.")
P
Peng Lyu 已提交
389
		},
A
Alex Dima 已提交
390
		'editor.renderFinalNewline': {
391
			'type': 'boolean',
A
renames  
Alex Dima 已提交
392
			'default': EditorOptions.renderFinalNewline.defaultValue,
A
Alex Dima 已提交
393
			'description': nls.localize('renderFinalNewline', "Render last line number when the file ends with a newline.")
394
		},
J
Johannes Rieken 已提交
395
		'editor.rulers': {
396 397 398 399
			'type': 'array',
			'items': {
				'type': 'number'
			},
A
Alex Dima 已提交
400
			'default': EditorOptions.rulers.defaultValue,
S
SteVen Batten 已提交
401
			'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.")
402
		},
J
Johannes Rieken 已提交
403
		'editor.wordSeparators': {
A
Alex Dima 已提交
404
			'type': 'string',
A
Alex Dima 已提交
405
			'default': EditorOptions.wordSeparators.defaultValue,
M
Matt Bierner 已提交
406
			'description': nls.localize('wordSeparators', "Characters that will be used as word separators when doing word related navigations or operations.")
A
Alex Dima 已提交
407
		},
J
Johannes Rieken 已提交
408
		'editor.tabSize': {
409
			'type': 'number',
410
			'default': EDITOR_MODEL_DEFAULTS.tabSize,
E
Erich Gamma 已提交
411
			'minimum': 1,
412
			'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.")
E
Erich Gamma 已提交
413
		},
414 415 416 417 418 419 420 421 422 423 424 425 426 427
		// 'editor.indentSize': {
		// 	'anyOf': [
		// 		{
		// 			'type': 'string',
		// 			'enum': ['tabSize']
		// 		},
		// 		{
		// 			'type': 'number',
		// 			'minimum': 1
		// 		}
		// 	],
		// 	'default': 'tabSize',
		// 	'markdownDescription': nls.localize('indentSize', "The number of spaces used for indentation or 'tabSize' to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.")
		// },
J
Johannes Rieken 已提交
428
		'editor.insertSpaces': {
429
			'type': 'boolean',
430
			'default': EDITOR_MODEL_DEFAULTS.insertSpaces,
431
			'markdownDescription': nls.localize('insertSpaces', "Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.")
E
Erich Gamma 已提交
432
		},
J
Johannes Rieken 已提交
433
		'editor.detectIndentation': {
434
			'type': 'boolean',
435
			'default': EDITOR_MODEL_DEFAULTS.detectIndentation,
436
			'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.")
437
		},
J
Johannes Rieken 已提交
438
		'editor.roundedSelection': {
E
Erich Gamma 已提交
439
			'type': 'boolean',
A
Alex Dima 已提交
440
			'default': EditorOptions.roundedSelection.defaultValue,
441
			'description': nls.localize('roundedSelection', "Controls whether selections should have rounded corners.")
E
Erich Gamma 已提交
442
		},
J
Johannes Rieken 已提交
443
		'editor.scrollBeyondLastLine': {
E
Erich Gamma 已提交
444
			'type': 'boolean',
A
Alex Dima 已提交
445
			'default': EditorOptions.scrollBeyondLastLine.defaultValue,
S
SteVen Batten 已提交
446
			'description': nls.localize('scrollBeyondLastLine', "Controls whether the editor will scroll beyond the last line.")
E
Erich Gamma 已提交
447
		},
448 449
		'editor.scrollBeyondLastColumn': {
			'type': 'number',
A
Alex Dima 已提交
450
			'default': EditorOptions.scrollBeyondLastColumn.defaultValue,
S
SteVen Batten 已提交
451
			'description': nls.localize('scrollBeyondLastColumn', "Controls the number of extra characters beyond which the editor will scroll horizontally.")
452
		},
453 454
		'editor.smoothScrolling': {
			'type': 'boolean',
A
Alex Dima 已提交
455
			'default': EditorOptions.smoothScrolling.defaultValue,
456
			'description': nls.localize('smoothScrolling', "Controls whether the editor will scroll using an animation.")
457
		},
458 459
		'editor.minimap.enabled': {
			'type': 'boolean',
A
renames  
Alex Dima 已提交
460
			'default': EditorOptions.minimap.defaultValue.enabled,
S
SteVen Batten 已提交
461
			'description': nls.localize('minimap.enabled', "Controls whether the minimap is shown.")
462
		},
463 464 465
		'editor.minimap.side': {
			'type': 'string',
			'enum': ['left', 'right'],
A
renames  
Alex Dima 已提交
466
			'default': EditorOptions.minimap.defaultValue.side,
A
Alex Dima 已提交
467
			'description': nls.localize('minimap.side', "Controls the side where to render the minimap.")
468
		},
469 470 471
		'editor.minimap.showSlider': {
			'type': 'string',
			'enum': ['always', 'mouseover'],
A
renames  
Alex Dima 已提交
472
			'default': EditorOptions.minimap.defaultValue.showSlider,
A
Alex Dima 已提交
473
			'description': nls.localize('minimap.showSlider', "Controls whether the minimap slider is automatically hidden.")
474
		},
475
		'editor.minimap.renderCharacters': {
476
			'type': 'boolean',
A
renames  
Alex Dima 已提交
477
			'default': EditorOptions.minimap.defaultValue.renderCharacters,
S
SteVen Batten 已提交
478
			'description': nls.localize('minimap.renderCharacters', "Render the actual characters on a line as opposed to color blocks.")
479
		},
A
Alex Dima 已提交
480 481
		'editor.minimap.maxColumn': {
			'type': 'number',
A
renames  
Alex Dima 已提交
482
			'default': EditorOptions.minimap.defaultValue.maxColumn,
S
SteVen Batten 已提交
483
			'description': nls.localize('minimap.maxColumn', "Limit the width of the minimap to render at most a certain number of columns.")
A
Alex Dima 已提交
484
		},
A
Alex Dima 已提交
485 486 487
		'editor.hover.enabled': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.contribInfo.hover.enabled,
488
			'description': nls.localize('hover.enabled', "Controls whether the hover is shown.")
A
Alex Dima 已提交
489
		},
490 491 492
		'editor.hover.delay': {
			'type': 'number',
			'default': EDITOR_DEFAULTS.contribInfo.hover.delay,
493
			'description': nls.localize('hover.delay', "Controls the delay in milliseconds after which the hover is shown.")
494
		},
495 496 497
		'editor.hover.sticky': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.contribInfo.hover.sticky,
498
			'description': nls.localize('hover.sticky', "Controls whether the hover should remain visible when mouse is moved over it.")
499
		},
500 501 502
		'editor.find.seedSearchStringFromSelection': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.contribInfo.find.seedSearchStringFromSelection,
503
			'description': nls.localize('find.seedSearchStringFromSelection', "Controls whether the search string in the Find Widget is seeded from the editor selection.")
504
		},
R
rebornix 已提交
505 506 507
		'editor.find.autoFindInSelection': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.contribInfo.find.autoFindInSelection,
508
			'description': nls.localize('find.autoFindInSelection', "Controls whether the find operation is carried out on selected text or the entire file in the editor.")
R
rebornix 已提交
509
		},
510 511 512
		'editor.find.globalFindClipboard': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.contribInfo.find.globalFindClipboard,
513
			'description': nls.localize('find.globalFindClipboard', "Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),
514
			'included': platform.isMacintosh
515
		},
516 517 518
		'editor.find.addExtraSpaceOnTop': {
			'type': 'boolean',
			'default': true,
P
Peng Lyu 已提交
519
			'description': nls.localize('find.addExtraSpaceOnTop', "Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")
520
		},
J
Johannes Rieken 已提交
521
		'editor.wordWrap': {
522
			'type': 'string',
A
Alex Dima 已提交
523
			'enum': ['off', 'on', 'wordWrapColumn', 'bounded'],
524
			'markdownEnumDescriptions': [
525 526
				nls.localize('wordWrap.off', "Lines will never wrap."),
				nls.localize('wordWrap.on', "Lines will wrap at the viewport width."),
A
Alex Dima 已提交
527 528 529 530 531
				nls.localize({
					key: 'wordWrap.wordWrapColumn',
					comment: [
						'- `editor.wordWrapColumn` refers to a different setting and should not be localized.'
					]
532
				}, "Lines will wrap at `#editor.wordWrapColumn#`."),
A
Alex Dima 已提交
533 534 535 536
				nls.localize({
					key: 'wordWrap.bounded',
					comment: [
						'- viewport means the edge of the visible window size.',
A
Alex Dima 已提交
537
						'- `editor.wordWrapColumn` refers to a different setting and should not be localized.'
A
Alex Dima 已提交
538
					]
539
				}, "Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`."),
540
			],
A
renames  
Alex Dima 已提交
541
			'default': EditorOptions.wordWrap.defaultValue,
A
Alex Dima 已提交
542 543 544 545 546 547
			'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.'
				]
548
			}, "Controls how lines should wrap.")
549 550 551
		},
		'editor.wordWrapColumn': {
			'type': 'integer',
A
renames  
Alex Dima 已提交
552
			'default': EditorOptions.wordWrapColumn.defaultValue,
553
			'minimum': 1,
554
			'markdownDescription': nls.localize({
A
Alex Dima 已提交
555 556 557 558 559
				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.'
				]
560
			}, "Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")
561
		},
J
Johannes Rieken 已提交
562
		'editor.wrappingIndent': {
E
Erich Gamma 已提交
563
			'type': 'string',
564
			'enum': ['none', 'same', 'indent', 'deepIndent'],
M
Matt Bierner 已提交
565 566 567 568 569 570
			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."),
			],
571
			'default': 'same',
M
Matt Bierner 已提交
572
			'description': nls.localize('wrappingIndent', "Controls the indentation of wrapped lines."),
E
Erich Gamma 已提交
573
		},
J
Johannes Rieken 已提交
574
		'editor.mouseWheelScrollSensitivity': {
E
Erich Gamma 已提交
575
			'type': 'number',
A
renames  
Alex Dima 已提交
576
			'default': EditorOptions.mouseWheelScrollSensitivity.defaultValue,
577
			'markdownDescription': nls.localize('mouseWheelScrollSensitivity', "A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")
E
Erich Gamma 已提交
578
		},
T
Tiago Ribeiro 已提交
579 580
		'editor.fastScrollSensitivity': {
			'type': 'number',
A
renames  
Alex Dima 已提交
581
			'default': EditorOptions.fastScrollSensitivity.defaultValue,
582
			'markdownDescription': nls.localize('fastScrollSensitivity', "Scrolling speed multiplier when pressing `Alt`.")
T
Tiago Ribeiro 已提交
583
		},
584
		'editor.multiCursorModifier': {
585
			'type': 'string',
586
			'enum': ['ctrlCmd', 'alt'],
587
			'markdownEnumDescriptions': [
588 589
				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.")
590
			],
591
			'default': 'alt',
592
			'markdownDescription': nls.localize({
593 594 595 596 597
				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.'
				]
598
			}, "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).")
599
		},
A
Alex Dima 已提交
600
		'editor.multiCursorMergeOverlapping': {
601
			'type': 'boolean',
A
Alex Dima 已提交
602
			'default': EditorOptions.multiCursorMergeOverlapping.defaultValue,
A
Alex Dima 已提交
603
			'description': nls.localize('multiCursorMergeOverlapping', "Merge multiple cursors when they are overlapping.")
604
		},
J
Johannes Rieken 已提交
605
		'editor.quickSuggestions': {
606
			'anyOf': [
607 608 609
				{
					type: 'boolean',
				},
610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630
				{
					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 已提交
631
			'default': EDITOR_DEFAULTS.contribInfo.quickSuggestions,
S
SteVen Batten 已提交
632
			'description': nls.localize('quickSuggestions', "Controls whether suggestions should automatically show up while typing.")
E
Erich Gamma 已提交
633
		},
J
Johannes Rieken 已提交
634
		'editor.quickSuggestionsDelay': {
E
Erich Gamma 已提交
635
			'type': 'integer',
A
Alex Dima 已提交
636
			'default': EDITOR_DEFAULTS.contribInfo.quickSuggestionsDelay,
E
Erich Gamma 已提交
637
			'minimum': 0,
S
SteVen Batten 已提交
638
			'description': nls.localize('quickSuggestionsDelay', "Controls the delay in milliseconds after which quick suggestions will show up.")
E
Erich Gamma 已提交
639
		},
640
		'editor.parameterHints.enabled': {
J
Joao Moreno 已提交
641
			'type': 'boolean',
642 643 644 645 646 647 648
			'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 已提交
649
		},
J
Johannes Rieken 已提交
650
		'editor.autoClosingBrackets': {
J
Jackson Kearl 已提交
651 652
			type: 'string',
			enum: ['always', 'languageDefined', 'beforeWhitespace', 'never'],
653
			enumDescriptions: [
654 655 656 657
				'',
				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."),
				'',
658
			],
A
Alex Dima 已提交
659
			'default': EditorOptions.autoClosingBrackets.defaultValue,
660
			'description': nls.localize('autoClosingBrackets', "Controls whether the editor should automatically close brackets after the user adds an opening bracket.")
E
Erich Gamma 已提交
661
		},
J
Jackson Kearl 已提交
662
		'editor.autoClosingQuotes': {
J
Jackson Kearl 已提交
663 664
			type: 'string',
			enum: ['always', 'languageDefined', 'beforeWhitespace', 'never'],
665
			enumDescriptions: [
666 667 668 669
				'',
				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."),
				'',
670
			],
A
Alex Dima 已提交
671
			'default': EditorOptions.autoClosingQuotes.defaultValue,
A
Aldo Donetti 已提交
672
			'description': nls.localize('autoClosingQuotes', "Controls whether the editor should automatically close quotes after the user adds an opening quote.")
J
Jackson Kearl 已提交
673
		},
674 675 676 677 678 679 680 681
		'editor.autoClosingOvertype': {
			type: 'string',
			enum: ['always', 'auto', 'never'],
			enumDescriptions: [
				nls.localize('editor.autoClosingOvertype.always', "Always type over closing quotes or brackets."),
				nls.localize('editor.autoClosingOvertype.auto', "Type over closing quotes or brackets only if they were automatically inserted."),
				nls.localize('editor.autoClosingOvertype.never', "Never type over closing quotes or brackets."),
			],
A
Alex Dima 已提交
682
			'default': EditorOptions.autoClosingOvertype.defaultValue,
683 684
			'description': nls.localize('autoClosingOvertype', "Controls whether the editor should type over closing quotes or brackets.")
		},
685
		'editor.autoSurround': {
J
Jackson Kearl 已提交
686
			type: 'string',
687
			enum: ['languageDefined', 'brackets', 'quotes', 'never'],
688
			enumDescriptions: [
689
				nls.localize('editor.autoSurround.languageDefined', "Use language configurations to determine when to automatically surround selections."),
690 691
				nls.localize('editor.autoSurround.brackets', "Surround with brackets but not quotes."),
				nls.localize('editor.autoSurround.quotes', "Surround with quotes but not brackets."),
692
				''
693
			],
A
Alex Dima 已提交
694
			'default': EditorOptions.autoSurround.defaultValue,
695
			'description': nls.localize('autoSurround', "Controls whether the editor should automatically surround selections.")
E
Erich Gamma 已提交
696
		},
J
Johannes Rieken 已提交
697
		'editor.formatOnType': {
E
Erich Gamma 已提交
698
			'type': 'boolean',
A
Alex Dima 已提交
699
			'default': EDITOR_DEFAULTS.contribInfo.formatOnType,
700
			'description': nls.localize('formatOnType', "Controls whether the editor should automatically format the line after typing.")
E
Erich Gamma 已提交
701
		},
702 703
		'editor.formatOnPaste': {
			'type': 'boolean',
A
Alex Dima 已提交
704
			'default': EDITOR_DEFAULTS.contribInfo.formatOnPaste,
705
			'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.")
706
		},
707 708
		'editor.autoIndent': {
			'type': 'boolean',
A
Alex Dima 已提交
709
			'default': EditorOptions.autoIndent.defaultValue,
710
			'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.")
711
		},
J
Johannes Rieken 已提交
712
		'editor.suggestOnTriggerCharacters': {
E
Erich Gamma 已提交
713
			'type': 'boolean',
A
Alex Dima 已提交
714
			'default': EDITOR_DEFAULTS.contribInfo.suggestOnTriggerCharacters,
715
			'description': nls.localize('suggestOnTriggerCharacters', "Controls whether suggestions should automatically show up when typing trigger characters.")
E
Erich Gamma 已提交
716
		},
J
Johannes Rieken 已提交
717
		'editor.acceptSuggestionOnEnter': {
718 719
			'type': 'string',
			'enum': ['on', 'smart', 'off'],
A
Alex Dima 已提交
720
			'default': EDITOR_DEFAULTS.contribInfo.acceptSuggestionOnEnter,
721
			'markdownEnumDescriptions': [
722 723 724 725
				'',
				nls.localize('acceptSuggestionOnEnterSmart', "Only accept a suggestion with `Enter` when it makes a textual change."),
				''
			],
726
			'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.")
727 728 729
		},
		'editor.acceptSuggestionOnCommitCharacter': {
			'type': 'boolean',
A
Alex Dima 已提交
730
			'default': EDITOR_DEFAULTS.contribInfo.acceptSuggestionOnCommitCharacter,
731
			'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.")
732
		},
733
		'editor.snippetSuggestions': {
734
			'type': 'string',
735
			'enum': ['top', 'bottom', 'inline', 'none'],
J
Johannes Rieken 已提交
736 737 738 739 740 741
			'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."),
			],
742
			'default': EDITOR_DEFAULTS.contribInfo.suggest.snippets,
743
			'description': nls.localize('snippetSuggestions', "Controls whether snippets are shown with other suggestions and how they are sorted.")
744
		},
745 746
		'editor.emptySelectionClipboard': {
			'type': 'boolean',
A
Alex Dima 已提交
747
			'default': EditorOptions.emptySelectionClipboard.defaultValue,
748 749
			'description': nls.localize('emptySelectionClipboard', "Controls whether copying without a selection copies the current line.")
		},
750
		'editor.copyWithSyntaxHighlighting': {
751
			'type': 'boolean',
A
Alex Dima 已提交
752
			'default': EditorOptions.copyWithSyntaxHighlighting.defaultValue,
753
			'description': nls.localize('copyWithSyntaxHighlighting', "Controls whether syntax highlighting should be copied into the clipboard.")
754
		},
755
		'editor.wordBasedSuggestions': {
756
			'type': 'boolean',
A
Alex Dima 已提交
757
			'default': EDITOR_DEFAULTS.contribInfo.wordBasedSuggestions,
J
Johannes Rieken 已提交
758
			'description': nls.localize('wordBasedSuggestions', "Controls whether completions should be computed based on words in the document.")
759
		},
J
Johannes Rieken 已提交
760
		'editor.suggestSelection': {
761
			'type': 'string',
J
Johannes Rieken 已提交
762
			'enum': ['first', 'recentlyUsed', 'recentlyUsedByPrefix'],
763
			'markdownEnumDescriptions': [
J
Johannes Rieken 已提交
764 765 766
				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 已提交
767
			],
J
Johannes Rieken 已提交
768 769
			'default': 'recentlyUsed',
			'description': nls.localize('suggestSelection', "Controls how suggestions are pre-selected when showing the suggest list.")
770
		},
J
Johannes Rieken 已提交
771
		'editor.suggestFontSize': {
J
Joao Moreno 已提交
772 773 774
			'type': 'integer',
			'default': 0,
			'minimum': 0,
775
			'markdownDescription': nls.localize('suggestFontSize', "Font size for the suggest widget. When set to `0`, the value of `#editor.fontSize#` is used.")
J
Joao Moreno 已提交
776
		},
J
Johannes Rieken 已提交
777
		'editor.suggestLineHeight': {
J
Joao Moreno 已提交
778 779 780
			'type': 'integer',
			'default': 0,
			'minimum': 0,
781
			'markdownDescription': nls.localize('suggestLineHeight', "Line height for the suggest widget. When set to `0`, the value of `#editor.lineHeight#` is used.")
J
Joao Moreno 已提交
782
		},
783
		'editor.tabCompletion': {
784 785 786
			type: 'string',
			default: 'off',
			enum: ['on', 'off', 'onlySnippets'],
787
			enumDescriptions: [
788 789 790 791 792
				nls.localize('tabCompletion.on', "Tab complete will insert the best matching suggestion when pressing tab."),
				nls.localize('tabCompletion.off', "Disable tab completions."),
				nls.localize('tabCompletion.onlySnippets', "Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled."),
			],
			description: nls.localize('tabCompletion', "Enables tab completions.")
J
Joao Moreno 已提交
793
		},
794 795 796 797 798
		'editor.suggest.filterGraceful': {
			type: 'boolean',
			default: true,
			description: nls.localize('suggest.filterGraceful', "Controls whether filtering and sorting suggestions accounts for small typos.")
		},
J
Johannes Rieken 已提交
799 800 801 802 803
		'editor.suggest.localityBonus': {
			type: 'boolean',
			default: false,
			description: nls.localize('suggest.localityBonus', "Controls whether sorting favours words that appear close to the cursor.")
		},
804 805 806 807 808
		'editor.suggest.shareSuggestSelections': {
			type: 'boolean',
			default: false,
			markdownDescription: nls.localize('suggest.shareSuggestSelections', "Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")
		},
809 810 811 812 813
		'editor.suggest.snippetsPreventQuickSuggestions': {
			type: 'boolean',
			default: true,
			description: nls.localize('suggest.snippetsPreventQuickSuggestions', "Control whether an active snippet prevents quick suggestions.")
		},
814 815 816 817 818
		'editor.suggest.showIcons': {
			type: 'boolean',
			default: EDITOR_DEFAULTS.contribInfo.suggest.showIcons,
			description: nls.localize('suggest.showIcons', "Controls whether to show or hide icons in suggestions.")
		},
J
Johannes Rieken 已提交
819
		'editor.suggest.maxVisibleSuggestions': {
820
			type: 'number',
J
Johannes Rieken 已提交
821
			default: EDITOR_DEFAULTS.contribInfo.suggest.maxVisibleSuggestions,
822
			minimum: 1,
J
Johannes Rieken 已提交
823 824
			maximum: 15,
			description: nls.localize('suggest.maxVisibleSuggestions', "Controls how many suggestions IntelliSense will show before showing a scrollbar (maximum 15).")
825
		},
826 827
		'editor.suggest.filteredTypes': {
			type: 'object',
828
			default: { keyword: true, snippet: true },
829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962
			markdownDescription: nls.localize('suggest.filtered', "Controls whether some suggestion types should be filtered from IntelliSense. A list of suggestion types can be found here: https://code.visualstudio.com/docs/editor/intellisense#_types-of-completions."),
			properties: {
				method: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.method', "When set to `false` IntelliSense never shows `method` suggestions.")
				},
				function: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.function', "When set to `false` IntelliSense never shows `function` suggestions.")
				},
				constructor: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.constructor', "When set to `false` IntelliSense never shows `constructor` suggestions.")
				},
				field: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.field', "When set to `false` IntelliSense never shows `field` suggestions.")
				},
				variable: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.variable', "When set to `false` IntelliSense never shows `variable` suggestions.")
				},
				class: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.class', "When set to `false` IntelliSense never shows `class` suggestions.")
				},
				struct: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.struct', "When set to `false` IntelliSense never shows `struct` suggestions.")
				},
				interface: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.interface', "When set to `false` IntelliSense never shows `interface` suggestions.")
				},
				module: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.module', "When set to `false` IntelliSense never shows `module` suggestions.")
				},
				property: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.property', "When set to `false` IntelliSense never shows `property` suggestions.")
				},
				event: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.event', "When set to `false` IntelliSense never shows `event` suggestions.")
				},
				operator: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.operator', "When set to `false` IntelliSense never shows `operator` suggestions.")
				},
				unit: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.unit', "When set to `false` IntelliSense never shows `unit` suggestions.")
				},
				value: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.value', "When set to `false` IntelliSense never shows `value` suggestions.")
				},
				constant: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.constant', "When set to `false` IntelliSense never shows `constant` suggestions.")
				},
				enum: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.enum', "When set to `false` IntelliSense never shows `enum` suggestions.")
				},
				enumMember: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.enumMember', "When set to `false` IntelliSense never shows `enumMember` suggestions.")
				},
				keyword: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.keyword', "When set to `false` IntelliSense never shows `keyword` suggestions.")
				},
				text: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.text', "When set to `false` IntelliSense never shows `text` suggestions.")
				},
				color: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.color', "When set to `false` IntelliSense never shows `color` suggestions.")
				},
				file: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.file', "When set to `false` IntelliSense never shows `file` suggestions.")
				},
				reference: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.reference', "When set to `false` IntelliSense never shows `reference` suggestions.")
				},
				customcolor: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.customcolor', "When set to `false` IntelliSense never shows `customcolor` suggestions.")
				},
				folder: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.folder', "When set to `false` IntelliSense never shows `folder` suggestions.")
				},
				typeParameter: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.typeParameter', "When set to `false` IntelliSense never shows `typeParameter` suggestions.")
				},
				snippet: {
					type: 'boolean',
					default: true,
					markdownDescription: nls.localize('suggest.filtered.snippet', "When set to `false` IntelliSense never shows `snippet` suggestions.")
				},
			}
		},
J
Johannes Rieken 已提交
963
		'editor.gotoLocation.multiple': {
J
Johannes Rieken 已提交
964
			description: nls.localize('editor.gotoLocation.multiple', "Controls the behavior of 'Go To' commands, like Go To Definition, when multiple target locations exist."),
965
			type: 'string',
J
Johannes Rieken 已提交
966
			enum: ['peek', 'gotoAndPeek', 'goto'],
J
Johannes Rieken 已提交
967
			default: EDITOR_DEFAULTS.contribInfo.gotoLocation.multiple,
968
			enumDescriptions: [
J
Johannes Rieken 已提交
969
				nls.localize('editor.gotoLocation.multiple.peek', 'Show peek view of the results (default)'),
J
Johannes Rieken 已提交
970
				nls.localize('editor.gotoLocation.multiple.gotoAndPeek', 'Go to the primary result and show a peek view'),
J
Johannes Rieken 已提交
971
				nls.localize('editor.gotoLocation.multiple.goto', 'Go to the primary result and enable peek-less navigation to others')
972 973
			]
		},
J
Johannes Rieken 已提交
974
		'editor.selectionHighlight': {
E
Erich Gamma 已提交
975
			'type': 'boolean',
A
Alex Dima 已提交
976
			'default': EDITOR_DEFAULTS.contribInfo.selectionHighlight,
R
Rob Lourens 已提交
977
			'description': nls.localize('selectionHighlight', "Controls whether the editor should highlight matches similar to the selection.")
E
Erich Gamma 已提交
978
		},
979 980
		'editor.occurrencesHighlight': {
			'type': 'boolean',
A
Alex Dima 已提交
981
			'default': EDITOR_DEFAULTS.contribInfo.occurrencesHighlight,
982
			'description': nls.localize('occurrencesHighlight', "Controls whether the editor should highlight semantic symbol occurrences.")
983
		},
J
Johannes Rieken 已提交
984
		'editor.overviewRulerLanes': {
E
Erich Gamma 已提交
985 986
			'type': 'integer',
			'default': 3,
987
			'description': nls.localize('overviewRulerLanes', "Controls the number of decorations that can show up at the same position in the overview ruler.")
E
Erich Gamma 已提交
988
		},
989
		'editor.overviewRulerBorder': {
990
			'type': 'boolean',
A
Alex Dima 已提交
991
			'default': EditorOptions.overviewRulerBorder.defaultValue,
S
SteVen Batten 已提交
992
			'description': nls.localize('overviewRulerBorder', "Controls whether a border should be drawn around the overview ruler.")
993
		},
J
Johannes Rieken 已提交
994
		'editor.cursorBlinking': {
995
			'type': 'string',
996
			'enum': ['blink', 'smooth', 'phase', 'expand', 'solid'],
A
Alex Dima 已提交
997
			'default': EditorOptions.cursorBlinking.defaultValue,
A
Alex Dima 已提交
998
			'description': nls.localize('cursorBlinking', "Control the cursor animation style.")
999
		},
1000 1001
		'editor.mouseWheelZoom': {
			'type': 'boolean',
A
Alex Dima 已提交
1002
			'default': EditorOptions.mouseWheelZoom.defaultValue,
1003
			'markdownDescription': nls.localize('mouseWheelZoom', "Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")
1004
		},
1005 1006
		'editor.cursorSmoothCaretAnimation': {
			'type': 'boolean',
A
Alex Dima 已提交
1007
			'default': EditorOptions.cursorSmoothCaretAnimation.defaultValue,
1008 1009
			'description': nls.localize('cursorSmoothCaretAnimation', "Controls whether the smooth caret animation should be enabled.")
		},
J
Johannes Rieken 已提交
1010
		'editor.cursorStyle': {
M
markrendle 已提交
1011
			'type': 'string',
1012
			'enum': ['block', 'block-outline', 'line', 'line-thin', 'underline', 'underline-thin'],
A
Alex Dima 已提交
1013
			'default': EditorOptions.cursorStyle.defaultValue,
1014
			'description': nls.localize('cursorStyle', "Controls the cursor style.")
M
markrendle 已提交
1015
		},
1016
		'editor.cursorWidth': {
1017
			'type': 'integer',
A
Alex Dima 已提交
1018
			'default': EditorOptions.cursorWidth.defaultValue,
1019
			'markdownDescription': nls.localize('cursorWidth', "Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")
1020
		},
J
Johannes Rieken 已提交
1021
		'editor.fontLigatures': {
1022
			'type': 'boolean',
A
Alex Dima 已提交
1023
			'default': EditorOptions.fontLigatures.defaultValue,
1024
			'description': nls.localize('fontLigatures', "Enables/Disables font ligatures.")
1025
		},
J
Johannes Rieken 已提交
1026
		'editor.hideCursorInOverviewRuler': {
E
Erich Gamma 已提交
1027
			'type': 'boolean',
A
Alex Dima 已提交
1028
			'default': EditorOptions.hideCursorInOverviewRuler.defaultValue,
1029
			'description': nls.localize('hideCursorInOverviewRuler', "Controls whether the cursor should be hidden in the overview ruler.")
E
Erich Gamma 已提交
1030 1031
		},
		'editor.renderWhitespace': {
1032
			'type': 'string',
1033
			'enum': ['none', 'boundary', 'selection', 'all'],
1034 1035
			'enumDescriptions': [
				'',
1036
				nls.localize('renderWhitespace.boundary', "Render whitespace characters except for single spaces between words."),
1037
				nls.localize('renderWhitespace.selection', "Render whitespace characters only on selected text."),
1038 1039
				''
			],
A
Alex Dima 已提交
1040
			default: EditorOptions.renderWhitespace.defaultValue,
1041
			description: nls.localize('renderWhitespace', "Controls how the editor should render whitespace characters.")
E
Erich Gamma 已提交
1042
		},
1043 1044
		'editor.renderControlCharacters': {
			'type': 'boolean',
A
Alex Dima 已提交
1045
			default: EditorOptions.renderControlCharacters.defaultValue,
1046
			description: nls.localize('renderControlCharacters', "Controls whether the editor should render control characters.")
1047
		},
1048 1049
		'editor.renderIndentGuides': {
			'type': 'boolean',
A
Alex Dima 已提交
1050
			default: EditorOptions.renderIndentGuides.defaultValue,
1051
			description: nls.localize('renderIndentGuides', "Controls whether the editor should render indent guides.")
1052
		},
1053 1054
		'editor.highlightActiveIndentGuide': {
			'type': 'boolean',
A
Alex Dima 已提交
1055
			default: EditorOptions.highlightActiveIndentGuide.defaultValue,
1056
			description: nls.localize('highlightActiveIndentGuide', "Controls whether the editor should highlight the active indent guide.")
1057
		},
1058
		'editor.renderLineHighlight': {
1059 1060
			'type': 'string',
			'enum': ['none', 'gutter', 'line', 'all'],
S
SteVen Batten 已提交
1061 1062 1063 1064 1065 1066
			'enumDescriptions': [
				'',
				'',
				'',
				nls.localize('renderLineHighlight.all', "Highlights both the gutter and the current line."),
			],
A
Alex Dima 已提交
1067
			default: EditorOptions.renderLineHighlight.defaultValue,
S
SteVen Batten 已提交
1068
			description: nls.localize('renderLineHighlight', "Controls how the editor should render the current line highlight.")
1069
		},
J
Johannes Rieken 已提交
1070
		'editor.codeLens': {
E
Erich Gamma 已提交
1071
			'type': 'boolean',
A
Alex Dima 已提交
1072
			'default': EDITOR_DEFAULTS.contribInfo.codeLens,
R
Rob Lourens 已提交
1073
			'description': nls.localize('codeLens', "Controls whether the editor shows CodeLens.")
E
Erich Gamma 已提交
1074
		},
J
Johannes Rieken 已提交
1075
		'editor.folding': {
M
Martin Aeschlimann 已提交
1076
			'type': 'boolean',
A
renames  
Alex Dima 已提交
1077
			'default': EditorOptions.folding.defaultValue,
R
Rob Lourens 已提交
1078
			'description': nls.localize('folding', "Controls whether the editor has code folding enabled.")
M
Martin Aeschlimann 已提交
1079
		},
1080 1081 1082 1083
		'editor.foldingStrategy': {
			'type': 'string',
			'enum': ['auto', 'indentation'],
			'default': EDITOR_DEFAULTS.contribInfo.foldingStrategy,
1084
			'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.")
1085
		},
1086 1087 1088 1089 1090
		'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.")
1091
		},
1092
		'editor.matchBrackets': {
1093
			'type': 'boolean',
A
Alex Dima 已提交
1094
			'default': EDITOR_DEFAULTS.contribInfo.matchBrackets,
1095
			'description': nls.localize('matchBrackets', "Highlight matching brackets when one of them is selected.")
1096
		},
I
isidor 已提交
1097 1098
		'editor.glyphMargin': {
			'type': 'boolean',
A
Alex Dima 已提交
1099
			'default': EditorOptions.glyphMargin.defaultValue,
I
isidor 已提交
1100 1101
			'description': nls.localize('glyphMargin', "Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")
		},
J
Johannes Rieken 已提交
1102
		'editor.useTabStops': {
1103
			'type': 'boolean',
A
Alex Dima 已提交
1104
			'default': EditorOptions.useTabStops.defaultValue,
M
Matt Bierner 已提交
1105
			'description': nls.localize('useTabStops', "Inserting and deleting whitespace follows tab stops.")
1106
		},
J
Johannes Rieken 已提交
1107
		'editor.trimAutoWhitespace': {
1108
			'type': 'boolean',
1109
			'default': EDITOR_MODEL_DEFAULTS.trimAutoWhitespace,
M
Matt Bierner 已提交
1110
			'description': nls.localize('trimAutoWhitespace', "Remove trailing auto inserted whitespace.")
1111
		},
J
Johannes Rieken 已提交
1112
		'editor.stablePeek': {
1113
			'type': 'boolean',
1114
			'default': false,
1115
			'markdownDescription': nls.localize('stablePeek', "Keep peek editors open even when double clicking their content or when hitting `Escape`.")
1116
		},
1117
		'editor.dragAndDrop': {
1118
			'type': 'boolean',
A
Alex Dima 已提交
1119
			'default': EditorOptions.dragAndDrop.defaultValue,
1120
			'description': nls.localize('dragAndDrop', "Controls whether the editor should allow moving selections via drag and drop.")
1121
		},
1122 1123 1124 1125 1126 1127 1128 1129
		'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."),
			],
A
renames  
Alex Dima 已提交
1130
			'default': EditorOptions.accessibilitySupport.defaultValue,
1131 1132
			'description': nls.localize('accessibilitySupport', "Controls whether the editor should run in a mode where it is optimized for screen readers.")
		},
1133 1134
		'editor.showUnused': {
			'type': 'boolean',
A
Alex Dima 已提交
1135
			'default': EditorOptions.showUnused.defaultValue,
1136 1137
			'description': nls.localize('showUnused', "Controls fading out of unused code.")
		},
1138
		'editor.links': {
1139
			'type': 'boolean',
1140
			'default': EDITOR_DEFAULTS.contribInfo.links,
S
SteVen Batten 已提交
1141
			'description': nls.localize('links', "Controls whether the editor should detect links and make them clickable.")
1142
		},
R
rebornix 已提交
1143
		'editor.colorDecorators': {
1144
			'type': 'boolean',
R
rebornix 已提交
1145
			'default': EDITOR_DEFAULTS.contribInfo.colorDecorators,
1146
			'description': nls.localize('colorDecorators', "Controls whether the editor should render the inline color decorators and color picker.")
1147
		},
1148 1149 1150
		'editor.lightbulb.enabled': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.contribInfo.lightbulbEnabled,
S
SteVen Batten 已提交
1151
			'description': nls.localize('codeActions', "Enables the code action lightbulb in the editor.")
1152
		},
1153 1154 1155
		'editor.maxTokenizationLineLength': {
			'type': 'integer',
			'default': 20_000,
A
Alex Dima 已提交
1156
			'description': nls.localize('maxTokenizationLineLength', "Lines above this length will not be tokenized for performance reasons")
1157
		},
1158 1159 1160 1161 1162
		'editor.codeActionsOnSave': {
			'type': 'object',
			'properties': {
				'source.organizeImports': {
					'type': 'boolean',
1163
					'description': nls.localize('codeActionsOnSave.organizeImports', "Controls whether organize imports action should be run on file save.")
1164
				},
1165
				'source.fixAll': {
1166
					'type': 'boolean',
1167
					'description': nls.localize('codeActionsOnSave.fixAll', "Controls whether auto fix action should be run on file save.")
1168 1169 1170 1171 1172 1173
				}
			},
			'additionalProperties': {
				'type': 'boolean'
			},
			'default': EDITOR_DEFAULTS.contribInfo.codeActionsOnSave,
M
Matt Bierner 已提交
1174
			'description': nls.localize('codeActionsOnSave', "Code action kinds to be run on save.")
1175 1176 1177 1178
		},
		'editor.codeActionsOnSaveTimeout': {
			'type': 'number',
			'default': EDITOR_DEFAULTS.contribInfo.codeActionsOnSaveTimeout,
1179
			'description': nls.localize('codeActionsOnSaveTimeout', "Timeout in milliseconds after which the code actions that are run on save are cancelled.")
1180
		},
1181 1182
		'editor.selectionClipboard': {
			'type': 'boolean',
A
renames  
Alex Dima 已提交
1183
			'default': EditorOptions.selectionClipboard.defaultValue,
S
SteVen Batten 已提交
1184
			'description': nls.localize('selectionClipboard', "Controls whether the Linux primary clipboard should be supported."),
1185
			'included': platform.isLinux
1186
		},
J
Johannes Rieken 已提交
1187
		'diffEditor.renderSideBySide': {
E
Erich Gamma 已提交
1188 1189
			'type': 'boolean',
			'default': true,
1190
			'description': nls.localize('sideBySide', "Controls whether the diff editor shows the diff side by side or inline.")
E
Erich Gamma 已提交
1191
		},
J
Johannes Rieken 已提交
1192
		'diffEditor.ignoreTrimWhitespace': {
E
Erich Gamma 已提交
1193 1194
			'type': 'boolean',
			'default': true,
1195
			'description': nls.localize('ignoreTrimWhitespace', "Controls whether the diff editor shows changes in leading or trailing whitespace as diffs.")
1196
		},
1197 1198 1199 1200
		'editor.largeFileOptimizations': {
			'type': 'boolean',
			'default': EDITOR_MODEL_DEFAULTS.largeFileOptimizations,
			'description': nls.localize('largeFileOptimizations', "Special handling for large files to disable certain memory intensive features.")
1201
		},
1202 1203 1204
		'diffEditor.renderIndicators': {
			'type': 'boolean',
			'default': true,
1205
			'description': nls.localize('renderIndicators', "Controls whether the diff editor shows +/- indicators for added/removed changes.")
E
Erich Gamma 已提交
1206 1207
		}
	}
A
Alex Dima 已提交
1208 1209
};

A
Alex Dima 已提交
1210
let cachedEditorConfigurationKeys: { [key: string]: boolean; } | null = null;
1211 1212
function getEditorConfigurationKeys(): { [key: string]: boolean; } {
	if (cachedEditorConfigurationKeys === null) {
A
Alex Dima 已提交
1213 1214 1215
		cachedEditorConfigurationKeys = <{ [key: string]: boolean; }>Object.create(null);
		Object.keys(editorConfiguration.properties!).forEach((prop) => {
			cachedEditorConfigurationKeys![prop] = true;
1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229
		});
	}
	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);
}

1230
configurationRegistry.registerConfiguration(editorConfiguration);