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

Investigate existing tree-sitter grammars #207416

Closed
6 tasks done
alexr00 opened this issue Mar 12, 2024 · 10 comments
Closed
6 tasks done

Investigate existing tree-sitter grammars #207416

alexr00 opened this issue Mar 12, 2024 · 10 comments
Assignees
Labels
exploration grammar Syntax highlighting grammar
Milestone

Comments

@alexr00
Copy link
Member

alexr00 commented Mar 12, 2024

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 ❌
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 ❌ (license) 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
@alexr00 alexr00 added grammar Syntax highlighting grammar exploration labels Mar 12, 2024
@alexr00 alexr00 added this to the March 2024 milestone Mar 12, 2024
@alexr00 alexr00 self-assigned this Mar 12, 2024
@alexr00
Copy link
Member Author

alexr00 commented Mar 12, 2024

HTML ✅

Repo https://github.com/tree-sitter/tree-sitter-html
Activity commits in 2024
Stars 110
Used by Neovim and Zed

@alexr00
Copy link
Member Author

alexr00 commented Mar 12, 2024

YAML ⚠️

Repo https://github.com/ikatyang/tree-sitter-yaml
Activity last commit was 3 years ago
Stars 81
Used by Neovim and emacs
Issues 18 open issues
Repo https://github.com/zed-industries/tree-sitter-yaml, fork of https://github.com/ikatyang/tree-sitter-yaml
Activity last commit was 9 mos ago
Stars 1
Used by Zed
Issues doesn't allow issues
Repo https://github.com/tree-sitter-grammars/tree-sitter-yaml , fork of https://github.com/ikatyang/tree-sitter-yaml
Activity only 1 commit since fork
Stars 0
Used by maybe no one
Issues allows issues but there are none

@alexr00
Copy link
Member Author

alexr00 commented Mar 12, 2024

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

@alexr00
Copy link
Member Author

alexr00 commented Mar 12, 2024

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

@alexr00
Copy link
Member Author

alexr00 commented Mar 12, 2024

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

@alexr00
Copy link
Member Author

alexr00 commented Mar 12, 2024

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

@NullVoxPopuli
Copy link

handlebars could probably be handled by https://github.com/ember-tooling/tree-sitter-glimmer

@KillyMXI
Copy link
Contributor

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

@alexr00
Copy link
Member Author

alexr00 commented Mar 20, 2024

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

@heartacker
Copy link
Contributor

@alexr00 涂鸦_Screenshot_2024-03-28-00-10-12-316_GitHub.png

is this done

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exploration grammar Syntax highlighting grammar
Projects
None yet
Development

No branches or pull requests

4 participants