提交 2a15ad9d 编写于 作者: A Alex Dima

Further clarification in TextEditorOptions #2797

上级 9dea2c3c
......@@ -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;
......
......@@ -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<any> {
_trySetOptions(id: string, options: ITextEditorConfigurationUpdate): TPromise<any> {
if (!this._textEditorsMap[id]) {
return TPromise.wrapError('TextEditor disposed');
}
......
......@@ -37,8 +37,8 @@ export class Disposable {
}
export interface EditorOptions {
tabSize: number;
insertSpaces: boolean;
tabSize: number | string;
insertSpaces: boolean | string;
}
export class Position {
......
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册