Description
Hi there 👋
I’m using Emacs 27 and lsp-haskell
for Haskell dev. Though many of haskell-language-server
’s features work great, including in-buffer syntax checking and code actions, it runs into problems when attempting to invoke company-complete
. As soon as I do so, Emacs goes unresponsive (despite these requests allegedly running asynchronously), only to return no results, displaying lsp: []
in the buffer. Examining lsp-log
shows that textDocument/completion
requests are returning no information:
[Trace - 01:35:22 PM] Received response 'textDocument/completion - (89)' in 678ms.
Result: null
In contrast, using hie-wrapper
instead of haskell-language-server-wrapper
returns all relevant completions.
I’m using GHC 8.8.3, and haskell-language-server
off of the master branch.
I had a tough time deciding where to file this bug - haskell-lsp
, company-lsp
, or haskell-language-server
. I settled on this repository because haskell-ide-engine
handles this case correctly.
Here is the hie.yaml I’m using in this repository:
cradle:
cabal:
- path: "./src"
component: "lib:tactics"
- path: "./test"
component: "tactics:test:tactics-test”
And here is the relevant section of my Emacs configuration, in case I’m doing something obviously wrong here:
(use-package lsp-mode
:commands (lsp lsp-execute-code-action)
:hook ((go-mode . lsp-deferred)
(lsp-mode . lsp-enable-which-key-integration)
(lsp-mode . lsp-diagnostics-modeline-mode))
:bind ("C-c C-c" . #'lsp-execute-code-action)
:custom
(lsp-print-performance t)
(lsp-log-io t)
(lsp-diagnostics-modeline-scope :project))
(use-package lsp-ui
:custom (lsp-ui-doc-delay 0.75)
:after lsp-mode)
(use-package lsp-ivy
:after (ivy lsp-mode))
(use-package company-lsp
:custom (company-lsp-enable-snippet t)
:after (company lsp-mode))
(use-package haskell-mode
:bind (("C-c a c" . haskell-cabal-visit-file)))
(use-package lsp-haskell
:hook (haskell-mode . lsp)
:custom (lsp-haskell-process-path-hie "hie-wrapper")
)
Please let me know if there’s any more information I can provide, and thank you for your work on this project: it’s impossible to overstate the impact that powerful, reliable editor integration will have on all who learn and use Haskell.