Intellisense for available 'using/import's in C# with Visual Studio Code

Fudge Fudge picture Fudge Fudge · Dec 28, 2018 · Viewed 11.8k times · Source

Edit: Vidual Studio Code and Visual Studio are 2 different things. Yes it's confusing but I know that VS has this feature, I'm asking about VS code.

Is there some extension/setting that makes Visual Studio Code's c# have Intellisense for all available namespaces, including those that were not yet imported, and then imports them when selected?

Example: Collections are not yet imported and I want to type IEnumerable and import it. Being the average programmer this is quite tedious and I might screw up the spelling or capitalization, and then have to press ctrl+.. I would like to just be able to type "ienu" and then IEnumerable would pop up and would be autocompleted and auto imported.

This feature exists for Typescript in VScode (thanks to an extension), and even for C# but in Visual Studio with the Resharper extension.

I have searched everywhere for this feature but it seems to me like it doesn't exist. It honestly feels insane to code without this.

Answer

Frip picture Frip · Nov 23, 2020

If you use "C# extension" for VSCode (this https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp)

you can try follow next steps:

  1. Right click on C# extension
  2. "Extension settings"
  3. In opened "Settings" tab, add import in search area
  4. Enable Checkbox (Screenshot of this step)
  5. Enjoy autoimport without "special" extension (Screenshot)