commonEditorConfig.ts 52.0 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';
11
import * as editorOptions 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 18 19
import EDITOR_DEFAULTS = editorOptions.EDITOR_DEFAULTS;
import EDITOR_FONT_DEFAULTS = editorOptions.EDITOR_FONT_DEFAULTS;
import EDITOR_MODEL_DEFAULTS = editorOptions.EDITOR_MODEL_DEFAULTS;
20
import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';
E
Erich Gamma 已提交
21

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

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

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

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

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

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

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

64 65
const hasOwnProperty = Object.hasOwnProperty;

66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
export class EditorConfiguration2 {
	public static readOptions(options: editorOptions.IEditorOptions): editorOptions.RawEditorOptions {
		// console.log(`parseOptions`, options);
		const result = new editorOptions.RawEditorOptions();
		for (const editorOption of editorOptions.editorOptionsRegistry) {
			result._write(editorOption.id, editorOption.read(options));
		}
		return result;
	}

	public static mixOptions(a: editorOptions.RawEditorOptions, b: editorOptions.IEditorOptions): editorOptions.RawEditorOptions {
		// console.log(`mixOptions`, a, b);
		const result = new editorOptions.RawEditorOptions();
		for (const editorOption of editorOptions.editorOptionsRegistry) {
			result._write(editorOption.id, editorOption.mix(a._read(editorOption.id), editorOption.read(b)));
		}
		return result;
	}

	public static validateOptions(options: editorOptions.RawEditorOptions): editorOptions.ValidatedEditorOptions {
		// console.log(`validateOptions`, options);
		const result = new editorOptions.ValidatedEditorOptions();
		for (const editorOption of editorOptions.editorOptionsRegistry) {
			result._write(editorOption.id, editorOption.validate(options._read(editorOption.id)));
		}
		return result;
	}

	public static computeOptions(options: editorOptions.ValidatedEditorOptions, env: editorOptions.IEnvironmentalOptions): editorOptions.ComputedEditorOptions {
		// console.log(`computeOptions`, options, env);
		const result = new editorOptions.ComputedEditorOptions();
		for (const editorOption of editorOptions.editorOptionsRegistry) {
			result._write(editorOption.id, editorOption.compute(options._read(editorOption.id)));
		}
		return result;
	}

	public static checkEquals(a: editorOptions.ComputedEditorOptions, b: editorOptions.ComputedEditorOptions): editorOptions.ChangedEditorOptions | null {
		// console.log(`equals`, a, b);
		const result = new editorOptions.ChangedEditorOptions();
		let somethingChanged = false;
		for (const editorOption of editorOptions.editorOptionsRegistry) {
			const equals = editorOption.equals(a._read(editorOption.id), b._read(editorOption.id));
			result._write(editorOption.id, equals);
			if (!equals) {
				somethingChanged = true;
			}
		}
		return (somethingChanged ? result : null);
	}
}

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

A
Alex Dima 已提交
120
	public readonly isSimpleWidget: boolean;
121 122
	protected _rawOptions: editorOptions.IEditorOptions;
	protected _validatedOptions: editorOptions.IValidatedEditorOptions;
A
Alex Dima 已提交
123
	public editor!: editorOptions.InternalEditorOptions;
J
Johannes Rieken 已提交
124
	private _isDominatedByLongLines: boolean;
125
	private _lineNumbersDigitCount: number;
E
Erich Gamma 已提交
126

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

130 131 132 133
	private _rawOptions2: editorOptions.RawEditorOptions;
	private _validatedOptions2: editorOptions.ValidatedEditorOptions;
	public options!: editorOptions.ComputedEditorOptions;

A
Alex Dima 已提交
134
	constructor(isSimpleWidget: boolean, options: editorOptions.IEditorOptions) {
A
Alex Dima 已提交
135
		super();
136

A
Alex Dima 已提交
137 138
		this.isSimpleWidget = isSimpleWidget;

139 140 141 142 143
		// 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 已提交
144
		this._rawOptions.hover = objects.mixin({}, this._rawOptions.hover || {});
145
		this._rawOptions.parameterHints = objects.mixin({}, this._rawOptions.parameterHints || {});
146

147
		this._validatedOptions = editorOptions.EditorOptionsValidator.validate(this._rawOptions, EDITOR_DEFAULTS);
148 149 150 151

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

E
Erich Gamma 已提交
152
		this._isDominatedByLongLines = false;
153
		this._lineNumbersDigitCount = 1;
A
Alex Dima 已提交
154

155
		this._register(EditorZoom.onDidChangeZoomLevel(_ => this._recomputeOptions()));
156
		this._register(TabFocus.onDidChangeTabFocus(_ => this._recomputeOptions()));
E
Erich Gamma 已提交
157 158
	}

A
Alex Dima 已提交
159 160 161 162
	public getOption<T extends editorOptions.IEditorOption<any, any, any>>(id: editorOptions.EditorOptionId): editorOptions.ComputedEditorOptionValue<T> {
		return this.options._read(id);
	}

A
Alex Dima 已提交
163 164 165
	public observeReferenceElement(dimension?: editorCommon.IDimension): void {
	}

E
Erich Gamma 已提交
166 167 168 169 170
	public dispose(): void {
		super.dispose();
	}

	protected _recomputeOptions(): void {
A
Alex Dima 已提交
171
		const oldOptions = this.editor;
172 173 174 175
		const oldOptions2 = this.options;
		const [newOptions, newOptions2] = this._computeInternalOptions();

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

177
		if (oldOptions && oldOptions.equals(newOptions) && oldOptions2 && changeEvent === null) {
178
			return;
E
Erich Gamma 已提交
179 180
		}

181
		this.editor = newOptions;
182
		this.options = newOptions2;
E
Erich Gamma 已提交
183

A
Alex Dima 已提交
184
		if (oldOptions) {
185
			this._onDidChange.fire(oldOptions.createChangeEvent(newOptions, changeEvent));
186
		}
E
Erich Gamma 已提交
187
	}
188

189
	public getRawOptions(): editorOptions.IEditorOptions {
190
		return this._rawOptions;
E
Erich Gamma 已提交
191
	}
192

193
	private _computeInternalOptions(): [editorOptions.InternalEditorOptions, editorOptions.ComputedEditorOptions] {
194
		const opts = this._validatedOptions;
A
Alex Dima 已提交
195
		const partialEnv = this._getEnvConfiguration();
A
Alex Dima 已提交
196
		const bareFontInfo = BareFontInfo.createFromRawSettings(this._rawOptions, partialEnv.zoomLevel, this.isSimpleWidget);
A
Alex Dima 已提交
197
		const env: editorOptions.IEnvironmentalOptions = {
A
Alex Dima 已提交
198 199
			outerWidth: partialEnv.outerWidth,
			outerHeight: partialEnv.outerHeight,
200
			fontInfo: this.readConfiguration(bareFontInfo),
201
			extraEditorClassName: partialEnv.extraEditorClassName,
202 203
			isDominatedByLongLines: this._isDominatedByLongLines,
			lineNumbersDigitCount: this._lineNumbersDigitCount,
204
			emptySelectionClipboard: partialEnv.emptySelectionClipboard,
A
Alex Dima 已提交
205
			pixelRatio: partialEnv.pixelRatio,
206 207
			tabFocusMode: TabFocus.getTabFocusMode(),
			accessibilitySupport: partialEnv.accessibilitySupport
A
Alex Dima 已提交
208
		};
209 210 211
		const r = editorOptions.InternalEditorOptionsFactory.createInternalEditorOptions(env, opts);
		const r2 = EditorConfiguration2.computeOptions(this._validatedOptions2, env);
		return [r, r2];
E
Erich Gamma 已提交
212 213
	}

214 215 216 217 218 219 220 221 222 223 224 225
	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 已提交
226 227
	private static _subsetEquals(base: { [key: string]: any }, subset: { [key: string]: any }): boolean {
		for (const key in subset) {
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253
			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;
	}

254
	public updateOptions(newOptions: editorOptions.IEditorOptions): void {
255 256 257 258 259 260
		if (typeof newOptions === 'undefined') {
			return;
		}
		if (CommonEditorConfiguration._subsetEquals(this._rawOptions, newOptions)) {
			return;
		}
261
		this._rawOptions = objects.mixin(this._rawOptions, newOptions || {});
262 263
		this._rawOptions2 = EditorConfiguration2.mixOptions(this._rawOptions2, newOptions);

264
		this._validatedOptions = editorOptions.EditorOptionsValidator.validate(this._rawOptions, EDITOR_DEFAULTS);
265 266
		this._validatedOptions2 = EditorConfiguration2.validateOptions(this._rawOptions2);

E
Erich Gamma 已提交
267 268 269
		this._recomputeOptions();
	}

J
Johannes Rieken 已提交
270
	public setIsDominatedByLongLines(isDominatedByLongLines: boolean): void {
E
Erich Gamma 已提交
271 272 273 274
		this._isDominatedByLongLines = isDominatedByLongLines;
		this._recomputeOptions();
	}

J
Johannes Rieken 已提交
275
	public setMaxLineNumber(maxLineNumber: number): void {
276
		let digitCount = CommonEditorConfiguration._digitCount(maxLineNumber);
277
		if (this._lineNumbersDigitCount === digitCount) {
A
Alex Dima 已提交
278 279
			return;
		}
280
		this._lineNumbersDigitCount = digitCount;
E
Erich Gamma 已提交
281 282 283
		this._recomputeOptions();
	}

284
	private static _digitCount(n: number): number {
A
Alex Dima 已提交
285
		let r = 0;
286 287 288 289 290 291
		while (n) {
			n = Math.floor(n / 10);
			r++;
		}
		return r ? r : 1;
	}
A
Alex Dima 已提交
292
	protected abstract _getEnvConfiguration(): IEnvConfiguration;
293

294
	protected abstract readConfiguration(styling: BareFontInfo): FontInfo;
295

E
Erich Gamma 已提交
296 297
}

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

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

A
Alex Dima 已提交
1171
let cachedEditorConfigurationKeys: { [key: string]: boolean; } | null = null;
1172 1173
function getEditorConfigurationKeys(): { [key: string]: boolean; } {
	if (cachedEditorConfigurationKeys === null) {
A
Alex Dima 已提交
1174 1175 1176
		cachedEditorConfigurationKeys = <{ [key: string]: boolean; }>Object.create(null);
		Object.keys(editorConfiguration.properties!).forEach((prop) => {
			cachedEditorConfigurationKeys![prop] = true;
1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190
		});
	}
	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);
}

1191
configurationRegistry.registerConfiguration(editorConfiguration);