mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
fix(48277): show parameter type inlay hints after ? operator (#48283)
This commit is contained in:
parent
7f652509b6
commit
f12922c8f7
@ -279,7 +279,7 @@ namespace ts.InlayHints {
|
||||
continue;
|
||||
}
|
||||
|
||||
addTypeHints(typeDisplayString, param.name.end);
|
||||
addTypeHints(typeDisplayString, param.questionToken ? param.questionToken.end : param.name.end);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
23
tests/cases/fourslash/inlayHintsShouldWork66.ts
Normal file
23
tests/cases/fourslash/inlayHintsShouldWork66.ts
Normal file
@ -0,0 +1,23 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////interface IFoo {
|
||||
//// bar(x?: boolean): void;
|
||||
////}
|
||||
////
|
||||
////const a: IFoo = {
|
||||
//// bar: function (x?/**/): void {
|
||||
//// throw new Error("Function not implemented.");
|
||||
//// }
|
||||
////}
|
||||
|
||||
const [marker] = test.markers();
|
||||
verify.getInlayHints([
|
||||
{
|
||||
text: ': boolean',
|
||||
position: marker.position,
|
||||
kind: ts.InlayHintKind.Type,
|
||||
whitespaceBefore: true
|
||||
},
|
||||
], undefined, {
|
||||
includeInlayFunctionParameterTypeHints: true
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user