halohalospecial / atom-elmjutsu

A bag of tricks for developing with Elm. (Atom package)
https://atom.io/packages/elmjutsu
MIT License
192 stars 24 forks source link

fancy search #37

Open feldman4 opened 7 years ago

feldman4 commented 7 years ago

It would be great to have something like http://klaftertief.github.io/elm-search/ available for the current project and dependencies.

halohalospecial commented 7 years ago

Looks cool! What are your use cases for this?

feldman4 commented 7 years ago

I'm waist-deep fixing a pipeline with the stellar atom-elmjutsu plugin and I can't quite remember the name of my own function : OneType -> ToAnother.

For library functions I just go to the website.

halohalospecial commented 7 years ago

Maybe we can replace Go To Symbol with this. We can search for either the symbol name or the type.

(Just imagine types and other info are also displayed.) go-to-symbol

I hope we can reuse code from https://github.com/klaftertief/elm-search :smile: cc: @klaftertief

Also for reference: https://wiki.haskell.org/Hoogle Check out the "1.1 Searches" section.

klaftertief commented 7 years ago

Thanks for pinging me. The elm-search is written in Elm and client-side only at the moment. It searches only published packages, though it can search local modules as well, given there is a proper index. The index is a combined list of documentation.json files. The search might not do everything you need at the moment, e.g. one can not prefix a function with a module name or search in types or type aliases. But this is quite easy to add... I have some plans to add some kind of server side search and to publish a standalone type-distance package that could be useful for editor integrations. I'm on parental leave a the moment, so my focus is a little bit shifted at the moment :-) So please keep me updated should you think about integrating some code as not all my pans and new code is published. I'll try to organise things then...

halohalospecial commented 7 years ago

@klaftertief Thank you for replying! Maybe it's best to wait on your progress. +1 on both the standalone Elm package and server side search! No need to hurry :smile:

halohalospecial commented 7 years ago

@feldman4, you might find this useful:

autocomplete-type-filtering

(Not as sophisticated as elm-search though because it's just using regex on the type signature :smile_cat:)