"Add using statement" command missing
See original GitHub issueEnvironment 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.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:7
- Comments:17 (6 by maintainers)
Top Results From Across the Web
Does VS Code support adding missing using statement?
i.e type SqlCommand and with cursor at end of d, press Ctro + period. You should get the option there. On a Mac...
Read more >Namespace not recognised in using statement. "The type or ...
Most of the times I see this, the cause is a class with the same name as part of the namespace. These are...
Read more >Generate usings - Visual Studio (Windows) - Microsoft Learn
Add missing usings refactoring · Copy code from a file and paste it into a new one without including the necessary using directives....
Read more >Missing using statement when generating C# code
Missing using statement when generating C# code · Clients · Add ServiceStack Reference · NoWoL November 21, 2016, 4:49pm #1. Hello,. When I...
Read more >show next statement missing from right-click menu
Try adding the menu item using Tools, Customise. Go to Commands tab, “Editor Context Menus | Code Window” context menu. Add the missing...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
On the Mac it’s Command + .
You should see this. In my experience, I’ve sometimes had to force it by pressing Ctrl+<dot>.