Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console.WriteLine snippet always prepends System #104

Closed
billwert opened this issue Mar 17, 2016 · 4 comments
Closed

Console.WriteLine snippet always prepends System #104

billwert opened this issue Mar 17, 2016 · 4 comments

Comments

@billwert
Copy link
Member

When you use the 'cw' snippet to insert Console.WriteLine in VSCode, you always get 'System.Console.WriteLine()', regardless of the presence of 'using System' in the file.

@DustinCampbell
Copy link
Member

This'd be nice to do, but I don't think there's a way to do this with VS Code snippets today. AFAIK, there's no way to run code when a snippet expands.

@billwert
Copy link
Member Author

Hmm, that's too bad. It may be worth trying to push a request down into VSCode to enable this. I am going to open another issue pertaining to the exception snippet: it currently includes the serialization ctor, which isn't supported on .NET Core. I'd love to see the snippet support include TFMs somehow so you can get appropriate snippets for the platform you're targeting. Perhaps we just need a meta issue for "have snippets work better in the context of the project they're being used in", which would drive the right platform support?

@JoeRobich
Copy link
Member

Closing as we offer CodeActions to simplify type names.

@JoeRobich JoeRobich closed this as not planned Won't fix, can't repro, duplicate, stale Nov 8, 2024
@glen-84
Copy link

glen-84 commented Nov 10, 2024

@JoeRobich Please consider using Console.WriteLine for the snippet, since ImplicitUsings is enabled by default in new projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants