diff --git a/init.el b/init.el index b53a61bc..77c2e7e8 100644 --- a/init.el +++ b/init.el @@ -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