From 219e703c94d79c012914aa5e4aa27592670adf0b Mon Sep 17 00:00:00 2001 From: "Lyu, Wei Da" Date: Fri, 12 Jan 2024 13:36:01 +0800 Subject: [PATCH] fix: map optionalReplacementSpan for typescript-language-server --- .../typescript-plugin/src/language-service/completions.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/typescript-plugin/src/language-service/completions.ts b/packages/typescript-plugin/src/language-service/completions.ts index b03b28da4..515f8b986 100644 --- a/packages/typescript-plugin/src/language-service/completions.ts +++ b/packages/typescript-plugin/src/language-service/completions.ts @@ -40,6 +40,13 @@ export function decorateCompletions( } return c; }); + + if (completions.optionalReplacementSpan) { + completions.optionalReplacementSpan = { + ...completions.optionalReplacementSpan, + start: toOriginalPos(completions.optionalReplacementSpan.start).pos + }; + } } }