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

7
import * as nls from 'vs/nls';
A
Alex Dima 已提交
8
import {IEditorOptions} from 'vs/editor/common/editorCommon';
9
import * as platform from 'vs/base/common/platform';
10
import {USUAL_WORD_SEPARATORS} from 'vs/editor/common/model/wordHelper';
E
Erich Gamma 已提交
11 12

export interface IConfiguration {
A
Alex Dima 已提交
13
	editor:IEditorOptions;
E
Erich Gamma 已提交
14 15
}

16 17
export const DEFAULT_INDENTATION = {
	tabSize: 4,
18
	insertSpaces: true,
19 20
	detectIndentation: true
};
21
export const DEFAULT_TRIM_AUTO_WHITESPACE = true;
A
Alex Dima 已提交
22

23 24 25 26
const DEFAULT_WINDOWS_FONT_FAMILY = 'Consolas, \'Courier New\', monospace';
const DEFAULT_MAC_FONT_FAMILY = 'Menlo, Monaco, \'Courier New\', monospace';
const DEFAULT_LINUX_FONT_FAMILY = '\'Droid Sans Mono\', \'Courier New\', monospace, \'Droid Sans Fallback\'';

27 28 29 30 31
/**
 * Determined from empirical observations.
 */
export const GOLDEN_LINE_HEIGHT_RATIO = platform.isMacintosh ? 1.5 : 1.35;

E
Erich Gamma 已提交
32 33
class ConfigClass implements IConfiguration {

A
Alex Dima 已提交
34
	public editor: IEditorOptions;
E
Erich Gamma 已提交
35 36 37

	constructor() {
		this.editor = {
38
			experimentalScreenReader: true,
B
Benjamin Pasero 已提交
39
			rulers: [],
A
Alex Dima 已提交
40
			wordSeparators: USUAL_WORD_SEPARATORS,
41
			selectionClipboard: true,
42
			ariaLabel: nls.localize('editorViewAccessibleLabel', "Editor content"),
E
Erich Gamma 已提交
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
			lineNumbers: true,
			selectOnLineNumbers: true,
			lineNumbersMinChars: 5,
			glyphMargin: false,
			lineDecorationsWidth: 10,
			revealHorizontalRightPadding: 30,
			roundedSelection: true,
			theme: 'vs',
			readOnly: false,
			scrollbar: {
				verticalScrollbarSize: 14,
				horizontal: 'auto',
				useShadows: true,
				verticalHasArrows: false,
				horizontalHasArrows: false
			},
			overviewRulerLanes: 2,
60
			cursorBlinking: 'blink',
61
			mouseWheelZoom: false,
M
markrendle 已提交
62
			cursorStyle: 'line',
63
			fontLigatures: false,
64
			disableTranslate3d: false,
E
Erich Gamma 已提交
65 66 67 68 69
			hideCursorInOverviewRuler: false,
			scrollBeyondLastLine: true,
			automaticLayout: false,
			wrappingColumn: 300,
			wrappingIndent: 'same',
70 71
			wordWrapBreakBeforeCharacters: '([{‘“〈《「『【〔([{「£¥$£¥++',
			wordWrapBreakAfterCharacters: ' \t})]?|&,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー’”〉》」』】〕)]}」',
E
Erich Gamma 已提交
72 73 74 75 76 77 78 79
			wordWrapBreakObtrusiveCharacters: '.',

			// Features
			hover: true,
			contextmenu: true,
			mouseWheelScrollSensitivity: 1,
			quickSuggestions: true,
			quickSuggestionsDelay: 10,
J
Joao Moreno 已提交
80
			parameterHints: true,
E
Erich Gamma 已提交
81 82 83 84
			iconsInSuggestions: true,
			autoClosingBrackets: true,
			formatOnType: false,
			suggestOnTriggerCharacters: true,
85
			acceptSuggestionOnEnter: true,
86
			snippetSuggestions: 'bottom',
87
			tabCompletion: false,
88
			wordBasedSuggestions: true,
E
Erich Gamma 已提交
89
			selectionHighlight: true,
90
			codeLens: true,
E
Erich Gamma 已提交
91
			referenceInfos: true,
92
			folding: true,
93
			renderWhitespace: 'none',
94
			renderControlCharacters: false,
95
			renderIndentGuides: false,
96
			renderLineHighlight: true,
97
			useTabStops: true,
E
Erich Gamma 已提交
98

99 100 101
			fontFamily: (
				platform.isMacintosh ? DEFAULT_MAC_FONT_FAMILY : (platform.isLinux ? DEFAULT_LINUX_FONT_FAMILY : DEFAULT_WINDOWS_FONT_FAMILY)
			),
102
			fontWeight: 'normal',
103 104 105
			fontSize: (
				platform.isMacintosh ? 12 : 14
			),
E
Erich Gamma 已提交
106 107 108 109 110
			lineHeight: 0
		};
	}
}

111
export const DefaultConfig: IConfiguration = new ConfigClass();