case insensitive ctags search (TagLEET/OpenCTags/other)?
I’ve created a custom language definition for CTAGS and am finding the TagLEET plugin extremely useful to browse a huge legacy code base. All the CTAGS regular expressions are generated in a case insensitive manner “–regex-…=/…/…/i”
My problem is that the legacy code base mixes case. The language is case insensitive.
Is there a way to configure Notepad++/TagLEET to ignore case when I try to browse a tag: to show me all tags matching the alphanumerics sans case?
Something equivalent to Vim’s “:set ignorecase” and then do my “:ts /”. I don’t want to use Vim.
Other solutions are welcome too.
Thanks in advance for your time.
I am the author of TagLEET. Glad to hear that you find it useful I got nearly zero feedback on it.
This is not relevant to “core” Notepad++ but to the tags plugin.
(1) Is the entire tags file sorted for case insensitivity?
That is tags for symbols aa, Ab, BB will be sorted [aa, Ab, BB] and not [Ab, BB, aa] which is normal case sensitive sorting.
(2) Is there some marker in the tags file header that indicates case insensitivity which TagLEET can read to decide on lookup algorithm?
Probably should be _TAG_FILE_SORTED 2.
First off, thanks again for the awesome plugin. Great work, much appreciated!
When I have “!_TAG_FILE_SORTED 1” case sensitivity doesn’t work and I see the tags in the form [Aa, Ab, BB, aa] as per your example. However, I am able to individually see “Aa” and “aa” through ALT-SPACE. Just not combined, which is what I’m after.
When I have !_TAG_FILE_SORTED 2" I do see the tags sorted in the form [aa, Aa, Ab, BB]. However, the ALT-SPACE window is always empty.
Thanks in advance for your help.
My complete header section is:
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 2 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /email@example.com/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.8 //
pnedev last edited by
You can try NppGTags plugin, it allows case insensitive search.
Just make sure to use initially the plugin’s Search window to set the case sensitivity option to your liking.
You can also find the plugin here.
What you described is expected.
Coming from C world I didn’t think of case insensitivity as an option.
TagLEET can only lookup files that are sorted. And current version only considers ‘case sensitive’ sort. So for files with !_TAG_FILE_SORTED 2 it would not find any results.
New version observes !_TAG_FILE_SORTED flag and replaces case sensitive string comparisons with case insensitive strings comparisons.
One warning. During testing I realized that there may be a problem with underscore ‘_’.
Is it sorted after letters or before?
It seems that ctags sorts it after letters as if all letters are upper case. Cygwin’s sort does the same.
Windows memicmp seems to sort it before letters as if all letters are lower case. Windows ‘sort’ does the same.
I forced TagLEET to use the ctags method but if for some reason another version of ctags will behave differently then Lookup may fail. A workaround will be to run tags file via cygwin’s sort.
@pnedev, thank you for the heads up.
Thanks for authoring/maintaining NppGTags.
And here I was thinking I have to go back to Vim, yet NPP has such a great community!!
Gur, thanks for your time! Much appreciated.
I downloaded the new DLL into my **/plugins, restarted NPP, regenerated my CTAGS with sorted and then again foldsorted… I’m still getting the limited hits when CTAGS is sorted and no results when foldsorted. I.e. no change in functionality since previous version.
Am I doing something wrong? Is it possible the older one was packaged in the new distribution?
When Selecting Plugins -> TagLEET -> About
Do you see version 184.108.40.206?
Gur, yes I do. Sorry, should have said so before: I did double check that.
Can you provide some small example? A few source files and foldsorted tags file.
Some code still used windows ‘XXXicmp’ functions. Sometimes it still worked since sorting is mostly the same.
Implemented my own ‘ZZZicmp’ functions to match ctags sorting order.
Thank you kindly for all your efforts.
Rest assured your work is much appreciated.
Notepad++ with TagLEET is perfect for a use case like mine: legacy code base with a custom CTAGS language definition. Now, even for a language that’s case insensitive.
There are other wonderful Notepad++ plugins for CTAGS, but they tend to focus on updating and regenerating the tags file. I couldn’t really figure out how to make them work with my TAGS and my .ctags–for the custom language I have to work with. With TagLEET there was literally no effort. Generate the TAGS file in the source code’s current folder or somewhere in an ancestor folder and that’s it.
TagLEET is also brilliantly quick. My TAGS file is 140Mb and I saw no problems as of yet.