-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
No syntax highlighting with gleam-mode #10
Comments
@gleam-lang/emacs-team Any ideas? |
Sorry for the delay on this! @vbmithr Sadly getting this setup can be a bit of a pain. My first guess would be that the tree-sitter grammar was not compiled. You can check this by looking in the Some reasons why that may have failed:
For whatever it's worth, a future revision will download a compiled asset instead of trying compile it on the host machine. The strength of the current approach is that it works anywhere a C compiler is available, whereas the downloading approach means that I'll have to maintain a repository of compiled assets for different OSes and architectures. |
|
Also, highighting works with tree-sitter cmdline program. |
I have the same issue too, I have the |
I have been able to replicate this issue in a bare-bones config, though I have syntax highlighting with the config I use daily. I'll be digging into this today to see if I can determine what setting I usually have enabled that causes syntax highlighting to work. |
Figured I'd post an update on debugging since it's taken awhile:
|
I figured out what part of my config was causing syntax highlighting to work, and it's a doozy: I honestly have no idea why syntax highlighting would be predicated on |
wow!, that infact does it, thanks a lot, that's some weird stuff though, but it's great, finally, I get to see some gleam on its glory 🙂. Thanks a lot @J3RN for looking into this. |
I can confirm it works with whitespace-mode indeed. |
I feel dumb for not being able to figure this out, but how do I compile the grammar? I've checked and I have a C compiler. ( |
@quarkw Are you using an M1/M2 mac? I only have access to an older Intel mac at the moment, but I can try to get ahold of an M1/M2 if that's the case. |
Ah yes, I’m on an M1 Mac. Usually I mention that in bug reports but forgot this time. |
Similar situation here, and it was a slight pain to fix it (and fair warning: I did it in the hackiest way possible). Here's a step-by-step in case someone else can benefit.
After this, I just restart Emacs (or just revert the buffer), and I have all the goodies from |
Seeing this too, I have Edit: Somehow |
Just in case this helps Doom users out there, I was also having some troubles getting the syntax highlighting to work correctly, so I hacked my way through it. After adding these 2 entries: ;; Gleam-lang support
(package! gleam-mode :recipe
(:host github
:repo "gleam-lang/gleam-mode"
:files ("gleam-mode.el")))
(package! gleam-ts-mode :recipe
(:host github
:repo "gleam-lang/gleam-mode"
:files ("gleam-ts-mode.el"))) I ran the usual
I could repro that issue easily from a Elisp REPL: (gleam-mode--compile-grammar)
*** Eval error *** Setting current directory: No such file or directory, /home/vv/.config/emacs/.local/straight/build-29.4/gleam-mode/tree-sitter-gleam/ However, after looking in $ cd ~/.config/emacs/.local/straight
$ find . -type d -name 'tree-sitter-gleam'
./repos/gleam-mode/.git/modules/tree-sitter-gleam
./repos/gleam-mode/tree-sitter-gleam So gleam-mode was looking in but the source code repo was actually installed in So I just ran: $ cd ~/.config/emacs/.local/straight/build-29.4/gleam-mode
$ ln -s ../../repos/gleam-mode/tree-sitter-gleam . and then things started to work fine! |
I have just installed gleam-mode followed the instruction, and it loads fine
(gleam tree-sitter company)
when I open a.gleam
file but there is no syntax highlighting. Not sure how to fix this nor to give more debug info.The text was updated successfully, but these errors were encountered: