fix(48277): show parameter type inlay hints after ? operator (#48283)

This commit is contained in:
Oleksandr T
2022-03-16 11:38:40 -07:00
committed by GitHub
parent 7f652509b6
commit f12922c8f7
2 changed files with 24 additions and 1 deletions
+1 -1
View File
@@ -279,7 +279,7 @@ namespace ts.InlayHints {
continue;
}
addTypeHints(typeDisplayString, param.name.end);
addTypeHints(typeDisplayString, param.questionToken ? param.questionToken.end : param.name.end);
}
}
@@ -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
});