* A framework name heuristic's pick (see name-heuristic.ts) among the * declarations of the reference's own package — its directory — its own * file's first. No folder convention applies: Go never reads a bare name from * another package, a dot import aside.
(ref: UnresolvedRef, kinds: ReadonlySet<string>, context: ResolutionContext)
| 195 | * another package, a dot import aside. |
| 196 | */ |
| 197 | function resolveInOwnPackage(ref: UnresolvedRef, kinds: ReadonlySet<string>, context: ResolutionContext): string | null { |
| 198 | const dir = ref.filePath.slice(0, ref.filePath.lastIndexOf('/') + 1); |
| 199 | const inPackage = (n: Node) => n.filePath.startsWith(dir) && !n.filePath.slice(dir.length).includes('/'); |
| 200 | return pickByNameAndKind(ref, kinds, () => false, context, { accept: inPackage }); |
| 201 | } |
no test coverage detected