@@ -654,6 +654,7 @@ impl TsServer {
654
654
format_code_settings : FormatCodeSettings ,
655
655
preferences : UserPreferences ,
656
656
scope : Option < ModuleSpecifier > ,
657
+ token : CancellationToken ,
657
658
) -> Vec < CodeFixAction > {
658
659
let req = TscRequest :: GetCodeFixesAtPosition ( Box :: new ( (
659
660
self . specifier_map . denormalize ( & specifier) ,
@@ -664,7 +665,9 @@ impl TsServer {
664
665
preferences,
665
666
) ) ) ;
666
667
let result = self
667
- . request :: < Vec < CodeFixAction > > ( snapshot, req, scope)
668
+ . request_with_cancellation :: < Vec < CodeFixAction > > (
669
+ snapshot, req, scope, token,
670
+ )
668
671
. await
669
672
. and_then ( |mut actions| {
670
673
for action in & mut actions {
@@ -695,6 +698,7 @@ impl TsServer {
695
698
trigger_kind : Option < lsp:: CodeActionTriggerKind > ,
696
699
only : String ,
697
700
scope : Option < ModuleSpecifier > ,
701
+ token : CancellationToken ,
698
702
) -> Result < Vec < ApplicableRefactorInfo > , LspError > {
699
703
let trigger_kind = trigger_kind. map ( |reason| match reason {
700
704
lsp:: CodeActionTriggerKind :: INVOKED => "invoked" ,
@@ -708,10 +712,13 @@ impl TsServer {
708
712
trigger_kind,
709
713
only,
710
714
) ) ) ;
711
- self . request ( snapshot, req, scope) . await . map_err ( |err| {
712
- log:: error!( "Failed to request to tsserver {}" , err) ;
713
- LspError :: invalid_request ( )
714
- } )
715
+ self
716
+ . request_with_cancellation ( snapshot, req, scope, token)
717
+ . await
718
+ . map_err ( |err| {
719
+ log:: error!( "Failed to request to tsserver {}" , err) ;
720
+ LspError :: invalid_request ( )
721
+ } )
715
722
}
716
723
717
724
pub async fn get_combined_code_fix (
0 commit comments