emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/haskell-tng-mode 1e3c465 329/385: import types and data co


From: ELPA Syncer
Subject: [nongnu] elpa/haskell-tng-mode 1e3c465 329/385: import types and data constructors
Date: Tue, 5 Oct 2021 23:59:58 -0400 (EDT)

branch: elpa/haskell-tng-mode
commit 1e3c4650bbe8d0385da8ce80deee8f01227dc2e0
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>

    import types and data constructors
---
 haskell-tng-hsinspect.el | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/haskell-tng-hsinspect.el b/haskell-tng-hsinspect.el
index 19e2f72..0616943 100644
--- a/haskell-tng-hsinspect.el
+++ b/haskell-tng-hsinspect.el
@@ -83,10 +83,24 @@ Respects the `C-u' cache invalidation convention."
                      'no-error))
                   (insert fqn ".")))
             (pcase (alist-get 'class hit)
-              ('tycon (haskell-tng--import-symbol module nil (alist-get 'type 
hit)))
-              ;; FIXME con
+              ('tycon
+               (haskell-tng--import-symbol
+                module nil
+                (haskell-tng--hsinspect-return-type (alist-get 'type hit))))
+              ('con
+               (haskell-tng--import-symbol
+                module nil
+                (concat (haskell-tng--hsinspect-return-type (alist-get 'type 
hit)) "(..)")))
               (_ (haskell-tng--import-symbol module nil (alist-get 'name 
hit))))))))))
 
+(defun haskell-tng--hsinspect-return-type (type)
+  (car
+   (split-string
+    (car
+     (last
+      (split-string
+       type (rx "->" (* space))))))))
+
 ;; TODO expand out pattern matches (function defns and cases) based on the cons
 ;; for a type obtained from the Index.
 
@@ -121,7 +135,6 @@ When using hsinspect-0.0.8, also: class, export, flavour."
         (lambda (module-entry)
           (let ((module (alist-get 'module module-entry))
                 (ids (alist-get 'ids module-entry)))
-            ;;(message "MODULE= %s" module)
             (seq-mapcat
              (lambda (entry)
                (let ((name (alist-get 'name entry))
@@ -130,7 +143,6 @@ When using hsinspect-0.0.8, also: class, export, flavour."
                      (export (alist-get 'export entry))
                      (flavour (alist-get 'flavour entry)))
                  (when (or (equal name sym) (equal type sym))
-                   ;; TODO add the hsinspect-0.0.8 bits
                    `(((unitid . ,unitid)
                       (module . ,module)
                       (name . ,name)
@@ -209,7 +221,7 @@ When using hsinspect-0.0.8, also: class, export, flavour."
   "Finds and checks the hsinspect binary for the current buffer.
 
 This is uncached, prefer `haskell-tng--hsinspect-exe'."
-  (let ((supported '("0.0.7" "0.0.8"))
+  (let ((supported '("0.0.7" "0.0.8" "0.0.9"))
         (bin
          (car
           (last



reply via email to

[Prev in Thread] Current Thread [Next in Thread]