SUGGESTION: Find, Find Next ehancements

Started by RickJ, Thu 02/10/2008 19:23:28

Previous topic - Next topic

RickJ

I am working on a fairly large module at the moment.  Navigating around such a large file has inspired me to think about ways of making this easier and so I'd like to share a couple of things on my wish list.

Find History
How about having another drop list, as is done for function names, that would contain the text of previous Find operations.   The list would be ordered from most recent at the top and least recent at the bottom.  The list could be limited to an arbitrary number of the most recent items searched for if necessary or desired.

A click on an item in this list it would copy that item to the find buffer and perform a Find  Next operation.   Subsequent presses of the F3 key would search for the same text.  On opening the Find Dialog (if no other text is selected) the search text field would also contain the text selected from the list.

Reverse Search
Would like to be able to search in the other direction (i.e. from current position in file towards beginning).  Perhaps it could be implemented with an extra button on the Find Dialog and a ctrl+F3 short cut?

Separate Find and Replace Menu Picks
People almost always know if they want to Find or Replace something before they click on the menu.   As it is now at least 50% of the time they have to click on an extra button to get the dialog that they really want.   

Couldn't there just be another Menu pick called Replace that opens the same dialog only with the replace field activated and conversely couldn't the Find menu pick open it without the replace field activated?   Everything else could be the same as it is now.

F3 - Find Next shortcut closes  Find Dialog
How about closing the "Find" dialog box and then doing the normal "Find Next" action when the F3 button is pressed?   If someone wanted the dialog to stay open they could just click on the Find Next button in the Find Dialog or press enter.   If they wanted it closed but still wanted to do  multiple Find Next operations they would just use the F3 key.   

Pumaman

These sound like reasonable suggestions, does anyone else have any comments on whether they would be useful?

Dualnames

How about this? I'd love to be able to find a variable(a global for example), in any scripts its placed, room scripts, modules,gloabl
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

SSH

A find-in-any-script woudl be handy, as well as searching for a string in char names, etc too
12

RickJ

Although I wished I had something like this on many occasions I am not sure a global find function is practical to implement.  It would have to open and read every single file and in a large game this could possibly take a longer time than people would like.   

I was thinking that perhaps a better and more practical approach would be to have a compiler option that would direct the compiler to create a listing in the form of a text file.  The text file could show where everything was defined and used as well as other useful information. 

The text file could be opened with the script editor and so would be searchable via the find function.   The usage info would be very helpful in identifying unused crap during  pre-release cleanup and at other times.  Also if we were allowed to write to and save the file, it would be possible for us to markup the file to keep track of what we are doing with it.

Dualnames ans SSH what do you guys thing about this?

Makeout Patrol

I always assumed that searching all scripts for something was impractical, but if it was feasible it would be a fantastic debugging tool. Either way, I would use the hell out of a separate 'replace' window and an improved 'find next' functionality.

Dualnames

Quote from: RickJ on Sat 04/10/2008 02:05:24
Although I wished I had something like this on many occasions I am not sure a global find function is practical to implement.  It would have to open and read every single file and in a large game this could possibly take a longer time than people would like.   

I was thinking that perhaps a better and more practical approach would be to have a compiler option that would direct the compiler to create a listing in the form of a text file.  The text file could show where everything was defined and used as well as other useful information. 

The text file could be opened with the script editor and so would be searchable via the find function.   The usage info would be very helpful in identifying unused crap during  pre-release cleanup and at other times.  Also if we were allowed to write to and save the file, it would be possible for us to markup the file to keep track of what we are doing with it.

Dualnames ans SSH what do you guys thing about this?


You mean like a window or whatever sort of section CJ wants, that when you click search everywhere you'd get a list of where the variable(or whatever you searched can be found).

If it's something like that or similar, it sounds good.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

RickJ

#7
I was thinking more along the lines of a function in the Build menu "Rebuild All (with listing)".  The compiler would generate an old school listing in the form of a text file.  The file could have a number of sections containing info about the game.   For example there could be one section documenting sprite usage and another section showing where variables/functions are defined and where they are used.

Since not everything is in a text file format a search function would likely have to partially duplicate the compiler's operations and would possibly take longer than anyone would desire.   I'm speculating that when the compiler does a "Rebuild All" operation it knows where everything is defined and used and could produce some kind of a report that could be used later to provide "where used" and "where defined" information as well as other things that may be useful to know.     

What other things?  How about something like a memory(disk map) showing how much space is taken up by different entities.  So if someone was trying to minimize their download size they could use such a report to identify where to apply their efforts.   There could also be a section with a list of things which are never referenced.  This would be very useful in removing sprites, variables, functions, etc that are no longer necessary.  Having such a report is, IMHO, more efficient that searching things out one by one.

I guess the downside is that the file can get out of date and would need to be regenerated periodically.  You would likely also have to manually navigate to the location of the thing of interest. 

Anyway I think we are getting way beyond the scope of the original simple suggestions, which CJ seemed willing to do if a couple of other folks also thought they would be useful.   Y'all please  remember that "A bird in the hand is worth two in the bush!".   ;D

[edit]
Hmmm, or was it "A hand in the bush is worth two birds..." ?  :-\

Dualnames

Quote from: RickJ on Sat 04/10/2008 09:42:22
I guess the downside is that the file can get out of date and would need to be regenerated periodically.  You would likely also have to manually navigate to the location of the thing of interest. 

It's sort of a more advanced command, so I'm sure newbies won't get put off by it, and CJ could allow an option that would be off automatically, that you can regeneration of the file everytime you compile the game.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

paolo

Quote from: SSH on Fri 03/10/2008 10:01:16
A find-in-any-script woudl be handy [snip]

Yes please! This would be extremely useful and is something I've wanted to use many a time.

Trent R

I agree with the global search or whatever you want to call it.

As for the normal find box:

History-I don't think it's really necessary, but I guess it would be nice if you were working on a large module.
Reverse- Definitely! I feel this is a must!
Separate Menu choice-Not needed whatsoever, you don't need to put something in the replace box for the find to work, so why bother? Besides, I use Ctrl-F
F3 Shortcut-I don't use F3 for searches, but it would be a nice addition (with the feature RickJ mentioned)

My 2¢.
~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

TwinMoon

Quote from: Trent R on Wed 29/10/2008 21:03:58
F3 Shortcut-I don't use F3 for searches, but it would be a nice addition (with the feature RickJ mentioned)

But this is already implemented!

Kweepa

Quote from: RickJ on Sat 04/10/2008 02:05:24
Although I wished I had something like this on many occasions I am not sure a global find function is practical to implement.  It would have to open and read every single file and in a large game this could possibly take a longer time than people would like.   

This is a standard feature of most major IDEs. It generally works in conjunction with a "find all" feature that lists the occurrences in a tab. Clicking on an occurrence opens the file at the appropriate line.

Something I've always wished for in a search function (not necessarily in AGS) is a google-style search where you type in some words and it finds places where the words are nearby, ranked. AND, OR, NOT would be icing.
Still waiting for Purity of the Surf II

Trent R

Quote from: TwinMoon on Wed 29/10/2008 22:06:53
Quote from: Trent R on Wed 29/10/2008 21:03:58
F3 Shortcut-I don't use F3 for searches, but it would be a nice addition (with the feature RickJ mentioned)

But this is already implemented!
My comments were just based off of the original post.
~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

TwinMoon

Pressing F3 to 'search again' was possible for a long time (2.72 had it). If it's just the issue of the Search Window staying open, hitting the escape button is possible, so it doesn't bother me personally.
Actually I think it's better when it does stay open, when someone doesn't know s/he can use F3, it would be a real nuisance.

And while I'm posting, a 'search all scripts' function would be a real timesaver. So +1 on that ;)

RickJ

F3
Please read the original post carefully.

Currently if you open the find window to enter the search string it will stay open until the cancel button is clicked.   If the window is open the F3 key is ignored and does nothing.   The suggestion was to allow the F3 key to close the window and then executes it's normal Find-next function.   After the search text is entered, the window no longer serves any useful purpose; it only obscures the script file.   

Separate Find and Replace Menu Picks
It's already implemented in the latest beta and is greatly appreciated by at least one person. ;).

Search History
It's already implemented in the latest beta and is greatly appreciated by at least one person. ;).

Global search
I agree with what  Steve said.

I would like to add that there needs to be a way of searching the entire game not just scripts.   It doesn't happen very often but once in a while you can get an orphaned reference in a no-script part of the game.  When it happened to me last the error got past the compiler and all I got was a "unresolved importof xxxx" message at run-time.     

It could be part of a global search or as I have suggested earlier perhaps the compiler could generate a listing of some kind.


SUGGESTION: Quick Search
Steve inspired this thought when he mentioned the Google like functionality.  This hasn't to do with internet type queries, just a little different UI to the existing search function. 

Create another drop list at the top of the script file just like the existing function search.  So the function search and the quick search drop lists would be on the same line and each would occupy half the width of the script page.   The quick search drop list would contain the search history; click on an item and the text is copied to the search buffer and a find-next operation is performed.   Type in a new string in the drop field and that text is copied to the search buffer and a find-next operation is performed.


SMF spam blocked by CleanTalk