Skip to content

Commit 507fd31

Browse files
authored
Remove lib.d.ts line info in inlay hint baselines (#55426)
1 parent 97d8c83 commit 507fd31

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/harness/fourslashImpl.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,15 @@ export class TestState {
839839
const fileName = this.activeFile.fileName;
840840
const hints = this.languageService.provideInlayHints(fileName, span, preferences);
841841
const annotations = ts.map(hints.sort(sortHints), hint => {
842+
if (hint.displayParts) {
843+
hint.displayParts = ts.map(hint.displayParts, part => {
844+
if (part.file && /lib(?:.*)\.d\.ts$/.test(part.file)) {
845+
part.span!.start = -1;
846+
}
847+
return part;
848+
});
849+
}
850+
842851
const span = { start: hint.position, length: hint.text.length };
843852
const { character, line } = this.languageServiceAdapterHost.positionToLineAndCharacter(fileName, span.start);
844853
const underline = " ".repeat(character) + "^";

0 commit comments

Comments
 (0)