diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index e437b85e713bfe6fe596254d0e8f33cb3937dd6e..1fb83005189d9b0d187dfa145ddda63578afe240 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -532,13 +532,17 @@ declare namespace 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. + * 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; + tabSize?: 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). + * When setting a text editor's options, this property is optional and it can be a boolean or `"auto"`. */ - insertSpaces: boolean | string; + insertSpaces?: boolean | string; } /** @@ -3104,7 +3108,7 @@ declare namespace vscode { /** * The folder that is open in VS Code. `undefined` when no folder * has been opened. - * + * * @readonly */ export let rootPath: string; diff --git a/src/vs/workbench/api/node/extHostEditors.ts b/src/vs/workbench/api/node/extHostEditors.ts index a56205bd4f58169337fe7119223b480080345ef3..14c89c8daf49ccc543c3ed61229369d8c80afd80 100644 --- a/src/vs/workbench/api/node/extHostEditors.ts +++ b/src/vs/workbench/api/node/extHostEditors.ts @@ -11,12 +11,12 @@ import {TPromise} from 'vs/base/common/winjs.base'; import {Remotable, IThreadService} from 'vs/platform/thread/common/thread'; import {ExtHostModelService, ExtHostDocumentData} from 'vs/workbench/api/node/extHostDocuments'; import {Selection, Range, Position, EditorOptions} from './extHostTypes'; -import {ISingleEditOperation, ISelection, IRange, IInternalIndentationOptions, IEditor, EditorType, ICommonCodeEditor, ICommonDiffEditor, IDecorationRenderOptions, IRangeWithMessage} from 'vs/editor/common/editorCommon'; +import {ISingleEditOperation, ISelection, IRange, IEditor, EditorType, ICommonCodeEditor, ICommonDiffEditor, IDecorationRenderOptions, IRangeWithMessage} from 'vs/editor/common/editorCommon'; import {ICodeEditorService} from 'vs/editor/common/services/codeEditorService'; import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService'; import {Position as EditorPosition} from 'vs/platform/editor/common/editor'; import {IModelService} from 'vs/editor/common/services/modelService'; -import {MainThreadEditorsTracker, TextEditorRevealType, MainThreadTextEditor, ITextEditorConfiguration} from 'vs/workbench/api/node/mainThreadEditors'; +import {MainThreadEditorsTracker, TextEditorRevealType, MainThreadTextEditor, ITextEditorConfigurationUpdate, ITextEditorConfiguration} from 'vs/workbench/api/node/mainThreadEditors'; import * as TypeConverters from './extHostTypeConverters'; import {TextDocument, TextEditorSelectionChangeEvent, TextEditorOptionsChangeEvent, TextEditorOptions, TextEditorViewColumnChangeEvent, ViewColumn} from 'vscode'; import {EventType} from 'vs/workbench/common/events'; @@ -697,7 +697,7 @@ export class MainThreadEditors { this._textEditorsMap[id].revealRange(range, revealType); } - _trySetOptions(id: string, options: IInternalIndentationOptions): TPromise { + _trySetOptions(id: string, options: ITextEditorConfigurationUpdate): TPromise { if (!this._textEditorsMap[id]) { return TPromise.wrapError('TextEditor disposed'); } diff --git a/src/vs/workbench/api/node/extHostTypes.ts b/src/vs/workbench/api/node/extHostTypes.ts index ab295e73a0c40daea4edbc8f722e10875d9722c0..0905bb768d44b6fd6b1834dfcb26876b4fb2692c 100644 --- a/src/vs/workbench/api/node/extHostTypes.ts +++ b/src/vs/workbench/api/node/extHostTypes.ts @@ -37,8 +37,8 @@ export class Disposable { } export interface EditorOptions { - tabSize: number; - insertSpaces: boolean; + tabSize: number | string; + insertSpaces: boolean | string; } export class Position { diff --git a/src/vs/workbench/api/node/mainThreadEditors.ts b/src/vs/workbench/api/node/mainThreadEditors.ts index eb0e7ed6e0f3a3c89901a30fc88aa7c149f53b82..78babf273949779836dc488bec94a42483f3a0c2 100644 --- a/src/vs/workbench/api/node/mainThreadEditors.ts +++ b/src/vs/workbench/api/node/mainThreadEditors.ts @@ -15,12 +15,12 @@ import {Range} from 'vs/editor/common/core/range'; import {Selection} from 'vs/editor/common/core/selection'; export interface ITextEditorConfigurationUpdate { - tabSize?: number; - insertSpaces?: boolean; + tabSize?: number | string; + insertSpaces?: boolean | string; } export interface ITextEditorConfiguration { - tabSize: number; - insertSpaces: boolean; + tabSize: number | string; + insertSpaces: boolean | string; } function configurationsEqual(a:ITextEditorConfiguration, b:ITextEditorConfiguration) {