Skip to content

Investigate existing tree-sitter grammars #207416

Closed

Description

@alexr00

Currently, we use textmate grammars for syntax highlighting. We get these grammars from other OSS projects, which let's us avoid becoming experts in every programming language that we support. Many of these OSS projects are no longer supported though, and we've had to take ownership of at least one of the grammars (css).

Tree-sitter appears to be popular right now for syntax highlight grammars, but before we consider adding support for tree-sitter grammars in VS Code, we should understand what grammars already have good tree-sitter support. In particular, the following textmate grammars have reached a dead-end and are particularly important to have support for in whatever syntax highlighting solution we support next:

Key:
✅ repo is very active
⚠️ limited repo activity
❌ no repo or no activity

  • HTML ✅
  • YAML ⚠️
  • XML ✅, but unclear how much use the grammar gets
  • Groovy ✅, but unclear how much use the grammar gets
  • Ini ⚠️
  • SCSS ❌
  • Perl ✅
All other textmate languages

Summary:

10 will be more supported
5 will be less supported
5 will be equivalently unsupported

Language Textmate maintained? Tree-sitter maintained?
bat ❌ ❌
clojure ❌ ✅ https://github.com/sogaiu/tree-sitter-clojure
coffeescript ❌ ❌
cpp ❌ license changed ✅ https://github.com/tree-sitter/tree-sitter-cpp
csharp ✅ ✅ https://github.com/tree-sitter/tree-sitter-c-sharp
css ⚠️ we maintain ✅ https://github.com/tree-sitter/tree-sitter-css
dart ✅ ✅ https://github.com/UserNobody14/tree-sitter-dart
diff ❌ ✅ https://github.com/the-mikedavis/tree-sitter-diff
docker ❌ ✅ https://github.com/camdencheek/tree-sitter-dockerfile
fsharp ✅ ⚠️ https://github.com/Nsidorenco/tree-sitter-fsharp
git ✅ ✅ https://github.com/gbprod/tree-sitter-gitcommit
go ✅ ✅ https://github.com/tree-sitter/tree-sitter-go
handlebars ⚠️ unclear if maintained ❌
hlsl ⚠️ unmaintained, 0 issues ✅ https://github.com/tree-sitter-grammars/tree-sitter-hlsl
java ✅ ✅ https://github.com/tree-sitter/tree-sitter-java
javascript ✅ ✅ https://github.com/tree-sitter/tree-sitter-javascript
json ✅ ✅ https://github.com/tree-sitter/tree-sitter-json
julia ✅ ✅ https://github.com/tree-sitter/tree-sitter-julia
latex ✅ ✅ https://github.com/latex-lsp/tree-sitter-latex
less ✅ ❌
log ✅ ❌
lua ✅ ✅ https://github.com/tree-sitter-grammars/tree-sitter-lua
make ⚠️ ⚠️ https://github.com/tree-sitter-grammars/tree-sitter-make
markdown ✅ ✅ https://github.com/tree-sitter-grammars/tree-sitter-markdown
objective c ⚠️ ⚠️ https://github.com/tree-sitter-grammars/tree-sitter-objc
perl ❌ ✅ https://github.com/tree-sitter-perl/tree-sitter-perl
php ⚠️ ✅ https://github.com/tree-sitter/tree-sitter-php
powershell ❌ ❌
pug ❌ ✅ https://github.com/zealot128/tree-sitter-pug
python ❌ ✅ https://github.com/tree-sitter/tree-sitter-python
razor ✅ ❌
ruby ❌ ✅ https://github.com/tree-sitter/tree-sitter-ruby
rust ✅ ✅ https://github.com/tree-sitter/tree-sitter-rust
shellscript ✅ ✅ https://github.com/tree-sitter/tree-sitter-bash
sql ✅ ✅ https://github.com/derekstride/tree-sitter-sql
swift ✅ ✅ https://github.com/alex-pinkus/tree-sitter-swift
typscript ✅ ✅ https://github.com/tree-sitter/tree-sitter-typescript
vb ❌ ❌

Activity

  1. added
    grammar
    on Mar 12, 2024
  2. alexr00 commented on Mar 12, 2024

    @alexr00
    MemberAuthor
  3. alexr00 commented on Mar 12, 2024

    @alexr00
    MemberAuthor
  4. alexr00 commented on Mar 12, 2024

    @alexr00
    MemberAuthor

    XML ✅

    Repo https://github.com/tree-sitter-grammars/tree-sitter-xml
    Activity very active in the last 12 months
    Stars 14
    Used by Neovim
    Issues 5 closed issues
  5. alexr00 commented on Mar 12, 2024

    @alexr00
    MemberAuthor

    Groovy ✅

    Repo https://github.com/murtaza64/tree-sitter-groovy
    Activity very active in the last 12 months
    Stars 7
    Used by Neovim
    Issues 1 open, 2 closed issues
  6. alexr00 commented on Mar 12, 2024

    @alexr00
    MemberAuthor

    Ini⚠️

    Repo https://github.com/justinmk/tree-sitter-ini
    Activity a little activity in the last 12 months
    Stars 16
    Used by Neovim
    Issues 3 open, 1 closed issues
  7. alexr00 commented on Mar 12, 2024

    @alexr00
    MemberAuthor

    SCSS ❌

    Repo https://github.com/serenadeai/tree-sitter-scss
    Activity last commit was 2 years ago
    Stars 22
    Used by Neovim
    Issues 7 open, 6 closed issues
  8. KillyMXI commented on Mar 18, 2024

    @KillyMXI
    Contributor

    Curiously, 2 of those that would be "less supported" with tree-sitter are fsharp and razor...

  9. alexr00 commented on Mar 20, 2024

    @alexr00
    MemberAuthor

    I didn't find a razor grammar, but if I missed one then please let me know!

  10. heartacker commented on Mar 27, 2024

    @heartacker
    Contributor
  11. locked and limited conversation to collaborators on Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

explorationgrammar

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions