Skip to content

Commit

Permalink
fixed: lsp-haskell-execute-code-action-add-signature
Browse files Browse the repository at this point in the history
[added: lsp-haskell-execute-code-action-add-signature by ncaq · Pull Request #129 · emacs-lsp/lsp-haskell](emacs-lsp/lsp-haskell#129)
  • Loading branch information
ncaq committed Jun 26, 2021
1 parent bb9fce1 commit c5967a8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -1104,12 +1104,15 @@ python, ruby, rustはスネークケースを含むのでruby(pythonはrubyのal
:defun lsp-code-actions-at-point
:init
(defun lsp-haskell-execute-code-action-add-signature ()
"Execute code action of 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" (gethash "title" e))) (lsp-code-actions-at-point))))
(if (hash-table-p action)
(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"))))
(message "I can't find add signature action for this point"))))
:bind (:haskell-mode-map
("C-c C-o" . lsp-haskell-execute-code-action-add-signature)))
(leaf haskell-customize
Expand Down

0 comments on commit c5967a8

Please sign in to comment.