Visual Studio Code IntelliSense suggestions don't pop up automatically

后端 未结 5 1212
一生所求
一生所求 2020-12-10 10:12

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 i

相关标签:
5条回答
  • 2020-12-10 10:54

    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.

    0 讨论(0)
  • 2020-12-10 10:54

    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).

    0 讨论(0)
  • 2020-12-10 11:10

    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

    0 讨论(0)
  • 2020-12-10 11:14

    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.

    0 讨论(0)
  • 2020-12-10 11:18

    You just have to pick up the language type from the bar at the bottom (the button with the flame).

    0 讨论(0)
提交回复
热议问题