Closed mstarkman closed 7 years ago
@daedlock This is from version 1.0.
Reproduced on Intellij 2017.2
This seems be the trigger
const ContactMenuIcon = styled(Icon).attrs({ iconName: 'contact_card' })`
...
`;
If we remove the following, the error disappears.
.attrs({ iconName: 'contact_card' })
@undeadcat. If I am not mistaken, it's an issue with Patterns.kt#getReferencePart()
expecting a reference expression while it's getting a call expression.
D'oh! Fixed. Thanks.
@mstarkman If you've downloaded the plugin from the IDE (not via zip file), the IDE will show a notification when the plugin can be updated.
I would aim to publish a new version by end of monday - tuesday, possibly with fixes for other issues if that's ok with everyone. I would not publish a new version for every bug because too many 'update available' notifications can be annoying.
@undeadcat. Agreed
Thanks @undeadcat! I'll keep an eye out for it in the IDE. Does the also cover the case of using extend.attrs({})
(https://www.styled-components.com/docs/basics#extending-styles)? We use that also and wasn't covered by another tool, so I just wanted to ask. This would be some example code:
const StyledIcon = styled(Icon)`
height: 24px;
width: 24px;
`
const FilterIcon = StyledIcon.extend.attrs({ iconName: 'filter' })`
line-height: 0;
margin-right: 1rem;
`
@mstarkman Fixed in v1.0.1 https://github.com/styled-components/webstorm-styled-components/releases/tag/v1.0.1
@daedlock This seems to be working in most cases for my code. However, the .extend.attrs({})
still isn't working properly. I've created a separate issue for it here: https://github.com/styled-components/webstorm-styled-components/issues/28.
Error Message:
Details:
This is the file that it seems to be failing on: