-
-
Notifications
You must be signed in to change notification settings - Fork 25
Add support for the schema tag #22
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
base: master
Are you sure you want to change the base?
Conversation
Been on the fence about this proprietary extension but I guess it's been requested enough that I'll go for it. Let's rename the group to |
May be we can add this conditionally, only when the file matches "sections/*.liquid" making something like a subtype, but I'm not sure how to implement that and not sure if it's worth the effort.
There are other two special tags for JavaScript and stylesheet that, while are not as important (rarely used), could also have special syntax highlighting.
Just mention to check your thoughts on those ideas...
|
Wrap those in a |
Just wanted to note that I've not forgot about this, but have problems finding the time... will work on this ASAP :) |
Ok it is working. I were trying to make Also, the indentation of JSON or CSS sections does not work and could not make it work as expected (using |
Is this what you're missing? vim-liquid/ftplugin/liquid.vim Line 56 in dd5243a
|
Yes, but I could not get it working... (Even the capture:endcapture is not working... )
|
Looks like a |
syntax/liquid.vim
Outdated
@@ -73,6 +73,15 @@ syn region liquidExpression matchgroup=liquidDelimiter start="{{-\=" end="-\=}} | |||
syn region liquidComment matchgroup=liquidDelimiter start="{%-\=\s*comment\s*-\=%}" end="{%-\=\s*endcomment\s*-\=%}" contains=liquidTodo,@Spell containedin=ALLBUT,@liquidExempt keepend | |||
syn region liquidRaw matchgroup=liquidDelimiter start="{%-\=\s*raw\s*-\=%}" end="{%-\=\s*endraw\s*-\=%}" contains=TOP,@liquidExempt containedin=ALLBUT,@liquidExempt keepend | |||
|
|||
if b:liquid_subtype ==# 'html' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable is not guaranteed to be defined. Use if get(b:, 'liquid_subtype', 'html') ==# 'html'
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've added a exists('b:liquid_subtype')
check instead mainly because it is already on the code (but also because it's easier to understand). I can correct if it is wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a behavior change: My version is true when b:liquid_subtype
is undefined and yours is false. But I think your behavior is probably the more sensible one? Leave what you have for now.
Use a single file-pattern to match multiple folders.
93e8f4c
to
aa0efe1
Compare
Implement the changes from tpope#16 to have JSON syntax highlighting on [section schema][1] and CSS highlighting on the [style][2] tag. [1]: https://shopify.dev/themes/architecture/sections/section-schema [2]: https://shopify.dev/api/liquid/tags/theme-tags#style
I think keywords like (Notably, |
I could not make the Any help is appreciated, I've been fighting with this a lot. |
Implement the changes from #16 to have syntax highlighting on section schema.