titusjan/objbrowser

Feature request: search by key

Opened this issue · 2 comments

Thank you for providing the object browser.
It'd nice to have a search field where one can look for specific methods and fields.

Thanks for the suggestion. At the moment I don't have much time to work on objbrowser but I'll keep it in mind if continue with it.

Furthermore I'm not sure search functionality is very useful, but perhaps you can explain more about your use case.

I can think of two different implementations:

  1. A 'traditional' search box that scrolls to the rows that match the text in the search box.
  2. A filter where only the rows that match the text in the filter are displayed. The other rows are hidden.

The first option might be useful to quickly jump to a row, but since the rows are already ordered alphabetically, it doesn't add much.

The second option may be handy for exploring. But it is more work to implement.

However the biggest draw back, for both options, is that it is only possible to search in the tree-rows that already have been expanded by the user. It cannot search through the entire tree because the tree has an infinite depth. Some nodes end up in a loop (e..g a=6; a.real.real.real. <etc>). This makes the search functionality confusing and less useful.

I meant the second option - filter while typing. Even though the list is sorted, you might want to look for methods/attributes that contain (not start with) keyword.
I was looking for smart inspectors in python and found only the objbrowser. Then I started my own project that does what I want. It's here https://github.com/dizcza/pinspect.
I'll make it graph-oriented so that it could deal with infinite depths and cycles.