Further clarification in TextEditorOptions #2797

This commit is contained in:
Alex Dima
2016-02-19 17:34:53 +01:00
parent 9dea2c3c3b
commit 2a15ad9dfb
4 changed files with 16 additions and 12 deletions

View File

@@ -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');
}

View File

@@ -37,8 +37,8 @@ export class Disposable {
}
export interface EditorOptions {
tabSize: number;
insertSpaces: boolean;
tabSize: number | string;
insertSpaces: boolean | string;
}
export class Position {

View File

@@ -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) {