diff --git a/src/features/ExtensionCommands.ts b/src/features/ExtensionCommands.ts index ebd38fa9f3..f2e1b81766 100644 --- a/src/features/ExtensionCommands.ts +++ b/src/features/ExtensionCommands.ts @@ -115,9 +115,14 @@ export interface ISetSelectionRequestArguments { } export const OpenFileRequestType = - new RequestType( + new RequestType( "editor/openFile"); +export interface IOpenFileDetails { + filePath: string; + preview: boolean; +} + export const NewFileRequestType = new RequestType( "editor/newFile"); @@ -347,13 +352,15 @@ export class ExtensionCommandsFeature implements IFeature { .then((_) => EditorOperationResponse.Completed); } - private openFile(filePath: string): Thenable { + private openFile(openFileDetails: IOpenFileDetails): Thenable { - filePath = this.normalizeFilePath(filePath); + const filePath = this.normalizeFilePath(openFileDetails.filePath); const promise = vscode.workspace.openTextDocument(filePath) - .then((doc) => vscode.window.showTextDocument(doc)) + .then((doc) => vscode.window.showTextDocument( + doc, + { preview: openFileDetails.preview })) .then((_) => EditorOperationResponse.Completed); return promise;