Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Haskell syntax highlighting? #1384

Closed
414owen opened this issue Dec 26, 2021 · 2 comments · Fixed by #1417
Closed

Haskell syntax highlighting? #1384

414owen opened this issue Dec 26, 2021 · 2 comments · Fixed by #1417
Labels
A-packaging Area: Packaging and bundling C-enhancement Category: Improvements upstream

Comments

@414owen
Copy link
Contributor

414owen commented Dec 26, 2021

Adding this to languages.toml gets LSP working:

[[language]]
name = "haskell"
scope = "source.haskell"
injection-regex = "haskell"
file-types = ["hs"]
roots = []
auto-format = false
comment-token = "--"
language-server = { command = "haskell-language-server-wrapper", args = ["--lsp"] }
indent = { tab-width = 2, unit = "  " }

But there's no syntax highlighting. I'm not sure why, tree-sitter-haskell is a submodule of the repo, and there seem to be queries under runtime/queries.

I'm on helix 0.5.0 from nixpkgs,but I've also tried master, although when I build master I don't even get rust syntax highlighting.

Any pointers?

@414owen 414owen added the C-enhancement Category: Improvements label Dec 26, 2021
@Triton171
Copy link
Contributor

There is currently an issue preventing tree-sitter-haskell from compiling on some systems. The reason is that it uses C++ 14 features but some OSs still use C++ 11 by default. Because of this, the haskell treesitter grammar was disabled in helix.
As far as I can see, this can usually be fixed by using a different C++ compiler or explicitly specifying the version. Also, I believe there was some talk on Matrix about re-enabling it even if it breaks compilation with older C++ compilers. Maybe @archseer knows when we should expect this to be re-enabled?

@414owen
Copy link
Contributor Author

414owen commented Dec 26, 2021

Hmm, the nix expression uses its own toolchain, so it might not have this problem.

414owen added a commit to 414owen/nixpkgs that referenced this issue Dec 26, 2021
Haskell syntax highlighting is disabled in `helix-editor` by default.
This is because of an issue compiling tree-sitter-haskell on M1 macs,
as its default compiler doesn't support c++14.
As we're using a nix-derived toolchain, we shouldn't be subject to
this problem.

See [this comment](helix-editor/helix#1384 (comment))
for more info.
@kirawi kirawi added A-packaging Area: Packaging and bundling upstream labels Dec 27, 2021
@archseer archseer linked a pull request Jan 4, 2022 that will close this issue
heyakyra pushed a commit to heyakyra/helix that referenced this issue Jan 22, 2022
After the changes to upgrade and reenable tree-sitter-haskell helix-editor#1417
for the purpose of enabling Haskell syntax highlighting helix-editor#1384, we
might as well take the final step.
heyakyra pushed a commit to heyakyra/helix that referenced this issue Jan 22, 2022
After the changes to upgrade and reenable tree-sitter-haskell helix-editor#1417
for the purpose of enabling Haskell syntax highlighting helix-editor#1384, we
might as well take the final step.
archseer pushed a commit that referenced this issue Jan 23, 2022
…#1556)

After the changes to upgrade and reenable tree-sitter-haskell #1417
for the purpose of enabling Haskell syntax highlighting #1384, we
might as well take the final step.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-packaging Area: Packaging and bundling C-enhancement Category: Improvements upstream
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants