Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-07

"Find in files" suggestion

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt

Hi,

I have all my projects set to use packages.
In fact, the projects are usually mostly empty, as most of the units are in packages. (I share the package between the actual project and the unit testing project)

This works great, but makes searching a bit more cumbersome:

A) it is not possible to search a package in 'Find in Files'. B) Search in directory is overkill, since the only common directory I could enter in the 'Find in Files' scope would include lots of other packages/projects. (thousands of files)

So, would it be possible to add to 'Find in files' the following search scopes:

a) Search in "Open Packages" (all packages that I have opened in the IDE) b) Search in "project and required packages".

Additionally, a 'find' in the package editor dialog would also be highly appreciated.

This is pending the inclusion of project group support in the IDE, after which a 'Search in Project group' can be added ;)

Anyway, these are just suggestions to make Lazarus even better. (I know, I know, it is hard to believe that this is still possible ;) )

Michael.

Reply by email

Václav Valíček
to Michael Van Canneyt

Hi,

V?clav Val??ek

Dne 15.7.2014 13:44, Michael Van Canneyt napsal(a):

Show quoted text 5 lines
[snip] So, would it be possible to add to 'Find in files' the following search scopes: a) Search in "Open Packages" (all packages that I have opened in the IDE)

+1, Would be nice...

b) Search in "project and required packages".

Same overkill as you describe above, if you realise that most projects are dependent on LCL (And it on LCLBase, next LazUtils, next FCL...) and it is huge bunch of files....

Additionally, a 'find' in the package editor dialog would also be highly appreciated.

+1

This is pending the inclusion of project group support in the IDE, after which a 'Search in Project group' can be added ;)

+1000000 :-D

[snip]

Reply by email

Mattias Gaertner
to Václav Valíček
Show quoted text 12 lines
Hi, V?clav Val??ek Dne 15.7.2014 13:44, Michael Van Canneyt napsal(a): > [snip] > So, would it be possible to add to 'Find in files' the following > search scopes: > > a) Search in "Open Packages" (all packages that I have opened in the IDE) +1, Would be nice...

"Open packages" are in Lazarus all used packages. That means used by package editors, project and IDE.

> b) Search in "project and required packages". Same overkill as you describe above, if you realise that most projects are dependent on LCL (And it on LCLBase, next LazUtils, next FCL...) and it is huge bunch of files....

Once searched, the OS has the files in cache and search takes only a few seconds on recent machines.

> Additionally, a 'find' in the package editor dialog would also be > highly appreciated. +1

Maybe better name it 'Find in files'.

Mattias

Reply by email

Václav Valíček
to Mattias Gaertner
Show quoted text 5 lines
> Same overkill as you describe above, if you realise that most projects > are dependent on LCL (And it on LCLBase, next LazUtils, next FCL...) and > it is huge bunch of files.... Once searched, the OS has the files in cache and search takes only a few seconds on recent machines.

While I was doing experiments with resourcestrings, I had clean git checkout of repo (without binaries) and script that greped resourcestrings (or any other word) in source tree... On quadcore server with 4GB of RAM, WD Black (server) HDD and only running ssh and nginx (load was ~0.15) the search took about 25-30 seconds... On my laptop, it was two minutes...

Reply by email

Mattias Gaertner
to Václav Valíček
Show quoted text 11 lines
>> Same overkill as you describe above, if you realise that most projects >> are dependent on LCL (And it on LCLBase, next LazUtils, next FCL...) and >> it is huge bunch of files.... > Once searched, the OS has the files in cache and search takes > only a few seconds on recent machines. While I was doing experiments with resourcestrings, I had clean git checkout of repo (without binaries) and script that greped resourcestrings (or any other word) in source tree... On quadcore server with 4GB of RAM, WD Black (server) HDD and only running ssh and nginx (load was ~0.15) the search took about 25-30 seconds... On my laptop, it was two minutes...

What have you searched?

Using "Find in files" to search for a plain string case insensitive in the whole Lazarus sources (no fpc sources) *.pas;*.pp;*.inc;*.lfm under Linux takes about 3 secs here.
Of course the first time is much longer, when the OS has to load the files from disk.

Mattias

Reply by email

Václav Valíček
to Mattias Gaertner

It was on headless server using *grep***... I have parsed all resourcestrings from lazarus and then was looking for their appearance in the code... I just wrote short script in bash, because I had to write it through ssh from mobile (free time, no laptop). I have tested search in files function on the server and it took 3 seconds first time to search through whole source tree... I'm sorry if I made any confusion or gossip around lazarus Search in Files function :-D

V?clav Val??ek

Dne 16.7.2014 20:18, Mattias Gaertner napsal(a):

Show quoted text 29 lines
On Wed, 16 Jul 2014 18:36:23 +0200 V?clav Val??ek wrote: >>> Same overkill as you describe above, if you realise that most projects >>> are dependent on LCL (And it on LCLBase, next LazUtils, next FCL...) and >>> it is huge bunch of files.... >> Once searched, the OS has the files in cache and search takes >> only a few seconds on recent machines. > While I was doing experiments with resourcestrings, I had clean git > checkout of repo (without binaries) and script that greped > resourcestrings (or any other word) in source tree... On quadcore server > with 4GB of RAM, WD Black (server) HDD and only running ssh and nginx > (load was ~0.15) the search took about 25-30 seconds... On my laptop, it > was two minutes... What have you searched? Using "Find in files" to search for a plain string case insensitive in the whole Lazarus sources (no fpc sources) *.pas;*.pp;*.inc;*.lfm under Linux takes about 3 secs here. Of course the first time is much longer, when the OS has to load the files from disk. Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140717/cf2bacb8/attachment-0001.html>

Reply by email

Michael Van Canneyt
to Mattias Gaertner: On Wed, 16 Jul 2014 08:32:27 +0200 "Open packages" are in Lazarus all used packages. That…
Mattias Gaertner wrote 18 lines
On Wed, 16 Jul 2014 08:32:27 +0200 V?clav Val??ek wrote: > Hi, > > V?clav Val??ek > > > Dne 15.7.2014 13:44, Michael Van Canneyt napsal(a): > > [snip] > > So, would it be possible to add to 'Find in files' the following > > search scopes: > > > > a) Search in "Open Packages" (all packages that I have opened in the IDE) > +1, Would be nice... "Open packages" are in Lazarus all used packages. That means used by package editors, project and IDE.

Let me rephrase that: Packages for which a dialog is visible.

> > b) Search in "project and required packages". > Same overkill as you describe above, if you realise that most projects > are dependent on LCL (And it on LCLBase, next LazUtils, next FCL...) and > it is huge bunch of files....

Good point, I hadn't thought of this. See however the above 'for which a dialog is visible'.

The situation I'm having difficulties with is that I have a project that uses some packages (I develop the packages). Although they are 'logically' part of the program, the packages are scattered over a variety of places, since they're used by other programs as well.

When working, I usually have the program + all relevant packages visibly open in the IDE.

To do a search is now very cumbersome, since I must repeat the search several times with 'find in directories'. (and that happens several times a day)
I could create a monster project and include all files in that. Kind of defeats the purpose of packages obviously.

My conclusion is that it is one more reason why project group support (and a related 'Find files in' option) is really a must. I'll have to dive in my implementation again :(

Michael.

Reply by email