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

update tree-sitter grammars #1728

Closed

Conversation

the-mikedavis
Copy link
Member

@the-mikedavis the-mikedavis commented Mar 2, 2022

Many of the tree-sitter grammars have fallen out of date since they were added. This PR tries to bring things up to date.

This branch will probably outlive #1659, so instead of updating the submodule refs, I added the new revisions and remotes into the commit messages for now. I'll rebase eventually to either update the submodules or update languages.toml (if after #1659).

This PR is WIP while I carve through the existing grammars. It's not pressing to upgrade the grammars so I'll probably push to this every now and then as my time allows.

notable updates

  • tree-sitter-git-commit has a fix that makes it very fast on large verbose commits
  • tree-sitter-git-rebase was rewritten to be much less "jumpy" with the highlights during normal editing

for me TODO:

- remove the remaining git assumption in the grammar
- add "patch" to file types
- test more diff results

changes:

- renamed to `tree-sitter-diff` as the grammar can handle various
  diff formats
changes:

- typed fields within records which do not declare a default
  value are now correctly highlighted as record fields
- the EEP49 'maybe' form is now parsed
- fixes for highlights for 'begin' and 'after' tokens
news:

- tree-sitter-elixir now powers Elixir syntax highlighting on github.com
- GitHub now supports code-navigation for Elixir repos via
  tree-sitter-elixir

changes:

- modules now use the `@module` highlight, which was added upstream to
  tree-sitter
    - it seems appropriate to use `@namespace` to follow helix convention
- added nullary range operator (e.g. `Enum.to_list(..) == []`), a new syntax
  for elixir 1.14
- a fix for stab clause nodes mis-highlighting when the right hand side of
  the stab clause contained multiple simple expressions
changes:

* the grammar has been completely rewritten in a way that removes
  some of the "jumpiness" of the highlights
    * when changing a command (for example from 'pick' to 'drop'),
      highlighting would treat parts of the commit hash as a command
Note: we are not upgrading hashes because the more recent changes
to the grammar leave it in worse shape than it was. I am working on
fixing the new bugs, and we should be fine to upgrade once it's
improved.

changes:

- highlights for the "or" keyword
@the-mikedavis
Copy link
Member Author

There are too many grammars to update in one PR, will split out these existing updates into smaller focused PRs

@the-mikedavis the-mikedavis deleted the md-update-grammars branch March 29, 2022 21:06
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 this pull request may close these issues.

1 participant