mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
fix(45999): show parameter inlay hints before initializer (#46040)
This commit is contained in:
@@ -279,7 +279,7 @@ namespace ts.InlayHints {
|
||||
continue;
|
||||
}
|
||||
|
||||
addTypeHints(typeDisplayString, param.end);
|
||||
addTypeHints(typeDisplayString, param.name.end);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
22
tests/cases/fourslash/inlayHintsShouldWork65.ts
Normal file
22
tests/cases/fourslash/inlayHintsShouldWork65.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
//// type F = (a: string, b: number) => void
|
||||
//// const f: F = (a/*a*/, b/*b*/ = 1) => { }
|
||||
|
||||
const [a, b] = test.markers();
|
||||
verify.getInlayHints([
|
||||
{
|
||||
text: ': string',
|
||||
position: a.position,
|
||||
kind: ts.InlayHintKind.Type,
|
||||
whitespaceBefore: true
|
||||
},
|
||||
{
|
||||
text: ': number',
|
||||
position: b.position,
|
||||
kind: ts.InlayHintKind.Type,
|
||||
whitespaceBefore: true
|
||||
}
|
||||
], undefined, {
|
||||
includeInlayFunctionParameterTypeHints: true
|
||||
});
|
||||
Reference in New Issue
Block a user