Search code examples
c#renamevisual-studio-2022

Visual Studio Inline Rename feature, is there a good reason not to also rename symbol files?


Going through the new features introduced with the latest Visual Studio they included an update to the Rename tool. There is the option to include; comments, strings, and symbol files. I understand why one may not want to rename comments and strings but can not think of a use case for not including symbol files, can someone give me a good reason not to include them?

While I have been developing for a number of years, there are areas I am woefully lacking in understanding, thanks for the help!


Solution

  • It doesn't rename "symbol files", it asks to rename the "symbol's file", "symbol" being a type name.

    C# doesn't necessarily have the "one type per file" dogma. You can group related classes, records, structs in one file.

    You could for example have a file Orders.cs, containing the symbols Order, OrderLine and OrderAddress. In that case you don't want to rename the file when renaming either symbol.