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

IntelliJ/WebStorm IDE props auto-completion broken in 4.0.0 alpha #14582

Closed
2 tasks done
ssypi opened this issue Feb 19, 2019 · 8 comments · Fixed by #14599
Closed
2 tasks done

IntelliJ/WebStorm IDE props auto-completion broken in 4.0.0 alpha #14582

ssypi opened this issue Feb 19, 2019 · 8 comments · Fixed by #14599

Comments

@ssypi
Copy link

ssypi commented Feb 19, 2019

  • This is not a v0.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior 🤔

In IntelliJ/Webstorm IDE, when importing component and using it in JSX, prop auto-completion/suggestions and validating should work as it did in previous version 3.9.x.

Current Behavior 😯

No props are suggested or validated.

Steps to Reproduce 🕹

  1. import any component from core/component
  2. use it in jsx
  3. try to have IDE suggest props

Context 🔦

If I downgrade material-ui/core back to 3.9 version, everything works, but not on 4.0.0-alpha.0.

Your Environment 🌎

Tech Version
Material-UI v4.0.0-alpha.0
IDE IntelliJ IDEA 2019.1 EAP

Solution?/Thoughts`

I noticed that if I add "typings": "./index.d.ts", line to for example core\Button\package.json, it works again just like before.

Another thing is that if I try to navigate to the source of the imported components, IDE navigates to the source in the core/esm/Component folder instead of core/Component even though I imported from core/Component. Possibly because of "module": "../esm/Chip/index.js", in the Component's package.json. But this is also fixed with the above typings addition.

(Possibly related to issue #14392 )

@ssypi ssypi changed the title IntelliJ/WebStorm IDE autocompletion broken in 4.0.0 alpha IntelliJ/WebStorm IDE props auto-completion broken in 4.0.0 alpha Feb 19, 2019
@eps1lon
Copy link
Member

eps1lon commented Feb 19, 2019

Another thing is that if I try to navigate to the source of the imported components, IDE navigates to the source in the core/esm/Component

Does it still do that with the added typings field?

@ssypi
Copy link
Author

ssypi commented Feb 19, 2019

Another thing is that if I try to navigate to the source of the imported components, IDE navigates to the source in the core/esm/Component

Does it still do that with the added typings field?

No, it will navigate to the core/component/index.d.ts where I think it is supposed to and where it was going in the previous versions.

I noticed you added the typescript label and while they indeed are typescript typing files, note that I'm not using typescript in the project, it's just that the IDE uses them for auto-completion.

@eps1lon
Copy link
Member

eps1lon commented Feb 19, 2019

note that I'm not using typescript in the project, it's just that the IDE uses them for auto-completion.

I think this is the only actionable fix for us though. Autocompletion is working fine in codesandbox (and probably for any vscode version). It's just that webstorm is not up to date.

@eps1lon
Copy link
Member

eps1lon commented Mar 6, 2019

@ssypi This was released with @material-ui/core@4.0.0-alpha.2. Could you please verify if this is working for you?

@ssypi
Copy link
Author

ssypi commented Mar 6, 2019 via email

@ssypi
Copy link
Author

ssypi commented Mar 9, 2019

For some reason, autocompletion for Button and ButtonBase components doesn't seem to work, but everything else I tried works perfectly such as Typography, Icon, IconButton, Step, StepButton, Divider etc. Button and ButtonBase seem to have slightly different d.ts files compared to some others.

declare const ButtonBase: ExtendButtonBase<ButtonBaseTypeMap>;

vs

declare const IconButton: React.ComponentType<IconButtonProps>;

Other than that, this is very good.

@geocolumbus
Copy link

geocolumbus commented Oct 15, 2020

4.11.0 still doesn't have autocomplete for <Box/> like it did in 3.9.2. I also tried 5.0.0-alpha.12 and that does not work. Earlier in the thread it was suggested that "Webstorm is just not up to date". What does that mean specifically? It would be really nice if this worked again.

@timvandam
Copy link

timvandam commented Jan 3, 2022

I am having this issue right now with mui 5. I am on the latest webstorm version. Tried downgrading to the oldest version Jetbrains Toolbox allowed me to (some 2020 version), but unfortunately had the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants