Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Alt+O missing files, inconsistency
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
1929 Posts

Posted - Nov 25 2019 :  04:06:03 AM  Show Profile  Reply with Quote
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.











accord
Whole Tomato Software

United Kingdom
3272 Posts

Posted - Nov 25 2019 :  5:55:50 PM  Show Profile  Reply with Quote
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?
Go to Top of Page

Uniwares
Tomato Guru

Portugal
1929 Posts

Posted - Nov 25 2019 :  6:25:12 PM  Show Profile  Reply with Quote
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. )
Go to Top of Page

Uniwares
Tomato Guru

Portugal
1929 Posts

Posted - Nov 25 2019 :  6:45:23 PM  Show Profile  Reply with Quote
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.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16777 Posts

Posted - Nov 27 2019 :  10:13:56 AM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
1929 Posts

Posted - Nov 27 2019 :  10:34:14 AM  Show Profile  Reply with Quote
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
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16777 Posts

Posted - Nov 27 2019 :  4:56:55 PM  Show Profile  Reply with Quote
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

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000