mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 11:38:51 +01:00
Remove diff resource
This commit is contained in:
@@ -642,7 +642,7 @@ export interface MainThreadEditorTabsShape extends IDisposable {
|
||||
export interface IEditorTabDto {
|
||||
viewColumn: EditorGroupColumn;
|
||||
label: string;
|
||||
resource?: UriComponents | { primary?: UriComponents, secondary?: UriComponents };
|
||||
resource?: UriComponents;
|
||||
editorId?: string;
|
||||
isActive: boolean;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import type * as vscode from 'vscode';
|
||||
import * as typeConverters from 'vs/workbench/api/common/extHostTypeConverters';
|
||||
import { IEditorTabDto, IExtHostEditorTabsShape } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import { URI, UriComponents } from 'vs/base/common/uri';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ViewColumn } from 'vs/workbench/api/common/extHostTypes';
|
||||
@@ -14,7 +14,7 @@ import { ViewColumn } from 'vs/workbench/api/common/extHostTypes';
|
||||
export interface IEditorTab {
|
||||
label: string;
|
||||
viewColumn: ViewColumn;
|
||||
resource?: vscode.Uri | { primary?: vscode.Uri, secondary?: vscode.Uri };
|
||||
resource?: vscode.Uri;
|
||||
editorId?: string;
|
||||
isActive: boolean;
|
||||
}
|
||||
@@ -55,23 +55,10 @@ export class ExtHostEditorTabs implements IExtHostEditorTabs {
|
||||
if (dto.isActive) {
|
||||
activeIndex = index;
|
||||
}
|
||||
// Resolve resource into the right shape for either normal or side by side
|
||||
let resource = undefined;
|
||||
if (dto.resource) {
|
||||
const resourceAsSidebySide = dto.resource as ({ primary?: UriComponents, secondary?: UriComponents });
|
||||
if (resourceAsSidebySide.primary || resourceAsSidebySide.secondary) {
|
||||
resource = {
|
||||
primary: URI.revive(resourceAsSidebySide.primary),
|
||||
secondary: URI.revive(resourceAsSidebySide.secondary)
|
||||
};
|
||||
} else {
|
||||
resource = URI.revive(dto.resource as UriComponents | undefined);
|
||||
}
|
||||
}
|
||||
return Object.freeze({
|
||||
label: dto.label,
|
||||
viewColumn: typeConverters.ViewColumn.to(dto.viewColumn),
|
||||
resource,
|
||||
resource: URI.revive(dto.resource),
|
||||
editorId: dto.editorId,
|
||||
isActive: dto.isActive
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user