Wanted behaviour? folding `Block Comment` with `Line Comment`



I want to know if the following is wanted / expected behaviour.

Notice that there is a line comment following a block comment. The line comment is folded with the block comment when attempting to fold the block comment.

Other non-atom examples ->


Thank you for sharing your opinion.


Like this? (this is C++ in Atom)


Tree sitter does it. Any patch to text mate grammars would have to be done by an enthusiastic volunteer at this point, and that seems unlikely.


Yes (thank you) like that.

Yes that is highly unlikely.

Rhetorical -> How about a how-to on converting my custom already-working grammar to Tree Sitter?

Another -> Has the old-standard snippets been ported to Tree Sitter yet?


Pain and suffering. Lots of that.

More helpfully, how complicated is it? I’ve written a couple, for BiBTeX and a custom lambda calculus syntax, but they take effort and planning.


:laughing: … sweat and tears to progress forward -> a given?

How to answer that objectively? :thinking: … I am still tuning it after several months.
It has roots from Pascal. So - how hard would it be to do Pascal?


Is something not working? They seem fine for me right now.

I don’t know Pascal well, so I doubt it would be easy. Tree-sitter is quite capable, but it’s written in a very different way to textmate grammars. You’ll be making an entire syntax tree with tree-sitter. A better reference might be ANTLR parsers like this one, but there are still differences between what tree-sitter does and what ANTLR does. Here are the docs (for anyone else who’s interested too)



This is the available C++ and Tree Sitter (only core) snippet:
<one item>

This list of snippets is available for C++ without Tree Sitter:


Thank you for sharing those notes.

@Aerijo: This might be an interesting package to take note of -