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

Improve coloring of block expressions #94

Closed
aeschli opened this issue Jan 23, 2017 · 4 comments · Fixed by #95
Closed

Improve coloring of block expressions #94

aeschli opened this issue Jan 23, 2017 · 4 comments · Fixed by #95

Comments

@aeschli
Copy link

aeschli commented Jan 23, 2017

{{#list people}}{{firstName}} {{lastName}}{{/list}}

{{ and #list get scope support.constant.handlebars.
It would be nice if if the block expressions gets a scope like: 'keyword.control'. That's matching what JavaScript gives to keywords like 'if', 'while'

firstName gets variable.parameter.handlebars

@aeschli aeschli changed the title Inconsistent coloring of block expressions Improve coloring of block expressions Jan 23, 2017
@daaain
Copy link
Owner

daaain commented Feb 6, 2017

Hey @aeschli, I finally got around to have a look at this and created a Pull request: #95.

It seems to be working, but I'm not sure if it's quite right yet. The colours with Sublime Text's default theme seem a bit off, so I'm thinking this would make sense if the closing tags (eg /list), inline keywords (eg else) and maybe even inline helpers (eg customHelper in {{customHelper "test1" 'test2' 32 true object.value}}) were the same?

image

@aeschli
Copy link
Author

aeschli commented Feb 6, 2017

Cool. Yes, coloring the closing tag like the block expression sounds like the right thing to me, and also the other suggestions make sense.
That said, I'm not a too deep into handlebars, I created the issue on behalf of @t-sauer. Thomas, thoughts?

@t-sauer
Copy link

t-sauer commented Feb 6, 2017

I think having the same colors for inline and block expressions is totally fine (at least for me).

@daaain daaain closed this as completed in #95 Jun 6, 2017
@daaain
Copy link
Owner

daaain commented Jun 6, 2017

OK, I just pushed a new version, in the end I decided not to apply the same scope on inline expressions as that's shared with variables and it was just too much.

But all block expression opening and closing tags, and else should have the new colour now.

Let me know if it works well for you!

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

Successfully merging a pull request may close this issue.

3 participants