zed
zed copied to clipboard
Haskell support
Would be great to have Haskell syntax support and LSP integration via haskell-language-server.
hls has auto formatting support via a couple of different plugins.
https://github.com/haskell/haskell-language-server https://haskell-language-server.readthedocs.io/
Update with tree-sitter link: https://github.com/tree-sitter/tree-sitter-haskell
Looking forward to this 👍
I was able to get basic syntax highlighting for Haskell, in case anyone is interested in running a dev build you can use this commit https://github.com/pseudomata/zed/commit/02ab16037c91a6d4883f91316ae7ed02b1bb3d69.
I'm not quite ready to open a PR because there's a few things that I'm not clear on but I plan on reading code for the other language integrations and add Haskell specific stuff in the indents.scm
, outline.scm
, and brackets.scm
files.
See screenshot showing syntax highlighting
The highlighting for imports and modules seems broken, so that's another thing I need to fix. See below.
If I have more time I'll look into adding the LSP adapter in Zed for Haskell as well :-)
If I have more time I'll look into adding the LSP adapter in Zed for Haskell as well :-)
@pseudomata I have a working (but fragile) implementation at https://github.com/leifu1128/zed/commit/1be3e7b99b5f0aa7ba7786a752c7dcd196dead5c, I copied your config.toml
to get it working temporarily, let me know if that's a problem.
That looks great @leifu1128! Maybe we can open a combined PR to add both the syntax highlighting and LSP once we have fixed any of the issues.
That looks great @leifu1128! Maybe we can open a combined PR to add both the syntax highlighting and LSP once we have fixed any of the issues.
Sounds good! Only thing I can't figure out is how to configure which directory the LSP runs in, since hls needs to run where hie.yml is.
Okay I think I've got the syntax highlighting in a good spot. I created a haskell-support
branch, and merged a PR for syntax support into that branch (see https://github.com/pseudomata/zed/pull/1). If you'd like to open a PR against that adding your LSP changes, we can have both our changes in one PR (if you prefer separate PRs that's fine too, I'm happy to do the work to make whatever work).
I opened a draft PR to merge the haskell-support
branch upstream: https://github.com/zed-industries/zed/pull/6786, once things are ready I'll mark it ready for review.
Regarding the directory: I'm not sure either! I can look into that a bit or see if we can get someone from Zed to take a look in the PR when we mark it ready for review (in the meanwhile, it should work with the implicit configuration?)
Hi there, I have a basic question. Once I have the LSP configured, how do I create and run the program? I am used to having a REPL within Doom Emacs and dont see the equivalent for Zed...
One possibility would be to use tasks and do something similar to https://github.com/zed-industries/zed/pull/10548/files#diff-555038673fd8f3dcee873862e12320197c756e5661ada52d90b94339c56f0266 does for bash: there's a way to spawn a bash task that runs the selection.
Presumably, Haskell and other repl-rich languages could define similar tasks in their plugins as a start.