[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/dart-mode a087c75 099/192: Add a result counter in search
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/dart-mode a087c75 099/192: Add a result counter in search results |
Date: |
Sun, 29 Aug 2021 11:01:58 -0400 (EDT) |
branch: elpa/dart-mode
commit a087c7523cdc0b89cd13ed4a6f370ac5cd63050b
Author: Natalie Weizenbaum <nex342@gmail.com>
Commit: Natalie Weizenbaum <nex342@gmail.com>
Add a result counter in search results
---
dart-mode.el | 80 ++++++++++++++++++++++++++++++++----------------------------
1 file changed, 43 insertions(+), 37 deletions(-)
diff --git a/dart-mode.el b/dart-mode.el
index 20be986..2788163 100644
--- a/dart-mode.el
+++ b/dart-mode.el
@@ -1262,7 +1262,10 @@ ARGUMENT. Displays a header beginning with HEADER in the
results."
CALLBACK is called with no arguments in the search result buffer
to add a header and otherwise prepare it for displaying results."
- (lexical-let* (buffer (search-id search-id) beginning-of-results)
+ (lexical-let* (buffer
+ (search-id search-id)
+ beginning-of-results
+ (total-results 0))
(with-current-buffer-window
"*Dart Search*" nil nil
(setq buffer (current-buffer))
@@ -1275,42 +1278,45 @@ to add a header and otherwise prepare it for displaying
results."
(with-current-buffer buffer
(dart--json-let event (id results (is-last isLast))
(when (equal id search-id)
- (when (eq is-last t)
- (dart--analysis-server-unsubscribe subscription))
-
- (save-excursion
- (goto-char (point-max))
- (loop
- for result across results
- do (lexical-let* ((location (cdr (assoc 'location result)))
- (path (cdr (assoc 'path result))))
- (let ((start (point))
- (buffer-read-only nil))
- (dart--fontify-excursion '(compilation-info underline)
- (when (cl-some
- (lambda (element)
- (equal (cdr (assoc 'kind element))
"CONSTRUCTOR"))
- path)
- (insert "new "))
-
- (insert
- (loop for element across path
- unless (member (cdr (assoc 'kind element))
- '("COMPILATION_UNIT" "FILE"
"LIBRARY" "PARAMETER"))
- unless (string-empty-p (cdr (assoc 'name
element)))
- collect (cdr (assoc 'name element)) into names
- finally return (mapconcat 'identity (reverse
names) ".")))
-
- (make-text-button
- start (point)
- 'action (lambda (_) (dart--goto-location
location))))
-
- (let ((file (cdr (assoc 'file location)))
- (line (cdr (assoc 'startLine location)))
- (column (cdr (assoc 'startColumn location))))
- (insert " " file ":"
- (dart--face-string line
'compilation-line-number) ":"
- (dart--face-string column
'compilation-column-number) ?\n))))))))))))
+ (let ((buffer-read-only nil))
+ (save-excursion
+ (goto-char (point-max))
+ (loop
+ for result across results
+ do (lexical-let* ((location (cdr (assoc 'location result)))
+ (path (cdr (assoc 'path result))))
+ (let ((start (point)))
+ (dart--fontify-excursion '(compilation-info
underline)
+ (when (cl-some
+ (lambda (element)
+ (equal (cdr (assoc 'kind element))
"CONSTRUCTOR"))
+ path)
+ (insert "new "))
+
+ (insert
+ (loop for element across path
+ unless (member (cdr (assoc 'kind element))
+ '("COMPILATION_UNIT" "FILE"
"LIBRARY" "PARAMETER"))
+ unless (string-empty-p (cdr (assoc 'name
element)))
+ collect (cdr (assoc 'name element)) into
names
+ finally return (mapconcat 'identity
(reverse names) ".")))
+
+ (make-text-button
+ start (point)
+ 'action (lambda (_) (dart--goto-location
location))))
+
+ (let ((file (cdr (assoc 'file location)))
+ (line (cdr (assoc 'startLine location)))
+ (column (cdr (assoc 'startColumn location))))
+ (insert " " file ":"
+ (dart--face-string line
'compilation-line-number) ":"
+ (dart--face-string column
'compilation-column-number) ?\n)))))
+
+ (setq total-results (+ total-results (length results)))
+
+ (when (eq is-last t)
+ (dart--analysis-server-unsubscribe subscription)
+ (insert "\nFound " (dart--face-string total-results 'bold)
" results."))))))))))
(select-window (get-buffer-window buffer))
(goto-char beginning-of-results)))
- [nongnu] elpa/dart-mode d507fa1 101/192: Add a binding to re-run searches, (continued)
- [nongnu] elpa/dart-mode d507fa1 101/192: Add a binding to re-run searches, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode a2ab55b 114/192: Make more thorough use of dash, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode c11d02a 137/192: Remedy invalid file path format, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 8f972c0 097/192: Add support for finding references, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 848f983 104/192: Show docs for expansions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 6bc08f7 136/192: Adds failing test against dart dev, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 9c9a63e 130/192: Fix dart-format, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 1f27d03 119/192: Properly set up font-lock variables, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 6397b3d 115/192: Clean up the way the SDK is configured, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode e9cd33d 109/192: Use proper private name convention, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode a087c75 099/192: Add a result counter in search results,
ELPA Syncer <=
- [nongnu] elpa/dart-mode 847707d 129/192: Require final newline, like dartfmt, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 570e58c 116/192: Refactor formatter support, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode d4da484 126/192: Removes nil c-syntactic-context (#56), ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 7c28c58 131/192: Add Travis-CI and Cask, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode adef2a5 118/192: Be more resilient to server crashes, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 61f334c 149/192: Improves indentation, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 47dc5a0 146/192: Fixes flycheck in Windows, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 6e1c42f 156/192: Fontify string interpolation, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode d78c5c7 142/192: Bump version to 1.0.4, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 1031016 141/192: Edit README to melpa rather than marmalade, ELPA Syncer, 2021/08/29