unisonweb / elm-browser

A Unison Github repo explorer in Elm
MIT License
34 stars 4 forks source link

Idea: Add a search functionality #12

Open dawehner opened 4 years ago

dawehner commented 4 years ago

It would be super cool to have some form of search functionality:

mitchellwrosen commented 4 years ago

Name-based search is kind of possible (and kind of implemented) right now; when loading a branch we compute mappings from name-to-term and name-to-type: https://github.com/unisonweb/elm-browser/blob/f4d5cf05c6010f4b07796c3e089a62ac87fb286d/client-src/Unison/Codebase/Branch.elm#L59 https://github.com/unisonweb/elm-browser/blob/f4d5cf05c6010f4b07796c3e089a62ac87fb286d/client-src/Unison/Codebase/Branch.elm#L55

Then search is just a matter of creating sets from the keys in these maps, and filtering.

https://github.com/unisonweb/elm-browser/blob/f4d5cf05c6010f4b07796c3e089a62ac87fb286d/client-src/Ucb/Main/View.elm#L117-L130