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
 VS2017 15.8 Multi-Caret Support
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

e-agaubatz
New Member

USA
3 Posts

Posted - Aug 15 2018 :  2:22:46 PM  Show Profile  Reply with Quote
Visual Studio 2017 15.8 added a feature for multi-caret editing, which is great. Unfortunately, when I try to edit a multi-caret selection with visual assist enabled, it types one letter correctly in all selections and from then on only modifies the first one.

Any plans to support this feature? Or is there a workaround to prevent this bug?

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Aug 15 2018 :  3:25:32 PM  Show Profile  Reply with Quote
We are aware of the change, but that is about as far as we have gotten so far on this:

case=117499

Is this something you are using often? I have never quite understood what this is for, then again, I am not used to having it available either.

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

e-agaubatz
New Member

USA
3 Posts

Posted - Aug 19 2018 :  6:18:52 PM  Show Profile  Reply with Quote
I find it very useful for quickly editing multiple things at once without having to do a full find/replace. It works particularly well when combined with the quick add next to selection feature.

I haven't used it much in Visual Studio, since it's brand new, but this is my favorite feature of Sublime Text, so I'm very excited to see it come to VS. The first gif/video on the sublime landing page shows a good example of how it can be used: https://www.sublimetext.com/
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Aug 20 2018 :  07:18:06 AM  Show Profile  Reply with Quote
That video makes sense. I have just been using various forms of find and replace to do the same thing for so long that is how I automatically think of doing the job

In terms of doing this with VA, I assume you will have to have a "master" caret, which will be where any listboxes appear while typing. Trying to show and update the listbox at all carets at the same time isn't going to work well. Or are you thinking of no listboxes at all when doing multi-caret editing?

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

tony.riviere
Ketchup Master

France
57 Posts

Posted - Aug 20 2018 :  09:03:44 AM  Show Profile  Reply with Quote
To me, not having suggestion at all to fix the bug quickly is OK.
But having them on the master caret would be a nice to have. Generally, we use multi caret edition on the same kind of "things" within the same function or class.
I see 3 use cases for multi caret edition:
  • change . to -> or vice versa (not handled by refactoring tools)
  • change the name of a variable / function (handled by refactoring tools but failed sometimes to replace all occurrences)
  • In some rarer cases, rewrite a portion of code at several location at once
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Aug 20 2018 :  3:08:42 PM  Show Profile  Reply with Quote
Do you have many cases where the Rename refactoring is missing some of the references? In theory cases where this happens should be very few and far between, but if you have a bunch of them it would be good to know, and make sure we are aware of the bug in question.

I am also wondering how easy / hard it would be to select all of the references you want to rename at once with multi-caret editing... just testing this here, it looks like the IDE simply goes on exact match for the word, without attempting any clever parsing.

I have put a note onto the case about now showing any listboxes, if this makes things easier. In VS2017 the "master" caret is shown in red, and the "extra" carets are shown in blue, so there is the concept of "this is where I am typing".

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

Zeblote
Tomato Guru

183 Posts

Posted - Aug 20 2018 :  5:29:05 PM  Show Profile  Reply with Quote
This is also useful for fixing up blocks of code that you copied from somewhere, so you can't use the refactorings because it's not valid code until you fixed it up.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Aug 21 2018 :  07:09:48 AM  Show Profile  Reply with Quote
That makes a lot of sense... I have been selecting the block and doing find and replace across it, but now you say this, I will have to keep an eye out for options to try using this like this, to get a better feel for it

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

jschroedl
Tomato Guru

USA
103 Posts

Posted - Aug 21 2018 :  09:05:04 AM  Show Profile  Reply with Quote
I just want to add another vote to please fix this asap. I failed a number of times before I realized that it was VA causing problems. I use multiple carets a lot in VS Code and really want to use them in VS.

One typical use case is to add carets to a number of ragged length lines then press End and start typing. ex. Backspace to strip off ; then type new code or End and add ; for a bunch of lines or // comments etc. It's also especially useful when editing comments with tables of values.

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Aug 21 2018 :  2:00:27 PM  Show Profile  Reply with Quote
We are aiming to have this fixed in the next build, but have not yet fixed this internally. Hopefully we will have this fixed and shipped fairly soon, but it is never safe to make promises until it has passed internal testing.

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

tony.riviere
Ketchup Master

France
57 Posts

Posted - Aug 22 2018 :  05:26:19 AM  Show Profile  Reply with Quote
@feline: the obvious case where the rename refactoring "doesn't work" is when I forget to reload a project containing the symbol, in this case I reload the project and then I do the changes manually.
The other case, which may be a bug, is to find all references of a function in a class inheritance. Sometimes it works, sometimes not. However, I didn't paid attention to the reason. It may happen after a branch switch in git or because it's a large code base with some old fancy code which failed to be parsed (maybe because of some macros).

Also, I didn't tried to rebuild the database; next time I'll try to investigate.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Aug 22 2018 :  08:33:41 AM  Show Profile  Reply with Quote
Only part of the solution is going to cause problems, best will in the world.

For code inheritance though, are you aware of the "Display inherited and overridden references" option in both the Rename dialog and the Find References Results window? If you turn this On we do try to extend the search across the class hierarchy.

Certainly if you come across a situation that VA should be handling, that it's having a problem with, I would be interested in having a look, if you have the time to report it. At the very least make sure we have an open bug report for the problem code.

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

e-agaubatz
New Member

USA
3 Posts

Posted - Aug 22 2018 :  5:00:55 PM  Show Profile  Reply with Quote
Thanks for jumping on this! Sublime text only shows the listbox at the first caret, which I think is a fine solution. No suggestion box would also be fine for the short term.

For me, the nice thing about this feature is that while it's not too intelligent, it's very reliable. Much like find and replace, it doesn't rely on the code compiling and it works consistently 100% of the time. I'll do a rename refactor if I want the IDE to help pick which things to edit.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Aug 23 2018 :  12:55:26 PM  Show Profile  Reply with Quote
That makes a great deal of sense. I am so used to thinking in terms of Find References, and context aware searching, that it is a slight surprise to see such a "simple" search working so well, but yes, the more I look at it, the more it being simple and reliable becomes sensible and helpful.

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 - Sep 24 2018 :  2:26:05 PM  Show Profile  Reply with Quote
case=117499 is fixed in build 2291 (VA no longer interferes with multi-caret edit).
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