Skip to content

Show Fixes -> Generate type in new file creates an empty file #2112

Closed
@brokenbacon

Description

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:

image

C# Extension version:

1.14.0

Steps to reproduce

  1. Open or Create a C# project.
    dotnet new mvc --auth individual
    
  2. Open any C# file. I used Startup.cs.
  3. Type MyClass abc
  4. Click on Show Fixes, or press Ctrl + .
  5. From the list of options, select Generate type 'MyClass' -> Generate class 'MyClass' in new file
  6. Open the generated file MyClass.cs
  7. The file contains an empty file, instead of a basic template.

image

image

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

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

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions