-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Split StringTemplate from HTML #5192
Conversation
Uses `atom/language-html`; not ideal as ST-unique syntax isn't matched
Ah, found a grammar: dangmarm/stringtemplate-lang |
Using dangmarm/stringtemplate-lang now
dangmarm/stringtemplate-lang
`source.stringtemplate`
Can't CTRL+F the logs but it's the same issue as #5194's failed run I assume. |
Lightshow doesn't seem to work.. |
Looks to be a problem with the grammar and not Lightshow. Picking another grammar source works. |
Should I just revert the grammar changes then? Can't find a better one. |
From a quick glance at their format's documentation, it seems that StringTemplate files can generate any sort of output, similar to Moustache (even if it's most commonly used to generate HTML). Ergo, a dedicated StringTemplate grammar would be more appropriate than Atom's HTML grammar, and it shouldn't take me too long to smash one together. I'll hold off on it until @lildude's finished deploying v7.13.0, just in case an update to |
All done @Alhadis. Go wild. |
Roger. Will push an update to @Nixinova's branch that contains the required grammar update. I'm wondering if there should be an undocumented |
Should I improve the StringTemplate heuristic then? |
What we have now should be sufficient. The delimiter characters are configurable, so
The only thing I'd suggest adding is StringTemplate's pattern: >-
(?x-m)
# Symmetrical delimiter: $…$ '…' #…# ~…~
(.)! .+? !\1
# Mirrored delimiters: <…> […] {…} “…” «…»
| <! .+? !>
| \[! .+? !\]
| \{! .+? !\} Skippable sidenotes that you should read anywayNow, I'd like to take a moment to explain a small but critical nuance about the behaviour of Now, while possessive matching ( Examples of when
|
Is what I added sufficient? |
@Nixinova Sorry I took so long to write that StringTemplate grammar. The language turned out to be more complex than I assumed it was. I've pushed an update to your branch to use the new grammar, so, no actions are required on your part. 👍 |
#4789 (comment): StringTemplate was added in #1117 as a raw HTML variant, but per #4979 HTML variants should be split.
It seems to be HTML but with control statements and variables inside$dollars$ .
Default to using default HTML grammar, which is not great as it doesn't match the dollar syntax at all, but couldn't find an actual one that works.Found a grammar: dangmarm/stringtemplate-langUPDATE (Alhadis): Added grammar for StringTemplates that use either
<…>
delimiters or$…$
delimiters.Color
#3fb34f
from logo.Closes #4789