mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Rename additionalResourcesAndViewIds
This commit is contained in:
parent
6dca4c1a1f
commit
0aa4642a59
|
@ -1284,7 +1284,7 @@ export class Repository implements Disposable {
|
|||
.filter(t =>
|
||||
t.resource && t.resource.scheme === 'file' && t.kind === TabKind.Diff &&
|
||||
workingTreeResources.some(r => pathEquals(r, t.resource!.fsPath)) &&
|
||||
t.additionalResourcesAndViewIds.find(r => r.resource!.scheme === 'git')));
|
||||
t.additionalResourcesAndViewTypes.find(r => r.resource!.scheme === 'git')));
|
||||
|
||||
// Close editors
|
||||
diffEditorTabsToClose.forEach(t => t.close());
|
||||
|
|
|
@ -56,14 +56,14 @@ export class MainThreadEditorTabs {
|
|||
resource: editor instanceof SideBySideEditorInput ? EditorResourceAccessor.getCanonicalUri(editor, { supportSideBySide: SideBySideEditor.PRIMARY }) : EditorResourceAccessor.getCanonicalUri(editor),
|
||||
editorId,
|
||||
kind: tabKind,
|
||||
additionalResourcesAndViewIds: [],
|
||||
additionalResourcesAndViewTypes: [],
|
||||
isPinned: group.isSticky(editorIndex),
|
||||
isActive: group.isActive(editor),
|
||||
isDirty: editor.isDirty()
|
||||
};
|
||||
tab.additionalResourcesAndViewIds.push({ resource: tab.resource, viewId: tab.editorId });
|
||||
tab.additionalResourcesAndViewTypes.push({ resource: tab.resource, viewId: tab.editorId });
|
||||
if (editor instanceof SideBySideEditorInput) {
|
||||
tab.additionalResourcesAndViewIds.push({ resource: EditorResourceAccessor.getCanonicalUri(editor, { supportSideBySide: SideBySideEditor.SECONDARY }), viewId: editor.primary.editorId ?? editor.editorId });
|
||||
tab.additionalResourcesAndViewTypes.push({ resource: EditorResourceAccessor.getCanonicalUri(editor, { supportSideBySide: SideBySideEditor.SECONDARY }), viewId: editor.primary.editorId ?? editor.editorId });
|
||||
}
|
||||
return tab;
|
||||
}
|
||||
|
@ -76,14 +76,14 @@ export class MainThreadEditorTabs {
|
|||
return {
|
||||
options: { override: tab.editorId },
|
||||
primary: { resource: URI.revive(tab.resource), options: { override: tab.editorId } },
|
||||
secondary: { resource: URI.revive(tab.additionalResourcesAndViewIds[1].resource), options: { override: tab.additionalResourcesAndViewIds[1].viewId } }
|
||||
secondary: { resource: URI.revive(tab.additionalResourcesAndViewTypes[1].resource), options: { override: tab.additionalResourcesAndViewTypes[1].viewId } }
|
||||
};
|
||||
} else {
|
||||
// Diff case
|
||||
return {
|
||||
options: { override: tab.editorId },
|
||||
modified: { resource: URI.revive(tab.resource), options: { override: tab.editorId } },
|
||||
original: { resource: URI.revive(tab.additionalResourcesAndViewIds[1].resource), options: { override: tab.additionalResourcesAndViewIds[1]?.viewId } }
|
||||
original: { resource: URI.revive(tab.additionalResourcesAndViewTypes[1].resource), options: { override: tab.additionalResourcesAndViewTypes[1]?.viewId } }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -641,7 +641,7 @@ export interface IEditorTabDto {
|
|||
isPinned: boolean;
|
||||
isDirty: boolean;
|
||||
kind: TabKind;
|
||||
additionalResourcesAndViewIds: { resource?: UriComponents; viewId?: string }[];
|
||||
additionalResourcesAndViewTypes: { resource?: UriComponents; viewId?: string }[];
|
||||
}
|
||||
|
||||
export interface IExtHostEditorTabsShape {
|
||||
|
|
|
@ -20,7 +20,7 @@ export interface IEditorTab {
|
|||
isPinned: boolean;
|
||||
kind: TabKind;
|
||||
isDirty: boolean;
|
||||
additionalResourcesAndViewIds: { resource: vscode.Uri | undefined; viewType: string | undefined }[];
|
||||
additionalResourcesAndViewTypes: { resource: vscode.Uri | undefined; viewType: string | undefined }[];
|
||||
move(index: number, viewColumn: ViewColumn): Promise<void>;
|
||||
close(): Promise<void>;
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ export class ExtHostEditorTabs implements IExtHostEditorTabs {
|
|||
label: tabDto.label,
|
||||
viewColumn: typeConverters.ViewColumn.to(tabDto.viewColumn),
|
||||
resource: URI.revive(tabDto.resource),
|
||||
additionalResourcesAndViewIds: tabDto.additionalResourcesAndViewIds.map(({ resource, viewId }) => ({ resource: URI.revive(resource), viewType: viewId })),
|
||||
additionalResourcesAndViewTypes: tabDto.additionalResourcesAndViewTypes.map(({ resource, viewId }) => ({ resource: URI.revive(resource), viewType: viewId })),
|
||||
viewType: tabDto.editorId,
|
||||
isActive: tabDto.isActive,
|
||||
kind: tabDto.kind,
|
||||
|
|
|
@ -39,7 +39,7 @@ suite('ExtHostEditorTabs', function () {
|
|||
isPinned: true,
|
||||
label: 'label1',
|
||||
viewColumn: 0,
|
||||
additionalResourcesAndViewIds: [],
|
||||
additionalResourcesAndViewTypes: [],
|
||||
kind: TabKind.Other
|
||||
};
|
||||
|
||||
|
@ -132,7 +132,7 @@ suite('ExtHostEditorTabs', function () {
|
|||
resource: URI.parse('file://abc/def.txt'),
|
||||
editorId: 'default',
|
||||
viewColumn: 0,
|
||||
additionalResourcesAndViewIds: [],
|
||||
additionalResourcesAndViewTypes: [],
|
||||
kind: TabKind.Singular
|
||||
};
|
||||
|
||||
|
|
2
src/vscode-dts/vscode.proposed.tabs.d.ts
vendored
2
src/vscode-dts/vscode.proposed.tabs.d.ts
vendored
|
@ -46,7 +46,7 @@ declare module 'vscode' {
|
|||
* {@link Tab.resource resource} and {@link Tab.viewType viewType} will
|
||||
* always be at index 0.
|
||||
*/
|
||||
readonly additionalResourcesAndViewIds: readonly {
|
||||
readonly additionalResourcesAndViewTypes: readonly {
|
||||
readonly resource: Uri | undefined;
|
||||
readonly viewType: string | undefined;
|
||||
}[];
|
||||
|
|
Loading…
Reference in a new issue