From c6a7994225495675961d18a9c722dc0e7f812bf3 Mon Sep 17 00:00:00 2001 From: "Lyu, Wei-Da" <36730922+jasonlyu123@users.noreply.github.com> Date: Fri, 12 Jan 2024 16:33:00 +0800 Subject: [PATCH] fix: map optionalReplacementSpan for typescript-language-server (#2257) #2251 For typescript plugin --- .../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 + }; + } } }