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

No code completion for cell component #4303

Open
Tobbe opened this issue Jan 30, 2022 · 7 comments
Open

No code completion for cell component #4303

Tobbe opened this issue Jan 30, 2022 · 7 comments

Comments

@Tobbe
Copy link
Member

Tobbe commented Jan 30, 2022

I ran yarn rw g cell join and now I want to use it in my page

image

I want VSCode to suggest <JoinCell>, but it doesn't. It suggests JoinCellStories, but that's not helpful.

@dac09
Copy link
Collaborator

dac09 commented Jan 30, 2022

You're using JS and asking for actually helpful code tips?! ;)

I have a feeling you just have to do the usual "restart TS server" in vscode and you'll get your auto completion.

@Tobbe
Copy link
Member Author

Tobbe commented Jan 31, 2022

It's the same in a TS project

image

And restarting the TS server, or even reloading the window doesn't help.

@dac09
Copy link
Collaborator

dac09 commented Feb 4, 2022

While investigating this I realised that our types were actually not being generated as part of the generate command. I've fixed this issue in #4376. However this doesn't solve the problem you're describing

I've investigated this further, and it looks like there may be a "trick" to making it appearing in the import suggestions list.

@Tobbe what do you think? Made a tape for you ->

Importing suggestions for Cells workaround

Img

@Tobbe
Copy link
Member Author

Tobbe commented Feb 4, 2022

Thanks for digging into this Danny!

I verified that your trick worked for a JS project as well. And it works both if you do it in the .test.js file or in the .stories.js file. But as soon as I remove it, it stops working again.

And for anyone who has this in their redwood.toml it wouldn't help

[generate]
  tests = false
  stories = false

Personally I prefer relative imports 🙈 but moving to src/components/MyCell in the test and stories file would be worth it for this trick. And even if it's not going to work for everyone it's better than what we have now IMHO.

It would be nice if we could put something in .redwood/ with the import instead. I tried changing the import in mirror/web/src/components/ContactCell/index.d.ts but that didn't help.

@Tobbe Tobbe unassigned dac09 Feb 6, 2022
@Tobbe
Copy link
Member Author

Tobbe commented Feb 6, 2022

I have something that works in a JS project. Going to test it in a TS project as well.
If that works I'll try to update the RW framework to generate the needed code.

@orianmarx
Copy link

@Tobbe I'm finding it very frustrating to not be able to auto-import cells in VSCode as well. I tried @dac09's trick but it's not working for me. It's kind of disconcerting as a newcomer to Redwood.

@Tobbe
Copy link
Member Author

Tobbe commented Mar 3, 2023

I did spend some time on trying to get it working, but got stuck and ran out of time. Any help getting it going again would be greatly appreciated #5820

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

No branches or pull requests

4 participants