Author Topic: How to find all matching files in a project?  (Read 4951 times)

Offline resander

  • Multiple posting newcomer
  • *
  • Posts: 49
How to find all matching files in a project?
« on: December 30, 2009, 10:09:08 am »
I need to find all matches in all files in a project, but sometimes I don't get that when using find-in-files, for example:

 - a file-search on 'xxx' sometimes gives no matches, some matches or all matches
 - on local-file-search (Ctrl-F) I get all matches searching on xxx.

Just before writing this I experimented a bit and found that only open files (those shown by tabs above the edit area) seem to be included in the search.

Is there a simple and convenient way to get all matches in a project? I still have some large projects to convert from Windows each containing 100+ files. I would need to use find-in-files a lot for these conversions and have to get all matches each time.


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: How to find all matching files in a project?
« Reply #1 on: December 30, 2009, 10:30:25 am »
Works for me, can you provide a simple project that breaks it?
You could try the ThreadSearch plugin. Also you could try a nightly build (if you're not using one already).
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline resander

  • Multiple posting newcomer
  • *
  • Posts: 49
Re: How to find all matching files in a project?
« Reply #2 on: December 30, 2009, 03:15:50 pm »
Forgot to mention it in the previous email. I am on Ubuntu 8.10 using codeblocks version 5911, which is the latest version from Jens released for Ubuntu via the Ubuntu Update Manager.

Here is minimal test project that demonstrates the problem. It contains a main.cpp and a headerfile.

+++++++++++
#include "headerfile.h"

int main(int argc, char ** argv)
   {
   int testvar1 = SYMBOL1 ;
   int testvar2 = SYMBOL2 ;
   return 0 ;
   }

//  headerfile.h

enum
   {
   SYMBOL1 ,
   SYMBOL2
   } ;
+++++

1. first keep only main.cpp open, A file-search on SYMBOL1 then only shows the match in main.cpp. The defining occurrence in the headerfile does not show up.

2. keeping only the header file open shows only the match in the header file.

3. keeping both closed and then issuing the file search brings up the error message 'No files to search in!', which would make sense if only the open files are searched.


I have been using codeblocks for more than a year and I have only become aware of this problem relatively recently. I ought to have seen it before if it has been like this all the time, but maybe I didn't.

Would be useful if someone can try the two files above for a more recent nightly build (don't know how to build them).
   

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: How to find all matching files in a project?
« Reply #3 on: December 30, 2009, 03:37:36 pm »
I am on Ubuntu 8.10 using codeblocks version 5911,
This is a known bug in theis version and will be fixed soon.

In the meantime you might want to use the ThreadSearch plugin.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ