T O P I C R E V I E W |
Uniwares |
Posted - Nov 25 2019 : 04:06:03 AM Alt+O doesnt always show all related files in C#, as the following shots show: Missing language resource files (depending in which .cs file you are) Missing nested souce code files.
|
6 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Nov 27 2019 : 4:56:55 PM I had no idea this feature existed in the IDE, and I suspect VA has never looked for it. I have put in a feature request for this:
case=141563 |
Uniwares |
Posted - Nov 27 2019 : 10:34:14 AM Hmm, i see. So its more a positive side effect in C# than expected behavior for all situations. That explains why no related files show up at all in LinqToSQL (.dbml) files |
feline |
Posted - Nov 27 2019 : 10:13:56 AM The test solution you sent me has the same "MainForm.cs" file, but no "MainForm.Test.cs" file, so setting up a test for this now, starting with this test solution.
We do have some fall back logic that Alt-O uses to look for related files, based on the filename, but this normally only gets triggered in C++, where matching files with other file extensions are common. I am guessing this is why these files are being picked up. |
Uniwares |
Posted - Nov 25 2019 : 6:45:23 PM Just checked it out in 2017, same effect, except there is no menu showing up in the mainform.cs instead it jumps directly to the designer. |
Uniwares |
Posted - Nov 25 2019 : 6:25:12 PM All right, lets explain this in details: 1) in VS you can create "related" files, or "nested files", that is files that are somehow related, like a form file and its .designer. file. Often this is used to create partial classes distributed into various files, although they appear under a "main" file. You can do that manually by adding a <depends> entry in the project file (vb or C#) or you can use an extension that does that for you, look for "File Nesting" in the VS extensions. 2) in the images above you can see that when in the "mainform.cs" file, only the "designer.cs and .resx" shows up in the Alt+O menu, but, when in the "mainform.test.cs" ALL related files show up (my guess is that somewhere a filename/extension matching goes on instead of reading the project) 3) from the images above its already clear that its a windows forms/C# project. The VS version is 2019 (november update) (but should be identical in 2017, the <depends> tags exist since many years. ) |
accord |
Posted - Nov 25 2019 : 5:55:50 PM Before I start testing these, I want to make sure I understand the problem.
On the first screenshot the active file is MainForm.Test.cs. I can see the other two tabs in the list, namingly MainForm.Designer.cs and MainForm.cs. What files are missing from that list? Can you please name it, so I can try and reproduce the problem.
Also I'm not familiar with C# projects. What type of project is this? Windows Forms App? Also, what version of Visual Studio are you using? I have created a new Windows Forms app and I see things like Form1.cs [Design] vs Form1.Designer.cs. No sure if it's a function of Visual Studio version or you doing something differently? |
|
|