简体   繁体   中英

VS Code Intellisense not showing suggestions in C#

Intellisense in VS Code only shows the previously used keywords and identifiers(in the current program) and not suggesting the new ones. The autocomplete only suggests the previously used keywords and identifiers.

禁用 c# 扩展然后重新启用并重新启动 vs 代码为我解决了这个问题

This will help you buddy.

C# language support is an optional install from the Marketplace. You can install it from within VS Code by searching for 'C#' in the Extensions view (Ctrl+Shift+X) or if you already have a project with C# files, VS Code will prompt you to install the extension as soon as you open a C# file.

Visual Studio Code uses the power of Roslyn and OmniSharp to offer an enhanced C# experience. So to summarize, you will need two things to do dotnet development using C#.

Install .NET Core.
Install the C# extension from the VS Code Marketplace.

Refer: https://code.visualstudio.com/docs/other/dotnet

Refer: https://code.visualstudio.com/Docs/languages/csharp

While I can see this is a minor problem and rather annoying - VSCode will do this. It's what makes it different to (IE) Visual Studio (Community / Enterprise).

Since I use both I had to look for a solution myself. I currently use the package 'All Autocomplete' by Atishay Jain ( https://github.com/atishay/vscode-allautocomplete ).

Good luck coding!

Quick edit: It will still not give you back all options for a class if there's no instance of that class (OO).

I closed VSCode, removed the workspace file and when I re-opened the folder with vscode with it asked me if I wanted to use a particular project file or read all project files in the folder.

Either choice would probably be fine as you will have been so annoyed by this issue, you would not get up to creating a second project :)

我已经安装了 BrackedPairColorizer,当我从 VS Code 中删除这个扩展时,它会有所帮助,并且编辑器会在重新加载后开始建议代码。

I had this issue, solution for me was downgrading the C# extension from v1.25.0 to v1.24.1

Other versions may also work but this was the first that I tried

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