1
0
mirror of https://github.com/golang/go synced 2024-11-18 20:44:45 -07:00
The Go programming language
Go to file
Alan Donovan f119874203 go.tools/oracle: improvements to command set and performance.
Command set:
- what: an extremely fast query that parses a single
  file and returns the AST stack, package name and the
  set of query modes that apply to the current selection.
  Intended for GUI tools that need to grey out UI elements.
- definition: shows the definition of an identifier.
- pointsto: the PTA features of 'describe' have been split
  out into their own command.
- describe: with PTA stripped out, the cost is now bounded by
  type checking.

Performance:
- The importer.Config.TypeCheckFuncBodies predicate supports
  setting the 'IgnoreFuncBodies' typechecker flag on a
  per-package basis.  This means we can load dependencies from
  source more quickly if we only need exported types.
  (We avoid gcimport data because it may be absent or stale.)
  This also means we can run type-based queries on packages
  that aren't part of the pointer analysis scope. (Yay.)
- Modes that require only type analysis of the query package
  run a "what" query first, and restrict their analysis scope
  to just that package and its dependencies (sans func
  bodies), making them much faster.
- We call newOracle not oracle.New in Query, so that the
  'needs' bitset isn't ignored (oops!).  This makes the
  non-PTA queries faster.

Also:
- removed vestigial timers junk.
- pos.go: existing position utilties split out into own file.
  Added parsePosFlag utility.
- numerous cosmetic tweaks.

+ very basic tests.

To do in follow-ups:
- sophisticated editor integration of "what".
- better tests.
- refactoring of control flow as described in comment.
- changes to "implements", "describe" commands.
- update design doc + user manual.

R=crawshaw, dominik.honnef
CC=golang-dev, gri
https://golang.org/cl/40630043
2013-12-13 10:04:55 -05:00
astutil go.tools/oracle: improvements to command set and performance. 2013-12-13 10:04:55 -05:00
blog go.tools/blog: strip prefix when serving static content 2013-11-08 13:28:32 +11:00
call go.tools/pointer: use new callgraph API. 2013-09-25 17:17:42 -04:00
cmd go.tools/oracle: improvements to command set and performance. 2013-12-13 10:04:55 -05:00
cover go.tools/cover: split parsing code out from cmd/cover 2013-12-03 20:55:21 -08:00
dashboard go.tools/dashboard/builder: do not fatal on subrepo fetch errors 2013-12-11 23:47:31 +11:00
go go.tools/go/exact: fix bug introduced with CL 41170043 2013-12-12 14:18:40 -08:00
godoc godoc: Add URLForSrcQuery option to godoc.Presentation. 2013-12-04 10:37:01 -05:00
importer go.tools/oracle: improvements to command set and performance. 2013-12-13 10:04:55 -05:00
oracle go.tools/oracle: improvements to command set and performance. 2013-12-13 10:04:55 -05:00
playground go.tools/present: add support for non Go code execution 2013-10-14 14:14:08 -07:00
pointer go.tools/oracle: improvements to command set and performance. 2013-12-13 10:04:55 -05:00
present go.tools/present: add Raw content to Code for new go-tour. 2013-11-26 10:04:08 +01:00
ssa go.tools/importer: move PathEnclosingInterval to package astutil. 2013-12-09 09:36:29 -05:00
.hgignore go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
AUTHORS go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
codereview.cfg go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
CONTRIBUTORS go.empty: prototype for new subrepository 2012-01-25 14:45:13 -05:00
LICENSE LICENSE: add 2012-03-17 15:20:58 +11:00
PATENTS go.empty: add PATENTS file to the subrepo. 2012-04-16 11:24:04 +10:00
README go.tools/README: minor correction. 2013-10-29 13:20:58 -04:00

This subrepository holds the source for various packages and tools that support
the Go programming language.

Some of the tools, godoc and vet for example, are included in binary Go distributions.
Others, including the Go oracle and the test coverage tool, can be fetched with "go get".

Packages include a type-checker for Go and an implementation of the
Static Single Assignment form (SSA) representation for Go programs.

To submit changes to this repository, see http://golang.org/doc/contribute.html.