Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code IntelliSense suggestions don't pop up automatically

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:

enter image description here

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?

like image 572
Cokile Ceoi Avatar asked Jun 03 '15 09:06

Cokile Ceoi


People also ask

How do I turn on auto suggestion in VS Code?

You can trigger IntelliSense in any editor window by typing Ctrl+Space or by typing a trigger character (such as the dot character (.)

Why is my VS Code not suggesting?

Why is VS Code suggestions not working? If you're coding in JavaScript or TypeScript and finds that VSCode IntelliSense does work but does not behave properly, it's likely that you've selected the wrong language mode. TypeScript and JavaScript share the same language service, so you need to select the right language.

How do I turn off VS Code suggestions?

Type “editor. hover. enable” into the search field then check/uncheck the checkbox associated with “Controls whether the hover is shown.” to enable/disable the suggestion tooltip on hover.


2 Answers

To activate IntelliSense on a .NET project:

  1. Open project folder: File->Open folder...
  2. Click on the flame on your bottom left corner, pick your project click on the flame
  3. IntelliSense activated! IntelliSense is now activated!

From what I've seen, IntelliSense cannot be activated on a .cs file alone. (See @natemcmaster's answer).

like image 59
FlySoFast Avatar answered Oct 14 '22 08:10

FlySoFast


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.

  1. Add your folder. File > Open Folder...
  2. Make sure you have a project file (either project.json or your *.csproj files).

This should be enough for OmniSharp to start providing you Intellisense.

like image 20
natemcmaster Avatar answered Oct 14 '22 09:10

natemcmaster