@@ -51,12 +51,6 @@ export interface CallHierarchyParams {
51
51
52
52
interface CallHierarchyItemResult {
53
53
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 ;
60
54
}
61
55
62
56
interface CallHierarchyCallsItem {
@@ -137,25 +131,23 @@ export class CallHierarchyProvider implements vscode.CallHierarchyProvider {
137
131
}
138
132
throw e ;
139
133
}
140
- cancellationTokenListener . dispose ( ) ;
141
- requestCanceledListener . dispose ( ) ;
134
+ finally {
135
+ cancellationTokenListener . dispose ( ) ;
136
+ requestCanceledListener . dispose ( ) ;
137
+ }
142
138
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 ) {
150
143
return undefined ;
151
144
}
152
145
153
146
this . isEntryRootNodeTelemetry = true ;
154
147
return this . makeVscodeCallHierarchyItem ( response . item ) ;
155
148
}
156
149
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 > {
159
151
await this . client . ready ;
160
152
workspaceReferences . cancelCurrentReferenceRequest ( CancellationSender . NewRequest ) ;
161
153
@@ -215,8 +207,7 @@ export class CallHierarchyProvider implements vscode.CallHierarchyProvider {
215
207
return result ;
216
208
}
217
209
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 > {
220
211
const CallHierarchyCallsFromEvent : string = "CallHierarchyCallsFrom" ;
221
212
if ( item === undefined ) {
222
213
this . logTelemetry ( CallHierarchyCallsFromEvent , CallHierarchyRequestStatus . Failed ) ;
0 commit comments