123
124
private static _readModelOptions(config: IRawConfig, isForSimpleWidget: boolean): ITextModelCreationOptions {
126
>
if (config.editor && typeof config.editor.tabSize !== 'undefined') {
127
tabSize = clampedInt(config.editor.tabSize, EDITOR_MODEL_DEFAULTS.tabSize, 1, 100);
128
}
130
>
let indentSize: number | 'tabSize' = 'tabSize';
131
>
if (config.editor && typeof config.editor.indentSize !== 'undefined' && config.editor.indentSize !== 'tabSize') {
132
indentSize = clampedInt(config.editor.indentSize, 'tabSize', 1, 100);
133
}
135
>
let insertSpaces = EDITOR_MODEL_DEFAULTS.insertSpaces;
136
>
if (config.editor && typeof config.editor.insertSpaces !== 'undefined') {
137
insertSpaces = (config.editor.insertSpaces === 'false' ? false : Boolean(config.editor.insertSpaces));
138
}
140
>
let newDefaultEOL = DEFAULT_EOL;
141
>
const eol = config.eol;
142
>
if (eol === '\r\n') {
143
newDefaultEOL = DefaultEndOfLine.CRLF;
145
>
newDefaultEOL = DefaultEndOfLine.LF;
146
>
}
147
>
148
>
let trimAutoWhitespace = EDITOR_MODEL_DEFAULTS.trimAutoWhitespace;
149
>
if (config.editor && typeof config.editor.trimAutoWhitespace !== 'undefined') {
150
trimAutoWhitespace = (config.editor.trimAutoWhitespace === 'false' ? false : Boolean(config.editor.trimAutoWhitespace));
151
}
153
>
let detectIndentation = EDITOR_MODEL_DEFAULTS.detectIndentation;
154
>
if (config.editor && typeof config.editor.detectIndentation !== 'undefined') {
155
detectIndentation = (config.editor.detectIndentation === 'false' ? false : Boolean(config.editor.detectIndentation));
156
}
158
>
let largeFileOptimizations = EDITOR_MODEL_DEFAULTS.largeFileOptimizations;
159
>
if (config.editor && typeof config.editor.largeFileOptimizations !== 'undefined') {
160
largeFileOptimizations = (config.editor.largeFileOptimizations === 'false' ? false : Boolean(config.editor.largeFileOptimizations));
161
}
162
>
let bracketPairColorizationOptions = EDITOR_MODEL_DEFAULTS.bracketPairColorizationOptions;
modelService.ts
163
>
if (config.editor?.bracketPairColorization && typeof config.editor.bracketPairColorization === 'object') {
164
const bpConfig = config.editor.bracketPairColorization as { enabled?: unknown; independentColorPoolPerBracketType?: unknown };
165
bracketPairColorizationOptions = {