[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode 38ed1b7 326/385: import types
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode 38ed1b7 326/385: import types |
Date: |
Tue, 5 Oct 2021 23:59:57 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit 38ed1b73a5bdcb3c0ecd354e9bc5a3c766c83221
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
import types
---
haskell-tng-hsinspect.el | 8 +++++---
test/haskell-tng-hsinspect-test.el | 14 +++++++++++++-
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/haskell-tng-hsinspect.el b/haskell-tng-hsinspect.el
index f2fb3c0..2eda5b7 100644
--- a/haskell-tng-hsinspect.el
+++ b/haskell-tng-hsinspect.el
@@ -59,13 +59,15 @@ A prefix argument ensures that caches are flushes."
(if (string-match (rx bos (group (+ anything)) "." (group (+ (not (any
".")))) eos) sym)
(let* ((fqn (match-string 1 sym))
(sym (match-string 2 sym)))
- ;; FIXME types and data constructors
(when-let (hit (haskell-tng--hsinspect-import-popup index sym))
(haskell-tng--import-symbol (alist-get 'module hit) fqn)))
(when-let (hit (haskell-tng--hsinspect-import-popup index sym))
;; TODO add parens around operators
;; TODO add the type around data constructors (requires hsinspect
changes)
- (haskell-tng--import-symbol (alist-get 'module hit) nil (alist-get
'name hit))))))
+ (pcase (alist-get 'class hit)
+ ('tycon (haskell-tng--import-symbol (alist-get 'module hit) nil
(alist-get 'type hit)))
+ ;; FIXME con
+ (_ (haskell-tng--import-symbol (alist-get 'module hit) nil
(alist-get 'name hit))))))))
;; TODO expand out pattern matches (function defns and cases) based on the cons
;; for a type obtained from the Index.
@@ -109,7 +111,7 @@ When using hsinspect-0.0.8, also: class, export, flavour."
(class (alist-get 'class entry))
(export (alist-get 'export entry))
(flavour (alist-get 'flavour entry)))
- (when (equal name sym)
+ (when (or (equal name sym) (equal type sym))
;; TODO add the hsinspect-0.0.8 bits
`(((unitid . ,unitid)
(module . ,module)
diff --git a/test/haskell-tng-hsinspect-test.el
b/test/haskell-tng-hsinspect-test.el
index 37aca5a..4cf4632 100644
--- a/test/haskell-tng-hsinspect-test.el
+++ b/test/haskell-tng-hsinspect-test.el
@@ -77,8 +77,20 @@
(export)
(flavour)))))
- ;; TODO type search
+ ;; type / typeclass search
+ (should
+ (equal
+ (haskell-tng--hsinspect-import-candidates index "Contravariant")
+ '(((unitid . "base")
+ (module . "Data.Functor.Contravariant")
+ (name)
+ (type . "Contravariant")
+ (class . tycon)
+ (export)
+ (flavour . "class")))))
+
;; TODO constructor search
+ ;;(message "%S" (haskell-tng--hsinspect-import-candidates index
"Contravariant"))
))
;; TODO tests for 0.0.7 data
- [nongnu] elpa/haskell-tng-mode fd06b8f 264/385: move haskell-tng-newline into the -extra package, (continued)
- [nongnu] elpa/haskell-tng-mode fd06b8f 264/385: move haskell-tng-newline into the -extra package, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 8ff79e7 247/385: allow parallelism, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 4e2cf00 284/385: simplify the installation of hsinspect, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 1107e63 274/385: bump hsinspect, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 8475578 311/385: typos, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f8d2b91 295/385: miss some false positive ghc errors, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode fca5c6e 315/385: better docs and cabal-install support, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode b2e19c9 318/385: document next steps, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode c39d0f4 321/385: some hsinspect tests, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 5fe4cb1 359/385: cleanup test includes, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 38ed1b7 326/385: import types,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode 6d4e150 353/385: upgrade hsinspect version, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 4f84cde 347/385: improve importing qualified symbols, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 86d9020 373/385: one hsinspect-lsp can be shared by all projects, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a98dda0 380/385: emacs 27 macro deprecations, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode aeaf363 220/385: bugfinding, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 9a7534e 262/385: bugfixes for abbrev, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 356f27b 278/385: more stable hsinspect calls, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode be39ede 258/385: if/then/else indentation test, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode be4cc15 238/385: better hsinspect command, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 73ba85d 270/385: nicer indentation for single parameter type sigs, ELPA Syncer, 2021/10/06