Reputation: 31
So I tried to uninstall VSCode, deleting all its files and folders and following guides to reset it. I have dotnet sdk installed, and in VSC terminal dotnet command works I have C# Extension in VSCode installed. In Unity I select VSCode as default script editor, and regenerate all .csproj files. They show up in VSCode when I open a script.
I create new script, open it, and start typing "De" to see if "Debug.Log" gets suggested. Its like VSCode never heard of it What am I doing wrong? Windows 10
Upvotes: 1
Views: 1159
Reputation: 523
C# extention
in VSCode
is uninstalledVSCode
process using the Task Manager
(ctrl+shift+esc in Windows)dotnet SDK
from https://dotnet.microsoft.com/downloaddotnet
using where.exe dotnet
command in a cmd
path
. follow this linkVSCode
, install C# extention
External Script Editor
to Visual Studio Code
Regenerate Project Files
buttonUpvotes: 0
Reputation:
Go to Project settings/external tools and set the visualstudiocode.exe as the script editor
Upvotes: 0
Reputation: 1
I just faced this problem, and fix it by following this link.
Here is my steps:
(Close vscode) Now open a c# file from Unity, and see bottom of your vscode. (the OmniSharp fire and Analyzing)
If it works you will see this. And your intellisense should work now.
If not there maybe:
PS. I'm using Unity 2021.3.5f1
PS2. Stackoverfolow not allow me to post a image.
Upvotes: 0
Reputation: 1016
I had this issue, you can't open C# files by double clicking in Unity, this will work in visuals studio but not visual studio code
Instead right click on an empty space on your project tab and you should find an option for "Open C# project" press on that (you need to make sure that vs code is your default external code editing tool) and you are good to go
Additionally, you need to make sure you have the C# extension and you installed all required C# stuff like .NET framework, mono, or whatever
little tip: install unity tools and unity snippets extensions for better experience
if it didn't work what is your OS?
Upvotes: 0
Reputation: 1
Try following the steps in this link
https://code.visualstudio.com/docs/editor/intellisense
Upvotes: 0
Reputation: 172
I had the same problem for along time but I think it is because Unity are using UnityScript So it is very similar to c# But in Unity There is some little different I think this is why it is not working .
SOLUTION 1:
try downloading Unity snippets extension Just Go To
File>Preferences>extensions
type Unity And Download these 3 extensions I find it more better than the original c# extension
Here is The Links
SOLUTION 2:
If none of the above Worked then the best solution is to download the Visual Studio IDE from Microsoft
Delete VS Code you have and download the Microsoft version [Link above] And Then you can Choose to download the Unity package from the start menu. so no need to download any extensions ..... This Is The Best Solution for your problem there is no fix Just Download And That's it
Upvotes: 2