@@ -35,7 +35,7 @@ import {
35
35
ImplementationRequest , SelectionRangeRequest , TypeDefinitionRequest , CallHierarchyPrepareRequest , SemanticTokensRegistrationType , LinkedEditingRangeRequest ,
36
36
TypeHierarchyPrepareRequest , InlineValueRequest , InlayHintRequest , WorkspaceSymbolRequest , TextDocumentRegistrationOptions , FileOperationRegistrationOptions ,
37
37
ConnectionOptions , PositionEncodingKind , DocumentDiagnosticRequest , NotebookDocumentSyncRegistrationType , NotebookDocumentSyncRegistrationOptions , ErrorCodes ,
38
- MessageStrategy , DidOpenTextDocumentParams
38
+ MessageStrategy , DidOpenTextDocumentParams , CodeLensResolveRequest , CompletionResolveRequest , CodeActionResolveRequest , InlayHintResolveRequest , DocumentLinkResolveRequest , WorkspaceSymbolResolveRequest
39
39
} from 'vscode-languageserver-protocol' ;
40
40
41
41
import * as c2p from './codeConverter' ;
@@ -1896,6 +1896,15 @@ export abstract class BaseLanguageClient implements FeatureClient<Middleware, La
1896
1896
SemanticTokensRangeRequest . method ,
1897
1897
SemanticTokensDeltaRequest . method
1898
1898
] ) ;
1899
+ private static CancellableResolveCalls : Set < string > = new Set ( [
1900
+ CompletionResolveRequest . method ,
1901
+ CodeLensResolveRequest . method ,
1902
+ CodeActionResolveRequest . method ,
1903
+ InlayHintResolveRequest . method ,
1904
+ DocumentLinkResolveRequest . method ,
1905
+ WorkspaceSymbolResolveRequest . method
1906
+ ] ) ;
1907
+
1899
1908
public handleFailedRequest < T > ( type : MessageSignature , token : CancellationToken | undefined , error : any , defaultValue : T , showNotification : boolean = true ) : T {
1900
1909
// If we get a request cancel or a content modified don't log anything.
1901
1910
if ( error instanceof ResponseError ) {
@@ -1915,7 +1924,7 @@ export abstract class BaseLanguageClient implements FeatureClient<Middleware, La
1915
1924
}
1916
1925
}
1917
1926
} else if ( error . code === LSPErrorCodes . ContentModified ) {
1918
- if ( BaseLanguageClient . RequestsToCancelOnContentModified . has ( type . method ) ) {
1927
+ if ( BaseLanguageClient . RequestsToCancelOnContentModified . has ( type . method ) || BaseLanguageClient . CancellableResolveCalls . has ( type . method ) ) {
1919
1928
throw new CancellationError ( ) ;
1920
1929
} else {
1921
1930
return defaultValue ;
0 commit comments