use Outgoing/Incoming terminology

This commit is contained in:
jrieken
2019-09-11 13:25:53 +00:00
parent c0802a73d7
commit 8e5edc0eda
8 changed files with 32 additions and 32 deletions

View File

@@ -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

View File

@@ -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
};

View File

@@ -1112,8 +1112,8 @@ export interface ExtHostLanguageFeaturesShape {
$provideFoldingRanges(handle: number, resource: UriComponents, context: modes.FoldingContext, token: CancellationToken): Promise<modes.FoldingRange[] | undefined>;
$provideSelectionRanges(handle: number, resource: UriComponents, positions: IPosition[], token: CancellationToken): Promise<modes.SelectionRange[][]>;
$resolveCallHierarchyItem(handle: number, resource: UriComponents, position: IPosition, token: CancellationToken): Promise<ICallHierarchyItemDto | undefined>;
$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 {

View File

@@ -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);
}

View File

@@ -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[];