Add TextMate support to parse syntax highlighting without tree-sitter #23949
Replies: 3 comments
-
For reference, TextMate grammars use kkos/oniguruma flavored regular expressions so likely Zed would likely have to embed that, perhaps via the onig crate. |
Beta Was this translation helpful? Give feedback.
-
While this issue is for the TextMate syntax format in particular, I'll mention some alternatives which also have a wide array of existing languages defined: For me, this issue is one of the handful still making Sublime Text the superior editor. Is this or something like it on the team's roadmap for sure, or might Zed remain tree-sitter-only, always? |
Beta Was this translation helpful? Give feedback.
-
No, this is not on our current roadmap, but that does not mean Zed will be tree-sitter-only forever. Given that pygments requires python and highlight is written in C++, we would be unlikely to bundle those in core. It is conceivable that Zed could add an extension API to enable extensions to provide syntax highlighting (beyond tree-sitters) that could leverage local processes (e.g. Python, C++ platform binaries) as we do for LSPs, but to my knowledge the design for such an Extension API has not been explored. Also wanted to mention trishume/syntect, a Rust library for Sublime Text syntax definitions (uses onig under the hood). |
Beta Was this translation helpful? Give feedback.
-
Check for existing issues
Describe the feature
It's not hard to understand tree-sitter is the first-class citizen, but there are cases that ASTs are not available. There is no tree-sitter parser for some languages (like cmd batch, powershell and specific assembly languages) and sometimes we don't want full language support (like temporarily viewing sources without installing its extension, and disabling tree-sitter parsing for lower memory occupation), and now the case is, without a tree-sitter parser, there is no syntax highlighting. For VSCode, common programming language syntax highlighting is built-in (easier and lighter), and with tree-sitter and language server we can have full support for that language.
If applicable, add mockups / screenshots to help present your vision of the feature
No response
Beta Was this translation helpful? Give feedback.
All reactions