Skip to content
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

Support for ECR #46

Open
shobhitic opened this issue Jun 24, 2018 · 2 comments
Open

Support for ECR #46

shobhitic opened this issue Jun 24, 2018 · 2 comments

Comments

@shobhitic
Copy link

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.

@sardaukar
Copy link

sardaukar commented Apr 8, 2020

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.

@plambert
Copy link

This also works for me; it's not perfect but way better than nothing. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants