diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index 2529df6f7c..fdd497bbac 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -1879,6 +1879,7 @@ impl Inner { &self.config, &specifier, )), + params.context.trigger_kind, only, ) .await?; diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs index 16cca30e15..2873ba703b 100644 --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -490,8 +490,14 @@ impl TsServer { specifier: ModuleSpecifier, range: Range, preferences: Option, + trigger_kind: Option, only: String, ) -> Result, LspError> { + let trigger_kind: Option<&str> = trigger_kind.map(|reason| match reason { + lsp::CodeActionTriggerKind::INVOKED => "invoked", + lsp::CodeActionTriggerKind::AUTOMATIC => "implicit", + _ => unreachable!(), + }); let req = TscRequest { method: "getApplicableRefactors", // https://github.com/denoland/deno/blob/v1.37.1/cli/tsc/dts/typescript.d.ts#L6274 @@ -499,7 +505,7 @@ impl TsServer { self.specifier_map.denormalize(&specifier), { "pos": range.start, "end": range.end }, preferences.unwrap_or_default(), - json!(null), + trigger_kind, only, ]), };