You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Ignore form reader macro should "comment" the following form #72
Additionally, could you make such comments collapsible, please. I know that for other languages, Atom doesn't make all inline comments collapsible; but for some of them it does. For example, following comment is collapsible in PHP:
/* any multiline
comment with code right after*/ $v= 1;
I took a quick look into this, but I am far from an expert on the subject of atom languages. But atom uses Tree-sitter to parse the content of the file. It parses line by line and not with multi-line support (this is an underlying assumption that is important to my argument). It relies on regex to match the opening and closing of multi-line comments (and other parameters). Other block commented languages often have a unique opening and closing statement such as /* and */ make it easier to find the closing statement. The reader macro is only closed by a paren.
We could implement the reader macro (#_()) in a number of different places which would need to select different closing parens. I'll indicate where the comment should stop with the | character.
There are regex ways (using recursion) to find the opening and closing matching parens, but given that tree-sitter doesn't have knowledge of the previous lines this becomes challening to identify the right closing paren using just the built in regex tree-sitter formatting.
Needless, I've given up modifying the simple grammar/clojure.cson
@eskemojoe007 mostly right; but Tree-sitter does work across multiple lines.
The grammar you were looking at was a TextMate grammar. Clojure does not have a Tree sitter grammar in Atom yet though, so your argument doesn’t change.
Activity
peter-lyons-kehl commentedon Jan 22, 2019
Additionally, could you make such comments collapsible, please. I know that for other languages, Atom doesn't make all inline comments collapsible; but for some of them it does. For example, following comment is collapsible in PHP:
eskemojoe007 commentedon Apr 5, 2019
I took a quick look into this, but I am far from an expert on the subject of atom languages. But atom uses
Tree-sitterto parse the content of the file. It parses line by line and not with multi-line support (this is an underlying assumption that is important to my argument). It relies onregexto match the opening and closing of multi-line comments (and other parameters). Other block commented languages often have a unique opening and closing statement such as/*and*/make it easier to find the closing statement. The reader macro is only closed by a paren.Consider the following simple function:
We could implement the reader macro (
#_()) in a number of different places which would need to select different closing parens. I'll indicate where the comment should stop with the|character.There are regex ways (using recursion) to find the opening and closing matching parens, but given that tree-sitter doesn't have knowledge of the previous lines this becomes challening to identify the right closing paren using just the built in regex tree-sitter formatting.
Needless, I've given up modifying the simple
grammar/clojure.csonAerijo commentedon Apr 5, 2019
@eskemojoe007 mostly right; but Tree-sitter does work across multiple lines.
The grammar you were looking at was a TextMate grammar. Clojure does not have a Tree sitter grammar in Atom yet though, so your argument doesn’t change.