Skip to content

Commit

Permalink
Remove lib.d.ts line info in inlay hint baselines (microsoft#55426)
Browse files Browse the repository at this point in the history
  • Loading branch information
MariaSolOs committed Aug 22, 2023
1 parent 97d8c83 commit 507fd31
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/harness/fourslashImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,15 @@ export class TestState {
const fileName = this.activeFile.fileName;
const hints = this.languageService.provideInlayHints(fileName, span, preferences);
const annotations = ts.map(hints.sort(sortHints), hint => {
if (hint.displayParts) {
hint.displayParts = ts.map(hint.displayParts, part => {
if (part.file && /lib(?:.*)\.d\.ts$/.test(part.file)) {
part.span!.start = -1;
}
return part;
});
}

const span = { start: hint.position, length: hint.text.length };
const { character, line } = this.languageServiceAdapterHost.positionToLineAndCharacter(fileName, span.start);
const underline = " ".repeat(character) + "^";
Expand Down

0 comments on commit 507fd31

Please sign in to comment.