1
0
mirror of https://github.com/golang/go synced 2024-10-01 06:08:32 -06:00
Commit Graph

4 Commits

Author SHA1 Message Date
Alan Donovan
6c84e9e3e0 cmd/guru: make fastQueryPos indirect through the -modified map
This fixes a bug in which guru reports a "query position beyond end of
file" error when making a query from an unsaved editor buffer at an
offset greater than the length of the file on disk.

Change-Id: I908c024d8dd14baa657b4227e3231fa760443732
Reviewed-on: https://go-review.googlesource.com/20167
Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com>
2016-03-03 19:00:43 +00:00
Alan Donovan
ee8cb08bfe cmd/guru: what: report identifiers equivalent to the selected one
This information is useful for editor UIs that highlight all
uses of the local variable under the cursor.

Change-Id: I718d648d407468509e6d12f932ae6cdef368830a
Reviewed-on: https://go-review.googlesource.com/19512
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-02-20 21:18:35 +00:00
Alan Donovan
fb3df4a89d cmd/guru: definition: try parser-based resolution first
The parser does intra-file resolution.  It's only a best-effort but
it's extremely fast, so we try it first and fall back to the loader-based
implementation if it fails.

Also:
- factor definitionResult so it doesn't depend on either go/types.Object
  or go/ast.Object.
- guessImportPath: make importPath=="" result an error,
  since you can't import the empty string.  Simplify importQueryPackage.
- Make fastQueryPos continue in face of minor parse errors.
- describe: eliminate old TODO; suppress log statement.

Change-Id: I30a32487e9fd9d5308b1580ec12220cad2c16299
Reviewed-on: https://go-review.googlesource.com/19507
Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com>
2016-02-16 00:29:23 +00:00
Alan Donovan
7347379304 cmd/guru: rename oracle to guru, copying it to a single package
See plans at:
https://docs.google.com/document/d/1UErU12vR7jTedYvKHVNRzGPmXqdMASZ6PfE7B-p6sIg/edit#heading=h.t5rbcuy7di7j

Change-Id: I369747e0ce8cd42a2975eb0f651a2e5fba47cf9e
Reviewed-on: https://go-review.googlesource.com/19475
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-02-12 03:38:58 +00:00