Tuesday, September 22, 2020

Don't use Ghcide anymore (directly)

Summary: I recommend people use the Haskell Language Server IDE.

Just over a year ago, I recommended people looking for a Haskell IDE experience to give Ghcide a try. A few months later the Haskell IDE Engine and Ghcide teams agreed to work together on Haskell Language Server - using Ghcide as a library as the core, with the plugins/installer experience from the Haskell IDE Engine (by that stage we were already both using the same Haskell setup and LSP libraries). At that time Alan Zimmerman said to me:

"We will have succeeded in joining forces when you (Neil) start recommending people use Haskell Language Server."

I'm delighted to say that time has come. For the last few months I've been both using and recommending Haskell Language Server for all Haskell IDE users. Moreover, for VS Code users, I recommend simply installing the Haskell extension which downloads the right version automatically. The experience of Haskell Language Server is better than either the Haskell IDE Engine or Ghcide individually, and is improving rapidly. The teams have merged seamlessly, and can now be regarded as a single team, producing one IDE experience.

There's still lots of work to be done. And for those people developing the IDE, Ghcide remains an important part of the puzzle - but it's now a developer-orientated piece rather than a user-orientated piece. Users should follow the README at Haskell Language Server and report bugs against Haskell Language Server.

4 comments:

Joseph Lucas said...

I have been using ghcide for a while now and I really like it.
Following your instructions I disabled ghcide and installed the "Haskell" extension of VScode that adds language support for Haskell, powered by the Haskell Language Server. The new extension works well !
I still have a small issue. While trying to evaluate expressions in comments (">>> expression") I get the error :

"command line>: ld-linux-x86-64.so.2: cannot open shared object file: No such file or directory"

I use NixOS, thus the error might be due to a static link at a wrong path on my machine. What should I do to fix that ?

Joseph Lucas said...

I installed the haskell-language-server package from nixpkgs and everything went fine, the vscode extension picked it.

Janus Troelsen said...

now ghcup supports hls, so it is really easy to try out

Neil Mitchell said...

Joseph: If you are having issues still you probably want to ask on https://github.com/haskell/haskell-language-server/issues. I'm not familiar with Nix.

Janus: Yep! It just keeps getting easier. I wasn't aware of that feature when I wrote this post, but things keep improving.