Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language server returns empty array when invoking textDocument/completion #71

Closed
patrickt opened this issue Apr 21, 2020 · 1 comment · Fixed by #107
Closed

Language server returns empty array when invoking textDocument/completion #71

patrickt opened this issue Apr 21, 2020 · 1 comment · Fixed by #107
Labels
performance Issues about memory consumption, responsiveness, etc.

Comments

@patrickt
Copy link

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.

@alanz
Copy link
Collaborator

alanz commented Apr 25, 2020

FYI, haskell-language-server is still very early stage, and performance of the various operations is one of the areas that needs attention, and is being worked on.

@jneira jneira added editor: emacs performance Issues about memory consumption, responsiveness, etc. labels May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Issues about memory consumption, responsiveness, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants