summaryrefslogtreecommitdiff
path: root/cli/lsp/tsc.rs
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2021-04-01 20:18:51 +1100
committerGitHub <noreply@github.com>2021-04-01 20:18:51 +1100
commitec6317e8944d87cb412128f44fe4bb4c2a2d136f (patch)
treedfe91598fb706fde6455c127d0d655af0faaf56e /cli/lsp/tsc.rs
parent47ac654ea27e22d328921dd2283953dfd675b427 (diff)
fix(lsp): ensure insert_text is passed back on completions (#9951)
Fixes #9920
Diffstat (limited to 'cli/lsp/tsc.rs')
-rw-r--r--cli/lsp/tsc.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs
index 1e7ae6f89..7b7f791d0 100644
--- a/cli/lsp/tsc.rs
+++ b/cli/lsp/tsc.rs
@@ -1188,10 +1188,10 @@ impl CompletionEntry {
}
let text_edit =
- if let (Some(text_span), Some(new_text)) = (range, insert_text) {
+ if let (Some(text_span), Some(new_text)) = (range, &insert_text) {
let range = text_span.to_range(line_index);
let insert_replace_edit = lsp::InsertReplaceEdit {
- new_text,
+ new_text: new_text.clone(),
insert: range,
replace: range,
};
@@ -1216,6 +1216,7 @@ impl CompletionEntry {
preselect,
text_edit,
filter_text,
+ insert_text,
detail,
tags,
data: Some(json!({