diff --git a/lsp-haskell.el b/lsp-haskell.el index 29703d3..d1e9e85 100644 --- a/lsp-haskell.el +++ b/lsp-haskell.el @@ -1,7 +1,7 @@ ;;; lsp-haskell.el --- Haskell support for lsp-mode ;; Version: 1.0 -;; Package-Requires: ((emacs "24.3") (lsp-mode "3.0") (haskell-mode "1.0")) +;; Package-Requires: ((emacs "26.1") (lsp-mode "3.0") (haskell-mode "1.0")) ;; Keywords: haskell ;; URL: https://github.com/emacs-lsp/lsp-haskell @@ -228,6 +228,17 @@ if projectile way fails" (user-error "Couldn't find cabal file, using: %s" dir) dir)))) +(defun lsp-haskell-execute-code-action-add-signature () + "Execute code action of add signature. +Add the type signature that GHC infers to the function located below the point." + (interactive) + (let ((action (seq-find + (lambda (e) (string-prefix-p "add signature" (lsp:code-action-title e))) + (lsp-code-actions-at-point)))) + (if action + (lsp-execute-code-action action) + (message "I can't find add signature action for this point")))) + ;; --------------------------------------------------------------------- ;; Starting the server and registration with lsp-mode