* The names a type name written bare inside a Go type declaration can mean * without naming another type: the declaration's own type parameters, and * its own name, which in a recursive type is the declaration itself.
(decl: SyntaxNode, source: string)
| 72 | * its own name, which in a recursive type is the declaration itself. |
| 73 | */ |
| 74 | function goDeclaredNames(decl: SyntaxNode, source: string): Set<string> { |
| 75 | const names = goTypeParameterNames(decl, source); |
| 76 | const nameNode = getChildByField(decl, 'name'); |
| 77 | if (nameNode) names.add(getNodeText(nameNode, source)); |
| 78 | return names; |
| 79 | } |
| 80 | |
| 81 | /** The type parameters a Go type declaration declares: `T` and `K` in `type Store[T any, K comparable] …`. */ |
| 82 | function goTypeParameterNames(decl: SyntaxNode, source: string): Set<string> { |
no test coverage detected