Skip to content

#{} highlighting for CoffeeScript #510

ghost opened this Issue Nov 17, 2011 · 3 comments

1 participant

ghost commented Nov 17, 2011

You can have expressions in #{}.

The problem is that this expression isn't highlighted which could be more pleasant to work with.

Could this be added so that the expression in it:

console.log "I am #{'happy!' if happy?}"

is highlighted as usual code.

fjakobs commented Nov 28, 2011

This is actually pretty hard. I have added a failing unit test for this but I'm not sure how to fix it. I looks like I need more context information than I have at hand.

@fjakobs fjakobs added a commit that referenced this issue Nov 28, 2011
@fjakobs fjakobs add failing unit test for #510 cd271f1
ghost commented Dec 18, 2011

Doesn't it work if Ace just highlights whatever is inside #{} as usual CoffeeScript code?

But only for:

"Some CS code: #{alert something}"

and not for:

'No highlighting for this: #{alert something}'
fjakobs commented Dec 19, 2011

the problem is that the inner highlighter needs to count parens to know when to switch back to string mode. This is currently not possible.

@nightwing nightwing closed this in f40cc1c May 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.