mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-04-28 16:55:51 -05:00
Remove lib.d.ts line info in inlay hint baselines (#55426)
This commit is contained in:
committed by
GitHub
parent
97d8c83bce
commit
507fd31d8b
@@ -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) + "^";
|
||||
|
||||
Reference in New Issue
Block a user