What is the current situation for using Vim as IDE for Haskell on Archlinux?
Asked Answered
S

3

2

My target, if doable, is to have command completion for Haskell in work in Vim, via YouCompleteMe. In this respect, as you can see in the following, I haven't found a consesus yet about how to get it to work.

The latest comments on a relevant issue on YouCompleteMe are not that old, therefore I installed haskell-ide-engine from the AUR (the repo on GitHub is here.

However, since it was taking so long (it took 110 minutes!) I checked the PKGBUILD file just to discover this:

# ...
# Supported are '8.4.2' '8.4.3' '8.4.4' '8.6.4' '8.6.5' '8.8.1' '8.8.2' '8.8.3'
# activated by default are the ones also used in a stackage snapshot. Removing
# versions you do not use will greatly reduce the compilation time of this
# package
_enabled_ghc_versions=('8.4.4' '8.6.4' '8.6.5' '8.8.2' '8.8.3')
# ...

Fair enough, my bad. So I searched for help on the #haskell IRC channel, and one user made this comment:

and then you find out that hardly anybody uses haskell-ide-engine anymore but haskell-language-server. and also that ghcup can install the prebuild binaries for you

a comment from another user was

the haskell situation on Arch is not optimal, to say the least

an yet another comment (from Fendor, his answer is already below) was

HIE is not actively developed anymore. Haskell Language Server is the successor. I would recommend Haskell Language Server

which seems not in line with what you can read on YouCompleteMe issue tracker.

So what is the situation at the moment?

Silky answered 27/9, 2020 at 10:1 Comment(0)
S
0

Setting up Haskell via installing ghcup and then installing all the rest (ghc, cabal, ...) via ghcup, as suggested in this answer, improves by far the experience with Vim and YCM. (Oh, and YCM has to be up to date, clearly.)

Silky answered 10/1, 2021 at 12:16 Comment(0)
M
6

Haskell IDE Engine and Haskell Language Server developer here.

It is true, Haskell IDE Engine is not actively being developed anymore. The teams of ghcide and Haskell IDE Engine have merged their efforts and created Haskell Language Server (based on ghcide as the main driver). Thus, Haskell Language Server is currently the focus of development and we recommend you prefer it over Haskell IDE Engine, as it is quicker and more stable. It also has a bunch of new features and will soon reach feature-parity with Haskell IDE Engine.

Haskell Language Server can be installed via ghcup, and the VSCode plugin Haskell can install the binaries automatically as well.

The blog post hopefully gives a better overview of the situation.

Markos answered 27/9, 2020 at 10:10 Comment(0)
M
2

Based on this, you should be able to make it work with

  let g:ycm_language_server = [
    \   {
    \     'name': 'haskell-language-server',
    \     'cmdline': [ 'haskell-language-server-wrapper', '--lsp' ],
    \     'filetypes': [ 'haskell', 'lhaskell' ],
    \     'project_root_files': [ 'stack.yaml', 'cabal.project', 'package.yaml', 'hie.yaml' ],
    \   },
    \ ]
Mazza answered 27/9, 2020 at 10:20 Comment(1)
puremourning's suggestion is great as usual. I got a little confused until I realized that g:ycm_language_server is is of course a list of dictionaries. let g:ycm_language_server = [] and let g:ycm_language_server += [...] in my .vimrc is the way I do it.Splinter
S
0

Setting up Haskell via installing ghcup and then installing all the rest (ghc, cabal, ...) via ghcup, as suggested in this answer, improves by far the experience with Vim and YCM. (Oh, and YCM has to be up to date, clearly.)

Silky answered 10/1, 2021 at 12:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.