Sublime Forum

Find File in Project API

#1

I’ve been working with some various custom commands to get to files open quickly. I’ve really enjoyed the goto overlay with the “show_files” option set to true since it allows me to quickly search the folders I have added to the project. However, sometimes I would like to make a plugin that does this search in the background and makes decisions about the results without any sort of user input. For example I’d love to be able to get a full path to a search for a file with a specific file name, like a “Is there a main.c in my project folders somewhere?”. Or maybe I could do a search for all files that match “*.cpp”.
So far I’ve found no way to do this except by calling window.project_data() and recursively searching each folder in the project myself. This can be a little slow depending on how many folders and sub-folders you have included in the project. I would think since there is already a goto overlay doing a similar search it would be a part of the Sublime Text API but I can’t seem to find anything for it.
Let me know if there is a way to do this, or if there is a possibility of having it added sometime.

Thanks,
-Sil

1 Like

#2

this is currently not possible, but is a fairly popular request

0 Likes