Documentation ¶
Index ¶
- func FindConflict(obj types.Object, name string) types.Object
- func FindDeclarationsAcrossInterfaces(obj types.Object, program *loader.Program) map[types.Object]bool
- func FindEmbeddedTypes(obj types.Object, program *loader.Program) map[types.Object]bool
- func FindInComments(name string, f *ast.File, fset *token.FileSet) []*text.Extent
- func FindOccurrences(obj types.Object, prog *loader.Program) map[*ast.Ident]bool
- func FindTypeSwitchVarOccurrences(typeSwitch *ast.TypeSwitchStmt, pkgInfo *loader.PackageInfo, ...) map[*ast.Ident]bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindConflict ¶
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.
func FindDeclarationsAcrossInterfaces ¶
func FindDeclarationsAcrossInterfaces(obj types.Object, program *loader.Program) map[types.Object]bool
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.
func FindEmbeddedTypes ¶
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.
func FindInComments ¶
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.
func FindOccurrences ¶
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 ¶
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.
Types ¶
This section is empty.