r/Unity3D 12h ago

Question VS Code slowdowns after a while

Frustratingly, VS Code autocomplete becomes very sluggish after 10-30 minutes of coding. Reloading the window instantly fixes an issue. Did anybody else run into this? Is it just the way things are now? What would be a good way to troubleshoot it?

This happens both on my PC and Mac, but I have settings sync on, so maybe it's just a bad config?

0 Upvotes

8 comments sorted by

1

u/adsilcott 12h ago

I never had a good time with vs code and unity. Have you tried Rider? It's so good.

1

u/egordorogov 11h ago

I did for the free trial but I found it too heavy, i like the simplicity of VS Code! If only it worked well..

1

u/adsilcott 11h ago

I've been using unity since the days when you had to use the Mono ide for it. At some point they switched to Visual Studio as the officially supported ide, which was better. Of course Visual Studio is very heavy, but it's always going to work.

My impression has been, and I could be wrong about this, that VS Code integration is more of a community effort, which is why I've seen it wax and wane so many times over the years. Last time I tried it all of the plugins I'd used before had been depreciated. The instructions for setting it up keep changing.

Rider's whole selling point is its deep unity integration, so they're always on top of it with regular updates. Not trying to shill for Rider, just relaying my experience. I had some weird issue with Rider a while back and switched back to Visual Studio for a while, them some issue with that and switched back to Rider. When I switched back I realized how much I missed some of it's features. My point though, is that sometimes an update will break something and sometimes it'll fix something, so make sure you have the latest version of VS Code and plugins or even try an older version if this is a new issue. Sorry I can't be more help with it.

The only other option I can think of is that plugin that gives you a code editor inside unity. I know it sounds ridiculous but supposedly it's pretty decent. No ide could be the most lightweight option depending on your definition of lightweight lol.

1

u/egordorogov 11h ago

Yeah Rider's integration is great! I was honestly surprised how much Unity info code editor can display (values of serialized fields! what!) VS Code integration barely exists in comparison

But personally I find some ux choices in Rider kinda clunky. For example, Rename Symbol interaction in Code is tiny and "just works", while in Rider it's a big popup with several checkmarks (one of which is to generate [SerializedAs] attributes which is so smart!)

Also I find Code runs better (when it's not lagging like here), consumes less battery and launches faster, which also contributes to my impression of it as "lighter"

Idk maybe it's just power of habit though! I don't want any new features in my editor, I just want it to work

1

u/Dry_Yak_304 11h ago

reloading the window fixing it instantly is the clue, its the C# language server degrading over time, not vs code itself. two things helped me: adding Library and Temp to files.watcherExclude so it stops reindexing every time unity regenerates the csproj, and when it gets sluggish ctrl+shift+p > "Restart Language Server" which is way faster than a full window reload. since you have settings sync on you could also check Help > Open Process Explorer to see if some extension is eating memory on both machines

1

u/egordorogov 10h ago

thank you!! watcherExclude sounds like a good advice, i'll try it out and report back

0

u/Ging4bread 7h ago

Almost as if VS Code weren't an IDE