emacs-lsp / lsp-haskell

lsp-mode :heart: haskell
https://emacs-lsp.github.io/lsp-haskell
GNU General Public License v3.0
236 stars 63 forks source link

Support for haskell-ts-mode #188

Open ScamChamp opened 2 months ago

ScamChamp commented 2 months ago

I had quick skim through code, and it seems like no feature from haskell mode is strictly required by lsp haskell that would be a big effort to change. https://codeberg.org/pranshu/haskell-ts-mode

michaelpj commented 2 months ago

Sure, I'd take a PR for this.

magthe commented 2 months ago

This would also address #181 .

ScamChamp commented 2 months ago

I did manage to find this: https://github.com/magthe/lsp-haskell/commit/2084ff1a313cb8a01020fb19fb86897546112c9e . Can you see any problems with it?

magthe commented 2 months ago

Well, it does replace all mentions of haskell-mode with haskell-ng-mode (my own attempt at a new mode for Haskell), so I'm guessing it won't work well with anything else.

I have since adjusted my change so that it

  1. removes the the requirement on haskell-mode, and
  2. adds mentions of haskell-ng-mode.

You can find it here. So far I've seen no problems with it.

I made a small addition on top of that, adding mentions of haskell-ts-mode as well, so you can more easily see if it'll work for you as well, @ScamChamp . https://github.com/magthe/lsp-haskell/commit/e9d0f8af5f33d07a4f74d25103e78bb9d0be0a44

ScamChamp commented 2 months ago

Thanks magthe, I adapted the code to make it work for haskell-ts-mode. I personally don't use lsp-haskell, but lack of lsp support is an issue for some people.

@michaelpj This patch adds support for haskell-ts-mode

magthe commented 2 months ago

Maybe it 's worth clarifying that I removed the requirement on haskell-mode, but left all the settings with it (putthing its modes in the various lists). I believe that'll keep lsp-haskell working with haskell-mode, but that needs verifying.

Then adding support for other Haskell modes is just a matter of adding them to the various list.

michaelpj commented 2 months ago

If someone can put up a PR and verify that it works with all three modes then I'm happy to merge it.