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

elm: Improve syntax highlighting and bracket handling #22293

Closed
wants to merge 3 commits into from

Conversation

edkv
Copy link

@edkv edkv commented Dec 20, 2024

Fixes various issues with current syntax highlighting for Elm: modules and patterns are not highlighted, number literals are treated as constants etc.

New highlights are mostly copied from nvim-treesitter with some modifications and removals of things that are not supported by Zed. In particular, @modules are highlighted as @title, similarly to how it's done in Zed's Haskell extension.

Also added brackets.scm.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Dec 20, 2024
@maxdeviant maxdeviant changed the title Improve Elm syntax highlighting and bracket handling elm: Improve syntax highlighting and bracket handling Dec 20, 2024
@edkv
Copy link
Author

edkv commented Dec 22, 2024

I also changed the default tab_size to 4 as that's how most of Elm projects are formatted. elm-format uses 4 spaces and it's not configurable.

@ConradIrwin
Copy link
Member

@edkv The elm support has been moved to https://github.com/zed-extensions/elm. That said, these changes seem reasonable to me, so a PR there would be a good idea!

cc @maxdeviant

@edkv
Copy link
Author

edkv commented Jan 9, 2025

@ConradIrwin Okay, created a PR in the new repo.

maxbrunsfeld pushed a commit to zed-extensions/elm that referenced this pull request Jan 10, 2025
Moved from zed-industries/zed#22293.

- Fixes various issues with current syntax highlighting: modules and
patterns are not highlighted, number literals are treated as constants
etc. New highlights are mostly copied from
[nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/elm/highlights.scm)
with some modifications and removals of things that are not supported by
Zed. In particular, `@modules` are highlighted as `@title`, similarly to
how it's done in Zed's Haskell extension.
- Added `brackets.scm`.
- Changed the default tab_size to 4 as that's how most of Elm projects
are formatted and what elm-format uses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants