x/tools/internal/typesinternal: FileQualifier needs to add imports, and reject unnameable types
#75 604 ouverte le 25 sept. 2025
Métriques du dépôt
- Stars
- (133 883 stars)
- Métriques de merge PR
- (Aucune PR mergée en 30 j)
Description
The job of FileQualifier is to help TypeString print types in valid Go syntax, respecting the local lexical environment and the file's set of existing imports. However, in general this may require (a) adding new imports for types belonging to packages that are not currently imported and (b) reporting that the task cannot be completed because one or more types are members of another package and are inaccessible either because they are unexported or because that package is internal relative to this one.
The task of this issue is to augment FileQualifier to accumulate a list of import edits, and an error when it sees a type it cannot print. This should fix a number of bugs across all our refactoring tools. It could also use some good tests.