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

Vote for adding support in IntelliJ IDEA #45

Open
kompot opened this issue Jun 21, 2016 · 4 comments
Open

Vote for adding support in IntelliJ IDEA #45

kompot opened this issue Jun 21, 2016 · 4 comments

Comments

@kompot
Copy link

kompot commented Jun 21, 2016

Hi guys,
thanks for a finally nice approach to CSS-in-JS.

I've created an issue to add improved tagged literal injected language support to IntelliJ IDEA.
Please vote there
https://youtrack.jetbrains.com/issue/WEB-22106
if you'd like to get it done.

Feel free to delete this issue if it bothers your flow.

Thanks.

@scott113341
Copy link
Collaborator

Hey @kompot, check out this comment for usage in IntelliJ.

I wonder why the template literals are getting parsed as HTML by default for you. When I use WebStorm, they are just interpreted as strings until I use the method above to Language Inject CSS.

Let me know if this helps! Though it would be totally cool if csjs could be auto-detected by an IntelliJ plugin...this is definitely worth exploring as the project gains users.

@kompot
Copy link
Author

kompot commented Jun 21, 2016

@scott113341 Thanks, I've actually managed to go a bit further and found a way to inject CSS language permanently by using language injection preferences dialog in IDEA and using this pattern.

+ jsLiteralExpression().withText(string().matchesBrics("csjs`.+`"))

But IDEA still does not parse references to variables within CSS. But does that successfully for default template literals assuming it contains plain HTML. So that issue I refer to seems like just a small fix (maybe not, let's see what IDEA's guys are thinking).

@scott113341
Copy link
Collaborator

Ok, so you are miles ahead of me! Thanks for that pattern, that totally did the trick (minus variable interpolation)! I voted for the issue on their tracker; hopefully that is an easy fix for them.

@avesus
Copy link

avesus commented Aug 30, 2016

+1 For Visual Studio Code too ;-)

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