From 149c366cb30eb664bd9c823ef90529b5f2155709 Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Tue, 20 Jun 2023 22:28:33 +0200 Subject: [PATCH] Don't generate parameter hints if argument variable name is the same as the argument --- packages/pyright-internal/src/analyzer/typeInlayHintsWalker.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/pyright-internal/src/analyzer/typeInlayHintsWalker.ts b/packages/pyright-internal/src/analyzer/typeInlayHintsWalker.ts index 5e50ed620535..dd40648b650d 100644 --- a/packages/pyright-internal/src/analyzer/typeInlayHintsWalker.ts +++ b/packages/pyright-internal/src/analyzer/typeInlayHintsWalker.ts @@ -142,6 +142,9 @@ export class TypeInlayHintsWalker extends ParseTreeWalker { if (p.paramName?.startsWith('__')) { continue; } + if (p.paramName === p.argument.name) { + continue; + } if (p.paramName) { this.featureItems.push({ inlayHintType: 'parameter',