Skip to content

Commit 89ee707

Browse files
authored
fix: account for added code in the range of inlay hint (#2387)
1 parent 2478212 commit 89ee707

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/typescript-plugin/src/language-service/inlay-hints.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ export function decorateInlayHints(
1818
}
1919

2020
const { languageService, toVirtualPos, toOriginalPos } = result;
21+
const start = toVirtualPos(span.start);
2122
return languageService
2223
.provideInlayHints(
2324
fileName,
2425
{
25-
start: toVirtualPos(span.start),
26-
length: span.length
26+
start,
27+
length: toVirtualPos(span.start + span.length) - start
2728
},
2829
preferences
2930
)

0 commit comments

Comments
 (0)