Open shobhitic opened 6 years ago
I got it to work (kinda), but not sure how to make it into a package. Just save this
%YAML 1.2
---
file_extensions:
- ecr
scope: text.html.ruby
contexts:
main:
- match: ''
push: 'scope:text.html.basic'
with_prototype:
- match: "<%+#"
scope: punctuation.definition.comment.ecr
push:
- meta_scope: comment.block.ecr
- match: "%>"
pop: true
- match: "<%+(?!>)[-=]?"
scope: punctuation.section.embedded.crystal
push:
- meta_scope: source.crystal.embedded.html
- match: "-?%>"
scope: punctuation.section.embedded.crystal
pop: true
- match: (#).*?(?=-?%>)
scope: comment.line.number-sign.crystal
captures:
1: punctuation.definition.comment.crystal
- include: "Crystal.sublime-syntax"
as ECR.sublime-syntax
on your User packages folder.
This also works for me; it's not perfect but way better than nothing. :)
Currently, the
.ecr
files are being shown as Plain Text files. I couldn't find a way to syntax highlight there. I think it should be a part of official crystal sublime package.