-
Notifications
You must be signed in to change notification settings - Fork 19
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
Improvements to parsing, code completion, inspections #7
Conversation
* use dummy identifier (EXTERNAL_FRAGMENT) in place of string interpolation arguments to preserve injected syntax structure as much as possible * add tests
@undeadcat this is so awesome, very happy to see you're working on support! I've invited you to the organization on GitHub, that should make collaboration easier-let me know who else to invite. |
@undeadcat that's a real game changer!!! thanks for the support. I will test it myself and release this ASAP! Thanks again. |
@mxstbr or @daedlock, You can add @prigara (https://github.com/prigara) |
This is just awesome. Thanks so much @undeadcat and @daedlock! |
@undeadcat Just tested the plugin on
Example: class X {
constructor() {
const Box = styled.div`
margin: 0;
padding: 0;
`;
}
} When reformatted using 4-space code style scheme for JS & LESS, it should be: class X {
constructor() {
const Box = styled.div`
margin: 0;
padding: 0;
`;
}
} Do you prefer adding the top points to this PR or shall I create separate issues for them? |
or that it works, but shouldn't be supported?
//language=HTML
let withoutArguments = `
<div>
<div></div>
</div>`
//language=HTML
let withoutArguments = `<div><div>${withArgument()}</div></div>` At the moment it doesn't seem like something that can be addressed on the plugin side with the current IDE versions. |
Nevermind that! It works fine.
Would be great to have that. Hopefully this would be already fixed in the next WebStorm release. For now, I think the code looks great! Will add a release and update the README! Thanks a lot @undeadcat for the amazing work! |
Cool! Thank for merging. @daedlock I've also main some new screenshots, I will add them to the Readme later today. |
Yessss, this is great! |
Hi!
I'm from the WebStorm team at JetBrains. Thank you for creating this plugin! We really appreciate your efforts!
We were actually planning to release a similar plugin to support Styled Components within the nearest days when we saw this plugin.
We would love it if you could accept our implementation that solves some of the issues you've mentioned in the readme and join the efforts with us to make support for Styled Components in WebStorm amazing.
Here's how the implementation in this PR is different:
For example, in case of
the current implementation would generate
which places the elements that should be nested side-by-side, significantly changing the code semantics.
This new version generates
This keeps nested elements nested (as they should be) and also allows code completion to work correctly.
![image](https://user-images.githubusercontent.com/7509842/29931093-e8b1573c-8e78-11e7-84f4-a32893d6141c.png)
Added tests that check injected content and for Expression inside parenthesis breaks parsing #6
Set the minumum compatible IDE version to 2017.2 (2017.2 AND all later versions should be supported). Reason for this is there were API changes in 2017.1, I think it may be made to work with earlier versions, but not sure it's worth it without a specific need.
The code is written in Kotlin and uses intellij-gradle-plugin to build it but this is only because our code was originally written this way.
I really don't have a preference here and since this is your project, I'll gladly convert it to Java or use your preferred build tool if you do =)