[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode f18b4eb 369/495: cmd/guru: support streaming plain
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode f18b4eb 369/495: cmd/guru: support streaming plain and -json output |
Date: |
Sat, 7 Aug 2021 09:05:50 -0400 (EDT) |
branch: elpa/go-mode
commit f18b4eb04ebbcf29f14a18b5fe7dd5c308b19608
Author: Alan Donovan <adonovan@google.com>
Commit: Dominik Honnef <dominik@honnef.co>
cmd/guru: support streaming plain and -json output
Visible changes:
- "referrers" queries now emit a stream of results,
so they start appearing quickly even in large queries.
We no longer report the total number of matches.
- packageReferrers now also uses AfterTypeCheck hook and streaming.
- XML support has been dropped.
- The -format flag has been replaced by -json.
JSON protocol changes:
- The enclosing Result struct has been removed.
- Likewise the 'mode' field (since the caller knows it already)
- "freevars" and "referrers" now emit a stream of objects
In the case of referrers, the first object has a different from the rest.
- The "referrers" results include the text of the matching line
(parity with -json=false)
Implementation details:
- the concurrency-safe q.Output function can be called
many times, each with a queryResult to print.
- fset is no longer saved in Query (cleaner)
- queryResult methods renamed PrintPlain, JSON
Change-Id: I41a4e3f57f266fcf043ece4045bca82c6f6a356f
Reviewed-on: https://go-review.googlesource.com/21397
Reviewed-by: Michael Matloob <matloob@golang.org>
---
guru_import/cmd/guru/go-guru.el | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/guru_import/cmd/guru/go-guru.el b/guru_import/cmd/guru/go-guru.el
index a097d2d..b79fe82 100644
--- a/guru_import/cmd/guru/go-guru.el
+++ b/guru_import/cmd/guru/go-guru.el
@@ -301,11 +301,9 @@ function containing the current point."
(defun go-guru-definition ()
"Jump to the definition of the selected identifier."
(interactive)
- ;; TODO(adonovan): use -format=sexpr when available to avoid a
- ;; dependency and to simplify parsing.
- (let* ((res (with-current-buffer (go-guru--exec "definition" nil
'("-format=json"))
+ (let* ((res (with-current-buffer (go-guru--exec "definition" nil '("-json"))
(goto-char (point-min))
- (cdr (car (json-read)))))
+ (json-read)))
(desc (cdr (assoc 'desc res))))
(push-mark)
(ring-insert find-tag-marker-ring (point-marker))
@@ -360,11 +358,10 @@ expression (of type 'error') may refer."
(defun go-guru-what ()
"Run a 'what' query and return the parsed JSON response as an
-associative list."
- (let ((res (with-current-buffer (go-guru--exec "what" nil '("-format=json")
t)
- (goto-char (point-min))
- (cdr (car (json-read))))))
- res))
+association list."
+ (with-current-buffer (go-guru--exec "what" nil '("-json") t)
+ (goto-char (point-min))
+ (json-read)))
(defun go-guru--hl-symbols (posn face id)
"Highlight the symbols at the positions POSN by creating
- [nongnu] elpa/go-mode 95c74ba 324/495: Update URL to gogetdoc tool., (continued)
- [nongnu] elpa/go-mode 95c74ba 324/495: Update URL to gogetdoc tool., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 228ded4 314/495: Use cons instead of append, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 205672f 322/495: Use separate godoc commands for godoc and godoc-at-point, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 737611e 329/495: Update URL to goimports, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode b65e408 334/495: go.tools/cmd/oracle: cosmetic tweaks to Emacs., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e76464a 331/495: go.tools/oracle: an oracle that answers questions about Go source code., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 8560557 354/495: cmd/guru: fix bug in mode map caused by bad merge, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode b36d2fd 352/495: cmd/guru: emacs: report an error when the guru command fails, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d41ebaf 341/495: go.tools/oracle: improvements to command set and performance., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 385153c 338/495: go.tools/oracle: new query 'referrers' returns all references to an identifier., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode f18b4eb 369/495: cmd/guru: support streaming plain and -json output,
ELPA Syncer <=
- [nongnu] elpa/go-mode 9a5284b 362/495: cmd/guru: emacs: update scope documentation, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4dfa1c4 350/495: cmd/guru: add support for loading modified files, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode fdb5dfa 335/495: go.tools/oracle: change notation for byte offsets to "-pos=file.go:#123-#456", ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 1dc6fb5 357/495: cmd/guru: fix mode map, again, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode fac4a24 336/495: go.tools/importer: negate "cgo" build tag to avoid native code in "net"., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 5b5ac61 364/495: cmd/guru: emacs: highlight all instances of an identifier, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4146860 373/495: cmd/guru: Emacs: run guru asynchronously using compilation-mode, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 7077c4f 375/495: cmd/guru: fix quoting bug in Emacs binding, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 142eae4 374/495: cmd/guru: add menu to Emacs, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode eb8cf16 386/495: refactor/rename: emacs: package.el compatibility changes, ELPA Syncer, 2021/08/07