I followed the install instructions in https://code.visualstudio.com , but when I write C# code, the IntelliSense suggestions don't pop up automatically, so I must trigger it by using shortcut Command+Space
, meanwhile, the suggestions are just from the code I wrote.
Here is the screen capture below:
I checked in https://code.visualstudio.com/Docs/editingevolved , VSCode do support C# IntelliSense.
I don't think it is bug, maybe I did something wrong when installing VSCode. How to solve this problem?
To activate IntelliSense on a .NET project:
From what I've seen, IntelliSense cannot be activated on a .cs file alone. (See @natemcmaster's answer).
OmniSharp doesn't know where your project files are. In your screenshot, the left sidebar says "You have not opened a folder". OmniSharp will look in your currently opened folder for project files.
This should be enough for OmniSharp to start providing you Intellisense.
Try changing the editor.quickSuggestions
setting to true
in the settings.json file. The settings file may be found in:
Windows: %APPDATA%\\Code\\User\\settings.json
Mac: $HOME/Library/Application Support/User/settings.json
Linux: $HOME/.config/Code/User/settings.json
In my case the problem was that I had 2 versions installed. I was launching from the command prompt and it kept running the older version. In Programs and Features, I removed the one that didn't have "(user)" at the end of the application name, and when I opened Code again, it started downloading packages, one of which was OmniSharp, and then IntelliSense started working.
Note that I was also getting the following warning when opening the older version, and searching for the warning led me to instructions on removing the other version, which in turn fixed the IntelliSense problem:
You are running the system-wide installation of Code, while having the user-wide distribution installed as well. Make sure you're running the Code version you expect.
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.