VSCode integration not working

I know this question has been asked to death but I’ve tried everything and I’m out of options.

What I’ve done so far:
reinstalled unity hub
installed 2022.2.12f1
updated project to 2022.2.12f1
reinstalled vscode
reinstalled dotnet sdk
removed and readded Visual Studio Code Editor 1.2.5
set editor in preferences to VSCode
reset arguments
regenerated project files
manually deleted project .sln
regenerated project files again
reinstalled C# for Visual Studio Code extension
reinstalled IntelliCode
disabled Unity Code Snippets and Unity Tools extensions
(only extensions enabled now are IntelliCode, IntelliCode API, and C# for VSCode)

I’ve tried it all, but still no luck. There isn’t any unity autocomplete.
I heard someone had some luck downgrading Visual Studio Code Editor to 1.2.0, but I couldn’t in package manager.
Is there something I missed or should I just give up and go with visual studio 2022?

All I have is the standard blurb, which is:

This may help you with intellisense and possibly other Visual Studio integration problems:

Sometimes the fix is as simple as doing Assets → Open C# Project from Unity. Other times it requires more.

Other times it requires you also nuke the userprefs and .vsconfig and other crufty low-value high-hassle files that Visual Studio tends to slowly damage over time, then try the above trick.

Barring all that, move on to other ideas:

Also, try update the VSCode package inside of Unity: Window → Package Manager → Search for Visual Studio Code Editor → Press the Update button

Also, this: No suggestions in Vscode

I don’t know if this is necessary unless you’re specifically following these instructions, but search your workspace settings for a checkbox for “modern C#” and make sure that is disabled. I have to disable it to make code analysis work.

Also, in VSCode, do you see something like this at the bottom left?

8919089--1221767--upload_2023-3-31_17-18-53.png

This means that VSCode is using the solution file. If it’s not there, then it won’t have any idea about what files are in your project.

1 Like

Thanks, I did Assets → Open C# Project from Unity, and followed the second link, had some good info.

This was part of my problem. Went and disabled modern .net, still didn’t work and didn’t have the .sln on the bottom. After making that change though I got a different error in output, was missing .NET Framework 4.7.1. Installed that and it works now. Thanks for the help.

1 Like

I recommend moving to Visual Studio 2022 at some point as support for VSCode is officially deprecated now. Unity hasn’t updated the package for it in more than two years which is why it’s as problematic as it is. It will still work for now if you can get it to cooperate (which you appear to have done so) but it’s eventually not going to work.

1 Like

Ah unfortunate. I use VSCode for most of my projects so I was hoping I could stick with it, but knowing it’s not receiving official support I’ll migrate to Visual Studio 2022. Thanks.

Visual Studio 2022 is a heap of bloat. In my case it uses >4x the memory Visual Studio Code uses on the same project, even with tricks like disabling every feature that has a toggle. Clean installs, fast PC, gigabit connection, still bad.

Visual Studio Code is adequately responsive out of the box (because not having typing delay is the bar VS2022 can’t jump) and has every feature I need besides debugging (which Unity abandoned)

It’s a shame that the only official options are a bogged-down IDE past its prime and a recurring fee one that’s not necessarily worth the money either.

1 Like

Try this fork out :stuck_out_tongue: - https://github.com/Chizaruu/com.tsk.ide.vscode

1 Like