commonEditorConfig.ts 51.9 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
renames  
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, blinkingStyleToString, cursorStyleToString } 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 132 133
	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 已提交
134
export abstract class CommonEditorConfiguration extends Disposable implements editorCommon.IConfiguration {
E
Erich Gamma 已提交
135

A
Alex Dima 已提交
136
	public readonly isSimpleWidget: boolean;
137 138 139
	protected _rawOptions: IEditorOptions;
	protected _validatedOptions: IValidatedEditorOptions;
	public editor!: InternalEditorOptions;
J
Johannes Rieken 已提交
140
	private _isDominatedByLongLines: boolean;
141
	private _lineNumbersDigitCount: number;
E
Erich Gamma 已提交
142

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

146 147 148
	private _rawOptions2: RawEditorOptions;
	private _validatedOptions2: ValidatedEditorOptions;
	public options!: ComputedEditorOptions;
149

150
	constructor(isSimpleWidget: boolean, options: IEditorOptions) {
A
Alex Dima 已提交
151
		super();
A
Alex Dima 已提交
152
		migrateOptions(options);
153

A
Alex Dima 已提交
154 155
		this.isSimpleWidget = isSimpleWidget;

156 157 158 159 160
		// 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 已提交
161
		this._rawOptions.hover = objects.mixin({}, this._rawOptions.hover || {});
162
		this._rawOptions.parameterHints = objects.mixin({}, this._rawOptions.parameterHints || {});
163

164
		this._validatedOptions = EditorOptionsValidator.validate(this._rawOptions, EDITOR_DEFAULTS);
165 166 167 168

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

E
Erich Gamma 已提交
169
		this._isDominatedByLongLines = false;
170
		this._lineNumbersDigitCount = 1;
A
Alex Dima 已提交
171

172
		this._register(EditorZoom.onDidChangeZoomLevel(_ => this._recomputeOptions()));
173
		this._register(TabFocus.onDidChangeTabFocus(_ => this._recomputeOptions()));
E
Erich Gamma 已提交
174 175
	}

A
Alex Dima 已提交
176 177 178
	public observeReferenceElement(dimension?: editorCommon.IDimension): void {
	}

E
Erich Gamma 已提交
179 180 181 182 183
	public dispose(): void {
		super.dispose();
	}

	protected _recomputeOptions(): void {
A
Alex Dima 已提交
184
		const oldOptions = this.editor;
185 186 187 188
		const oldOptions2 = this.options;
		const [newOptions, newOptions2] = this._computeInternalOptions();

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

190
		if (oldOptions && oldOptions.equals(newOptions) && oldOptions2 && changeEvent === null) {
191
			return;
E
Erich Gamma 已提交
192 193
		}

194
		this.editor = newOptions;
195
		this.options = newOptions2;
E
Erich Gamma 已提交
196

A
Alex Dima 已提交
197
		if (oldOptions) {
198
			this._onDidChange.fire(oldOptions.createChangeEvent(newOptions, changeEvent));
199
		}
E
Erich Gamma 已提交
200
	}
201

202
	public getRawOptions(): IEditorOptions {
203
		return this._rawOptions;
E
Erich Gamma 已提交
204
	}
205

206
	private _computeInternalOptions(): [InternalEditorOptions, ComputedEditorOptions] {
207
		const opts = this._validatedOptions;
A
Alex Dima 已提交
208
		const partialEnv = this._getEnvConfiguration();
A
Alex Dima 已提交
209
		const bareFontInfo = BareFontInfo.createFromRawSettings(this._rawOptions, partialEnv.zoomLevel, this.isSimpleWidget);
210
		const env: IEnvironmentalOptions = {
A
Alex Dima 已提交
211 212
			outerWidth: partialEnv.outerWidth,
			outerHeight: partialEnv.outerHeight,
213
			fontInfo: this.readConfiguration(bareFontInfo),
214
			extraEditorClassName: partialEnv.extraEditorClassName,
215 216
			isDominatedByLongLines: this._isDominatedByLongLines,
			lineNumbersDigitCount: this._lineNumbersDigitCount,
217
			emptySelectionClipboard: partialEnv.emptySelectionClipboard,
A
Alex Dima 已提交
218
			pixelRatio: partialEnv.pixelRatio,
219 220
			tabFocusMode: TabFocus.getTabFocusMode(),
			accessibilitySupport: partialEnv.accessibilitySupport
A
Alex Dima 已提交
221
		};
222
		const r = InternalEditorOptionsFactory.createInternalEditorOptions(env, opts);
223 224
		const r2 = EditorConfiguration2.computeOptions(this._validatedOptions2, env);
		return [r, r2];
E
Erich Gamma 已提交
225 226
	}

227 228 229 230 231 232 233 234 235 236 237 238
	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 已提交
239 240
	private static _subsetEquals(base: { [key: string]: any }, subset: { [key: string]: any }): boolean {
		for (const key in subset) {
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266
			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;
	}

267
	public updateOptions(newOptions: IEditorOptions): void {
268 269 270
		if (typeof newOptions === 'undefined') {
			return;
		}
A
Alex Dima 已提交
271
		migrateOptions(newOptions);
272 273 274
		if (CommonEditorConfiguration._subsetEquals(this._rawOptions, newOptions)) {
			return;
		}
275
		this._rawOptions = objects.mixin(this._rawOptions, newOptions || {});
276 277
		this._rawOptions2 = EditorConfiguration2.mixOptions(this._rawOptions2, newOptions);

278
		this._validatedOptions = EditorOptionsValidator.validate(this._rawOptions, EDITOR_DEFAULTS);
279 280
		this._validatedOptions2 = EditorConfiguration2.validateOptions(this._rawOptions2);

E
Erich Gamma 已提交
281 282 283
		this._recomputeOptions();
	}

J
Johannes Rieken 已提交
284
	public setIsDominatedByLongLines(isDominatedByLongLines: boolean): void {
E
Erich Gamma 已提交
285 286 287 288
		this._isDominatedByLongLines = isDominatedByLongLines;
		this._recomputeOptions();
	}

J
Johannes Rieken 已提交
289
	public setMaxLineNumber(maxLineNumber: number): void {
290
		let digitCount = CommonEditorConfiguration._digitCount(maxLineNumber);
291
		if (this._lineNumbersDigitCount === digitCount) {
A
Alex Dima 已提交
292 293
			return;
		}
294
		this._lineNumbersDigitCount = digitCount;
E
Erich Gamma 已提交
295 296 297
		this._recomputeOptions();
	}

298
	private static _digitCount(n: number): number {
A
Alex Dima 已提交
299
		let r = 0;
300 301 302 303 304 305
		while (n) {
			n = Math.floor(n / 10);
			r++;
		}
		return r ? r : 1;
	}
A
Alex Dima 已提交
306
	protected abstract _getEnvConfiguration(): IEnvConfiguration;
307

308
	protected abstract readConfiguration(styling: BareFontInfo): FontInfo;
309

E
Erich Gamma 已提交
310 311
}

312
const configurationRegistry = Registry.as<IConfigurationRegistry>(Extensions.Configuration);
313
const editorConfiguration: IConfigurationNode = {
E
Erich Gamma 已提交
314 315 316
	'id': 'editor',
	'order': 5,
	'type': 'object',
317
	'title': nls.localize('editorConfigurationTitle', "Editor"),
318
	'overridable': true,
S
Sandeep Somavarapu 已提交
319
	'scope': ConfigurationScope.RESOURCE,
J
Johannes Rieken 已提交
320 321
	'properties': {
		'editor.fontFamily': {
E
Erich Gamma 已提交
322
			'type': 'string',
323
			'default': EDITOR_FONT_DEFAULTS.fontFamily,
E
Erich Gamma 已提交
324 325
			'description': nls.localize('fontFamily', "Controls the font family.")
		},
J
Johannes Rieken 已提交
326
		'editor.fontWeight': {
327
			'type': 'string',
328
			'enum': ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
329
			'default': EDITOR_FONT_DEFAULTS.fontWeight,
330 331
			'description': nls.localize('fontWeight', "Controls the font weight.")
		},
J
Johannes Rieken 已提交
332
		'editor.fontSize': {
E
Erich Gamma 已提交
333
			'type': 'number',
334
			'default': EDITOR_FONT_DEFAULTS.fontSize,
335
			'description': nls.localize('fontSize', "Controls the font size in pixels.")
E
Erich Gamma 已提交
336
		},
J
Johannes Rieken 已提交
337
		'editor.lineHeight': {
E
Erich Gamma 已提交
338
			'type': 'number',
339
			'default': EDITOR_FONT_DEFAULTS.lineHeight,
S
SteVen Batten 已提交
340
			'description': nls.localize('lineHeight', "Controls the line height. Use 0 to compute the line height from the font size.")
E
Erich Gamma 已提交
341
		},
342 343
		'editor.letterSpacing': {
			'type': 'number',
344
			'default': EDITOR_FONT_DEFAULTS.letterSpacing,
345 346
			'description': nls.localize('letterSpacing', "Controls the letter spacing in pixels.")
		},
J
Johannes Rieken 已提交
347
		'editor.lineNumbers': {
348
			'type': 'string',
349
			'enum': ['off', 'on', 'relative', 'interval'],
350 351 352
			'enumDescriptions': [
				nls.localize('lineNumbers.off', "Line numbers are not rendered."),
				nls.localize('lineNumbers.on', "Line numbers are rendered as absolute number."),
353 354
				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.")
355
			],
356
			'default': 'on',
A
Alex Dima 已提交
357
			'description': nls.localize('lineNumbers', "Controls the display of line numbers.")
E
Erich Gamma 已提交
358
		},
359
		'editor.cursorSurroundingLines': {
P
Peng Lyu 已提交
360
			'type': 'number',
361 362
			'default': EDITOR_DEFAULTS.viewInfo.cursorSurroundingLines,
			'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 已提交
363
		},
A
Alex Dima 已提交
364
		'editor.renderFinalNewline': {
365
			'type': 'boolean',
A
renames  
Alex Dima 已提交
366
			'default': EditorOptions.renderFinalNewline.defaultValue,
A
Alex Dima 已提交
367
			'description': nls.localize('renderFinalNewline', "Render last line number when the file ends with a newline.")
368
		},
J
Johannes Rieken 已提交
369
		'editor.rulers': {
370 371 372 373
			'type': 'array',
			'items': {
				'type': 'number'
			},
A
Alex Dima 已提交
374
			'default': EDITOR_DEFAULTS.viewInfo.rulers,
S
SteVen Batten 已提交
375
			'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.")
376
		},
J
Johannes Rieken 已提交
377
		'editor.wordSeparators': {
A
Alex Dima 已提交
378
			'type': 'string',
379
			'default': EDITOR_DEFAULTS.wordSeparators,
M
Matt Bierner 已提交
380
			'description': nls.localize('wordSeparators', "Characters that will be used as word separators when doing word related navigations or operations.")
A
Alex Dima 已提交
381
		},
J
Johannes Rieken 已提交
382
		'editor.tabSize': {
383
			'type': 'number',
384
			'default': EDITOR_MODEL_DEFAULTS.tabSize,
E
Erich Gamma 已提交
385
			'minimum': 1,
386
			'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 已提交
387
		},
388 389 390 391 392 393 394 395 396 397 398 399 400 401
		// '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 已提交
402
		'editor.insertSpaces': {
403
			'type': 'boolean',
404
			'default': EDITOR_MODEL_DEFAULTS.insertSpaces,
405
			'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 已提交
406
		},
J
Johannes Rieken 已提交
407
		'editor.detectIndentation': {
408
			'type': 'boolean',
409
			'default': EDITOR_MODEL_DEFAULTS.detectIndentation,
410
			'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.")
411
		},
J
Johannes Rieken 已提交
412
		'editor.roundedSelection': {
E
Erich Gamma 已提交
413
			'type': 'boolean',
A
Alex Dima 已提交
414
			'default': EDITOR_DEFAULTS.viewInfo.roundedSelection,
415
			'description': nls.localize('roundedSelection', "Controls whether selections should have rounded corners.")
E
Erich Gamma 已提交
416
		},
J
Johannes Rieken 已提交
417
		'editor.scrollBeyondLastLine': {
E
Erich Gamma 已提交
418
			'type': 'boolean',
A
Alex Dima 已提交
419
			'default': EDITOR_DEFAULTS.viewInfo.scrollBeyondLastLine,
S
SteVen Batten 已提交
420
			'description': nls.localize('scrollBeyondLastLine', "Controls whether the editor will scroll beyond the last line.")
E
Erich Gamma 已提交
421
		},
422 423 424
		'editor.scrollBeyondLastColumn': {
			'type': 'number',
			'default': EDITOR_DEFAULTS.viewInfo.scrollBeyondLastColumn,
S
SteVen Batten 已提交
425
			'description': nls.localize('scrollBeyondLastColumn', "Controls the number of extra characters beyond which the editor will scroll horizontally.")
426
		},
427 428 429
		'editor.smoothScrolling': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.viewInfo.smoothScrolling,
430
			'description': nls.localize('smoothScrolling', "Controls whether the editor will scroll using an animation.")
431
		},
432 433
		'editor.minimap.enabled': {
			'type': 'boolean',
A
renames  
Alex Dima 已提交
434
			'default': EditorOptions.minimap.defaultValue.enabled,
S
SteVen Batten 已提交
435
			'description': nls.localize('minimap.enabled', "Controls whether the minimap is shown.")
436
		},
437 438 439
		'editor.minimap.side': {
			'type': 'string',
			'enum': ['left', 'right'],
A
renames  
Alex Dima 已提交
440
			'default': EditorOptions.minimap.defaultValue.side,
A
Alex Dima 已提交
441
			'description': nls.localize('minimap.side', "Controls the side where to render the minimap.")
442
		},
443 444 445
		'editor.minimap.showSlider': {
			'type': 'string',
			'enum': ['always', 'mouseover'],
A
renames  
Alex Dima 已提交
446
			'default': EditorOptions.minimap.defaultValue.showSlider,
A
Alex Dima 已提交
447
			'description': nls.localize('minimap.showSlider', "Controls whether the minimap slider is automatically hidden.")
448
		},
449
		'editor.minimap.renderCharacters': {
450
			'type': 'boolean',
A
renames  
Alex Dima 已提交
451
			'default': EditorOptions.minimap.defaultValue.renderCharacters,
S
SteVen Batten 已提交
452
			'description': nls.localize('minimap.renderCharacters', "Render the actual characters on a line as opposed to color blocks.")
453
		},
A
Alex Dima 已提交
454 455
		'editor.minimap.maxColumn': {
			'type': 'number',
A
renames  
Alex Dima 已提交
456
			'default': EditorOptions.minimap.defaultValue.maxColumn,
S
SteVen Batten 已提交
457
			'description': nls.localize('minimap.maxColumn', "Limit the width of the minimap to render at most a certain number of columns.")
A
Alex Dima 已提交
458
		},
A
Alex Dima 已提交
459 460 461
		'editor.hover.enabled': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.contribInfo.hover.enabled,
462
			'description': nls.localize('hover.enabled', "Controls whether the hover is shown.")
A
Alex Dima 已提交
463
		},
464 465 466
		'editor.hover.delay': {
			'type': 'number',
			'default': EDITOR_DEFAULTS.contribInfo.hover.delay,
467
			'description': nls.localize('hover.delay', "Controls the delay in milliseconds after which the hover is shown.")
468
		},
469 470 471
		'editor.hover.sticky': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.contribInfo.hover.sticky,
472
			'description': nls.localize('hover.sticky', "Controls whether the hover should remain visible when mouse is moved over it.")
473
		},
474 475 476
		'editor.find.seedSearchStringFromSelection': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.contribInfo.find.seedSearchStringFromSelection,
477
			'description': nls.localize('find.seedSearchStringFromSelection', "Controls whether the search string in the Find Widget is seeded from the editor selection.")
478
		},
R
rebornix 已提交
479 480 481
		'editor.find.autoFindInSelection': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.contribInfo.find.autoFindInSelection,
482
			'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 已提交
483
		},
484 485 486
		'editor.find.globalFindClipboard': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.contribInfo.find.globalFindClipboard,
487
			'description': nls.localize('find.globalFindClipboard', "Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),
488
			'included': platform.isMacintosh
489
		},
490 491 492
		'editor.find.addExtraSpaceOnTop': {
			'type': 'boolean',
			'default': true,
P
Peng Lyu 已提交
493
			'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.")
494
		},
J
Johannes Rieken 已提交
495
		'editor.wordWrap': {
496
			'type': 'string',
A
Alex Dima 已提交
497
			'enum': ['off', 'on', 'wordWrapColumn', 'bounded'],
498
			'markdownEnumDescriptions': [
499 500
				nls.localize('wordWrap.off', "Lines will never wrap."),
				nls.localize('wordWrap.on', "Lines will wrap at the viewport width."),
A
Alex Dima 已提交
501 502 503 504 505
				nls.localize({
					key: 'wordWrap.wordWrapColumn',
					comment: [
						'- `editor.wordWrapColumn` refers to a different setting and should not be localized.'
					]
506
				}, "Lines will wrap at `#editor.wordWrapColumn#`."),
A
Alex Dima 已提交
507 508 509 510
				nls.localize({
					key: 'wordWrap.bounded',
					comment: [
						'- viewport means the edge of the visible window size.',
A
Alex Dima 已提交
511
						'- `editor.wordWrapColumn` refers to a different setting and should not be localized.'
A
Alex Dima 已提交
512
					]
513
				}, "Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`."),
514
			],
A
renames  
Alex Dima 已提交
515
			'default': EditorOptions.wordWrap.defaultValue,
A
Alex Dima 已提交
516 517 518 519 520 521
			'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.'
				]
522
			}, "Controls how lines should wrap.")
523 524 525
		},
		'editor.wordWrapColumn': {
			'type': 'integer',
A
renames  
Alex Dima 已提交
526
			'default': EditorOptions.wordWrapColumn.defaultValue,
527
			'minimum': 1,
528
			'markdownDescription': nls.localize({
A
Alex Dima 已提交
529 530 531 532 533
				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.'
				]
534
			}, "Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")
535
		},
J
Johannes Rieken 已提交
536
		'editor.wrappingIndent': {
E
Erich Gamma 已提交
537
			'type': 'string',
538
			'enum': ['none', 'same', 'indent', 'deepIndent'],
M
Matt Bierner 已提交
539 540 541 542 543 544
			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."),
			],
545
			'default': 'same',
M
Matt Bierner 已提交
546
			'description': nls.localize('wrappingIndent', "Controls the indentation of wrapped lines."),
E
Erich Gamma 已提交
547
		},
J
Johannes Rieken 已提交
548
		'editor.mouseWheelScrollSensitivity': {
E
Erich Gamma 已提交
549
			'type': 'number',
A
renames  
Alex Dima 已提交
550
			'default': EditorOptions.mouseWheelScrollSensitivity.defaultValue,
551
			'markdownDescription': nls.localize('mouseWheelScrollSensitivity', "A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")
E
Erich Gamma 已提交
552
		},
T
Tiago Ribeiro 已提交
553 554
		'editor.fastScrollSensitivity': {
			'type': 'number',
A
renames  
Alex Dima 已提交
555
			'default': EditorOptions.fastScrollSensitivity.defaultValue,
556
			'markdownDescription': nls.localize('fastScrollSensitivity', "Scrolling speed multiplier when pressing `Alt`.")
T
Tiago Ribeiro 已提交
557
		},
558
		'editor.multiCursorModifier': {
559
			'type': 'string',
560
			'enum': ['ctrlCmd', 'alt'],
561
			'markdownEnumDescriptions': [
562 563
				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.")
564
			],
565
			'default': 'alt',
566
			'markdownDescription': nls.localize({
567 568 569 570 571
				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.'
				]
572
			}, "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).")
573
		},
A
Alex Dima 已提交
574
		'editor.multiCursorMergeOverlapping': {
575
			'type': 'boolean',
A
Alex Dima 已提交
576 577
			'default': EDITOR_DEFAULTS.multiCursorMergeOverlapping,
			'description': nls.localize('multiCursorMergeOverlapping', "Merge multiple cursors when they are overlapping.")
578
		},
J
Johannes Rieken 已提交
579
		'editor.quickSuggestions': {
580
			'anyOf': [
581 582 583
				{
					type: 'boolean',
				},
584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604
				{
					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 已提交
605
			'default': EDITOR_DEFAULTS.contribInfo.quickSuggestions,
S
SteVen Batten 已提交
606
			'description': nls.localize('quickSuggestions', "Controls whether suggestions should automatically show up while typing.")
E
Erich Gamma 已提交
607
		},
J
Johannes Rieken 已提交
608
		'editor.quickSuggestionsDelay': {
E
Erich Gamma 已提交
609
			'type': 'integer',
A
Alex Dima 已提交
610
			'default': EDITOR_DEFAULTS.contribInfo.quickSuggestionsDelay,
E
Erich Gamma 已提交
611
			'minimum': 0,
S
SteVen Batten 已提交
612
			'description': nls.localize('quickSuggestionsDelay', "Controls the delay in milliseconds after which quick suggestions will show up.")
E
Erich Gamma 已提交
613
		},
614
		'editor.parameterHints.enabled': {
J
Joao Moreno 已提交
615
			'type': 'boolean',
616 617 618 619 620 621 622
			'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 已提交
623
		},
J
Johannes Rieken 已提交
624
		'editor.autoClosingBrackets': {
J
Jackson Kearl 已提交
625 626
			type: 'string',
			enum: ['always', 'languageDefined', 'beforeWhitespace', 'never'],
627
			enumDescriptions: [
628 629 630 631
				'',
				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."),
				'',
632 633

			],
634
			'default': EDITOR_DEFAULTS.autoClosingBrackets,
635
			'description': nls.localize('autoClosingBrackets', "Controls whether the editor should automatically close brackets after the user adds an opening bracket.")
E
Erich Gamma 已提交
636
		},
J
Jackson Kearl 已提交
637
		'editor.autoClosingQuotes': {
J
Jackson Kearl 已提交
638 639
			type: 'string',
			enum: ['always', 'languageDefined', 'beforeWhitespace', 'never'],
640
			enumDescriptions: [
641 642 643 644
				'',
				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."),
				'',
645
			],
J
Jackson Kearl 已提交
646
			'default': EDITOR_DEFAULTS.autoClosingQuotes,
A
Aldo Donetti 已提交
647
			'description': nls.localize('autoClosingQuotes', "Controls whether the editor should automatically close quotes after the user adds an opening quote.")
J
Jackson Kearl 已提交
648
		},
649 650 651 652 653 654 655 656 657 658 659
		'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."),
			],
			'default': EDITOR_DEFAULTS.autoClosingOvertype,
			'description': nls.localize('autoClosingOvertype', "Controls whether the editor should type over closing quotes or brackets.")
		},
660
		'editor.autoSurround': {
J
Jackson Kearl 已提交
661
			type: 'string',
662
			enum: ['languageDefined', 'brackets', 'quotes', 'never'],
663
			enumDescriptions: [
664
				nls.localize('editor.autoSurround.languageDefined', "Use language configurations to determine when to automatically surround selections."),
665 666
				nls.localize('editor.autoSurround.brackets', "Surround with brackets but not quotes."),
				nls.localize('editor.autoSurround.quotes', "Surround with quotes but not brackets."),
667
				''
668
			],
669 670
			'default': EDITOR_DEFAULTS.autoSurround,
			'description': nls.localize('autoSurround', "Controls whether the editor should automatically surround selections.")
E
Erich Gamma 已提交
671
		},
J
Johannes Rieken 已提交
672
		'editor.formatOnType': {
E
Erich Gamma 已提交
673
			'type': 'boolean',
A
Alex Dima 已提交
674
			'default': EDITOR_DEFAULTS.contribInfo.formatOnType,
675
			'description': nls.localize('formatOnType', "Controls whether the editor should automatically format the line after typing.")
E
Erich Gamma 已提交
676
		},
677 678
		'editor.formatOnPaste': {
			'type': 'boolean',
A
Alex Dima 已提交
679
			'default': EDITOR_DEFAULTS.contribInfo.formatOnPaste,
680
			'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.")
681
		},
682 683 684
		'editor.autoIndent': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.autoIndent,
685
			'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.")
686
		},
J
Johannes Rieken 已提交
687
		'editor.suggestOnTriggerCharacters': {
E
Erich Gamma 已提交
688
			'type': 'boolean',
A
Alex Dima 已提交
689
			'default': EDITOR_DEFAULTS.contribInfo.suggestOnTriggerCharacters,
690
			'description': nls.localize('suggestOnTriggerCharacters', "Controls whether suggestions should automatically show up when typing trigger characters.")
E
Erich Gamma 已提交
691
		},
J
Johannes Rieken 已提交
692
		'editor.acceptSuggestionOnEnter': {
693 694
			'type': 'string',
			'enum': ['on', 'smart', 'off'],
A
Alex Dima 已提交
695
			'default': EDITOR_DEFAULTS.contribInfo.acceptSuggestionOnEnter,
696
			'markdownEnumDescriptions': [
697 698 699 700
				'',
				nls.localize('acceptSuggestionOnEnterSmart', "Only accept a suggestion with `Enter` when it makes a textual change."),
				''
			],
701
			'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.")
702 703 704
		},
		'editor.acceptSuggestionOnCommitCharacter': {
			'type': 'boolean',
A
Alex Dima 已提交
705
			'default': EDITOR_DEFAULTS.contribInfo.acceptSuggestionOnCommitCharacter,
706
			'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.")
707
		},
708
		'editor.snippetSuggestions': {
709
			'type': 'string',
710
			'enum': ['top', 'bottom', 'inline', 'none'],
J
Johannes Rieken 已提交
711 712 713 714 715 716
			'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."),
			],
717
			'default': EDITOR_DEFAULTS.contribInfo.suggest.snippets,
718
			'description': nls.localize('snippetSuggestions', "Controls whether snippets are shown with other suggestions and how they are sorted.")
719
		},
720 721
		'editor.emptySelectionClipboard': {
			'type': 'boolean',
722
			'default': EDITOR_DEFAULTS.emptySelectionClipboard,
723 724
			'description': nls.localize('emptySelectionClipboard', "Controls whether copying without a selection copies the current line.")
		},
725
		'editor.copyWithSyntaxHighlighting': {
726
			'type': 'boolean',
727
			'default': EDITOR_DEFAULTS.copyWithSyntaxHighlighting,
728
			'description': nls.localize('copyWithSyntaxHighlighting', "Controls whether syntax highlighting should be copied into the clipboard.")
729
		},
730
		'editor.wordBasedSuggestions': {
731
			'type': 'boolean',
A
Alex Dima 已提交
732
			'default': EDITOR_DEFAULTS.contribInfo.wordBasedSuggestions,
J
Johannes Rieken 已提交
733
			'description': nls.localize('wordBasedSuggestions', "Controls whether completions should be computed based on words in the document.")
734
		},
J
Johannes Rieken 已提交
735
		'editor.suggestSelection': {
736
			'type': 'string',
J
Johannes Rieken 已提交
737
			'enum': ['first', 'recentlyUsed', 'recentlyUsedByPrefix'],
738
			'markdownEnumDescriptions': [
J
Johannes Rieken 已提交
739 740 741
				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 已提交
742
			],
J
Johannes Rieken 已提交
743 744
			'default': 'recentlyUsed',
			'description': nls.localize('suggestSelection', "Controls how suggestions are pre-selected when showing the suggest list.")
745
		},
J
Johannes Rieken 已提交
746
		'editor.suggestFontSize': {
J
Joao Moreno 已提交
747 748 749
			'type': 'integer',
			'default': 0,
			'minimum': 0,
750
			'markdownDescription': nls.localize('suggestFontSize', "Font size for the suggest widget. When set to `0`, the value of `#editor.fontSize#` is used.")
J
Joao Moreno 已提交
751
		},
J
Johannes Rieken 已提交
752
		'editor.suggestLineHeight': {
J
Joao Moreno 已提交
753 754 755
			'type': 'integer',
			'default': 0,
			'minimum': 0,
756
			'markdownDescription': nls.localize('suggestLineHeight', "Line height for the suggest widget. When set to `0`, the value of `#editor.lineHeight#` is used.")
J
Joao Moreno 已提交
757
		},
758
		'editor.tabCompletion': {
759 760 761
			type: 'string',
			default: 'off',
			enum: ['on', 'off', 'onlySnippets'],
762
			enumDescriptions: [
763 764 765 766 767
				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 已提交
768
		},
769 770 771 772 773
		'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 已提交
774 775 776 777 778
		'editor.suggest.localityBonus': {
			type: 'boolean',
			default: false,
			description: nls.localize('suggest.localityBonus', "Controls whether sorting favours words that appear close to the cursor.")
		},
779 780 781 782 783
		'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#`).")
		},
784 785 786 787 788
		'editor.suggest.snippetsPreventQuickSuggestions': {
			type: 'boolean',
			default: true,
			description: nls.localize('suggest.snippetsPreventQuickSuggestions', "Control whether an active snippet prevents quick suggestions.")
		},
789 790 791 792 793
		'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 已提交
794
		'editor.suggest.maxVisibleSuggestions': {
795
			type: 'number',
J
Johannes Rieken 已提交
796
			default: EDITOR_DEFAULTS.contribInfo.suggest.maxVisibleSuggestions,
797
			minimum: 1,
J
Johannes Rieken 已提交
798 799
			maximum: 15,
			description: nls.localize('suggest.maxVisibleSuggestions', "Controls how many suggestions IntelliSense will show before showing a scrollbar (maximum 15).")
800
		},
801 802
		'editor.suggest.filteredTypes': {
			type: 'object',
803
			default: { keyword: true, snippet: true },
804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 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
			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 已提交
938
		'editor.gotoLocation.multiple': {
J
Johannes Rieken 已提交
939
			description: nls.localize('editor.gotoLocation.multiple', "Controls the behavior of 'Go To' commands, like Go To Definition, when multiple target locations exist."),
940
			type: 'string',
J
Johannes Rieken 已提交
941
			enum: ['peek', 'gotoAndPeek', 'goto'],
J
Johannes Rieken 已提交
942
			default: EDITOR_DEFAULTS.contribInfo.gotoLocation.multiple,
943
			enumDescriptions: [
J
Johannes Rieken 已提交
944
				nls.localize('editor.gotoLocation.multiple.peek', 'Show peek view of the results (default)'),
J
Johannes Rieken 已提交
945
				nls.localize('editor.gotoLocation.multiple.gotoAndPeek', 'Go to the primary result and show a peek view'),
J
Johannes Rieken 已提交
946
				nls.localize('editor.gotoLocation.multiple.goto', 'Go to the primary result and enable peek-less navigation to others')
947 948
			]
		},
J
Johannes Rieken 已提交
949
		'editor.selectionHighlight': {
E
Erich Gamma 已提交
950
			'type': 'boolean',
A
Alex Dima 已提交
951
			'default': EDITOR_DEFAULTS.contribInfo.selectionHighlight,
R
Rob Lourens 已提交
952
			'description': nls.localize('selectionHighlight', "Controls whether the editor should highlight matches similar to the selection.")
E
Erich Gamma 已提交
953
		},
954 955
		'editor.occurrencesHighlight': {
			'type': 'boolean',
A
Alex Dima 已提交
956
			'default': EDITOR_DEFAULTS.contribInfo.occurrencesHighlight,
957
			'description': nls.localize('occurrencesHighlight', "Controls whether the editor should highlight semantic symbol occurrences.")
958
		},
J
Johannes Rieken 已提交
959
		'editor.overviewRulerLanes': {
E
Erich Gamma 已提交
960 961
			'type': 'integer',
			'default': 3,
962
			'description': nls.localize('overviewRulerLanes', "Controls the number of decorations that can show up at the same position in the overview ruler.")
E
Erich Gamma 已提交
963
		},
964
		'editor.overviewRulerBorder': {
965
			'type': 'boolean',
A
Alex Dima 已提交
966
			'default': EDITOR_DEFAULTS.viewInfo.overviewRulerBorder,
S
SteVen Batten 已提交
967
			'description': nls.localize('overviewRulerBorder', "Controls whether a border should be drawn around the overview ruler.")
968
		},
J
Johannes Rieken 已提交
969
		'editor.cursorBlinking': {
970
			'type': 'string',
971
			'enum': ['blink', 'smooth', 'phase', 'expand', 'solid'],
972
			'default': blinkingStyleToString(EDITOR_DEFAULTS.viewInfo.cursorBlinking),
A
Alex Dima 已提交
973
			'description': nls.localize('cursorBlinking', "Control the cursor animation style.")
974
		},
975 976
		'editor.mouseWheelZoom': {
			'type': 'boolean',
A
Alex Dima 已提交
977
			'default': EDITOR_DEFAULTS.viewInfo.mouseWheelZoom,
978
			'markdownDescription': nls.localize('mouseWheelZoom', "Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")
979
		},
980 981 982 983 984
		'editor.cursorSmoothCaretAnimation': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.viewInfo.cursorSmoothCaretAnimation,
			'description': nls.localize('cursorSmoothCaretAnimation', "Controls whether the smooth caret animation should be enabled.")
		},
J
Johannes Rieken 已提交
985
		'editor.cursorStyle': {
M
markrendle 已提交
986
			'type': 'string',
987
			'enum': ['block', 'block-outline', 'line', 'line-thin', 'underline', 'underline-thin'],
988
			'default': cursorStyleToString(EDITOR_DEFAULTS.viewInfo.cursorStyle),
989
			'description': nls.localize('cursorStyle', "Controls the cursor style.")
M
markrendle 已提交
990
		},
991
		'editor.cursorWidth': {
992
			'type': 'integer',
993
			'default': EDITOR_DEFAULTS.viewInfo.cursorWidth,
994
			'markdownDescription': nls.localize('cursorWidth', "Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")
995
		},
J
Johannes Rieken 已提交
996
		'editor.fontLigatures': {
997
			'type': 'boolean',
A
Alex Dima 已提交
998
			'default': EDITOR_DEFAULTS.viewInfo.fontLigatures,
999
			'description': nls.localize('fontLigatures', "Enables/Disables font ligatures.")
1000
		},
J
Johannes Rieken 已提交
1001
		'editor.hideCursorInOverviewRuler': {
E
Erich Gamma 已提交
1002
			'type': 'boolean',
A
Alex Dima 已提交
1003
			'default': EDITOR_DEFAULTS.viewInfo.hideCursorInOverviewRuler,
1004
			'description': nls.localize('hideCursorInOverviewRuler', "Controls whether the cursor should be hidden in the overview ruler.")
E
Erich Gamma 已提交
1005 1006
		},
		'editor.renderWhitespace': {
1007
			'type': 'string',
1008
			'enum': ['none', 'boundary', 'selection', 'all'],
1009 1010
			'enumDescriptions': [
				'',
1011
				nls.localize('renderWhitespace.boundary', "Render whitespace characters except for single spaces between words."),
1012
				nls.localize('renderWhitespace.selection', "Render whitespace characters only on selected text."),
1013 1014
				''
			],
A
Alex Dima 已提交
1015
			default: EDITOR_DEFAULTS.viewInfo.renderWhitespace,
1016
			description: nls.localize('renderWhitespace', "Controls how the editor should render whitespace characters.")
E
Erich Gamma 已提交
1017
		},
1018 1019
		'editor.renderControlCharacters': {
			'type': 'boolean',
A
Alex Dima 已提交
1020
			default: EDITOR_DEFAULTS.viewInfo.renderControlCharacters,
1021
			description: nls.localize('renderControlCharacters', "Controls whether the editor should render control characters.")
1022
		},
1023 1024
		'editor.renderIndentGuides': {
			'type': 'boolean',
A
Alex Dima 已提交
1025
			default: EDITOR_DEFAULTS.viewInfo.renderIndentGuides,
1026
			description: nls.localize('renderIndentGuides', "Controls whether the editor should render indent guides.")
1027
		},
1028 1029 1030
		'editor.highlightActiveIndentGuide': {
			'type': 'boolean',
			default: EDITOR_DEFAULTS.viewInfo.highlightActiveIndentGuide,
1031
			description: nls.localize('highlightActiveIndentGuide', "Controls whether the editor should highlight the active indent guide.")
1032
		},
1033
		'editor.renderLineHighlight': {
1034 1035
			'type': 'string',
			'enum': ['none', 'gutter', 'line', 'all'],
S
SteVen Batten 已提交
1036 1037 1038 1039 1040 1041
			'enumDescriptions': [
				'',
				'',
				'',
				nls.localize('renderLineHighlight.all', "Highlights both the gutter and the current line."),
			],
A
Alex Dima 已提交
1042
			default: EDITOR_DEFAULTS.viewInfo.renderLineHighlight,
S
SteVen Batten 已提交
1043
			description: nls.localize('renderLineHighlight', "Controls how the editor should render the current line highlight.")
1044
		},
J
Johannes Rieken 已提交
1045
		'editor.codeLens': {
E
Erich Gamma 已提交
1046
			'type': 'boolean',
A
Alex Dima 已提交
1047
			'default': EDITOR_DEFAULTS.contribInfo.codeLens,
R
Rob Lourens 已提交
1048
			'description': nls.localize('codeLens', "Controls whether the editor shows CodeLens.")
E
Erich Gamma 已提交
1049
		},
J
Johannes Rieken 已提交
1050
		'editor.folding': {
M
Martin Aeschlimann 已提交
1051
			'type': 'boolean',
A
renames  
Alex Dima 已提交
1052
			'default': EditorOptions.folding.defaultValue,
R
Rob Lourens 已提交
1053
			'description': nls.localize('folding', "Controls whether the editor has code folding enabled.")
M
Martin Aeschlimann 已提交
1054
		},
1055 1056 1057 1058
		'editor.foldingStrategy': {
			'type': 'string',
			'enum': ['auto', 'indentation'],
			'default': EDITOR_DEFAULTS.contribInfo.foldingStrategy,
1059
			'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.")
1060
		},
1061 1062 1063 1064 1065
		'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.")
1066
		},
1067
		'editor.matchBrackets': {
1068
			'type': 'boolean',
A
Alex Dima 已提交
1069
			'default': EDITOR_DEFAULTS.contribInfo.matchBrackets,
1070
			'description': nls.localize('matchBrackets', "Highlight matching brackets when one of them is selected.")
1071
		},
I
isidor 已提交
1072 1073
		'editor.glyphMargin': {
			'type': 'boolean',
A
Alex Dima 已提交
1074
			'default': EDITOR_DEFAULTS.viewInfo.glyphMargin,
I
isidor 已提交
1075 1076
			'description': nls.localize('glyphMargin', "Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")
		},
J
Johannes Rieken 已提交
1077
		'editor.useTabStops': {
1078
			'type': 'boolean',
1079
			'default': EDITOR_DEFAULTS.useTabStops,
M
Matt Bierner 已提交
1080
			'description': nls.localize('useTabStops', "Inserting and deleting whitespace follows tab stops.")
1081
		},
J
Johannes Rieken 已提交
1082
		'editor.trimAutoWhitespace': {
1083
			'type': 'boolean',
1084
			'default': EDITOR_MODEL_DEFAULTS.trimAutoWhitespace,
M
Matt Bierner 已提交
1085
			'description': nls.localize('trimAutoWhitespace', "Remove trailing auto inserted whitespace.")
1086
		},
J
Johannes Rieken 已提交
1087
		'editor.stablePeek': {
1088
			'type': 'boolean',
1089
			'default': false,
1090
			'markdownDescription': nls.localize('stablePeek', "Keep peek editors open even when double clicking their content or when hitting `Escape`.")
1091
		},
1092
		'editor.dragAndDrop': {
1093
			'type': 'boolean',
1094
			'default': EDITOR_DEFAULTS.dragAndDrop,
1095
			'description': nls.localize('dragAndDrop', "Controls whether the editor should allow moving selections via drag and drop.")
1096
		},
1097 1098 1099 1100 1101 1102 1103 1104
		'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 已提交
1105
			'default': EditorOptions.accessibilitySupport.defaultValue,
1106 1107
			'description': nls.localize('accessibilitySupport', "Controls whether the editor should run in a mode where it is optimized for screen readers.")
		},
1108 1109 1110 1111 1112
		'editor.showUnused': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.showUnused,
			'description': nls.localize('showUnused', "Controls fading out of unused code.")
		},
1113
		'editor.links': {
1114
			'type': 'boolean',
1115
			'default': EDITOR_DEFAULTS.contribInfo.links,
S
SteVen Batten 已提交
1116
			'description': nls.localize('links', "Controls whether the editor should detect links and make them clickable.")
1117
		},
R
rebornix 已提交
1118
		'editor.colorDecorators': {
1119
			'type': 'boolean',
R
rebornix 已提交
1120
			'default': EDITOR_DEFAULTS.contribInfo.colorDecorators,
1121
			'description': nls.localize('colorDecorators', "Controls whether the editor should render the inline color decorators and color picker.")
1122
		},
1123 1124 1125
		'editor.lightbulb.enabled': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.contribInfo.lightbulbEnabled,
S
SteVen Batten 已提交
1126
			'description': nls.localize('codeActions', "Enables the code action lightbulb in the editor.")
1127
		},
1128 1129 1130
		'editor.maxTokenizationLineLength': {
			'type': 'integer',
			'default': 20_000,
A
Alex Dima 已提交
1131
			'description': nls.localize('maxTokenizationLineLength', "Lines above this length will not be tokenized for performance reasons")
1132
		},
1133 1134 1135 1136 1137
		'editor.codeActionsOnSave': {
			'type': 'object',
			'properties': {
				'source.organizeImports': {
					'type': 'boolean',
1138
					'description': nls.localize('codeActionsOnSave.organizeImports', "Controls whether organize imports action should be run on file save.")
1139
				},
1140
				'source.fixAll': {
1141
					'type': 'boolean',
1142
					'description': nls.localize('codeActionsOnSave.fixAll', "Controls whether auto fix action should be run on file save.")
1143 1144 1145 1146 1147 1148
				}
			},
			'additionalProperties': {
				'type': 'boolean'
			},
			'default': EDITOR_DEFAULTS.contribInfo.codeActionsOnSave,
M
Matt Bierner 已提交
1149
			'description': nls.localize('codeActionsOnSave', "Code action kinds to be run on save.")
1150 1151 1152 1153
		},
		'editor.codeActionsOnSaveTimeout': {
			'type': 'number',
			'default': EDITOR_DEFAULTS.contribInfo.codeActionsOnSaveTimeout,
1154
			'description': nls.localize('codeActionsOnSaveTimeout', "Timeout in milliseconds after which the code actions that are run on save are cancelled.")
1155
		},
1156 1157
		'editor.selectionClipboard': {
			'type': 'boolean',
A
renames  
Alex Dima 已提交
1158
			'default': EditorOptions.selectionClipboard.defaultValue,
S
SteVen Batten 已提交
1159
			'description': nls.localize('selectionClipboard', "Controls whether the Linux primary clipboard should be supported."),
1160
			'included': platform.isLinux
1161
		},
J
Johannes Rieken 已提交
1162
		'diffEditor.renderSideBySide': {
E
Erich Gamma 已提交
1163 1164
			'type': 'boolean',
			'default': true,
1165
			'description': nls.localize('sideBySide', "Controls whether the diff editor shows the diff side by side or inline.")
E
Erich Gamma 已提交
1166
		},
J
Johannes Rieken 已提交
1167
		'diffEditor.ignoreTrimWhitespace': {
E
Erich Gamma 已提交
1168 1169
			'type': 'boolean',
			'default': true,
1170
			'description': nls.localize('ignoreTrimWhitespace', "Controls whether the diff editor shows changes in leading or trailing whitespace as diffs.")
1171
		},
1172 1173 1174 1175
		'editor.largeFileOptimizations': {
			'type': 'boolean',
			'default': EDITOR_MODEL_DEFAULTS.largeFileOptimizations,
			'description': nls.localize('largeFileOptimizations', "Special handling for large files to disable certain memory intensive features.")
1176
		},
1177 1178 1179
		'diffEditor.renderIndicators': {
			'type': 'boolean',
			'default': true,
1180
			'description': nls.localize('renderIndicators', "Controls whether the diff editor shows +/- indicators for added/removed changes.")
E
Erich Gamma 已提交
1181 1182
		}
	}
A
Alex Dima 已提交
1183 1184
};

A
Alex Dima 已提交
1185
let cachedEditorConfigurationKeys: { [key: string]: boolean; } | null = null;
1186 1187
function getEditorConfigurationKeys(): { [key: string]: boolean; } {
	if (cachedEditorConfigurationKeys === null) {
A
Alex Dima 已提交
1188 1189 1190
		cachedEditorConfigurationKeys = <{ [key: string]: boolean; }>Object.create(null);
		Object.keys(editorConfiguration.properties!).forEach((prop) => {
			cachedEditorConfigurationKeys![prop] = true;
1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204
		});
	}
	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);
}

1205
configurationRegistry.registerConfiguration(editorConfiguration);