Godot: Search through all currently opened scripts

Created on 10 Oct 2015  路  15Comments  路  Source: godotengine/godot

When you press control+f and search something wile scripting, it only looks through the script you are looking at. I think it would be a nice time-saver if there was an option to look through all scripts that are currently opened.

feature proposal editor usability

Most helpful comment

Or all scripts in the project. :+1:

All 15 comments

Or all scripts in the project. :+1:

:+1:

I plan to implement this after replacing the current search dialog with a search bar.

I may end up doing this in time for 2.1. I have a doubt though: Do we want this option to search only on scripts or should other text files be include?

I think it would be most useful for (opened) scripts. It could be a good idea to make some quick-open-file option where it searches through the file content as a pose to only the file name. This would have to be discussed in a separate issue though.

The ideal thing would be the search Sublime Text 3 provides. But that's more work I guess^^

It would be great to have these in the dialog:

  • The text to search
  • A combo box for the scope of the search: current file, opened files, all files
  • A file filter, by extension for example (text box? Or combo box?)

Then display the results in a window, or a dock so we can iterate on results without having to redo the search. Having an option to show the context where the occurences are found would be nice too.

Note: I mostly use this feature as a replacement for "Find all references", which is a must have when you refactor anything. Which would be even better, but that's not the scope of this issue :p

As GDScript works currently, a "find all references" wouldn't be much different of a "search files for string" (unless you hack in some inference cleverness).

But I too miss this search feature, so it's a :+1: from me. Just not sure about the extension filter. Currently the editor can only open .gd files, so that's the only file type to search.

@vnen maybe it will change, one day. There is an issue for it: https://github.com/godotengine/godot/issues/1390

@neikeq Do you still intend to work on this for 2.1, or should it be postponed to 2.2?

I didn't have time to work on this for 2.1 so moving to 2.2

I am too busy with mono integration. Feel free to take this one if anyone wants to.

See #6217 for some implementation thoughts.

Any progress on this? Its a rather useful feature to have 馃憤

I just coded a quick glob search in GDScript for 2.1.4, because I need it so badly when developping my game (too bad, I couldn't find a function to open a script at a given line).
For now it does the bare minimum without stall, completely independent from the editor, but it took me only an evening to make it:

image

Lots of room for improvements but nothing too difficult I think :)

Fixed by #16571.

Was this page helpful?
0 / 5 - 0 ratings