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
 Feature Requests
 case sensitive includes
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

daThomas
Junior Member

15 Posts

Posted - Dec 16 2009 :  05:02:11 AM  Show Profile  Reply with Quote
Hi,

when writing software in Windows, you often get compiler errors under unix due to wrong case in the include files.
FAT and NFTS are case-insensitive and accept any style of writing include files.

What about checking the files and correct them? The file could be searched on disk to get the correct filename and corrected afterwards perhaps. This would be a nice enhancement that would save much time.

regards,
Thomas

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Dec 16 2009 :  5:54:58 PM  Show Profile  Reply with Quote
Are you aware of "Add include" refactoring? As far as I know it adds case sensitively the headers, so you may avoid these type of problems using this tool. Or accepting suggestions while typing the file name in the include statement also corrects the case. Certainly, these won't help with already added include statements.
Go to Top of Page

daThomas
Junior Member

15 Posts

Posted - Dec 17 2009 :  03:01:33 AM  Show Profile  Reply with Quote
Right. I know the new feature but we have tons of code in lots of different modules. Here and there, a module is patched or released in a new version and it would be cool to run such a tool as check before release.
We are using our own build system and have therefore sometimes problems with the suggestions for new includes as they seem to be not found/known by VA.

What i currently do is using the (little enhanced) sorting feature to sort and group the includes. As sorting is case sensitive, this is not so easy and thats why some of us switched to lower case before sorting ... :)
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Dec 17 2009 :  1:09:22 PM  Show Profile  Reply with Quote
What if I put in a feature request for sort feature to be case insensitive? I know you mentioned this to illustrate how many include statements are affected rather than just asking for an another "workaround", an evasive answer. But to be honest I think that a feature like this would be strange since our main platform is windows where it is not a problem. My first idea is to create a new refactoring but still you would need to do it on every include or at least on every file. I would write an easy tool for it since this task does not require symbol information or any other fancy detail.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - Dec 17 2009 :  2:55:06 PM  Show Profile  Reply with Quote
It turns out there is already a feature request for making sort lines case insensitive:

case=29858

daThomas finding all of the #include lines with the "wrong" case gets us into static code analysis, and is going to have problems. For example what happens when the same header file exists but with a different case on Windows and unix machines? Currently we don't have any plans to get deeper into this sort of code analysis.

Personally I would be tempted to just run a find, grep across all of the .cpp and .h files, sort and unique the #include lines, and then try to diff this against a sorted list of all solution header files on the unix machine.

A little rough and ready, but it should produce usable results quite quickly from a unix command line, since you would know which #include statements were wrong, so you could just grep for them.

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

Arnt
Junior Member

20 Posts

Posted - Mar 25 2010 :  06:49:18 AM  Show Profile  Reply with Quote
Yes, especially for sorting lists of headers, case insensitive sort as an option, or better even as an extra command, so you can even have both buttons on the toolbar (or keyboard shortcuts) would be wonderful.
Go to Top of Page

Arnt
Junior Member

20 Posts

Posted - Mar 25 2010 :  06:53:49 AM  Show Profile  Reply with Quote
(This was also suggested in the beta form: http://forum.wholetomato.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=3048 )

I'm wondering, does anybody actually want case sensitive sorting for anything?
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - Mar 29 2010 :  6:14:31 PM  Show Profile  Reply with Quote
Case sensitive sorting comes up occasionally, as you have found, but not that often. It is one of many feature requests we have and are considering.

For now it should be possible to write an IDE macro to sort a selected block of text. This macro for manipulating a block of text should help to point you in the right direction:

http://support.wholetomato.com?W445

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

Arnt
Junior Member

20 Posts

Posted - Mar 30 2010 :  05:06:45 AM  Show Profile  Reply with Quote
Thanks for the pointer, I made my own macro to sort.
(However, I think it would be nice if VA include the option. Just add an extra 'Sort Selected Lines (case insensitive)' in the long list of commands you already have.)
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - Mar 31 2010 :  11:23:00 AM  Show Profile  Reply with Quote
We are considering adding this feature to VA one day, it is covered by:

case=29858

but it is not currently a high priority. One of our main focus's right now is on VS2010 support.

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

sean
Whole Tomato Software

USA
2817 Posts

Posted - Jul 18 2016 :  10:44:37 PM  Show Profile  Reply with Quote
case=29858 is implemented in build 2107.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000