I like to use a better file organisation
I like to use a better file organisation in my
/convex
directory for tables that require more than one file (mainly to organize file that can extend to 1000+ lines), when I'm inside a file in say /convex/chat/support.ts
I don't get convex's functions in /_generated
directory suggested to me, anyway I can fix that within my editor or tsconfig?13 Replies
Should work just the same if you’re importing eg.,
api
from the generated api file - what are you seeing?if it works the same I wouldn't be asking the question 😛 haha
for instance when I try importing query:
(I tried updating the paths in my tsconfig earlier, this is why I have a bunch of options)

and when I try importing api:

Weird bug
I use that structure just fine, default tsconfig, editor etc
Sorry, what I meant with "should work the same" is "no you don't have to do anything to make it work"
Can you share your convex/tsconfig?
Are the functions in the generated files ?
It's the basic tsconfig that's generarated by convex
Did you happen to restart the ts server
yes
I wonder if webstorm would show the same results
Dang that's really strange. I would try importing api and console logging a function reference, then running tsc from the console to see if it's just your editor or not
To make it clear, I'm asking about the IntelliSense 😅 everything else works perfectly
Yeah I know, I'm just trying to help troubleshoot as I haven't seen anyone encounter this before. I understand things work, but wanted to specifically confirm that this is actually limited to intellisense, which requires running code that intellisense thinks is incorrect.
Hmm wait so you're saying if you manually add
import { api } from ./_generated/api
, everything works in the editor, types click through, etc?
Like literally just intellisense?
If so I think that really goes squarely on the editor and plugins. Which is super unhelpful, I know. Just not sure there's anything Convex specific happening if that's the case.