Skip to content

Commit c46fd07

Browse files
committed
feat(impact): Go callers from syntax facts
A Go package is its directory, and an import binds it by the path go.mod gives it, an alias or a dot import. An unexported name never leaves its package. A method call resolves when the syntax states the value's type (a receiver, a parameter, `var x T`, `x := &pkg.T{}`), and is a candidate from any file that can see the method's package otherwise. A same-named function of another package, a struct field, a local and a string are no longer callers. Gate: go_callers_bind_through_the_package_and_the_stated_type, with decoys of each kind; the lexical build finds 0 of 3 Total callers and lists the field decoy, and finds no Reconcile caller. Refs #506
1 parent f57d4b9 commit c46fd07

5 files changed

Lines changed: 731 additions & 20 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Go callers come from syntax facts: a package is its directory, an import
13+
binds it by the path `go.mod` gives it, an alias or a dot import names it,
14+
an unexported name never leaves its package, and a method call resolves
15+
when the syntax states the value's type (a receiver, a parameter,
16+
`x := &pkg.T{}`). A same-named function of another package, a struct
17+
field, a local and a string are no longer callers (#506).
18+
1019
### Fixed
1120

1221
- Module-level calls are listed beside a function-level caller in the same

0 commit comments

Comments
 (0)