styled-components/webstorm-styled-components

Exported styled-component with generic (Typescript) in styled function doesn't add props autocomplete when used in JSX

RIP21 opened this issue · 11 comments

RIP21 commented

What steps will reproduce the problem?

Having let say this component:

import styled from 'styled-components'

const Component = styled.div<{ someProp: string }>``

export default Component
import Component from 'components/Component'

const SomeOtherComponent = () => <Component />
  1. Then trying to Ctrl + Space to autocomplete possible props.

What is the expected result?
Should suggest someProp in autocomplete

What happens instead?
No autocomplete.

+1 Same problem here. Not sure if this is a problem with plugin or with Webstorm itself.

This is something that should be addressed on the IDE side. The relevant issue is https://youtrack.jetbrains.com/issue/WEB-34865.

I think this is fixed, at least its status is set to fixed in the issue you linked @undeadcat, and I can't seem to replicate the bug.

Which version of WebStorm do you have?

Actually IntelliJ, but I should think the tooling is the same. Using IntelliJ IDEA 2018.3.1 (Ultimate Edition) Build #IU-183.4588.61, built on December 4, 2018.

Hey all, the fix will land in WebStorm and IntelliJ IDEA 2018.3.3 which is expected at the end of December - beginning of January. Thank you for waiting!

Hey @prigara on your internal bug tracker this is marked as fixed, but the problem still remains.

image

I am using

image

@Havret we'll investigate. I'll get back to you as soon as I know more.

@halvves I've reopened the issue because it wasn't fixed for the latest version of @types/styled-components. Hope it will be fixed again soon. Thanks for bringing the attention to it.

@prigara It would be great if we have this fixed, because working with Webstorm and styled-components has been really painful for the last few months.

WEB-34865 is fixed for the newest styled-components versions on the IDE side in 2019.1.
Please try it out in an EAP build (https://www.jetbrains.com/webstorm/eap/)