summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/lsp/language_server.rs1
-rw-r--r--cli/lsp/tsc.rs8
2 files changed, 8 insertions, 1 deletions
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs
index 2529df6f7..fdd497bba 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 16cca30e1..2873ba703 100644
--- a/cli/lsp/tsc.rs
+++ b/cli/lsp/tsc.rs
@@ -490,8 +490,14 @@ impl TsServer {
specifier: ModuleSpecifier,
range: Range<u32>,
preferences: Option<UserPreferences>,
+ trigger_kind: Option<lsp::CodeActionTriggerKind>,
only: String,
) -> Result<Vec<ApplicableRefactorInfo>, 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,
]),
};