-
Notifications
You must be signed in to change notification settings - Fork 173
See if we can re-use tree-sitter-tact for syntax highlighting in code snippets #1158
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
Comments
It is possible, but would require some workarounds to fix contexts. For example, the following is how tree-sitter tries to parse a small snippet of a single statement. Notice, that it fails because of lack of proper context: And here's when we add more context to the statement, such as the body of a global static function This workaround will make many code snippets a tad more verbose, so there are other approaches trying to pre-process code blocks as if they were encapsulated in global static function bodies in the first place. Moreover, the TextMate grammar docs are using needs to exist in order for VSCode extension and Sublime Text package to work. So, after a discussion with @anton-trunov we figured, that it's best to improve the current TextMate grammar and make a single upstream source of it, such that tact-docs, tact-vscode, upcoming Sublime Text package, Nujan IDE and others can consume it to get decent syntax highlighting. Closing this issue as |
Maybe not today or next month, but in a year. Admittedly, we don't the manpower to work on this now. But what if someone from the TON community comes along and gets excited to work on something like this. Especially because we have a grants and bounties program to support community members. |
We may try to do something like the expandable/collapsible code blocks, as seen in Kotlin docs: Additionally, and this is well out of scope of this issue, we may try to bring Blueprint test runner (or some other approach) into docs to support running Tact's code blocks directly in docs. |
@i582 What are your thoughts on this? Should we close this? |
I think TextMate's grammar is sufficient for highlighting for GitHub and documentation :) |
Uh oh!
There was an error while loading. Please reload this page.
It should be in principle possible, since GitHub uses it in Linguist.
No more regex-based highlighting! :)
This would make things like tact-lang/tact-docs#183 much easier
The text was updated successfully, but these errors were encountered: