Skip to content

Commit adaae60

Browse files
Copilotjakebailey
andcommitted
Use positive IsIdentifier check instead of negative IsBindingPattern check
Following the TypeScript reference more precisely - check if param.Name() is an Identifier rather than checking if it's NOT a binding pattern. This is more explicit and matches the pattern in utilities.ts:4703 where it checks `p.name.kind === SyntaxKind.Identifier`. Co-authored-by: jakebailey <[email protected]>
1 parent 093a1e0 commit adaae60

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎internal/checker/checker.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30398,8 +30398,8 @@ func (c *Checker) getSymbolAtLocation(node *ast.Node, ignoreErrors bool) *ast.Sy
3039830398
} else if ast.IsJSDocParameterTag(parent) && parent.Name() == node {
3039930399
if fn := ast.GetNodeAtPosition(ast.GetSourceFileOfNode(node), node.Pos(), false); fn != nil && ast.IsFunctionLike(fn) {
3040030400
for _, param := range fn.Parameters() {
30401-
// Skip binding patterns - they don't have a simple name to compare
30402-
if !ast.IsBindingPattern(param.Name()) && param.Name().Text() == node.Text() {
30401+
// Only compare against identifier names, not binding patterns
30402+
if ast.IsIdentifier(param.Name()) && param.Name().Text() == node.Text() {
3040330403
return c.getSymbolOfNode(param)
3040430404
}
3040530405
}

0 commit comments

Comments
 (0)