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

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

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

export const TabFocus: ITabFocus = new class {
	private _tabFocus: boolean = false;

	private _onDidChangeTabFocus: Emitter<boolean> = new Emitter<boolean>();
J
Johannes Rieken 已提交
38
	public 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 58
export interface IEnvConfiguration {
	extraEditorClassName: string;
	outerWidth: number;
	outerHeight: number;
	canUseTranslate3d: boolean;
59
	emptySelectionClipboard: boolean;
A
Alex Dima 已提交
60 61
	pixelRatio: number;
	zoomLevel: number;
62
	accessibilitySupport: platform.AccessibilitySupport;
63 64
}

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

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

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

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

79
		this._rawOptions = objects.mixin({}, options || {});
80
		this._validatedOptions = editorOptions.EditorOptionsValidator.validate(this._rawOptions, EDITOR_DEFAULTS);
A
Alex Dima 已提交
81
		this.editor = null;
E
Erich Gamma 已提交
82
		this._isDominatedByLongLines = false;
83
		this._lineNumbersDigitCount = 1;
A
Alex Dima 已提交
84

85
		this._register(EditorZoom.onDidChangeZoomLevel(_ => this._recomputeOptions()));
86
		this._register(TabFocus.onDidChangeTabFocus(_ => this._recomputeOptions()));
E
Erich Gamma 已提交
87 88 89 90 91 92 93
	}

	public dispose(): void {
		super.dispose();
	}

	protected _recomputeOptions(): void {
A
Alex Dima 已提交
94 95
		const oldOptions = this.editor;
		const newOptions = this._computeInternalOptions();
96

A
Alex Dima 已提交
97
		if (oldOptions && oldOptions.equals(newOptions)) {
98
			return;
E
Erich Gamma 已提交
99 100
		}

101
		this.editor = newOptions;
E
Erich Gamma 已提交
102

A
Alex Dima 已提交
103 104
		if (oldOptions) {
			this._onDidChange.fire(oldOptions.createChangeEvent(newOptions));
105
		}
E
Erich Gamma 已提交
106
	}
107

108
	public getRawOptions(): editorOptions.IEditorOptions {
109
		return this._rawOptions;
E
Erich Gamma 已提交
110
	}
111

112
	private _computeInternalOptions(): editorOptions.InternalEditorOptions {
113
		const opts = this._validatedOptions;
A
Alex Dima 已提交
114 115
		const partialEnv = this._getEnvConfiguration();
		const bareFontInfo = BareFontInfo.createFromRawSettings(this._rawOptions, partialEnv.zoomLevel);
A
Alex Dima 已提交
116
		const env: editorOptions.IEnvironmentalOptions = {
A
Alex Dima 已提交
117 118
			outerWidth: partialEnv.outerWidth,
			outerHeight: partialEnv.outerHeight,
119
			fontInfo: this.readConfiguration(bareFontInfo),
120
			extraEditorClassName: partialEnv.extraEditorClassName,
121 122
			isDominatedByLongLines: this._isDominatedByLongLines,
			lineNumbersDigitCount: this._lineNumbersDigitCount,
A
Alex Dima 已提交
123
			canUseTranslate3d: partialEnv.canUseTranslate3d,
124
			emptySelectionClipboard: partialEnv.emptySelectionClipboard,
A
Alex Dima 已提交
125
			pixelRatio: partialEnv.pixelRatio,
126 127
			tabFocusMode: TabFocus.getTabFocusMode(),
			accessibilitySupport: partialEnv.accessibilitySupport
A
Alex Dima 已提交
128
		};
129
		return editorOptions.InternalEditorOptionsFactory.createInternalEditorOptions(env, opts);
E
Erich Gamma 已提交
130 131
	}

132
	public updateOptions(newOptions: editorOptions.IEditorOptions): void {
133
		this._rawOptions = objects.mixin(this._rawOptions, newOptions || {});
134
		this._validatedOptions = editorOptions.EditorOptionsValidator.validate(this._rawOptions, EDITOR_DEFAULTS);
E
Erich Gamma 已提交
135 136 137
		this._recomputeOptions();
	}

J
Johannes Rieken 已提交
138
	public setIsDominatedByLongLines(isDominatedByLongLines: boolean): void {
E
Erich Gamma 已提交
139 140 141 142
		this._isDominatedByLongLines = isDominatedByLongLines;
		this._recomputeOptions();
	}

J
Johannes Rieken 已提交
143
	public setMaxLineNumber(maxLineNumber: number): void {
144
		let digitCount = CommonEditorConfiguration._digitCount(maxLineNumber);
145
		if (this._lineNumbersDigitCount === digitCount) {
A
Alex Dima 已提交
146 147
			return;
		}
148
		this._lineNumbersDigitCount = digitCount;
E
Erich Gamma 已提交
149 150 151
		this._recomputeOptions();
	}

152
	private static _digitCount(n: number): number {
153 154 155 156 157 158 159
		var r = 0;
		while (n) {
			n = Math.floor(n / 10);
			r++;
		}
		return r ? r : 1;
	}
A
Alex Dima 已提交
160
	protected abstract _getEnvConfiguration(): IEnvConfiguration;
161

162
	protected abstract readConfiguration(styling: BareFontInfo): FontInfo;
163

E
Erich Gamma 已提交
164 165
}

166 167
const configurationRegistry = <IConfigurationRegistry>Registry.as(Extensions.Configuration);
const editorConfiguration: IConfigurationNode = {
E
Erich Gamma 已提交
168 169 170
	'id': 'editor',
	'order': 5,
	'type': 'object',
171
	'title': nls.localize('editorConfigurationTitle', "Editor"),
172
	'overridable': true,
J
Johannes Rieken 已提交
173 174
	'properties': {
		'editor.fontFamily': {
E
Erich Gamma 已提交
175
			'type': 'string',
176
			'default': EDITOR_FONT_DEFAULTS.fontFamily,
E
Erich Gamma 已提交
177 178
			'description': nls.localize('fontFamily', "Controls the font family.")
		},
J
Johannes Rieken 已提交
179
		'editor.fontWeight': {
180
			'type': 'string',
181
			'enum': ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
182
			'default': EDITOR_FONT_DEFAULTS.fontWeight,
183 184
			'description': nls.localize('fontWeight', "Controls the font weight.")
		},
J
Johannes Rieken 已提交
185
		'editor.fontSize': {
E
Erich Gamma 已提交
186
			'type': 'number',
187
			'default': EDITOR_FONT_DEFAULTS.fontSize,
188
			'description': nls.localize('fontSize', "Controls the font size in pixels.")
E
Erich Gamma 已提交
189
		},
J
Johannes Rieken 已提交
190
		'editor.lineHeight': {
E
Erich Gamma 已提交
191
			'type': 'number',
192
			'default': EDITOR_FONT_DEFAULTS.lineHeight,
193
			'description': nls.localize('lineHeight', "Controls the line height. Use 0 to compute the lineHeight from the fontSize.")
E
Erich Gamma 已提交
194
		},
195 196
		'editor.letterSpacing': {
			'type': 'number',
197
			'default': EDITOR_FONT_DEFAULTS.letterSpacing,
198 199
			'description': nls.localize('letterSpacing', "Controls the letter spacing in pixels.")
		},
J
Johannes Rieken 已提交
200
		'editor.lineNumbers': {
201 202
			'type': 'string',
			'enum': ['off', 'on', 'relative'],
203
			'default': 'on',
204
			'description': nls.localize('lineNumbers', "Controls the display of line numbers. Possible values are 'on', 'off', and 'relative'. 'relative' shows the line count from the current cursor position.")
E
Erich Gamma 已提交
205
		},
J
Johannes Rieken 已提交
206
		'editor.rulers': {
207 208 209 210
			'type': 'array',
			'items': {
				'type': 'number'
			},
A
Alex Dima 已提交
211
			'default': EDITOR_DEFAULTS.viewInfo.rulers,
212 213
			'description': nls.localize('rulers', "Columns at which to show vertical rulers")
		},
J
Johannes Rieken 已提交
214
		'editor.wordSeparators': {
A
Alex Dima 已提交
215
			'type': 'string',
216
			'default': EDITOR_DEFAULTS.wordSeparators,
A
Alex Dima 已提交
217 218
			'description': nls.localize('wordSeparators', "Characters that will be used as word separators when doing word related navigations or operations")
		},
J
Johannes Rieken 已提交
219
		'editor.tabSize': {
220
			'type': 'number',
221
			'default': EDITOR_MODEL_DEFAULTS.tabSize,
E
Erich Gamma 已提交
222
			'minimum': 1,
223
			'description': nls.localize('tabSize', "The number of spaces a tab is equal to. This setting is overriden based on the file contents when `editor.detectIndentation` is on."),
224
			'errorMessage': nls.localize('tabSize.errorMessage', "Expected 'number'. Note that the value \"auto\" has been replaced by the `editor.detectIndentation` setting.")
E
Erich Gamma 已提交
225
		},
J
Johannes Rieken 已提交
226
		'editor.insertSpaces': {
227
			'type': 'boolean',
228
			'default': EDITOR_MODEL_DEFAULTS.insertSpaces,
229
			'description': nls.localize('insertSpaces', "Insert spaces when pressing Tab. This setting is overriden based on the file contents when `editor.detectIndentation` is on."),
230
			'errorMessage': nls.localize('insertSpaces.errorMessage', "Expected 'boolean'. Note that the value \"auto\" has been replaced by the `editor.detectIndentation` setting.")
E
Erich Gamma 已提交
231
		},
J
Johannes Rieken 已提交
232
		'editor.detectIndentation': {
233
			'type': 'boolean',
234
			'default': EDITOR_MODEL_DEFAULTS.detectIndentation,
A
Alex Dima 已提交
235
			'description': nls.localize('detectIndentation', "When opening a file, `editor.tabSize` and `editor.insertSpaces` will be detected based on the file contents.")
236
		},
J
Johannes Rieken 已提交
237
		'editor.roundedSelection': {
E
Erich Gamma 已提交
238
			'type': 'boolean',
A
Alex Dima 已提交
239
			'default': EDITOR_DEFAULTS.viewInfo.roundedSelection,
E
Erich Gamma 已提交
240 241
			'description': nls.localize('roundedSelection', "Controls if selections have rounded corners")
		},
J
Johannes Rieken 已提交
242
		'editor.scrollBeyondLastLine': {
E
Erich Gamma 已提交
243
			'type': 'boolean',
A
Alex Dima 已提交
244
			'default': EDITOR_DEFAULTS.viewInfo.scrollBeyondLastLine,
E
Erich Gamma 已提交
245 246
			'description': nls.localize('scrollBeyondLastLine', "Controls if the editor will scroll beyond the last line")
		},
247 248
		'editor.minimap.enabled': {
			'type': 'boolean',
A
Alex Dima 已提交
249
			'default': EDITOR_DEFAULTS.viewInfo.minimap.enabled,
250 251
			'description': nls.localize('minimap.enabled', "Controls if the minimap is shown")
		},
252
		'editor.minimap.renderCharacters': {
253
			'type': 'boolean',
A
Alex Dima 已提交
254
			'default': EDITOR_DEFAULTS.viewInfo.minimap.renderCharacters,
255
			'description': nls.localize('minimap.renderCharacters', "Render the actual characters on a line (as opposed to color blocks)")
256
		},
A
Alex Dima 已提交
257 258
		'editor.minimap.maxColumn': {
			'type': 'number',
A
Alex Dima 已提交
259
			'default': EDITOR_DEFAULTS.viewInfo.minimap.maxColumn,
A
Alex Dima 已提交
260 261
			'description': nls.localize('minimap.maxColumn', "Limit the width of the minimap to render at most a certain number of columns")
		},
262 263 264
		'editor.find.seedSearchStringFromSelection': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.contribInfo.find.seedSearchStringFromSelection,
265
			'description': nls.localize('find.seedSearchStringFromSelection', "Controls if we seed the search string in Find Widget from editor selection")
266
		},
R
rebornix 已提交
267 268 269 270 271
		'editor.find.autoFindInSelection': {
			'type': 'boolean',
			'default': EDITOR_DEFAULTS.contribInfo.find.autoFindInSelection,
			'description': nls.localize('find.autoFindInSelection', "Controls if Find in Selection flag is turned on when multiple characters or lines of text are selected in the editor")
		},
J
Johannes Rieken 已提交
272
		'editor.wordWrap': {
273
			'type': 'string',
A
Alex Dima 已提交
274
			'enum': ['off', 'on', 'wordWrapColumn', 'bounded'],
275 276 277
			'enumDescriptions': [
				nls.localize('wordWrap.off', "Lines will never wrap."),
				nls.localize('wordWrap.on', "Lines will wrap at the viewport width."),
A
Alex Dima 已提交
278 279 280 281 282 283
				nls.localize({
					key: 'wordWrap.wordWrapColumn',
					comment: [
						'- `editor.wordWrapColumn` refers to a different setting and should not be localized.'
					]
				}, "Lines will wrap at `editor.wordWrapColumn`."),
A
Alex Dima 已提交
284 285 286 287
				nls.localize({
					key: 'wordWrap.bounded',
					comment: [
						'- viewport means the edge of the visible window size.',
A
Alex Dima 已提交
288
						'- `editor.wordWrapColumn` refers to a different setting and should not be localized.'
A
Alex Dima 已提交
289 290
					]
				}, "Lines will wrap at the minimum of viewport and `editor.wordWrapColumn`."),
291
			],
292
			'default': EDITOR_DEFAULTS.wordWrap,
A
Alex Dima 已提交
293 294 295 296 297 298 299
			'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.'
				]
			}, "Controls how lines should wrap. Can be:\n - 'off' (disable wrapping),\n - 'on' (viewport wrapping),\n - 'wordWrapColumn' (wrap at `editor.wordWrapColumn`) or\n - 'bounded' (wrap at minimum of viewport and `editor.wordWrapColumn`).")
300 301 302
		},
		'editor.wordWrapColumn': {
			'type': 'integer',
303
			'default': EDITOR_DEFAULTS.wordWrapColumn,
304
			'minimum': 1,
A
Alex Dima 已提交
305 306 307 308 309 310 311
			'description': nls.localize({
				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.'
				]
			}, "Controls the wrapping column of the editor when `editor.wordWrap` is 'wordWrapColumn' or 'bounded'.")
312
		},
J
Johannes Rieken 已提交
313
		'editor.wrappingIndent': {
E
Erich Gamma 已提交
314 315
			'type': 'string',
			'enum': ['none', 'same', 'indent'],
316
			'default': 'same',
E
Erich Gamma 已提交
317 318
			'description': nls.localize('wrappingIndent', "Controls the indentation of wrapped lines. Can be one of 'none', 'same' or 'indent'.")
		},
J
Johannes Rieken 已提交
319
		'editor.mouseWheelScrollSensitivity': {
E
Erich Gamma 已提交
320
			'type': 'number',
A
Alex Dima 已提交
321
			'default': EDITOR_DEFAULTS.viewInfo.scrollbar.mouseWheelScrollSensitivity,
E
Erich Gamma 已提交
322 323
			'description': nls.localize('mouseWheelScrollSensitivity', "A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events")
		},
324 325 326 327 328 329
		'editor.multicursorModifier': {
			'type': 'string',
			'enum': (platform.isMacintosh ? ['cmd', 'alt'] : ['ctrl', 'alt']),
			'default': 'alt',
			'description': nls.localize('multicursorModifier', "The modifier to be used to add multiple cursors with the mouse.")
		},
J
Johannes Rieken 已提交
330
		'editor.quickSuggestions': {
331
			'anyOf': [
332 333 334
				{
					type: 'boolean',
				},
335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355
				{
					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 已提交
356
			'default': EDITOR_DEFAULTS.contribInfo.quickSuggestions,
357
			'description': nls.localize('quickSuggestions', "Controls if suggestions should automatically show up while typing")
E
Erich Gamma 已提交
358
		},
J
Johannes Rieken 已提交
359
		'editor.quickSuggestionsDelay': {
E
Erich Gamma 已提交
360
			'type': 'integer',
A
Alex Dima 已提交
361
			'default': EDITOR_DEFAULTS.contribInfo.quickSuggestionsDelay,
E
Erich Gamma 已提交
362 363 364
			'minimum': 0,
			'description': nls.localize('quickSuggestionsDelay', "Controls the delay in ms after which quick suggestions will show up")
		},
J
Johannes Rieken 已提交
365
		'editor.parameterHints': {
J
Joao Moreno 已提交
366
			'type': 'boolean',
A
Alex Dima 已提交
367
			'default': EDITOR_DEFAULTS.contribInfo.parameterHints,
J
Joao Moreno 已提交
368 369
			'description': nls.localize('parameterHints', "Enables parameter hints")
		},
J
Johannes Rieken 已提交
370
		'editor.autoClosingBrackets': {
E
Erich Gamma 已提交
371
			'type': 'boolean',
372
			'default': EDITOR_DEFAULTS.autoClosingBrackets,
E
Erich Gamma 已提交
373 374
			'description': nls.localize('autoClosingBrackets', "Controls if the editor should automatically close brackets after opening them")
		},
J
Johannes Rieken 已提交
375
		'editor.formatOnType': {
E
Erich Gamma 已提交
376
			'type': 'boolean',
A
Alex Dima 已提交
377
			'default': EDITOR_DEFAULTS.contribInfo.formatOnType,
E
Erich Gamma 已提交
378 379
			'description': nls.localize('formatOnType', "Controls if the editor should automatically format the line after typing")
		},
380 381
		'editor.formatOnPaste': {
			'type': 'boolean',
A
Alex Dima 已提交
382
			'default': EDITOR_DEFAULTS.contribInfo.formatOnPaste,
383
			'description': nls.localize('formatOnPaste', "Controls if 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.")
384
		},
J
Johannes Rieken 已提交
385
		'editor.suggestOnTriggerCharacters': {
E
Erich Gamma 已提交
386
			'type': 'boolean',
A
Alex Dima 已提交
387
			'default': EDITOR_DEFAULTS.contribInfo.suggestOnTriggerCharacters,
E
Erich Gamma 已提交
388 389
			'description': nls.localize('suggestOnTriggerCharacters', "Controls if suggestions should automatically show up when typing trigger characters")
		},
J
Johannes Rieken 已提交
390
		'editor.acceptSuggestionOnEnter': {
391 392
			'type': 'string',
			'enum': ['on', 'smart', 'off'],
A
Alex Dima 已提交
393
			'default': EDITOR_DEFAULTS.contribInfo.acceptSuggestionOnEnter,
394
			'description': nls.localize('acceptSuggestionOnEnter', "Controls if suggestions should be accepted on 'Enter' - in addition to 'Tab'. Helps to avoid ambiguity between inserting new lines or accepting suggestions. The value 'smart' means only accept a suggestion with Enter when it makes a textual change")
395 396 397
		},
		'editor.acceptSuggestionOnCommitCharacter': {
			'type': 'boolean',
A
Alex Dima 已提交
398
			'default': EDITOR_DEFAULTS.contribInfo.acceptSuggestionOnCommitCharacter,
399
			'description': nls.localize('acceptSuggestionOnCommitCharacter', "Controls if suggestions should be accepted on commit characters. For instance in JavaScript the semi-colon (';') can be a commit character that accepts a suggestion and types that character.")
400
		},
401
		'editor.snippetSuggestions': {
402
			'type': 'string',
403
			'enum': ['top', 'bottom', 'inline', 'none'],
A
Alex Dima 已提交
404
			'default': EDITOR_DEFAULTS.contribInfo.snippetSuggestions,
405
			'description': nls.localize('snippetSuggestions', "Controls whether snippets are shown with other suggestions and how they are sorted.")
406
		},
407 408
		'editor.emptySelectionClipboard': {
			'type': 'boolean',
409
			'default': EDITOR_DEFAULTS.emptySelectionClipboard,
410 411
			'description': nls.localize('emptySelectionClipboard', "Controls whether copying without a selection copies the current line.")
		},
412
		'editor.wordBasedSuggestions': {
413
			'type': 'boolean',
A
Alex Dima 已提交
414
			'default': EDITOR_DEFAULTS.contribInfo.wordBasedSuggestions,
J
Johannes Rieken 已提交
415
			'description': nls.localize('wordBasedSuggestions', "Controls whether completions should be computed based on words in the document.")
416
		},
J
Johannes Rieken 已提交
417
		'editor.suggestFontSize': {
J
Joao Moreno 已提交
418 419 420 421 422
			'type': 'integer',
			'default': 0,
			'minimum': 0,
			'description': nls.localize('suggestFontSize', "Font size for the suggest widget")
		},
J
Johannes Rieken 已提交
423
		'editor.suggestLineHeight': {
J
Joao Moreno 已提交
424 425 426 427 428
			'type': 'integer',
			'default': 0,
			'minimum': 0,
			'description': nls.localize('suggestLineHeight', "Line height for the suggest widget")
		},
J
Johannes Rieken 已提交
429
		'editor.selectionHighlight': {
E
Erich Gamma 已提交
430
			'type': 'boolean',
A
Alex Dima 已提交
431
			'default': EDITOR_DEFAULTS.contribInfo.selectionHighlight,
E
Erich Gamma 已提交
432 433
			'description': nls.localize('selectionHighlight', "Controls whether the editor should highlight similar matches to the selection")
		},
434 435
		'editor.occurrencesHighlight': {
			'type': 'boolean',
A
Alex Dima 已提交
436
			'default': EDITOR_DEFAULTS.contribInfo.occurrencesHighlight,
437 438
			'description': nls.localize('occurrencesHighlight', "Controls whether the editor should highlight semantic symbol occurrences")
		},
J
Johannes Rieken 已提交
439
		'editor.overviewRulerLanes': {
E
Erich Gamma 已提交
440 441 442 443
			'type': 'integer',
			'default': 3,
			'description': nls.localize('overviewRulerLanes', "Controls the number of decorations that can show up at the same position in the overview ruler")
		},
444
		'editor.overviewRulerBorder': {
445
			'type': 'boolean',
A
Alex Dima 已提交
446
			'default': EDITOR_DEFAULTS.viewInfo.overviewRulerBorder,
447
			'description': nls.localize('overviewRulerBorder', "Controls if a border should be drawn around the overview ruler.")
448
		},
J
Johannes Rieken 已提交
449
		'editor.cursorBlinking': {
450
			'type': 'string',
451
			'enum': ['blink', 'smooth', 'phase', 'expand', 'solid'],
452
			'default': editorOptions.blinkingStyleToString(EDITOR_DEFAULTS.viewInfo.cursorBlinking),
453
			'description': nls.localize('cursorBlinking', "Control the cursor animation style, possible values are 'blink', 'smooth', 'phase', 'expand' and 'solid'")
454
		},
455 456
		'editor.mouseWheelZoom': {
			'type': 'boolean',
A
Alex Dima 已提交
457
			'default': EDITOR_DEFAULTS.viewInfo.mouseWheelZoom,
458 459
			'description': nls.localize('mouseWheelZoom', "Zoom the font of the editor when using mouse wheel and holding Ctrl")
		},
J
Johannes Rieken 已提交
460
		'editor.cursorStyle': {
M
markrendle 已提交
461
			'type': 'string',
462
			'enum': ['block', 'block-outline', 'line', 'line-thin', 'underline', 'underline-thin'],
463
			'default': editorOptions.cursorStyleToString(EDITOR_DEFAULTS.viewInfo.cursorStyle),
464
			'description': nls.localize('cursorStyle', "Controls the cursor style, accepted values are 'block', 'block-outline', 'line', 'line-thin', 'underline' and 'underline-thin'")
M
markrendle 已提交
465
		},
J
Johannes Rieken 已提交
466
		'editor.fontLigatures': {
467
			'type': 'boolean',
A
Alex Dima 已提交
468
			'default': EDITOR_DEFAULTS.viewInfo.fontLigatures,
469 470
			'description': nls.localize('fontLigatures', "Enables font ligatures")
		},
J
Johannes Rieken 已提交
471
		'editor.hideCursorInOverviewRuler': {
E
Erich Gamma 已提交
472
			'type': 'boolean',
A
Alex Dima 已提交
473
			'default': EDITOR_DEFAULTS.viewInfo.hideCursorInOverviewRuler,
E
Erich Gamma 已提交
474 475 476
			'description': nls.localize('hideCursorInOverviewRuler', "Controls if the cursor should be hidden in the overview ruler.")
		},
		'editor.renderWhitespace': {
477 478
			'type': 'string',
			'enum': ['none', 'boundary', 'all'],
A
Alex Dima 已提交
479
			default: EDITOR_DEFAULTS.viewInfo.renderWhitespace,
480
			description: nls.localize('renderWhitespace', "Controls how the editor should render whitespace characters, possibilities are 'none', 'boundary', and 'all'. The 'boundary' option does not render single spaces between words.")
E
Erich Gamma 已提交
481
		},
482 483
		'editor.renderControlCharacters': {
			'type': 'boolean',
A
Alex Dima 已提交
484
			default: EDITOR_DEFAULTS.viewInfo.renderControlCharacters,
485 486
			description: nls.localize('renderControlCharacters', "Controls whether the editor should render control characters")
		},
487 488
		'editor.renderIndentGuides': {
			'type': 'boolean',
A
Alex Dima 已提交
489
			default: EDITOR_DEFAULTS.viewInfo.renderIndentGuides,
490 491
			description: nls.localize('renderIndentGuides', "Controls whether the editor should render indent guides")
		},
492
		'editor.renderLineHighlight': {
493 494
			'type': 'string',
			'enum': ['none', 'gutter', 'line', 'all'],
A
Alex Dima 已提交
495
			default: EDITOR_DEFAULTS.viewInfo.renderLineHighlight,
496
			description: nls.localize('renderLineHighlight', "Controls how the editor should render the current line highlight, possibilities are 'none', 'gutter', 'line', and 'all'.")
497
		},
J
Johannes Rieken 已提交
498
		'editor.codeLens': {
E
Erich Gamma 已提交
499
			'type': 'boolean',
A
Alex Dima 已提交
500
			'default': EDITOR_DEFAULTS.contribInfo.codeLens,
501
			'description': nls.localize('codeLens', "Controls if the editor shows code lenses")
E
Erich Gamma 已提交
502
		},
J
Johannes Rieken 已提交
503
		'editor.folding': {
M
Martin Aeschlimann 已提交
504
			'type': 'boolean',
A
Alex Dima 已提交
505
			'default': EDITOR_DEFAULTS.contribInfo.folding,
506
			'description': nls.localize('folding', "Controls whether the editor has code folding enabled")
M
Martin Aeschlimann 已提交
507
		},
508 509 510 511 512
		'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.")
513
		},
514
		'editor.matchBrackets': {
515
			'type': 'boolean',
A
Alex Dima 已提交
516
			'default': EDITOR_DEFAULTS.contribInfo.matchBrackets,
517
			'description': nls.localize('matchBrackets', "Highlight matching brackets when one of them is selected.")
518
		},
I
isidor 已提交
519 520
		'editor.glyphMargin': {
			'type': 'boolean',
A
Alex Dima 已提交
521
			'default': EDITOR_DEFAULTS.viewInfo.glyphMargin,
I
isidor 已提交
522 523
			'description': nls.localize('glyphMargin', "Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")
		},
J
Johannes Rieken 已提交
524
		'editor.useTabStops': {
525
			'type': 'boolean',
526
			'default': EDITOR_DEFAULTS.useTabStops,
527 528
			'description': nls.localize('useTabStops', "Inserting and deleting whitespace follows tab stops")
		},
J
Johannes Rieken 已提交
529
		'editor.trimAutoWhitespace': {
530
			'type': 'boolean',
531
			'default': EDITOR_MODEL_DEFAULTS.trimAutoWhitespace,
532 533
			'description': nls.localize('trimAutoWhitespace', "Remove trailing auto inserted whitespace")
		},
J
Johannes Rieken 已提交
534
		'editor.stablePeek': {
535
			'type': 'boolean',
536
			'default': false,
537
			'description': nls.localize('stablePeek', "Keep peek editors open even when double clicking their content or when hitting Escape.")
538
		},
539
		'editor.dragAndDrop': {
540
			'type': 'boolean',
541
			'default': EDITOR_DEFAULTS.dragAndDrop,
542
			'description': nls.localize('dragAndDrop', "Controls if the editor should allow to move selections via drag and drop.")
543
		},
J
Johannes Rieken 已提交
544
		'diffEditor.renderSideBySide': {
E
Erich Gamma 已提交
545 546 547 548
			'type': 'boolean',
			'default': true,
			'description': nls.localize('sideBySide', "Controls if the diff editor shows the diff side by side or inline")
		},
J
Johannes Rieken 已提交
549
		'diffEditor.ignoreTrimWhitespace': {
E
Erich Gamma 已提交
550 551 552
			'type': 'boolean',
			'default': true,
			'description': nls.localize('ignoreTrimWhitespace', "Controls if the diff editor shows changes in leading or trailing whitespace as diffs")
553 554 555 556 557
		},
		'diffEditor.renderIndicators': {
			'type': 'boolean',
			'default': true,
			'description': nls.localize('renderIndicators', "Controls if the diff editor shows +/- indicators for added/removed changes")
E
Erich Gamma 已提交
558 559
		}
	}
A
Alex Dima 已提交
560 561 562 563 564
};

if (platform.isLinux) {
	editorConfiguration['properties']['editor.selectionClipboard'] = {
		'type': 'boolean',
A
Alex Dima 已提交
565
		'default': EDITOR_DEFAULTS.contribInfo.selectionClipboard,
A
Alex Dima 已提交
566 567 568 569
		'description': nls.localize('selectionClipboard', "Controls if the Linux primary clipboard should be supported.")
	};
}

570
configurationRegistry.registerConfiguration(editorConfiguration);