Thom1729 / Sublime-JS-Custom

Customizable JavaScript syntax highlighting for Sublime Text.
MIT License
137 stars 9 forks source link

Enable emmet completions in styled-components #55

Closed mohitsinghs closed 5 years ago

mohitsinghs commented 5 years ago

This pull request fixes #46 and also adds createGlobalStyle to support styled-components v4.

Problem As described by @hudochenkov in this comment, emmet abbreviation does not work inside styled-components.

Proposed solution Emmet abbreviation do work when setting parent scope to css. We can do this by clearing entire scope when a template literal with styled-components is triggered and then re-adding js scope when styled-components block ends.

Thanks for creating such a great plugin @Thom1729

Thom1729 commented 5 years ago

This sounds like a bug on Emmet's end, but given how buggy Emmet is, I think we'll have to address it here.

We're on the brink of the 2.0 release, so I'll probably wait to merge so that I don't have to do it in two places.

mohitsinghs commented 5 years ago

@Thom1729 Sounds great.

hudochenkov commented 5 years ago

Thank you for working on this!

hudochenkov commented 5 years ago

@Thom1729 thank you for merging! When do you plan to release it?

Thom1729 commented 5 years ago

It's out now in v2.0.1.

hudochenkov commented 5 years ago

Thank you, @mohitsinghs. @Thom1729! Works like a charm!