AddAnyFile icon indicating copy to clipboard operation
AddAnyFile copied to clipboard

Classes created as 'Internal' by default

Open staffordkierandev opened this issue 2 years ago • 2 comments

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

staffordkierandev avatar Feb 03 '23 16:02 staffordkierandev

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

GutierrezDev avatar Mar 02 '23 21:03 GutierrezDev

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

StevenTCramer avatar Mar 08 '23 11:03 StevenTCramer