Show Fixes -> Generate type in new file creates an empty file #2112
Closed
Description
opened on Mar 14, 2018
Environment data
dotnet --info
output:
$ dotnet --info
.NET Command Line Tools (2.0.2)
Product Information:
Version: 2.0.2
Commit SHA-1 hash: a04b4bf512
Runtime Environment:
OS Name: Windows
OS Version: 10.0.16299
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.0.2\
Microsoft .NET Core Shared Framework Host
Version : 2.0.0
Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
VS Code version:
C# Extension version:
1.14.0
Steps to reproduce
- Open or Create a C# project.
dotnet new mvc --auth individual
- Open any C# file. I used
Startup.cs
. - Type MyClass abc
- Click on Show Fixes, or press
Ctrl + .
- From the list of options, select Generate type 'MyClass' -> Generate class 'MyClass' in new file
- Open the generated file
MyClass.cs
- The file contains an empty file, instead of a basic template.
Although the screenshots show I'm using some extensions, I removed all the other extensions from VS Code when I was testing this. Plus I tested on two different machines.
Expected behavior
The generated class or interface file should have namespace and class name defined from templates.
Actual behavior
The generated file has no content.
This is bothering me so much. Any helps will be appreciated!
Activity