-
Notifications
You must be signed in to change notification settings - Fork 5
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
Svelte Language Server Not Picking Up New Schema Tables #8
Comments
Based on a suggestion from @thomasballinger, I tried playing around with extra saves on the various generated files to see whether one such save would nudge the Svelte server into catching up. The good news is that re-saving / So this means that this problem should exist irrespective of whether schemas are involved right? That generated file just comes from the set of api modules in the convex source directory, if I understand it correctly? |
Ah great find! To be clear, of 1 viewing the file in VSCode, 2) saving the file from VSCode, or 3) touching it from the terminal it's 2 and 3 that both fix the problem, making svelte types catch up? Yep, |
Yes indeed - anything that would bump the mtime on that generated api TS definition file does the trick. I also have a secondary (rather weak) signal that I haven't had a chance to investigate. When rapidly building up api files in the I have had to force reload the windows a couple of times under these circumstances to get the right code completion even in scripts that have nothing to do with Svelte. I'm mentioning all this here in case its another mini-clue that the generated files are being instantiated in a somehow LSP-unfriendly way. This problem is proving difficult to reproduce though so I'm not confident in the signal yet. |
Ported over from a discussion on the Convex Community Discord.
goats.ts
containing...This initially gets a red squiggle under "goats" because I guess it's not one of the table names in my schema file.
And if I go back to
goats.ts
, the red squiggle has disappeared. So VS Code now understands the set of literal table names correctly.Then I head over to my test svelte route and start typing
api.
and it completes with prior table names but doesn't offergoats
.If I then restart the Svelte language server, the autocomplete now works as expected. So it's something about the build / transpilation step in Svelte ...maybe?
Note I am runnning both
convex dev
andnpm dev
during this scenario so both convex and Svelte are doing their updating magic.The text was updated successfully, but these errors were encountered: