-
I've begun work on a TextMate bundle for Bunch files, the grammer is coming along, but not quite finished. First of all, I'll offer Brett kudos on the excellent Bunch documentation. Writing a grammer from documentation is a really quick way to learn how good the documentation is, and in this case it's outstanding. While working on the grammer I discovered the following, which is really a plea for advice. Section header documentation says it can start with a Comments documentation says a line comment can start with Experimentation shows that a line containing The request for advice: is it a feature or a bug that Piling on, if you can give a bit of guidance, I'll happily submit a PR for this documentation about snippet fragments. The question: is it called a fragment, a partial snippet, or a section? All three are used. I lean towards calling them fragments. That would make the nouns:
Brett, what nouns would you prefer for these things? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
That's awesome!
When a snippet is loaded without a fragment ID, the headers are treated as comments (i.e. ignored), so I guess it's kind of a feature. In the Sublime Text syntax definition I use this regex for the fragment header:
(Starts with --, =, >, or #, followed by any combination of those characters plus space, containing a pair of square brackets with at least one character between them.) The comment regex:
(Requires that the marker, either # or //, come at the very beginning of a line or following a space, and does not contain a square bracket as the first non-marker, non-space character. Looking at that now I realize it would catch For scoping I would recommend treating the fragment headers like comments, but highlighting the square brackets. I'm using the following scopes for the captures in the first regex:
Great question, and one that should definitely be clarified. Let's go with your suggestion and consistently use "Fragment". The only thing to add would be the '<Snippet#fragment' part of a snippet line. I tend to use "Fragment ID" when I'm talking about the Thanks! |
Beta Was this translation helpful? Give feedback.
That's awesome!
When a snippet is loaded without a fragment ID, the headers are treated as comments (i.e. ignored), so I guess it's kind of a feature. In the Sublime Text syntax definition I use this …