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


#1

Hello.

I want to know if the following is wanted / expected behaviour.
folding%20block%20and%20line%20comment

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 ->
2018-08-01_06-35-17

2018-08-01_06-36-44

Thank you for sharing your opinion.


#2

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

folds

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.


#3

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?


#4

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.


#5

: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?


#6

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)

https://tree-sitter.github.io/tree-sitter/creating-parsers


#7

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

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


#9

Thank you for sharing those notes.


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