1
0
mirror of https://github.com/golang/go synced 2024-11-18 08:54:45 -07:00
go/cmd
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
..
benchcmp benchmark/parser, cmd/benchcmp: improve names of exported identifiers 2015-01-15 01:28:17 +00:00
bundle all: address vet issues, fix print calls 2016-03-27 20:36:34 +00:00
callgraph x/tools/cmd/callgraph: add -ptalog flag 2015-12-04 17:49:28 +00:00
cover all: address vet issues, fix print calls 2016-03-27 20:36:34 +00:00
digraph tools: add import comments. 2014-12-09 22:42:16 +00:00
eg refactor/eg: refactor to break dependency on go/loader 2015-09-01 14:26:06 +00:00
fiximports cmd/fiximports: -replace flag specifies canonical packages in absence of import comments 2015-09-01 14:23:39 +00:00
godex x/tools: delete x/tools/go/types and dependent packages/client files 2016-04-06 21:52:49 +00:00
godoc cmd/godoc: accept GOOS and GOARCH URL parameters in -http mode 2016-02-04 22:11:53 +00:00
goimports imports: add support for vendor directories 2016-02-18 16:47:46 +00:00
gomvpkg go/buildutil: TagsFlag provides a flag.Value for setting build.Context.BuildTags from -tags flag. 2015-04-23 14:10:21 +00:00
gorename cmd/gorename: -d flag prints diffs instead of rewriting files 2015-12-30 15:25:00 +00:00
gotype x/tools: delete x/tools/go/types and dependent packages/client files 2016-04-06 21:52:49 +00:00
guru cmd/guru: definition: opt: avoid type checker for qualified identifiers 2016-04-28 17:00:30 +00:00
html2article all: address vet reports 2014-12-29 06:08:34 +00:00
oracle cmd/oracle: add pointsto, whicherrs to help message 2016-02-11 22:30:21 +00:00
present x/tools/present: add command line flag to enable presenter notes 2016-04-07 00:38:29 +00:00
ssadump x/tools: delete x/tools/go/types and dependent packages/client files 2016-04-06 21:52:49 +00:00
stress all: fix plan9 failures 2016-01-28 00:31:03 +00:00
stringer cmd/stringer: fixed usage line typo 2016-04-17 02:19:27 +00:00
tip cmd/tip: bump verison serving tip.golang.org to HEAD 2016-04-28 01:23:19 +00:00