Skip to content

x/tools/internal/typesinternal: FileQualifier needs to add imports, and reject unnameable types #75604

@adonovan

Description

@adonovan

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.

Metadata

Metadata

Assignees

Labels

NeedsFixThe path to resolution is known, but the work has not been done.RefactoringIssues related to refactoring toolsToolsThis label describes issues relating to any tools in the x/tools repository.help wanted

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions