提交 9b18dc50 编写于 作者: B Benjamin Pasero

adopt ITextEditorOptions

上级 273159c1
......@@ -494,6 +494,7 @@ export class TextEditorOptions extends EditorOptions {
protected startColumn: number;
protected endLineNumber: number;
protected endColumn: number;
private editorViewState: IEditorViewState;
public static from(input: IResourceInput): TextEditorOptions {
......
......@@ -826,15 +826,7 @@ export class DebugService implements debug.IDebugService {
// Display the error from debug adapter using a temporary editor #8836
return this.getDebugStringEditorInput(source, err.message, MIME_TEXT);
}).then(editorInput => {
return this.editorService.openEditor(editorInput, wbeditorcommon.TextEditorOptions.create({
selection: {
startLineNumber: lineNumber,
startColumn: 1,
endLineNumber: lineNumber,
endColumn: 1
},
preserveFocus: preserveFocus
}), sideBySide);
return this.editorService.openEditor(editorInput, { preserveFocus, selection: { startLineNumber: lineNumber, startColumn: 1, endLineNumber: lineNumber, endColumn: 1 } }, sideBySide);
});
}
......
......@@ -10,12 +10,12 @@ import platform = require('vs/base/common/platform');
import nls = require('vs/nls');
import {EventType} from 'vs/base/common/events';
import {IEditor as IBaseEditor} from 'vs/platform/editor/common/editor';
import {TextEditorOptions, EditorInput, IGroupEvent, IEditorRegistry, Extensions} from 'vs/workbench/common/editor';
import {EditorInput, IGroupEvent, IEditorRegistry, Extensions} from 'vs/workbench/common/editor';
import {BaseTextEditor} from 'vs/workbench/browser/parts/editor/textEditor';
import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService';
import {IHistoryService} from 'vs/workbench/services/history/common/history';
import {Selection} from 'vs/editor/common/core/selection';
import {Position, IEditorInput} from 'vs/platform/editor/common/editor';
import {Position, IEditorInput, ITextEditorOptions} from 'vs/platform/editor/common/editor';
import {IEventService} from 'vs/platform/event/common/event';
import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace';
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
......@@ -207,7 +207,7 @@ export abstract class BaseHistoryService {
interface IStackEntry {
input: IEditorInput;
options?: TextEditorOptions;
options?: ITextEditorOptions;
}
export class HistoryService extends BaseHistoryService implements IHistoryService {
......@@ -441,10 +441,12 @@ export class HistoryService extends BaseHistoryService implements IHistoryServic
if (!this.currentFileEditorState || this.currentFileEditorState.justifiesNewPushState(stateCandidate)) {
this.currentFileEditorState = stateCandidate;
let options: TextEditorOptions;
let options: ITextEditorOptions;
if (storeSelection) {
options = new TextEditorOptions();
options.selection(editor.getSelection().startLineNumber, editor.getSelection().startColumn);
const selection = editor.getSelection();
options = {
selection: { startLineNumber: selection.startLineNumber, startColumn: selection.startColumn }
};
}
this.addToStack(editor.input, options);
......@@ -460,7 +462,7 @@ export class HistoryService extends BaseHistoryService implements IHistoryServic
this.addToStack(editor.input);
}
private addToStack(input: IEditorInput, options?: TextEditorOptions): void {
private addToStack(input: IEditorInput, options?: ITextEditorOptions): void {
// Overwrite an entry in the stack if we have a matching input that comes
// with editor options to indicate that this entry is more specific.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册