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

Strings and variable names are not highlighted in scala-ts-mode compared to scala-mode #12

Closed
Flowdalic opened this issue Feb 1, 2024 · 8 comments · Fixed by #16
Closed

Comments

@Flowdalic
Copy link

First of all, thanks of working on scala-ts-mode. It has made working with brace-less Scala 3 code in Emacs very comfortable.

However, I found that, when using scala-ts-mode, Emacs does not highlight strings and variable names.

Compare scala-mode

Screenshot from 2024-02-01 13-38-44

with scala-ts-mode

Screenshot from 2024-02-01 13-39-24

Is there maybe a configuration option I am missing?

@KaranAhlawat
Copy link
Owner

KaranAhlawat commented Feb 1, 2024

From just the screenshots, it looks like the treesit-font-lock-level variable is not set sufficiently. This variable by default is 3, which does not include variables, literals (strings included) etc.

So, in your configuration, can you please try setting treesit-font-lock-level to 4

(setq treesit-font-lock-level 4)

and then re-opening the Scala file?

@kschwarz1116
Copy link

Chiming in here to say that I was experiencing the same thing and that change worked for me. Thanks for the pointer! Might be nice to add that to the README.

@SethTisue
Copy link
Contributor

oh wow, amazing, thank you!!! I had been meaning to come ask about this

@SethTisue
Copy link
Contributor

SethTisue commented Feb 1, 2024

putting the word out: https://fosstodon.org/@SethTisue/111858506965158147

I also put the word out in a few relevant places on Discord

@KaranAhlawat
Copy link
Owner

@Flowdalic Can we mark this issue as resolved then?

@KaranAhlawat KaranAhlawat pinned this issue Feb 2, 2024
@SethTisue
Copy link
Contributor

SethTisue commented Feb 2, 2024

before & after images

Screenshot 2024-02-02 at 10 44 50 AM Screenshot 2024-02-02 at 10 45 41 AM

@Flowdalic
Copy link
Author

Actually, I am re-opening this, until this is documented in the README. I may submit a PR for that.

@Flowdalic Flowdalic reopened this Feb 5, 2024
SethTisue added a commit to SethTisue/scala-ts-mode that referenced this issue Mar 15, 2024
@SethTisue
Copy link
Contributor

@Flowdalic I've submitted my own PR: #16

@KaranAhlawat KaranAhlawat unpinned this issue Mar 16, 2024
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

Successfully merging a pull request may close this issue.

4 participants