madskristensen / AddAnyFile

A Visual Studio extension
Apache License 2.0
262 stars 121 forks source link

Classes created as 'Internal' by default #142

Open staffordkierandev opened 1 year ago

staffordkierandev commented 1 year ago

Description

I use AddAnyFile by pressing Shift+F2 and typing a file name. e.g. myclass.cs. In the past, this always created the correct file for me with the public scope. However I have just recently started using the extension with Visual Studio 2022 and alas, it seems to create new class files with the internal scope. Is there a way to revert back to the preferred behavior? I write a lot of decoupled injected code so seldom use internal.

Steps to reproduce

  1. Within Visual Studio 2022 Solution Explorer, press Shift+F2 to create a new c# class file.
  2. Enter the filename (e.g. myclass.cs) into the dialog and press enter

Expected behavior: A new c# class gets created scoped as public

Actual behavior: A new c# class gets created scoped as internal

GutierrezDev commented 1 year ago

I have the same issue. Don't remember which version added this but it change my flow.

StevenTCramer commented 1 year ago

You probably are not actually using the extension.

Visual studio now has a built in AddQuickFile feature. That overrideds the Shift+F2

look at you keyboard bindings

image

To use this extension with Shift F2 you need to set the NewEmptyFile binding.

image