// UnpackRecv unpacks a receiver type expression, reporting whether it is a // pointer recever, along with the type name identifier and any receiver type // parameter identifiers. // // Copied (with modifications) from go/types. func UnpackRecv(rtyp ast.Expr) (ptr bool, rname *ast.Ident, tparams []*ast.Ident) { … } // NodeContains returns true if a node encloses a given position pos. // The end point will also be inclusive, which will to allow hovering when the // cursor is behind some nodes. // // Precondition: n must not be nil. func NodeContains(n ast.Node, pos token.Pos) bool { … }