[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/dart-mode 848f983 104/192: Show docs for expansions
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/dart-mode 848f983 104/192: Show docs for expansions |
Date: |
Sun, 29 Aug 2021 11:01:59 -0400 (EDT) |
branch: elpa/dart-mode
commit 848f9836a53efe7d54b3689ec164b376222dc4a2
Author: Natalie Weizenbaum <nex342@gmail.com>
Commit: Natalie Weizenbaum <nex342@gmail.com>
Show docs for expansions
---
dart-mode.el | 42 +++++++++++++++++++++++++++++++++++++++---
1 file changed, 39 insertions(+), 3 deletions(-)
diff --git a/dart-mode.el b/dart-mode.el
index 12cf8a3..180583f 100644
--- a/dart-mode.el
+++ b/dart-mode.el
@@ -1458,14 +1458,50 @@ If FIRST is non-nil, this is the first completion event
for this completion."
(defun dart--use-expand-suggestion (offset length suggestion)
"Inserts SUGGESTION at OFFSET and LENGTH."
(dart--json-let suggestion
- (completion
- (selection-offset selectionOffset))
+ (completion element
+ (selection-offset selectionOffset)
+ (is-deprecated isDeprecated)
+ (doc-summary docSummary))
(setq dart--last-expand-length (length completion))
(goto-char offset)
(delete-char length)
(save-excursion (insert completion))
- (forward-char selection-offset)))
+ (forward-char selection-offset)
+
+ (with-temp-buffer
+ (when (eq is-deprecated t)
+ (insert (dart--face-string "DEPRECATED" 'font-lock-warning-face) ?\n))
+
+ (insert (dart--highlight-description (dart--description-of-element
element)))
+ (when doc-summary
+ (insert ?\n ?\n (dart--highlight-dartdoc doc-summary nil)))
+
+ (message "%s" (buffer-string)))))
+
+(defun dart--description-of-element (element)
+ "Returns a textual description of an analysis server ELEMENT."
+ (dart--json-let element
+ (kind name parameters
+ (return-type returnType)
+ (type-parameters typeParameters))
+ (with-temp-buffer
+ (if (equal kind "CONSTRUCTOR")
+ (progn
+ (insert "new " return-type)
+ (unless (string-empty-p name)
+ (insert "." name))
+ (insert parameters)
+ (insert " → " return-type))
+
+ (case kind
+ ("GETTER" (insert "get "))
+ ("SETTER" (insert "set ")))
+ (insert name)
+ (when type-parameters (insert type-parameters))
+ (when parameters (insert parameters))
+ (when return-type (insert " → " return-type)))
+ (buffer-string))))
;;; Popup Mode
- [nongnu] elpa/dart-mode 0cf32d5 092/192: Highlight hover descriptions, (continued)
- [nongnu] elpa/dart-mode 0cf32d5 092/192: Highlight hover descriptions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode c4a5045 096/192: Add support for navigation, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode a1f36f4 094/192: Allow dart-show-hover to display in a new buffer, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 89a2d4e 100/192: Add a special mode for popups, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode eca3f15 105/192: Add the ability to autocomplete parameters, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode d333a73 102/192: Add an analyzer-based auto-complete, ELPA Syncer, 2021/08/29
- [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 <=
- [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, 2021/08/29
- [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