简体   繁体   中英

Not able to get full Intellisense in Visual Studio Code with Unity functions

Ok, I know this question has been asked and answered many times, but I've spent like 3 days trying to solve this, and nothing I've tried so far has worked. I basically have partial Intellisense in Visual Studio Code; that is, it only seems to recognize Unity classes and variables like GameObject, and doesn't recognize Unity functions like Update() or OnDestroy(). I'm also getting some error messages in the OmniSharp Log that might lead me to believe its a problem with the sln file? I don't really know. The Omnisharp server seems to boot up fine and load the project but then I get errors in the Omnisharp Log like "Received response for /v2/getcodeactions but could not find request" while I'm typing in the editor. Here's an example of what the errors in the Omnisharp Log usually look like:

Received response for /quickinfo but could not find request.

Received response for /completion/resolve but could not find request.

Received response for /v2/getcodeactions but could not find request.

No symbol found. File: /Users/noahbissell/Desktop/Unity Editors/Test/Assets/Test.cs, Line: 11, Column: 12.

Here's all the versions of things I have installed at the moment (also I'm on Mac, macOS Monterey):

  • Visual Studio Code 1.62.3
  • Mono 6.12.0 (Stable channel)
  • .NET 3.0.3
  • Unity Editor 2020.3.23
  • Visual Studio Code Editor Package 1.2.4
  • Visual Studio Code C# extension 1.23.16

Some of the more common solutions I've tried are to set the useGlobalMono variable to "always", and to regenerate csproj files from Unity. I've also made sure that I'm using the correct sln file, and have tried a whole bunch of suggestions from other threads. At this point it feels like I've exhausted all possible solutions but if anyone's figured this out for your setup let me know so I can give it a try. Also if you're on Mac as well could you post your working versions of all the software above so I can try your configuration? I guess as long as I can't get this working I'll just settle for VSCode extensions...

I just got the same error message about /v2/getcodeactions which seemed to stop any packages from being recognized by VSC. The solution seems to be to downgrade VSC Editor Package from 1.2.4 to 1.2.3 for now.

Regarding the error message and the VSCode Editor Package (Received response for /v2/getcodeactions but could not find request.).

  1. Close VSCode.
  2. You must uninstall the VSCode Editor Package from Unity > Window > Package Manager.
  3. Afterward, you (re)install the latest VSCode Editor Package from the Package Manager inside Unity.

With the next startup of VSCode, your project should have the updated files without errors.

I've been having the same issue but reinstalling the Visual Studio Code Editor Package hasn't seemed to work, it still brings up the same errors.

Downgrading hasn't seemed to work either.

Interestingly enough, I'm on Windows and have essentially a completely different configuration, but I'm still experiencing the same issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM