Is it possible to search the julia registry for a function

Is there a tool that will search the packages in the Julia registry for a function name?

I sometimes come across online examples that use a Julia function I would also like to use but can’t find the package that contains the function because the code snippet elided the using statements.

1 Like

See JuliaHub registry search

1 Like

In my experience the “symbol search” is buggy, so I usually use the code search instead. Bug reports:

1 Like

Thanks for the tip. I tried code search but it doesn’t have a “definition” search. In the AbstractIrrational code search returns 217 results which is a lot to look through to find the defining package.

Is there a way to get just the source files that define the symbol using code search?

AbstractIrrational is defined in Base, which you can discover with

julia> parentmodule(AbstractIrrational)
Base
1 Like

Filtering all source files in a registry with a symbol is going to give a lot of results too. Filtering further to definitions using a symbol needs the Julia runtime because plain text search can’t distinguish imports, multi-line strings, metaprogramming, and variant syntax. Just a headache when people don’t share project files.