Skip to content

Commit 5eb8ff5

Browse files
committed
Don't create new haskell process in eldoc
Use haskell-session-maybe and haskell-session-process instead of haskell-process.
1 parent 954f183 commit 5eb8ff5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

haskell-doc.el

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,8 +1622,7 @@ will be returned directly."
16221622
sym (lambda (response)
16231623
(setq haskell-doc-current-info--interaction-last
16241624
(cons 'async response))
1625-
(eldoc-print-current-symbol-info)))
1626-
'async)))))
1625+
(eldoc-print-current-symbol-info))))))))
16271626

16281627
(defun haskell-process-get-type (expr-string &optional callback sync)
16291628
"Asynchronously get the type of a given string.
@@ -1633,7 +1632,8 @@ EXPR-STRING should be an expression passed to :type in ghci.
16331632
CALLBACK will be called with a formatted type string.
16341633
16351634
If SYNC is non-nil, make the call synchronously instead."
1636-
(let ((process (haskell-process))
1635+
(let ((process (and (haskell-session-maybe)
1636+
(haskell-session-process (haskell-session-maybe))))
16371637
;; Avoid passing bad strings to ghci
16381638
(expr-okay (not (string-match-p "\n" expr-string)))
16391639
(ghci-command (concat ":type " expr-string))
@@ -1666,7 +1666,8 @@ If SYNC is non-nil, make the call synchronously instead."
16661666
process
16671667
(make-haskell-command
16681668
:go (lambda (_) (haskell-process-send-string process ghci-command))
1669-
:complete complete-func))))))
1669+
:complete complete-func))
1670+
'async))))
16701671

16711672
(defun haskell-doc-sym-doc (sym)
16721673
"Show the type of the function near point.

0 commit comments

Comments
 (0)