vscode-csharp: "Add using statement" command missing
Environment data
dotnet --info
output:
.NET Command Line Tools (1.0.0-preview2-1-003177)
Product Information:
Version: 1.0.0-preview2-1-003177
Commit SHA-1 hash: a2df9c2576
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.12
OS Platform: Darwin
RID: osx.10.12-x64
VS Code version: 1.8.1 C# Extension version: 1.6.2
Expected behavior
When typing the name of a class, that isn’t currently imported using a using
statement, I’d expect to be able to perform the “add using statement” command that Visual Studio has offered for a long time.
This command automatically resolves a class name to a .NET namespace inside a .NET assembly that’s part of the project, and adds the using statement for that namespace to the current C# code file.
Actual behavior
“Add using statement” command isn’t available in Visual Studio Code.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 7
- Comments: 17 (6 by maintainers)
On the Mac it’s Command + .
You should see this. In my experience, I’ve sometimes had to force it by pressing Ctrl+<dot>.
@richardmcintyre On the Mac it is CMD and . as in
command [dot]
@pcgeek86 it should work just fine, here is a screenshot from my Mac
Make sure that if you open a folder containing multiple projects, in the bottom right hand corner, where it says
Select project
, the one that you are currently editing is selected. Also, make sure that the particular assembly is available in your project all (i.e. isNetStandard.Library
or the relevant package referenced and restored?)Yo “using suggestions” don’t work for me none either on WSL latest VSCode updated everything, but I get those normal suggestions.
@DustinCampbell I tried using
CTRL + .
, but it doesn’t work. Are you sure it works on Mac OS X?