提交 fc6067f5 编写于 作者: B Benjamin Pasero

more complete fix for #57483

上级 281f32a4
......@@ -42,6 +42,12 @@ export interface IBaseResourceInput {
* Description to show for the diff editor
*/
description?: string;
/**
* Hint to indicate that this input should be treated as a file
* that opens in an editor capable of showing file content.
*/
isFile?: boolean;
}
export interface IResourceInput extends IBaseResourceInput {
......@@ -55,12 +61,6 @@ export interface IResourceInput extends IBaseResourceInput {
* The encoding of the text input if known.
*/
encoding?: string;
/**
* Hint to indicate that this input should be treated as a file
* that opens in an editor capable of showing file content.
*/
isFile?: boolean;
}
export interface IEditorOptions {
......
......@@ -793,7 +793,8 @@ export class Workbench extends Disposable implements IPartService {
return TPromise.as([<IResourceDiffInput>{
leftResource: filesToDiff[0].resource,
rightResource: filesToDiff[1].resource,
options: { pinned: true }
options: { pinned: true },
isFile: true
}]);
}
......
......@@ -470,8 +470,8 @@ export class EditorService extends Disposable implements EditorServiceImpl {
// Side by Side Support
const resourceSideBySideInput = <IResourceSideBySideInput>input;
if (resourceSideBySideInput.masterResource && resourceSideBySideInput.detailResource) {
const masterInput = this.createInput({ resource: resourceSideBySideInput.masterResource });
const detailInput = this.createInput({ resource: resourceSideBySideInput.detailResource });
const masterInput = this.createInput({ resource: resourceSideBySideInput.masterResource, isFile: resourceSideBySideInput.isFile });
const detailInput = this.createInput({ resource: resourceSideBySideInput.detailResource, isFile: resourceSideBySideInput.isFile });
return new SideBySideEditorInput(
resourceSideBySideInput.label || masterInput.getName(),
......@@ -484,8 +484,8 @@ export class EditorService extends Disposable implements EditorServiceImpl {
// Diff Editor Support
const resourceDiffInput = <IResourceDiffInput>input;
if (resourceDiffInput.leftResource && resourceDiffInput.rightResource) {
const leftInput = this.createInput({ resource: resourceDiffInput.leftResource });
const rightInput = this.createInput({ resource: resourceDiffInput.rightResource });
const leftInput = this.createInput({ resource: resourceDiffInput.leftResource, isFile: resourceDiffInput.isFile });
const rightInput = this.createInput({ resource: resourceDiffInput.rightResource, isFile: resourceDiffInput.isFile });
const label = resourceDiffInput.label || localize('compareLabels', "{0} ↔ {1}", this.toDiffLabel(leftInput), this.toDiffLabel(rightInput));
return new DiffEditorInput(label, resourceDiffInput.description, leftInput, rightInput);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册