Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 VAX 1532: surround selection problem

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
Uniwares Posted - Aug 23 2006 : 11:54:39 PM
VS2005, C#
When selecting some lines, pressing # does insert the #region pragma. With this build i see occasionally that the #region/#endregion is inserted in completely wrong locations, usually right after the ... class ... statement of the current class.

Or simply said: it messes it up badly. Not seeing any pattern in this behaviour.
16   L A T E S T    R E P L I E S    (Newest First)
Uniwares Posted - Sep 18 2006 : 2:48:14 PM
Already running it. Lets see.
support Posted - Sep 18 2006 : 2:44:27 PM
Uniwares: we believe the fix for the random behavior with surround selection is in build 1535. Can you try the build for a while and let us know what you discover.

case=2395
feline Posted - Sep 09 2006 : 3:03:31 PM
using VS2005 professional and VA 1534 i have just tried the same test as Sean.
to select the text i use the home key to make sure the caret is in the very first column and then use SHIFT + DOWN ARROW to select one or more lines of text. i them press # to surround them with #region #endregion

i have just done this to 21 different blocks in this newly saved out file.
i did not save the file after doing the rename, and i did not save the file at any point while i was introducing the #region blocks.

every single block went in just fine.

am i doing anything obviously different?

i am starting to wonder if how you select the text matters. are you using the mouse of the keyboard? sometimes selecting "backwards", either from the bottom up or from right to left causes strange effects with VA enabled. perhaps that is what is going on here. it could explain the random element.
Uniwares Posted - Sep 07 2006 : 6:02:27 PM
exactly what seems to trigger it for me. but its not consistent 100%. Happens in about half the cases I'd say.
sean Posted - Sep 06 2006 : 6:58:31 PM
Does the rename scenario cause it happen 100% or is it intermittent?

Here's what I tried to no avail:
Open cs file.
Do file save as and give new name.
Ctrl+H to rename class in editor.
Select block in middle of class and press #.
Uniwares Posted - Sep 06 2006 : 5:29:47 PM
Since VA rename would also find the original class name and its references I do it with Find/Replace.
sean Posted - Sep 06 2006 : 3:14:44 PM
By rename are you talking about the VA Rename refactoring or doing a find and replace operation?
Uniwares Posted - Sep 06 2006 : 3:07:11 PM
Tried it again.
Seems to happen only when you save a copy of a file and rename the class.
Uniwares Posted - Sep 06 2006 : 2:56:28 PM
Uhm, sorry, my bad. The #region problem is local to one file, it just looks similar to the problem in http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=5223, forget what i said about it in this thread.
sean Posted - Sep 06 2006 : 2:51:03 PM
Thanks for the further info - didn't realize from the original description that multiple files were involved.
Uniwares Posted - Sep 06 2006 : 2:41:29 PM
Original selection is unselected and text is unchanged, on the last active window, at the last insert position the mess starts, the end is where it would be in the original file, eg: 3 lines selected in file A will result in a region inserted in file B beginning at the last insert position, ending 3 lines below.

If the last insert position was in the middle of a line, it will insert the #region in the middle of the line.

I am not sure if its possibly related to changed checked-in files, that would be a possible source of problems: editing prompts to check out, check out will overwrite the file with the changed file, VAX gets confused with the changed contents.
sean Posted - Sep 06 2006 : 1:55:07 PM
Sounds unrelated to coloring - more likely a timing issue, position info incorrect, etc.
Not able to repro but have an idea about how to address it. case=2395

Can you describe the result more?
You have a selection and expect it to be surrounded with a region.
Does the selected text stay where it was? Or does it move?
It sounds like the new text (the # lines) are put in the wrong place - but what happens to the original selection?
Uniwares Posted - Aug 27 2006 : 2:53:57 PM
Coloring is enabled. new code was correctly colored, refactoring worked too (renamed some classes/symbols), next/previous i didnt use, too scared after seeing the mess it did

I guess it HAD parsed the code correctly - what i did, was "save as" of some classes the then rename them through refactoring.
feline Posted - Aug 27 2006 : 1:48:10 PM
do you have VA's enhanced colouring enabled? i am guessing yes.
was it colouring things correctly in this new code?
did you try the alt-m list, or next and previous context at any point before the restart?

if VA had not yet parsed the code this might make sense, but leaves us needing to work out why the code had not been parsed.
Uniwares Posted - Aug 26 2006 : 3:51:53 PM
Cant really say, I've just added a bunch of new classes and added a region around similar parts of code. And in all cases I would just do the same mess. Restarting VS solved it although. Not sure what might be the initial cause. The code was not commented out, actually without any comments. And nothing special - contructor and data members.
feline Posted - Aug 26 2006 : 3:04:44 PM
do you have any idea of how often this goes wrong? i have just tried wrapping various blocks of code in #region #endregion using VS2005, C# and VA 1533. i have done this about 25 times up and down a cs file, with various sized blocks, and the only time anything odd happened was when i tried to wrap commented out code.

do you ever try to wrap commented out code? or anything else "odd"?
if you did this 20 - 25 times would you expect to see it go wrong at least once?

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