In the process of program development, one of the functions that programmers often use is to find references (find Reference), and the corresponding function inside Visual Studio is "Find All references" (Find all References).
I have been using notepad++ to write code because I can not find similar features and distress. Have to find all references every time you use Find in files.
However, each lookup requires traversing the entire file system of the target directory, which can take a long time to file.
notepad++ have plug-ins to achieve the same functionality, but compared to the search for the entire file system, the plug-in only need to perform a keyword index, followed by only in the keyword index to find the line. The speed is fast and the result is instantaneous.
I currently found two such plugins, one in plugin manager called "Gtags Search", installed well called "Gtagfornplus". However, after a trial, I found that it was not available in the current version of notepad++ (6.7.9.2). Method of use See: http://sourceforge.net/p/gtagfornplus/code/HEAD/tree/
Another plugin is nppgtags.
This is said in the official statement of the plugin: Gtags built-in code parser supports C, C + +, YACC, Java, PHP4 and Assembly. Other languages is supported through Pygments + CTags parser. This means that the default (built-in) parser only supports C C + + YACC Java PHP4 and assembly language, while optional pygments and CT AGS Parser These two parsers are available for support in other languages. I use notepad++ to develop LUA scripts, so it seems that only the latter two parsers are selected. But Ctags parser actually can only use find definitions and find Reference (find reference) This function is useless. Pygments This has not been used successfully, prompting "Gtags:cannot open shared object ' Pygments-parser.dll '.
It is frustrating to find that LUA cannot be supported. But then I tried. Change the. Lua suffix name to. C To use! So I thought about it. Rename the. Lua under the project file to. C or. hpp to support Lua lookup references. I've actually written a script to do this, so I can find all the references, but it's still necessary to run it. Lua. If you copy a copy and modify the copied. Lua to. C or. HPP, it is not possible to make the modification at the same time as the perfect support for the lookup reference, because the modification will need to apply the corresponding modification to the file with the suffix name modified, and the click Jump in the lookup reference cannot jump to the. lua file, so it cannot be Make modifications to the corresponding LUA files.
In the find pygments can not be used (because someone on the web said to jump out of the hint that Pygments-parser.dll is not open because the specified path is not correct) in the process found in the Nppgtags directory below a file gtags.conf
This specifies that a different parser file (DLL) is used for different languages when using a non-default parser. I found that when using the parser of build-in, I specified a different language corresponding to the file suffix name! So I guess the addition of. Lua can support the creation of the keyword index database for LUA files. As shown below:
Next (make sure to cut back the default parser in setting instead of pygments or ctags), then click on the plugin->nppgtags->create database to create the index databases and then check the keywords to find references (click Plugins- >nppgtags->find Reference), the results are as shown (find results in the bottom window, here is a reference to "rect"):
It is convenient to use with shortcut keys. Click on the search results to access the source file. Yes, it's cool, isn't it:D
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
notepad++ Lookup Reference (Find Reference) (for C C + + and various scripts such as LUA)