mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 02:58:56 +01:00
call hierarchy shows root node, also update API proposal for this, #81753
This commit is contained in:
@@ -496,8 +496,20 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
|
||||
|
||||
$registerCallHierarchyProvider(handle: number, selector: IDocumentFilterDto[]): void {
|
||||
this._registrations.set(handle, callh.CallHierarchyProviderRegistry.register(selector, {
|
||||
provideOutgoingCalls: async (model, position, token) => {
|
||||
const outgoing = await this._proxy.$provideCallHierarchyOutgoingCalls(handle, model.uri, position, token);
|
||||
|
||||
prepareCallHierarchy: async (document, position, token) => {
|
||||
const result = await this._proxy.$prepareCallHierarchy(handle, document.uri, position, token);
|
||||
if (!result) {
|
||||
return undefined;
|
||||
}
|
||||
return {
|
||||
dispose: () => this._proxy.$releaseCallHierarchy(handle, result.sessionId),
|
||||
root: MainThreadLanguageFeatures._reviveCallHierarchyItemDto(result.root)
|
||||
};
|
||||
},
|
||||
|
||||
provideOutgoingCalls: async (item, token) => {
|
||||
const outgoing = await this._proxy.$provideCallHierarchyOutgoingCalls(handle, item.id, token);
|
||||
if (!outgoing) {
|
||||
return outgoing;
|
||||
}
|
||||
@@ -508,8 +520,8 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
|
||||
};
|
||||
});
|
||||
},
|
||||
provideIncomingCalls: async (model, position, token) => {
|
||||
const incoming = await this._proxy.$provideCallHierarchyIncomingCalls(handle, model.uri, position, token);
|
||||
provideIncomingCalls: async (item, token) => {
|
||||
const incoming = await this._proxy.$provideCallHierarchyIncomingCalls(handle, item.id, token);
|
||||
if (!incoming) {
|
||||
return incoming;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user