mirror of
https://github.com/golang/go
synced 2024-11-05 15:46:11 -07:00
d75c6bdb8f
- print "oracle:" not "Error:" in error messages; remove period. - allocate token.FileSet correctly. - remove stale TODO (multiple test packages) - fix typo and omission ('what') in usage message. LGTM=gri R=gri CC=golang-codereviews https://golang.org/cl/178860043
100 lines
2.6 KiB
Plaintext
100 lines
2.6 KiB
Plaintext
|
|
|
|
ORACLE TODO
|
|
===========
|
|
|
|
General
|
|
=======
|
|
|
|
Refactor control flow so that each mode has a "one-shot setup" function.
|
|
|
|
Use a fault-tolerant parser that can recover from bad parses.
|
|
|
|
Save unsaved editor buffers into an archive and provide that to the
|
|
tools, which should act as if they were saved.
|
|
|
|
Fix: make the guessImportPath hack work with external _test.go files too.
|
|
|
|
Include complete pos/end information Serial output.
|
|
But beware that sometimes a single token (e.g. +) is more helpful
|
|
than the pos/end of the containing expression (e.g. x \n + \n y).
|
|
|
|
Specific queries
|
|
================
|
|
|
|
callers, callees
|
|
|
|
Use a type-based (e.g. RTA) callgraph when a callers/callees query is
|
|
outside the analysis scope.
|
|
|
|
implements
|
|
|
|
Make it require that the selection is a type, and show only the
|
|
implements relation as it applies to that type.
|
|
|
|
definition, referrers
|
|
|
|
Use the parser's resolver information to answer the query
|
|
for local names. Only run the type checker if that fails.
|
|
(NB: gri's new parser won't do any resolution.)
|
|
|
|
referrers: Show the text of the matching line of code, like grep.
|
|
|
|
definition: Make it work with qualified identifiers (SelectorExpr) too.
|
|
|
|
references: Make it work on things that are implicit idents, like
|
|
import specs, perhaps?
|
|
|
|
what
|
|
|
|
Report def/ref info if available.
|
|
Editors could use it to highlight all idents of the same local var.
|
|
|
|
Fix: support it in (*Oracle).Query (long-running tools).
|
|
|
|
More tests.
|
|
|
|
pointsto
|
|
|
|
When invoked on a function Ident, we get an error.
|
|
|
|
When invoked on a named return parameter, we get an error.
|
|
|
|
describe
|
|
|
|
When invoked on a var, we want to see the type and its methods.
|
|
|
|
Split "show type" and "describe syntax" into separate commands?
|
|
|
|
peers
|
|
|
|
Permit querying from a makechan, for...range, or reflective op.
|
|
|
|
Report aliasing reflect.{Send,Recv,Close} and close() operations.
|
|
|
|
New queries
|
|
|
|
"updaters": show all statements that may update the selected lvalue
|
|
(local, global, field, etc).
|
|
|
|
"creators": show all places where an object of type T is created
|
|
(&T{}, var t T, new(T), new(struct{array [3]T}), etc.
|
|
(Useful for datatypes whose zero value is not safe)
|
|
|
|
|
|
Editor-specific
|
|
===============
|
|
|
|
Add support for "what" to .el; clean up.
|
|
|
|
Emacs: use JSON to get the raw information from the oracle. Don't
|
|
open an editor buffer for simpler queries, just jump to the result
|
|
and/or display it in the modeline.
|
|
|
|
Emacs: go-root-and-paths depends on the current buffer, so be sure to
|
|
call it from within the source file, not the *go-oracle* buffer:
|
|
the user may have switched workspaces and the oracle should run in
|
|
the new one.
|
|
|
|
Support other editors: vim, Eclipse, Sublime, etc.
|