Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Search symbols or strings in current function

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
bogdanc Posted - Jul 05 2016 : 07:13:13 AM
Apologize if this already exists and I'm missing it somehow, but in case it's missing, would be great to search for a symbol or a simple string _only_ in the current function the cursor is in, with wrap around if possible.

With a wide monitor and huge functions, I'm always doing mental gymnastics to find where I land (if I'm still in that function or outside) after I do a string search.

Thanks.
7   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Jul 15 2016 : 2:27:24 PM
Triple click in VA Outline will also select the whole method or any other symbol.
Dusan Posted - Jul 15 2016 : 02:57:05 AM
You can press Alt+] multiple times to get whole funtion selected.

If you don't like to press it multiple times, you can hold Alt+] pressed and key repeat will invoke command as many times as necessary. If selection leaks your expected range, you can use Alt+[ to shrink selection to expected range.

If you want to select method in single click and your VA Outline is open, just use "Select in Editor" item from context menu of VA Outline.
feline Posted - Jul 12 2016 : 6:20:22 PM
What you are describing, what you are seeing, is not very helpful, I agree. Which IDE are you using? Using VS2015 with VA 2012 I am seeing something different. Using the following very simple test code:

int simpleGlobalVar;

void testFindScopeOne()
{
	if(true == false)
	{
		// select and copy "simpleGlobalVar" on the next line
		// Alt+] twice to select just this function
		// then IDE find
		simpleGlobalVar = 0;
		simpleGlobalVar++;
	}

	simpleGlobalVar--;
}

void testFindScopeTwo()
{
	simpleGlobalVar = 2;
	simpleGlobalVar += 3;
	simpleGlobalVar--;
}

I did the select function, and then find across the selected code. At this point no code is selected. Pressing F3 moves me through only 3 references to "simpleGlobalVar". When the end of the function is reached, I am taken to the first reference in the function once more.

This has no effect on VA's:

VA Options -> Highlighting -> Highlight write and read references to symbol under cursor

setting and behaviour, so you can still use this highlighting to help track another variable, while working on the variable you did the find on. If you try the same steps, what results are you getting?
bogdanc Posted - Jul 12 2016 : 11:51:56 AM
Sorry to revive this, wanted to share the experience using the workaround.

I have to say it's not great. I'd just love to have a CTRL+SHIFT+F3 to wrap around search in the current function, without me having to move the cursor in a proper spot to be in the function namespace not in an if(), then ALT+], which highlights the selection (this is killer), which overrides the current highlights I already have (variables I'm watching). Then for the entire search duration I have to work with code selected being highlighted, which is not ideal for my eyes or brain at all.

Sad panda :(.
bogdanc Posted - Jul 05 2016 : 2:46:41 PM
Oh, didn't know about Alt+]. Thanks, that's close to what I want!
feline Posted - Jul 05 2016 : 2:00:55 PM
I know its not quite the same, but have you considered using Smart Select:

https://wholetomato.fogbugz.com/default.asp?W560

to select the entire current function, and then do an IDE find across the selected code? F3 will then cycle you through the find results, which will be limited to the current function.

The advantage here is that this is already available, and you can quickly select the current function with a few presses of Alt+], then trigger Ctrl-F.

The idea is interesting, I am just not sure how much help it offers in general.
foxmuldr Posted - Jul 05 2016 : 08:40:39 AM
quote:
Originally posted by bogdanc

Apologize if this already exists and I'm missing it somehow, but in case it's missing, would be great to search for a symbol or a simple string _only_ in the current function the cursor is in, with wrap around if possible.

With a wide monitor and huge functions, I'm always doing mental gymnastics to find where I land (if I'm still in that function or outside) after I do a string search.

Thanks.



I must say, that is an excellent suggestion! Now, let's see if the VA staff will receive it. :-)

Best regards,
Rick C. Hodgin

PS - My only account on this system is this one, and I have not told anyone of my request, save those who would've read it here. The solicitation I reply to above is here at VA forums entirely on its own merits. It has nothing to do with me, though I do find it interesting. :-)

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