Tree sitter grammar #1815
Replies: 4 comments 3 replies
-
I've done some work on this, definitely to not the point where I can open source it...hold on... I'll just put this under the org real quick. https://github.com/fastn-stack/tree-sitter-ftd/ |
Beta Was this translation helpful? Give feedback.
-
tree-sitter also supports code folding in text editors which will be a good addition. I've talked about this before here: FifthTry/ui#58 (comment) |
Beta Was this translation helpful? Give feedback.
-
tree-sitter grammar can also be used for syntax highlighting code on web pages. We can get rid of prism js files in fastn by introducing this as a compile time dep along with smaller css file. Github uses TS to highlight code on their website. They also have https://github.com/github-linguist/linguist where they allow accepting TS grammars to add a new language to GitHub. |
Beta Was this translation helpful? Give feedback.
-
TS grammars are also suitable to use in LSP servers, which we should definitely work on, would be great to have autocomplete, auto import, snippets and docs inside the editor. Vim/Neovim, Emacs and Vscode supports have native support for LSP. We can also compile a lsp server to WASM and use it in our private editor product on the client side (not sure about the memory consumption issues). |
Beta Was this translation helpful? Give feedback.
-
We should create it as many editors support syntax highlighting based on it.
https://www.jonashietala.se/blog/2024/03/19/lets_create_a_tree-sitter_grammar/
Beta Was this translation helpful? Give feedback.
All reactions