Closed o8ruza8o closed 3 years ago
you should set "omnisharp.useGlobalMono": "always" in VS Code settings
Thank you, that did prevent the output I showed in the omnisharp log. However, "Go to Definition" still gives "No definition found" for everything (including things defined in the same file): IntelliSense still does not work.
It seems that my guess was wrong. Could you please help?
can you set the "omnisharp.loggingLevel":"debug" and capture the log output again?
also, if this is a Unity project please make sure you have updated your VSCode Editor package in Unity to version 1.2.3. The earlier version generates an invalid csproj file. See the comments in this issue for more details - https://github.com/OmniSharp/omnisharp-vscode/issues/4113#issuecomment-718006809
VSCode version: 2.9 (with automatic updates) Unity version: 2020.1.8f1 (my project requires some preview packages that need 2020.1)
as I wrote above, please make sure to update the VS Code Editor package in Unity and regenerate the csproj files as discussed in https://github.com/OmniSharp/omnisharp-vscode/issues/4113#issuecomment-718006809
I did that but my comment is too long now for github (maximum is 65536 characters). How do I supply the log?
@o8ruza8o Can you describe what types of intellisense are not working for you at the moment? Looking at the last logs you shared it appears to be correctly loading Unity assemblies and reporting diagnostics to VS Code.
{
"LogLevel": "Warning",
"Id": "CS0612",
"Tags": [],
"FileName": "/home/ruza/RemeshTest/Assets/Scripts/Editor/MyLightingShaderGUI.cs",
"Line": 56,
"Column": 7,
"EndLine": 56,
"EndColumn": 27,
"Text": "'ColorPickerHDRConfig' is obsolete",
"Projects": [
"Assembly-CSharp-Editor"
]
},
Go to Definition/Implementation/Reference does not work. Peek does not work. Find all references does not work.
I am certain my list is not complete. But I do not even know all kinds of intellisense there are.
@o8ruza8o Just trying to narrow things down. In the file MyLightingShaderGUI.cs, if you hover over ColorPickerHDRConfig on line 56, does it show information about the type? Are you able to Go to definition on it?
Yes that works in fact. Surprising you found an example that does after so many I tired that do not.
Obviously, you do not have my project in its entirety. How do I show you examples that fail?
@o8ruza8o It looks like you have 2 project with 6 files and I would expect that intelliesense works well in all of them.
In addition, I see attempts to get information for another file, "/home/ruza/quicksilver/Unity.QuickSilver/Operators/Decimate.cs". I believe the issue here is that the Unity.QuickSilver project isn't part of your solution and won't have any language support. I am not very familiar with Unity, but I believe there is a setting called something like "Generate all project files" or something similar. Enabling this may tell Unity to generate a Unity.QuickSilver project and add it to your Solution.
*Edit Found the setting on the preferences dialog.
Oh, I see what you mean. Yes, there are several files I added as assets to the Unity project for testing and visualization. And you are saying that intellisense works for assets well. That might be true, I did not even notice as I am not developing the assets.
The code I work on is in project under Packages and added via path in Packages/manifest.json. That allows me to keep version control in my repos while importing things as assets makes copies. None of these files had intellisense.
I did generate all project files for everything previously but regenerating them seems to have fixed the problem. Thank you so much!
To review all the steps, as this will need to be done for each Unity project:
If that sounds correct feel free to close this issue. I would suggest updating the error message (see my initial log) to include it as a suggestion instead of directing linux users to get a Windows executable.
I can also recreate this issue. No IntelliSense on MacOS VSCode running OmniSharp for Unity files under a package and asset directory. Can't find definitions, not having any errors highlighted.
Sort of fixed with setting the generate .csproj files for: to include what was needed.
However it's not being able to reference across different assembly definitions
@thomasfdm Have you updated your VSCode Editor Package in Unity to 1.2.3? If yes, could you open a new issue and provide the OmniSharp Log (with omnisharp.loggingLevel
set to debug
) from the Output Pane?
@o8ruza8o Glad things are working for you. I'm going to close this issue out.
Sorry, thought I'd done that but for some reason hadn't actually done the update for some reason. All good now 👍
Thanks. I will try to do all these steps next time I start a Unity project fort testing. Just to clarify I am developing on Linux not MacOS as you mentioned in your last comment.
I had this intellisense issue for VSCode and Unity, using the steps above, I fixed the issue! Thanks guys 👍😄
My missing IntelliSense in a C# mininmal Web Api file for Results.Problem()
was fixed when I switched the "C# Dev Kit" extension to "Pre-Release" (v0.2.70).
OmniSharp does not load correctly. The error message is not helpful on Linux. Please, see log:
OmniSharp log
Environment information
mono version: 6.12.0.90 VSCode version: 1.51.1 C# Extension: 1.23.6
Mono Information
OmniSharp using built-in monoDotnet Information
.NET Core SDK (reflecting any global.json): Version: 3.1.404 Commit: 470f6754b3 Runtime Environment: OS Name: ubuntu OS Version: 20.04 OS Platform: Linux RID: ubuntu.20.04-x64 Base Path: /usr/share/dotnet/sdk/3.1.404/ Host (useful for support): Version: 3.1.10 Commit: 1721e39439 .NET Core SDKs installed: 3.1.404 [/usr/share/dotnet/sdk] .NET Core runtimes installed: Microsoft.AspNetCore.App 3.1.10 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.10 [/usr/share/dotnet/shared/Microsoft.NETCore.App] To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-downloadVisual Studio Code Extensions
|Extension|Author|Version| |---|---|---| |csharp|ms-dotnettools|1.23.6| |emacs|vscodeemacs|0.1.3| |remote-containers|ms-vscode-remote|0.148.1| |unity-debug|Unity|3.0.2| |unity-tools|Tobiah|1.2.12| |vscode-docker|ms-azuretools|1.8.0|;Guess
The problem is most probably coming from OmniSharp using built-in mono instead of the system mono 6.12.0.90 [/usr/bin/mono]. How do I redirect it?