I would like to generate a new C#
Class or C#
Interface in Microsoft Visual Studio Code following the newest C#10
file-scoped namespace syntax.
https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/types/namespaces
Beginning with C# 10, you can declare a namespace for all types defined in that file, as shown in the following example:
namespace SampleNamespace; class AnotherSampleClass { public void AnotherSampleMethod() { System.Console.WriteLine( "SampleMethod inside SampleNamespace"); } }
I'm generating C# classes this way:
Right click on folder in the explorer -> New C# Class.
The output looks like this: (the old syntax with curly braces)
namespace SampleNamespace { class SampleClass { public void SampleMethod() { System.Console.WriteLine( "SampleMethod inside SampleNamespace"); } } }
I'm using C# for Visual Studio Code (powered by OmniSharp).
v1.24.0
VS Code version is 1.62.3
Is there any way to override the generator behaviour to generate new file-scoped namespace syntax?