简体   繁体   中英

VSCode OSX C#, classes not highlighted, no ⌘ + F12 goto implementation

I have Visual Studio Code (v. 1.69.2) running on OSX and it's not doing the following:

  • Doesn't highlight any classes (custom or system classes)
  • ⌘ + F12 doesn't go to implementation of a class or method
  • Doesn't show tooltips over System classes indicating what library they come from, etc.

It does do the following:

  • Highlights basic system struts like int, double, string.
  • Gives intellisense autocomplete while typing.

Some background:

I have the C# (OmniSharp) extension installed and up to date. My VSCode is also up to date. My projects are all .net core 3.1, there are multiple projects in my folder along with a solution file. I've tried "⌘ + ⇧ + P" choosing "OmniSharp Select Project" and selecting the solution, but it doesn't resolve the issue.

The most annoying part is not being able to see the tooltips regarding what exactly a class is and what library it's coming from. For example I was "Using System.Security.Claims" and when I type "User" down in the code, it autocomplete it's available methods but I get no details on what the class is or where it comes from. Is this just the way things are with VSCode, if so it's bordline unusable.

Am I using the wrong extension? (seems to be the Microsoft suggested one)

Screenshots:

在此处输入图像描述

在此处输入图像描述

I ended up installing Visual Studio for Mac 2022 (not Visual Studio Code), for work with another project. This re-installed .net core 3.1 on my machine. After that my Visual Studio Code IntelliSense (OmniSharp Extension) started working. Now I can right click and go to definition etc.

So not sure what the initial issue was, but seems a re-install of .net core 3.1 worked. If anyone else runs into the issue, I'd suggest first removing the OmniSharp Extension, restarting your Mac, restarting VSCode and re-installing the extension. If that doesn't work uninstall VSCode entirely and re-install. Basically after a fresh install of .net core framework everything worked.

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