diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index 06cea89735c..7543fbae74c 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -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 { diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 206518c36a6..266358031ab 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -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); }); } diff --git a/src/vs/workbench/services/history/browser/history.ts b/src/vs/workbench/services/history/browser/history.ts index 8d8017680a0..618d7ebee05 100644 --- a/src/vs/workbench/services/history/browser/history.ts +++ b/src/vs/workbench/services/history/browser/history.ts @@ -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.