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
 Feature Requests
 Search symbols or strings in current function
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bogdanc
New Member

5 Posts

Posted - Jul 05 2016 :  07:13:13 AM  Show Profile  Reply with Quote
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.

foxmuldr
Tomato Guru

USA
412 Posts

Posted - Jul 05 2016 :  08:40:39 AM  Show Profile  Reply with Quote
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. :-)

Edited by - foxmuldr on Jul 05 2016 08:41:57 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Jul 05 2016 :  2:00:55 PM  Show Profile  Reply with Quote
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.

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

bogdanc
New Member

5 Posts

Posted - Jul 05 2016 :  2:46:41 PM  Show Profile  Reply with Quote
Oh, didn't know about Alt+]. Thanks, that's close to what I want!
Go to Top of Page

bogdanc
New Member

5 Posts

Posted - Jul 12 2016 :  11:51:56 AM  Show Profile  Reply with Quote
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 :(.

Edited by - bogdanc on Jul 12 2016 11:53:01 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Jul 12 2016 :  6:20:22 PM  Show Profile  Reply with Quote
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?

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

Dusan
Whole Tomato Software

Slovakia
177 Posts

Posted - Jul 15 2016 :  02:57:05 AM  Show Profile  Reply with Quote
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.

Edited by - Dusan on Jul 16 2016 3:20:58 PM
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jul 15 2016 :  2:27:24 PM  Show Profile  Reply with Quote
Triple click in VA Outline will also select the whole method or any other symbol.
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