question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Add using statement" command missing

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
tverbooncommented, Jan 26, 2017

On the Mac it’s Command + .

5reactions
DustinCampbellcommented, Jan 13, 2017

You should see this. In my experience, I’ve sometimes had to force it by pressing Ctrl+<dot>.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found