Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Code inspection - option to avoid generating auto

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
EnricoGasperoni Posted - Oct 09 2017 : 9:24:05 PM
My company has a strict "no auto" rule. It would be great if there was an option to tell VA to avoid using auto when generating code.

My main use case is when code inspection converts a regular for loop into a range based for loop (awesome feature by the way) and it always makes the variable auto, and I always have to go change it afterwards.

Thanks,
Enrico
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Oct 11 2017 : 08:56:01 AM
That's fair. The convert auto refactoring command would help, but it's not really the same. I have put in a feature request not to introduce auto when converting a for loop into a range-based loop:

case=111640
EnricoGasperoni Posted - Oct 10 2017 : 7:21:12 PM
Thank you for pointing that auto, I hadn't noticed it and I can see how seeing the type is a pretty useful feature.
However in my case it doesn't help much because the type is explicitly written before Code Inspection converts the for loop so I know that already.
For me it is about the hassle of having to "fix" the result of Code Inspection every time I change a for loop.
If Code Inspection would allow me to opt out from auto, even just for converting for loops, that would make the conversion a one step task for me (which is what CI is trying to do).

Thanks for the quick reply, and thanks for making Code Inspection, it's pretty awesome :)
feline Posted - Oct 10 2017 : 07:26:13 AM
We are looking to add a refactoring command to expand the auto into it's full type:

case=79735

which should help here. For now, are you aware that if you place the caret into a symbol, the VA Definition field (at the top of the editor, where the Alt-m list appears) will show you the full definition, including the expanded type. You can then copy the type from here, which can make it quicker and easier to look up the type when removing auto from your code.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000