File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -495,6 +495,26 @@ Note that this must be set to true in order to get completion of pragmas."
495495; ; ---------------------------------------------------------------------
496496; ; Starting the server and registration with lsp-mode
497497
498+ (cl-defmethod lsp-clients-extract-signature-on-hover (contents (_server-id (eql lsp-haskell)))
499+ " Display the type signature of the function under point."
500+ (let* ((groups (--filter (s-equals? " ```haskell" (car it))
501+ (-partition-by #'s-blank?
502+ (->> (lsp-get contents :value )
503+ s-trim
504+ s-lines))))
505+ (type-sig-group
506+ (car (--filter (--any? (s-contains? (symbol-name (symbol-at-point ))
507+ it)
508+ it)
509+ groups))))
510+ (lsp--render-string
511+ (->> (or type-sig-group (car groups))
512+ (-drop 1 ) ; ``` LANG
513+ (-drop-last 1 ) ; ```
514+ (-map #'s-trim )
515+ (s-join " " ))
516+ " haskell" )))
517+
498518(defun lsp-haskell--server-command ()
499519 " Command and arguments for launching the inferior language server process.
500520These are assembled from the customizable variables `lsp-haskell-server-path'
You can’t perform that action at this time.
0 commit comments