Remove public facing usages of indentSize (#10339)

This commit is contained in:
Alex Dima
2019-02-27 17:24:18 +01:00
parent 60ebcd164b
commit e2049cdca3
4 changed files with 28 additions and 37 deletions
@@ -289,20 +289,20 @@ const editorConfiguration: IConfigurationNode = {
'minimum': 1,
'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.")
},
'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.")
},
// '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.")
// },
'editor.insertSpaces': {
'type': 'boolean',
'default': EDITOR_MODEL_DEFAULTS.insertSpaces,
+1 -1
View File
@@ -362,7 +362,7 @@ export class TextModelResolvedOptions {
trimAutoWhitespace: boolean;
}) {
this.tabSize = src.tabSize | 0;
this.indentSize = src.indentSize | 0;
this.indentSize = src.tabSize | 0;
this.insertSpaces = Boolean(src.insertSpaces);
this.defaultEOL = src.defaultEOL | 0;
this.trimAutoWhitespace = Boolean(src.trimAutoWhitespace);
+1 -10
View File
@@ -641,22 +641,13 @@ declare module 'vscode' {
/**
* The size in spaces a tab takes. This is used for two purposes:
* - the rendering width of a tab character;
* - the number of spaces to insert when [insertSpaces](#TextEditorOptions.insertSpaces) is true
* and `indentSize` is set to `"tab"`.
* - the number of spaces to insert when [insertSpaces](#TextEditorOptions.insertSpaces) is true.
*
* When getting a text editor's options, this property will always be a number (resolved).
* When setting a text editor's options, this property is optional and it can be a number or `"auto"`.
*/
tabSize?: number | string;
/**
* The number of spaces to insert when [insertSpaces](#TextEditorOptions.insertSpaces) is true.
*
* When getting a text editor's options, this property will always be a number (resolved).
* When setting a text editor's options, this property is optional and it can be a number or `"tabSize"`.
*/
indentSize?: number | string;
/**
* When pressing Tab insert [n](#TextEditorOptions.tabSize) spaces.
* When getting a text editor's options, this property will always be a boolean (resolved).
+12 -12
View File
@@ -316,18 +316,18 @@ export class ExtHostTextEditorOptions implements vscode.TextEditorOptions {
}
}
if (typeof newOptions.indentSize !== 'undefined') {
let indentSize = this._validateIndentSize(newOptions.indentSize);
if (indentSize === 'tabSize') {
hasUpdate = true;
bulkConfigurationUpdate.indentSize = indentSize;
} else if (typeof indentSize === 'number' && this._indentSize !== indentSize) {
// reflect the new indentSize value immediately
this._indentSize = indentSize;
hasUpdate = true;
bulkConfigurationUpdate.indentSize = indentSize;
}
}
// if (typeof newOptions.indentSize !== 'undefined') {
// let indentSize = this._validateIndentSize(newOptions.indentSize);
// if (indentSize === 'tabSize') {
// hasUpdate = true;
// bulkConfigurationUpdate.indentSize = indentSize;
// } else if (typeof indentSize === 'number' && this._indentSize !== indentSize) {
// // reflect the new indentSize value immediately
// this._indentSize = indentSize;
// hasUpdate = true;
// bulkConfigurationUpdate.indentSize = indentSize;
// }
// }
if (typeof newOptions.insertSpaces !== 'undefined') {
let insertSpaces = this._validateInsertSpaces(newOptions.insertSpaces);