tools/cmd/guru
Alan Donovan 50ff896a1c cmd/guru: definition: opt: avoid type checker for qualified identifiers
For a 'definition' query on X in p.X, use special logic to load and
parse package p and find the declaration of package member X, without
using the type checker.  Such queries now typically take under
10ms (faster than godef).

The logic assumes that import "something/p" defines the name p.  If this
assumption is false, p.X could be a selection of a field or method X on
a member p of the same package, defined in another file.
So don't write code like that.

Added missing test of 'definitions'.
JSON tests now sanitize absolute $GOPATH filenames in the output.

Fixes issue #15458

Change-Id: I21e75fcc9372aaedd56851cace444aef205c7a97
Reviewed-on: https://go-review.googlesource.com/22526
Reviewed-by: Dominik Honnef <dominik@honnef.co>
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-04-28 17:00:30 +00:00
..
serial cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00
testdata/src cmd/guru: definition: opt: avoid type checker for qualified identifiers 2016-04-28 17:00:30 +00:00
callees.go cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00
callers.go cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00
callstack.go cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00
definition.go cmd/guru: definition: opt: avoid type checker for qualified identifiers 2016-04-28 17:00:30 +00:00
describe.go cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00
emacs-test.bash cmd/guru: in Emacs, change 'definition' to jump directly 2016-02-15 17:57:16 +00:00
freevars.go cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00
go-guru.el cmd/guru: Emacs: run guru asynchronously using compilation-mode 2016-04-28 14:21:22 +00:00
guru.go cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00
guru.vim cmd/guru: clean ups to command-line interface 2016-02-12 21:50:49 +00:00
guru_test.go cmd/guru: definition: opt: avoid type checker for qualified identifiers 2016-04-28 17:00:30 +00:00
implements.go cmd/guru: implements: if selected expr is a value, use its type 2016-04-28 14:33:14 +00:00
main.go cmd/guru: avoid bug when -scope="" 2016-04-18 16:46:08 +00:00
peers.go cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00
pointsto.go cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00
pos.go cmd/guru: fix nil deref when position is not in Go source 2016-03-07 15:53:42 +00:00
referrers.go cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00
what.go cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00
whicherrs.go cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00