Package names provides functions to analyze the usage names (functions, types, variables, etc.) across multiple files.
FindConflict determines if there already exists an identifier with the given newName such that the given ident cannot be renamed to name. It returns one such conflicting declaration, if possible, and nil if there are none.
FindDeclarationsAcrossInterfaces finds all objects that might need to be renamed if the given identifier is renamed. In the case of a method, there may be indirect relationships such as the following:
Interface1 Interface2 / \ / \ / implements \ / \ / \ Type1 Type2 Type3
where renaming a method in Type1 could force a method with the same signature to be renamed in Interface1, Interface2, Type2, and Type3. This method returns a set containing the reflexive, transitive closure of objects that must be renamed if the given identifier is renamed.
FindEmbeddedTypes finds each use of the given Object's type as an embedded type and returns a set consisting of the given Object and all uses in embedded types.
FindInComments searches the comments of the given packages' source files for occurrences of the given name (as a word, not a subword) and returns their source locations. Position information is obtained from the given FileSet.
FindOccurrences receives an Object and returns the set of all identifiers that refer to that Object.
Note that this method cannot be used to find occurrences of package names or variables defined by type switch statements; those must be handled using different methods in this package.
func FindTypeSwitchVarOccurrences(typeSwitch *ast.TypeSwitchStmt, pkgInfo *loader.PackageInfo, program *loader.Program) map[*ast.Ident]bool
FindTypeSwitchVarOccurrences returns the set of all identifiers that refer to the variable defined in the type switch statement.