Let me introduce my package InteractiveCodeSearch.jl. It helps you searching Julia code.
@less, etc. which are very handy for reading the implementation of functions. However, you need to specify a “good enough” set of (type) parameters for them to find the location of the code.
InteractiveCodeSearch provides a few macros to interactively choose the code you want to read. Features:
- Interactively choose a method signature before opening the code location in your editor.
- Various ways to search methods, such as: by function name
@search show, function call expression
@search show(stdout, "hello"), function call signature
@search show(::IO, ::String), module name
@search Base, argument value
@searchmethods 1, argument type
@searchmethods ::Int, and return type
- Interactively search history. It works in IJulia as well.
It’s already registered so you can install it by:
]add InteractiveCodeSearch # Julia ≥ 0.7 Pkg.add("InteractiveCodeSearch") # Julia 0.6
EDIT: I forgot to mention that the most of the cool things are happening in the interactive matching program. I use
peco (written in Go) and
InteractiveCodeSearch is useful (e.g., it can handle
@search Base) because
peco is highly efficient.