Skip to content

Commit 9e64e29

Browse files
adonovangopherbot
authored andcommitted
internal/typesinternal: add TODO to improve FileQualifier
Change-Id: I09e3660a7713707ef906dab2e04c41bbaefe87ed Reviewed-on: https://go-review.googlesource.com/c/tools/+/702936 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Madeline Kalil <mkalil@google.com> Auto-Submit: Alan Donovan <adonovan@google.com>
1 parent e38be50 commit 9e64e29

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

internal/typesinternal/qualifier.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ import (
1515
// file.
1616
// If the same package is imported multiple times, the last appearance is
1717
// recorded.
18+
//
19+
// TODO(adonovan): this function ignores the effect of shadowing. It
20+
// should accept a [token.Pos] and a [types.Info] and compute only the
21+
// set of imports that are not shadowed at that point, analogous to
22+
// [analysisinternal.AddImport]. It could also compute (as a side
23+
// effect) the set of additional imports required to ensure that there
24+
// is an accessible import for each necessary package, making it
25+
// converge even more closely with AddImport.
1826
func FileQualifier(f *ast.File, pkg *types.Package) types.Qualifier {
1927
// Construct mapping of import paths to their defined names.
2028
// It is only necessary to look at renaming imports.

0 commit comments

Comments
 (0)