We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a819c61 commit e8722c0Copy full SHA for e8722c0
go/types/internal/play/play.go
@@ -173,6 +173,26 @@ func handleSelectJSON(w http.ResponseWriter, req *http.Request) {
173
}
174
175
176
+ // selection x.f information (if cursor is over .f)
177
+ for _, n := range path[:2] {
178
+ if sel, ok := n.(*ast.SelectorExpr); ok {
179
+ seln, ok := pkg.TypesInfo.Selections[sel]
180
+ if ok {
181
+ fmt.Fprintf(out, "Selection: %s recv=%v obj=%v type=%v indirect=%t index=%d\n\n",
182
+ strings.Fields("FieldVal MethodVal MethodExpr")[seln.Kind()],
183
+ seln.Recv(),
184
+ seln.Obj(),
185
+ seln.Type(),
186
+ seln.Indirect(),
187
+ seln.Index())
188
+
189
+ } else {
190
+ fmt.Fprintf(out, "Selector is qualified identifier.\n\n")
191
+ }
192
+ break
193
194
195
196
// Object type information.
197
switch n := path[0].(type) {
198
case *ast.Ident:
0 commit comments