-
Notifications
You must be signed in to change notification settings - Fork 686
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
Intellisense not working at all #3286
Comments
I am not getting Intellisense or syntax highlighting as well. I have C# extension version 1.21.3, and .NET Core SDK version 3.0.100. VSCode Info: Version: 1.38.1 (user setup) |
@mrosari0 Since you're on windows, you can use a small workaround. You can follow the directions from here: #3289 (comment)
It should be using msbuild from the new build tools you just installed rather than the one shipping with omnisharp. I think the problem is basically this #3290 Edit: |
The linked comment is not correct. OmniSharp ships with MSBuild 16 since April (OmniSharp/omnisharp-roslyn#1444) - that's why .NET Core 3.0 previews worked with OmniSharp before. It's just MSBuild 16 has assembly version 15.x which is why it shows up in the paths in a misleading way, with 15. There are several other issues that cause certain problems though - especially with .NET Core 3.0 RTM. If you install VS 2019 or VS 2019 Build Tools (or Mono 6+ on *nix), OmniSharp will automatically pick it up instead of the embedded MSBuild and use that for language services - there should be no need to export any additional variables. It has always worked like that (for all VS versions) and it's the safest bet to resolve any issues. For the embedded runtime - without VS/VS Build Tools/Mono - at the moment the best workaround would be to try #3290 (comment) or #3290 (comment). The latter will always be better though as the support in the built-in MSBuild in VS2019 / Mono will be always better than in the built in instance running on embedded Mono. Hope this clarifies this a bit. |
I actually have VS Enterprise 2019 installed so it sounds like I don't need to pick up the build tools. This is what's showing in my OmniSharp Log. I have debugging on but didn't get the output you had referenced. Would these lines work as confirmation?
|
I followed the tutorial from Microsoft for VS Code with Unity and it seemed to finally do the trick... https://code.visualstudio.com/docs/other/unity Steps I took:
Hope this helps! |
I've run into this before. In my case, it was simply because the project was not added to the solution in the directory root. Appears that OmniSharp looks in there to determine which projects to provide intellisense for. |
One thing to be aware of when working with C# scripts in Unity is that you don't want to double click the script from Unity to open it. When this happens, only the file is opened which doesn't pull in the Project references and other information needed to provide intellisense and analysis. It is better to use Assets -> Open C# Project, since that will open the full project in VS Code. |
@JAMJAR64 does this still reproduce for you? How did you open the C# file, as @JoeRobich describes? |
Bro, i have the answer for you. the solution is super SIMPLE you just have to make sure that you already downloaded these tools :
which you can find them all on VSCode, after installing it, close the VSCode and reopen. That's all of it. I've been strolling to any possible solutions I could find for the same problems as yours, but the answer is just as away as your right-hand to your mouse. |
@paulusuluap Bro, I have installed these tools for ages, but still it won't work in Unity 2020. |
Update: I found a workaround on the Unity forum that actually worked: https://forum.unity.com/threads/intellisense-not-working-for-visual-studio-code.812040/#post-5858986 I have no idea why it helped, because I was already running a blank Unity project and Unity should have set everything up already. But it worked. |
Closing out as there was no repro given. |
Issue Description
Intellisense does not work at all. It has not worked since I downloaded Visual Studio Code.
Steps to Reproduce
Downloaded Unity, Downloaded Visual Studio Code, Installed C# Extension and recommended .NET SDK, Intellisense not working.
Expected Behavior
Expected underlines, suggestions, etc. All features of Intellisense.
Actual Behavior
Some suggestions, no descriptions, no underlines. Visual Studio is basically unusable.
Logs
OmniSharp log
C# log
Environment information
VSCode version: 1.38.1
C# Extension: 1.21.3
Dotnet Information
.NET Core SDK (reflecting any global.json): Version: 2.2.402 Commit: c7f2f96116Runtime Environment:
OS Name: Windows
OS Version: 10.0.18362
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.2.402\
Host (useful for support):
Version: 2.2.7
Commit: b1e29ae826
.NET Core SDKs installed:
2.2.402 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Visual Studio Code Extensions
The text was updated successfully, but these errors were encountered: