mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-10 18:04:18 -05:00
fix(57445): No inlay hints for property declaration types inferred from constructor (#57494)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
This commit is contained in:
@@ -118,6 +118,7 @@ import {
|
||||
tokenToString,
|
||||
TupleTypeReference,
|
||||
Type,
|
||||
TypeFlags,
|
||||
unescapeLeadingUnderscores,
|
||||
UserPreferences,
|
||||
usingSingleLineStringWriter,
|
||||
@@ -260,7 +261,10 @@ export function provideInlayHints(context: InlayHintsContext): InlayHint[] {
|
||||
}
|
||||
|
||||
function visitVariableLikeDeclaration(decl: VariableDeclaration | PropertyDeclaration) {
|
||||
if (!decl.initializer || isBindingPattern(decl.name) || isVariableDeclaration(decl) && !isHintableDeclaration(decl)) {
|
||||
if (
|
||||
decl.initializer === undefined && !(isPropertyDeclaration(decl) && !(checker.getTypeAtLocation(decl).flags & TypeFlags.Any)) ||
|
||||
isBindingPattern(decl.name) || (isVariableDeclaration(decl) && !isHintableDeclaration(decl))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user