mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 03:29:00 +01:00
Tie in tab input, remove cleanup .d.ts
This commit is contained in:
@@ -13,7 +13,7 @@ import { OverviewRulerLane } from 'vs/editor/common/model';
|
||||
import * as languageConfiguration from 'vs/editor/common/languages/languageConfiguration';
|
||||
import { score } from 'vs/editor/common/languageSelector';
|
||||
import * as files from 'vs/platform/files/common/files';
|
||||
import { ExtHostContext, MainContext, CandidatePortSource, ExtHostLogLevelServiceShape, TabKind } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import { ExtHostContext, MainContext, CandidatePortSource, ExtHostLogLevelServiceShape } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import { UIKind } from 'vs/workbench/services/extensions/common/extensionHostProtocol';
|
||||
import { ExtHostApiCommands } from 'vs/workbench/api/common/extHostApiCommands';
|
||||
import { ExtHostClipboard } from 'vs/workbench/api/common/extHostClipboard';
|
||||
@@ -1261,7 +1261,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
|
||||
SymbolInformation: extHostTypes.SymbolInformation,
|
||||
SymbolKind: extHostTypes.SymbolKind,
|
||||
SymbolTag: extHostTypes.SymbolTag,
|
||||
TabKind: TabKind,
|
||||
Task: extHostTypes.Task,
|
||||
TaskGroup: extHostTypes.TaskGroup,
|
||||
TaskPanelKind: extHostTypes.TaskPanelKind,
|
||||
|
||||
@@ -670,24 +670,15 @@ export interface IEditorTabGroupDto {
|
||||
groupId: number;
|
||||
}
|
||||
|
||||
export enum TabKind {
|
||||
Singular = 0,
|
||||
Diff = 1,
|
||||
SidebySide = 2
|
||||
}
|
||||
|
||||
export interface IEditorTabDto {
|
||||
id: string;
|
||||
viewColumn: EditorGroupColumn;
|
||||
label: string;
|
||||
input: AnyInputDto;
|
||||
resource?: UriComponents;
|
||||
editorId?: string;
|
||||
isActive: boolean;
|
||||
isPinned: boolean;
|
||||
isDirty: boolean;
|
||||
kind: TabKind;
|
||||
additionalResourcesAndViewTypes: { resource?: UriComponents; viewId?: string }[];
|
||||
}
|
||||
|
||||
export interface IExtHostEditorTabsShape {
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
MainContext, MainThreadDebugServiceShape, ExtHostDebugServiceShape, DebugSessionUUID,
|
||||
IBreakpointsDeltaDto, ISourceMultiBreakpointDto, IFunctionBreakpointDto, IDebugSessionDto
|
||||
} from 'vs/workbench/api/common/extHost.protocol';
|
||||
import { Disposable, Position, Location, SourceBreakpoint, FunctionBreakpoint, DebugAdapterServer, DebugAdapterExecutable, DataBreakpoint, DebugConsoleMode, DebugAdapterInlineImplementation, DebugAdapterNamedPipeServer } from 'vs/workbench/api/common/extHostTypes';
|
||||
import { Disposable, Position, Location, SourceBreakpoint, FunctionBreakpoint, DebugAdapterServer, DebugAdapterExecutable, DataBreakpoint, DebugConsoleMode, DebugAdapterInlineImplementation, DebugAdapterNamedPipeServer, TextDiffTabInput, NotebookEditorDiffTabInput, TextTabInput } from 'vs/workbench/api/common/extHostTypes';
|
||||
import { AbstractDebugAdapter } from 'vs/workbench/contrib/debug/common/abstractDebugAdapter';
|
||||
import { IExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace';
|
||||
import { IExtHostExtensionService } from 'vs/workbench/api/common/extHostExtensionService';
|
||||
@@ -956,11 +956,10 @@ export class ExtHostVariableResolverService extends AbstractVariableResolverServ
|
||||
const activeTab = editorTabs.tabGroups.groups.find(group => group.isActive)?.activeTab;
|
||||
if (activeTab !== undefined) {
|
||||
// Resolve a resource from the tab
|
||||
const asSideBySideResource = activeTab.resource as { primary?: URI; secondary?: URI } | undefined;
|
||||
if (asSideBySideResource && (asSideBySideResource.primary || asSideBySideResource.secondary)) {
|
||||
return asSideBySideResource.primary ?? asSideBySideResource.secondary;
|
||||
if (activeTab?.input instanceof TextDiffTabInput || activeTab?.input instanceof NotebookEditorDiffTabInput) {
|
||||
return activeTab?.input.modified;
|
||||
} else {
|
||||
return activeTab.resource as URI | undefined;
|
||||
return (activeTab?.input as TextTabInput | undefined)?.uri;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,12 +49,6 @@ class ExtHostEditorTab {
|
||||
get input() {
|
||||
return that._input;
|
||||
},
|
||||
get resource() {
|
||||
return URI.revive(that._dto.resource);
|
||||
},
|
||||
get viewType() {
|
||||
return that._dto.editorId;
|
||||
},
|
||||
get isDirty() {
|
||||
return that._dto.isDirty;
|
||||
},
|
||||
@@ -64,12 +58,6 @@ class ExtHostEditorTab {
|
||||
get viewColumn() {
|
||||
return typeConverters.ViewColumn.to(that._dto.viewColumn);
|
||||
},
|
||||
get kind() {
|
||||
return that._dto.kind;
|
||||
},
|
||||
get additionalResourcesAndViewTypes() {
|
||||
return that._dto.additionalResourcesAndViewTypes.map(({ resource, viewId }) => ({ resource: URI.revive(resource), viewType: viewId }));
|
||||
},
|
||||
move: async (index: number, viewColumn: ViewColumn) => {
|
||||
this._proxy.$moveTab(that._dto.id, index, typeConverters.ViewColumn.from(viewColumn));
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user