[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode 70e649b 330/385: import qualified is even
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode 70e649b 330/385: import qualified is even smarter |
Date: |
Tue, 5 Oct 2021 23:59:58 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit 70e649b05039f05ffc258674b3facb09b81dfaab
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
import qualified is even smarter
---
haskell-tng-hsinspect.el | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/haskell-tng-hsinspect.el b/haskell-tng-hsinspect.el
index 0616943..accca31 100644
--- a/haskell-tng-hsinspect.el
+++ b/haskell-tng-hsinspect.el
@@ -44,6 +44,14 @@ A prefix argument ensures that caches are flushes."
;; TODO jump-to-definition using import + index + heuristics
+(defvar-local haskell-tng-hsinspect-as
+ ;; TODO populate with even more than this
+ '(("Data.List" . "L")
+ ("Data.List.NonEmpty" . "NE")
+ ("Data.ByteString" . "BS")
+ ("Data.ByteString.Lazy" . "LBS"))
+ "An alist of (MODULE . NAME) to use for qualified imports.")
+
;;;###autoload
(defun haskell-tng-import-symbol-at-point (&optional alt)
"Import the symbol at point by querying the user to select from a menu.
@@ -72,8 +80,11 @@ Respects the `C-u' cache invalidation convention."
(module (alist-get 'module hit)))
;; TODO add parens around operators (or should that be in the
utility?)
(if (eq '- alt)
- ;; TODO guess the name, e.g. find the camel cases
- (let ((fqn (read-string (concat "import qualified " module " as
"))))
+ (let ((fqn (or
+ (alist-get module haskell-tng-hsinspect-as nil nil
'equal)
+ (read-string
+ (concat "import qualified " module " as ")
+ (car (last (split-string module (regexp-quote
"."))))))))
(haskell-tng--import-symbol module fqn)
(save-excursion
(unless (looking-at (regexp-quote sym))
- [nongnu] elpa/haskell-tng-mode e245a93 296/385: allow opt-out of local history, (continued)
- [nongnu] elpa/haskell-tng-mode e245a93 296/385: allow opt-out of local history, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 411268e 310/385: improve hsinspect error messages, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 766480d 290/385: fast-tags should be project specific, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode efd8093 299/385: silent formatter errors, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 26c6828 291/385: fqn imports, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 4480bb4 319/385: bump hsinspect/ghcflags versions, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 99287ef 316/385: stack projectile defaults, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode dbb2b7a 350/385: block / return-from instead of catch / throw, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode d611f0b 322/385: thots, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a717a50 331/385: allow workflow with qualified imports as default, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 70e649b 330/385: import qualified is even smarter,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode 5a064fd 328/385: hypen prefix asks to qualify the import, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode c42b5c5 338/385: use url-copy-path instead of shelling out, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 8405852 351/385: document bugs and ideas, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f429326 327/385: thots, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 8bb3c34 363/385: the in-memory cache doesn't have to cache nil, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f5977b6 339/385: bugfix for source downloading, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 9359c7b 349/385: cl-loop, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f5d76fc 348/385: tidy docs, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3b37524 360/385: bugfix for qualified imports when the cache was bad, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode fe2b164 372/385: fix the build, ELPA Syncer, 2021/10/06