Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Trouble getting syntax highlighting #1748

Closed
frisbro303 opened this issue Mar 4, 2022 · 5 comments
Closed

Trouble getting syntax highlighting #1748

frisbro303 opened this issue Mar 4, 2022 · 5 comments

Comments

@frisbro303
Copy link

frisbro303 commented Mar 4, 2022

Description
When opening a haskell file there is no syntax highlighting and the haskell language server does not seem to run.
HLS works fine when running haskell-language-server-wrapper from terminal.
In my config i have display-messages = true.
It also indents with 4 spaces instead of the 2 spaces specified in the languages.toml, which might indicate there is something wrong with language.toml for haskell?

This issue only happens when opening .hs files. When opening other file formats, it works flawlessly.
I tested with python or rust files.

Can anyone help me?

@the-mikedavis
Copy link
Member

Which version of helix are you running? Haskell was re-enabled in #1520 which was merged after the last release (0.6.0). You'll need to build from source in order to use haskell syntax highlighting (or await the next release)

@frisbro303
Copy link
Author

Yes you were completely right. After installing from source it works perfectly. Thanks for the help!

@Max0nyshchenko
Copy link

Max0nyshchenko commented Apr 22, 2022

@wush303 Can you provide some example with helix LSP, I've installed helix lsp by ghcup, added language to languages.toml but cannot get it to work anyway, still have "Language server not active for current buffer" issue.

Here is my languages.toml

[[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 = " " }

HLS working from terminal. But cannot get it to work with .hs files

hx --health shows that HLS installed

@frisbro303
Copy link
Author

frisbro303 commented Apr 23, 2022

@Max0nyshchenko I didn't add anything to the languages.toml and relied on the default one.
I installed hls via ghcup as you. What ultimately ended up fixing my issue was just building helix from source.

@Max0nyshchenko
Copy link

@wush303 Thx, deleting languages.toml did the thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants