diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 7e70fbc1c53..f3f63579962 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -29,13 +29,13 @@ declare module 'vscode' { constructor(kind: SymbolKind, name: string, detail: string, uri: Uri, range: Range, selectionRange: Range); } - export class CallsTo { + export class CallHierarchyIncomingCall { source: CallHierarchyItem; sourceRanges: Range[]; constructor(item: CallHierarchyItem, sourceRanges: Range[]); } - export class CallsFrom { + export class CallHierarchyOutgoingCall { sourceRanges: Range[]; target: CallHierarchyItem; constructor(item: CallHierarchyItem, sourceRanges: Range[]); @@ -43,15 +43,15 @@ declare module 'vscode' { export interface CallHierarchyItemProvider { + provideCallHierarchyIncomingCalls(target: CallHierarchyItem, token: CancellationToken): ProviderResult; + + provideCallHierarchyOutgoingCalls(source: CallHierarchyItem, token: CancellationToken): ProviderResult; + /** * Given a document and position compute a call hierarchy item. This is justed as * anchor for call hierarchy and then `resolveCallHierarchyItem` is being called. */ resolveCallHierarchyItem(document: TextDocument, position: Position, token: CancellationToken): ProviderResult; - - provideCallsTo(target: CallHierarchyItem, token: CancellationToken): ProviderResult; - - provideCallsFrom(source: CallHierarchyItem, token: CancellationToken): ProviderResult; } export namespace languages { diff --git a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts index 26ce381604c..e74e585c3d6 100644 --- a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts +++ b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts @@ -497,24 +497,24 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha resolveCallHierarchyItem: (document, position, token) => { return this._proxy.$resolveCallHierarchyItem(handle, document.uri, position, token).then(MainThreadLanguageFeatures._reviveCallHierarchyItemDto); }, - provideCallsFrom: async (item, token) => { - const callsFrom = await this._proxy.$provideCallHierarchyItemsFrom(handle, item, token); - if (!callsFrom) { - return callsFrom; + provideOutgoingCalls: async (item, token) => { + const outgoing = await this._proxy.$provideCallHierarchyOutgoingCalls(handle, item, token); + if (!outgoing) { + return outgoing; } - return callsFrom.map(([item, sourceRanges]): callh.CallsFrom => { + return outgoing.map(([item, sourceRanges]): callh.OutgoingCall => { return { target: MainThreadLanguageFeatures._reviveCallHierarchyItemDto(item), sourceRanges } }); }, - provideCallsTo: async (item, token) => { - const callsTo = await this._proxy.$provideCallHierarchyItemsTo(handle, item, token); - if (!callsTo) { - return callsTo; + provideIncomingCalls: async (item, token) => { + const incoming = await this._proxy.$provideCallHierarchyIncomingCalls(handle, item, token); + if (!incoming) { + return incoming; } - return callsTo.map(([item, sourceRanges]): callh.CallsTo => { + return incoming.map(([item, sourceRanges]): callh.IncomingCall => { return { source: MainThreadLanguageFeatures._reviveCallHierarchyItemDto(item), sourceRanges diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index 620d4e3c42d..5dde2c62f2b 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -893,8 +893,8 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I ViewColumn: extHostTypes.ViewColumn, WorkspaceEdit: extHostTypes.WorkspaceEdit, // proposed - CallsFrom: extHostTypes.CallsFrom, - CallsTo: extHostTypes.CallsTo, + CallHierarchyOutgoingCall: extHostTypes.CallHierarchyOutgoingCall, + CallHierarchyIncomingCall: extHostTypes.CallHierarchyIncomingCall, CallHierarchyItem: extHostTypes.CallHierarchyItem, Decoration: extHostTypes.Decoration }; diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index 8643aeec336..d02471a71b7 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -1112,8 +1112,8 @@ export interface ExtHostLanguageFeaturesShape { $provideFoldingRanges(handle: number, resource: UriComponents, context: modes.FoldingContext, token: CancellationToken): Promise; $provideSelectionRanges(handle: number, resource: UriComponents, positions: IPosition[], token: CancellationToken): Promise; $resolveCallHierarchyItem(handle: number, resource: UriComponents, position: IPosition, token: CancellationToken): Promise; - $provideCallHierarchyItemsTo(handle: number, target: callHierarchy.CallHierarchyItem, token: CancellationToken): Promise<[ICallHierarchyItemDto, IRange[]][] | undefined>; - $provideCallHierarchyItemsFrom(handle: number, source: callHierarchy.CallHierarchyItem, token: CancellationToken): Promise<[ICallHierarchyItemDto, IRange[]][] | undefined>; + $provideCallHierarchyIncomingCalls(handle: number, target: callHierarchy.CallHierarchyItem, token: CancellationToken): Promise<[ICallHierarchyItemDto, IRange[]][] | undefined>; + $provideCallHierarchyOutgoingCalls(handle: number, source: callHierarchy.CallHierarchyItem, token: CancellationToken): Promise<[ICallHierarchyItemDto, IRange[]][] | undefined>; } export interface ExtHostQuickOpenShape { diff --git a/src/vs/workbench/api/common/extHostLanguageFeatures.ts b/src/vs/workbench/api/common/extHostLanguageFeatures.ts index 1d166cad13c..6b17efba31f 100644 --- a/src/vs/workbench/api/common/extHostLanguageFeatures.ts +++ b/src/vs/workbench/api/common/extHostLanguageFeatures.ts @@ -1036,7 +1036,7 @@ class CallHierarchyAdapter { if (!item) { return undefined; } - const calls = await this._provider.provideCallsTo(item, token); + const calls = await this._provider.provideCallHierarchyIncomingCalls(item, token); if (!calls) { return undefined; } @@ -1048,7 +1048,7 @@ class CallHierarchyAdapter { if (!item) { return undefined; } - const calls = await this._provider.provideCallsFrom(item, token); + const calls = await this._provider.provideCallHierarchyOutgoingCalls(item, token); if (!calls) { return undefined; } @@ -1506,11 +1506,11 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape { return this._withAdapter(handle, CallHierarchyAdapter, adapter => adapter.resolveCallHierarchyItem(URI.revive(resource), position, token), undefined); } - $provideCallHierarchyItemsTo(handle: number, target: callHierarchy.CallHierarchyItem, token: CancellationToken): Promise<[ICallHierarchyItemDto, IRange[]][] | undefined> { + $provideCallHierarchyIncomingCalls(handle: number, target: callHierarchy.CallHierarchyItem, token: CancellationToken): Promise<[ICallHierarchyItemDto, IRange[]][] | undefined> { return this._withAdapter(handle, CallHierarchyAdapter, adapter => adapter.provideCallsTo(target, token), undefined); } - $provideCallHierarchyItemsFrom(handle: number, source: callHierarchy.CallHierarchyItem, token: CancellationToken): Promise<[ICallHierarchyItemDto, IRange[]][] | undefined> { + $provideCallHierarchyOutgoingCalls(handle: number, source: callHierarchy.CallHierarchyItem, token: CancellationToken): Promise<[ICallHierarchyItemDto, IRange[]][] | undefined> { return this._withAdapter(handle, CallHierarchyAdapter, adapter => adapter.provideCallsFrom(source, token), undefined); } diff --git a/src/vs/workbench/api/common/extHostTypes.ts b/src/vs/workbench/api/common/extHostTypes.ts index cd935172512..57e377721b8 100644 --- a/src/vs/workbench/api/common/extHostTypes.ts +++ b/src/vs/workbench/api/common/extHostTypes.ts @@ -1164,7 +1164,7 @@ export class CallHierarchyItem { } } -export class CallsTo { +export class CallHierarchyIncomingCall { source: CallHierarchyItem; sourceRanges: Range[]; @@ -1174,7 +1174,7 @@ export class CallsTo { this.source = item; } } -export class CallsFrom { +export class CallHierarchyOutgoingCall { target: CallHierarchyItem; sourceRanges: Range[]; diff --git a/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.ts b/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.ts index 20fdcb654ab..73f7f51f280 100644 --- a/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.ts +++ b/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.ts @@ -49,7 +49,7 @@ export class SingleDirectionDataSource implements IAsyncDataSource { try { - const callsFrom = await this.provider.provideCallsFrom(source.item, CancellationToken.None); + const callsFrom = await this.provider.provideOutgoingCalls(source.item, CancellationToken.None); if (!callsFrom) { return; } @@ -67,7 +67,7 @@ export class SingleDirectionDataSource implements IAsyncDataSource { try { - const callsTo = await this.provider.provideCallsTo(target.item, CancellationToken.None); + const callsTo = await this.provider.provideIncomingCalls(target.item, CancellationToken.None); if (!callsTo) { return; } diff --git a/src/vs/workbench/contrib/callHierarchy/common/callHierarchy.ts b/src/vs/workbench/contrib/callHierarchy/common/callHierarchy.ts index c45d704779b..6e8a9bd9eaf 100644 --- a/src/vs/workbench/contrib/callHierarchy/common/callHierarchy.ts +++ b/src/vs/workbench/contrib/callHierarchy/common/callHierarchy.ts @@ -25,12 +25,12 @@ export interface CallHierarchyItem { selectionRange: IRange; } -export interface CallsTo { +export interface IncomingCall { source: CallHierarchyItem, sourceRanges: IRange[] } -export interface CallsFrom { +export interface OutgoingCall { sourceRanges: IRange[], target: CallHierarchyItem } @@ -39,9 +39,9 @@ export interface CallHierarchyProvider { resolveCallHierarchyItem(document: ITextModel, postion: IPosition, token: CancellationToken): ProviderResult; - provideCallsTo(target: CallHierarchyItem, token: CancellationToken): ProviderResult; + provideIncomingCalls(target: CallHierarchyItem, token: CancellationToken): ProviderResult; - provideCallsFrom(source: CallHierarchyItem, token: CancellationToken): ProviderResult; + provideOutgoingCalls(source: CallHierarchyItem, token: CancellationToken): ProviderResult; } export const CallHierarchyProviderRegistry = new LanguageFeatureRegistry();