Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Joining multiple code lines together

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
rpalma Posted - Oct 31 2017 : 07:23:18 AM
A new coding assistance feature to join multiple adjacent lines of code together would be helpful.
Consider the following snippet:

int GetValue() const
{
  return m_nValue;
}

After selecting those four lines in the editor and pressing a 'join lines' keyboard shortcut, the content of those lines will be collapsed, with unnecessary white space removed:

int GetValue() const {return m_nValue;}

Also, it would be nice to be able to join the 'current' line with the next one via a keyboard shortcut, without having to select those lines first.

I know there are VS extensions that can do this, but it would be nice if my favorite extension would support this feature.


4   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Oct 31 2017 : 11:41:25 AM
I like the idea and I have put in a feature request for this:

case=112075

I would imagine this as a refactoring command.
feline Posted - Oct 31 2017 : 10:03:28 AM
Unfortunately this is really getting into code formatting, which is something we are not looking to add to VA at this point in time. The reason is simply that everyone wants something different, so you end up having to have a great many options to specify all of the different formatting rules people want.

I know VBA macros have been removed in recent versions of the IDE, but there are a couple of extensions that can add this ability back in again. But yes, this does leave you needing to use another extension, but hopefully one designed to do this specific job well.
rpalma Posted - Oct 31 2017 : 09:49:49 AM
Unfortunately VBA macros have been removed since VS 2012, if I am right.
As this is something that I need to do quite frequently, I don't wan't to repeat all the necessary steps to accomplish this via regex find/replace.
So that brings me back to extensions, and my question to include this in VA, as I want to limit the number of installed extensions.
feline Posted - Oct 31 2017 : 08:50:56 AM
A fairly simple regular expression search and replace will do this for you. To automate this, and map it to a keyboard shortcut, you could write an IDE macro and map the macro to a keyboard shortcut. This would require an earlier IDE which still has macros built in, or a macro extension, but doing it this way would give you full control over the formatting via the search and replace.

In fact, this sample macro, that does a search and replace across selected lines of text, could easily be changed to do exactly this:

https://support.wholetomato.com/default.asp?W445

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