locating functions by Function name

Source: Internet
Author: User
Tags functions regular expression
Function
In programming often only remember part of the function name, want to quickly locate, but the C # editor function list has no search function, use regular expression search can solve this problem, now write this process as a macro.
How to use:
Open the VS macro editor and paste the following code.
Specify a shortcut key for this macro (optional)
Use the shortcut key or run the macro directly, enter the function name.
Use F3 to search for the next function that meets the requirements.

Sub searchfunction ()
Search for functions by function name
by Pharaoh 2005-4-19
http://blog.csdn.net/pharaoh/
Dim Sfind as String
Sfind = InputBox ("Enter function name")
DTE. Find.findwhat = "^[\t]* (public |protected |private |static). *" + Sfind + ". *\ (. *$" "^[\t]* (public |protected |private | static). * "+ Sfind +" *\ ([^;] *\).*$"
DTE. Find.target = Vsfindtarget.vsfindtargetcurrentdocument
DTE. Find.matchcase = False
DTE. Find.matchwholeword = False
DTE. Find.backwards = False
DTE. Find.matchinhiddentext = True
DTE. Find.patternsyntax = vsfindpatternsyntax.vsfindpatternsyntaxregexpr
DTE. Find.action = Vsfindaction.vsfindactionfind
DTE. Find.execute ()
End Sub
The body of this macro is generated with a record macro of VS, with a small amount of modification. Use this method to quickly generate some macros that are useful to you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.