Claude Code got the ability to work with LSPs directly just recently. That means Claude can get precise type information, find usages of symbols, and all the other great things we get from HLS.
I created a plugin to take advantage of this new functionality. Check it out at GitHub - m4dc4p/claude-hls (installation instructions are available there).
How does it work? Does the plugin start the HLS server on its own? Asking because I use Nix to manage my development environment, so whenever .cabal file gets updated, a restart of Nix shell is often necessary before restarting HLS.
As an aside, I’ve been using ghcid to provide quick feedback to Claude Code.
Claude code starts HLS but I don’t think it’s smart enough to restart it. As for nix, you have to have HLS on the path before starting claude so you’d also have to restart the nix shell yourself.
I use GHCId myself mostly. I think this plugin isn’t so great for compilation errors, but rather for precise types (“hover”) and export info (“document symbols”).
Hi, I’m curious whether there’s added benefits of such a thing when the AI tooling is already integrated into the editor (e.g. Roocode in vscode, which can automatically read the “Problems” panel, which is populated by HLS). Thanks for the info!