@@ -51,12 +51,6 @@ export interface CallHierarchyParams {
5151
5252interface CallHierarchyItemResult {
5353 item ?: CallHierarchyItem ;
54-
55- /**
56- * If a request is cancelled, `succeeded` will be undefined to indicate no result was returned.
57- * Therefore, object is not defined as optional on the language server.
58- */
59- succeeded : boolean ;
6054}
6155
6256interface CallHierarchyCallsItem {
@@ -137,25 +131,23 @@ export class CallHierarchyProvider implements vscode.CallHierarchyProvider {
137131 }
138132 throw e ;
139133 }
140- cancellationTokenListener . dispose ( ) ;
141- requestCanceledListener . dispose ( ) ;
134+ finally {
135+ cancellationTokenListener . dispose ( ) ;
136+ requestCanceledListener . dispose ( ) ;
137+ }
142138
143- if ( cancelSource . token . isCancellationRequested || response . succeeded === undefined ) {
144- // Return undefined instead of vscode.CancellationError to avoid the following error message from VS Code:
145- // "MISSING provider."
146- // TODO: per issue https://github.com/microsoft/vscode/issues/169698 vscode.CancellationError is expected,
147- // so when VS Code fixes the error use vscode.CancellationError again.
148- return undefined ;
149- } else if ( response . item === undefined ) {
139+ if ( cancelSource . token . isCancellationRequested ) {
140+ throw new vscode . CancellationError ( ) ;
141+ }
142+ if ( response . item === undefined ) {
150143 return undefined ;
151144 }
152145
153146 this . isEntryRootNodeTelemetry = true ;
154147 return this . makeVscodeCallHierarchyItem ( response . item ) ;
155148 }
156149
157- public async provideCallHierarchyIncomingCalls ( item : vscode . CallHierarchyItem , token : vscode . CancellationToken ) :
158- Promise < vscode . CallHierarchyIncomingCall [ ] | undefined > {
150+ public async provideCallHierarchyIncomingCalls ( item : vscode . CallHierarchyItem , token : vscode . CancellationToken ) : Promise < vscode . CallHierarchyIncomingCall [ ] | undefined > {
159151 await this . client . ready ;
160152 workspaceReferences . cancelCurrentReferenceRequest ( CancellationSender . NewRequest ) ;
161153
@@ -215,8 +207,7 @@ export class CallHierarchyProvider implements vscode.CallHierarchyProvider {
215207 return result ;
216208 }
217209
218- public async provideCallHierarchyOutgoingCalls ( item : vscode . CallHierarchyItem , token : vscode . CancellationToken ) :
219- Promise < vscode . CallHierarchyOutgoingCall [ ] | undefined > {
210+ public async provideCallHierarchyOutgoingCalls ( item : vscode . CallHierarchyItem , token : vscode . CancellationToken ) : Promise < vscode . CallHierarchyOutgoingCall [ ] | undefined > {
220211 const CallHierarchyCallsFromEvent : string = "CallHierarchyCallsFrom" ;
221212 if ( item === undefined ) {
222213 this . logTelemetry ( CallHierarchyCallsFromEvent , CallHierarchyRequestStatus . Failed ) ;
0 commit comments