Skip to content

Commit 69bf36f

Browse files
committed
Tweak docs
1 parent 0c3cfb6 commit 69bf36f

File tree

2 files changed

+32
-21
lines changed

2 files changed

+32
-21
lines changed

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,22 @@
99

1010
Julia has `@edit`, `@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.
1111

12-
Instead, `InteractiveCodeSearch` provides a way to interactively choose the code you want to read.
12+
Instead, `InteractiveCodeSearch` provides a few macros to interactively choose the code you want to read.
13+
14+
## Features
15+
16+
* Interactively choose a method signature before opening the code location in your editor.
17+
* 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 `@searchreturn Int`.
18+
* Interactively search history. It works in IJulia as well.
1319

1420
## Examples
1521

1622
```julia
1723
using InteractiveCodeSearch
1824
@search show # search method definitions
1925
@searchmethods 1 # search methods defined for integer
20-
@searchhistory # search history (Julia >= 0.7)
21-
@searchreturn String Pkg # search methods returning a given type (Julia >= 0.7)
26+
@searchhistory # search history (Julia 0.7)
27+
@searchreturn String Pkg # search methods returning a given type (Julia 0.7)
2228
```
2329

2430
## Requirements
@@ -159,14 +165,11 @@ InteractiveCodeSearch.CONFIG.auto_open = false # open matcher even when there
159165

160166
**Using InteractiveCodeSearch.jl by default**
161167

162-
Use the same trick as [Revise.jl](https://github.com/timholy/Revise.jl/tree/v0.6); i.e., put the following code in your `~/.julia/config/startup.jl` (>= Julia 0.7) or `~/.juliarc.jl` (Julia 0.6):
168+
Put the following code in your `~/.julia/config/startup.jl` ( Julia 0.7) or `~/.juliarc.jl` (Julia 0.6):
163169

164170
```julia
165-
@async begin
166-
sleep(0.1)
167-
@eval using InteractiveCodeSearch
168-
# InteractiveCodeSearch.CONFIG.interactive_matcher = ...
169-
end
171+
using InteractiveCodeSearch
172+
# InteractiveCodeSearch.CONFIG.interactive_matcher = ...
170173
```
171174

172175

src/InteractiveCodeSearch.jl

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,30 @@ implementation of functions. However, you need to specify a "good
88
enough" set of (type) parameters for them to find the location of the
99
code.
1010
11-
Instead, `InteractiveCodeSearch` provides a way to interactively
12-
choose the code you want to read.
11+
Instead, `InteractiveCodeSearch` provides a few macros to
12+
interactively choose the code you want to read.
13+
14+
## Features
15+
16+
* Interactively choose a method signature before opening the code
17+
location in your editor.
18+
19+
* Various ways to search methods, such as: by function name `@search show`,
20+
function call expression `@search show(stdout, "hello")`,
21+
function call signature `@search show(::IO, ::String)`,
22+
module name `@search Base`, argument value `@searchmethods 1`,
23+
argument type `@searchmethods ::Int`, and return type `@searchreturn Int`.
24+
25+
* Interactively search history. It works in IJulia as well.
1326
1427
## Examples
1528
1629
```julia
1730
using InteractiveCodeSearch
1831
@search show # search method definitions
1932
@searchmethods 1 # search methods defined for integer
20-
@searchhistory # search history (Julia >= 0.7)
21-
@searchreturn String Pkg # search methods returning a given type (Julia >= 0.7)
33+
@searchhistory # search history (Julia 0.7)
34+
@searchreturn String Pkg # search methods returning a given type (Julia 0.7)
2235
```
2336
2437
## Requirements
@@ -290,17 +303,12 @@ InteractiveCodeSearch.CONFIG.auto_open = false # open matcher even when there
290303
291304
## Using InteractiveCodeSearch.jl by default
292305
293-
Use the same trick as
294-
[Revise.jl](https://github.com/timholy/Revise.jl/tree/v0.6); i.e., put
295-
the following code in your `~/.julia/config/startup.jl` (>= Julia 0.7)
306+
Put the following code in your `~/.julia/config/startup.jl` (≥ Julia 0.7)
296307
or `~/.juliarc.jl` (Julia 0.6):
297308
298309
```julia
299-
@async begin
300-
sleep(0.1)
301-
@eval using InteractiveCodeSearch
302-
# InteractiveCodeSearch.CONFIG.interactive_matcher = ...
303-
end
310+
using InteractiveCodeSearch
311+
# InteractiveCodeSearch.CONFIG.interactive_matcher = ...
304312
```
305313
"""
306314
const CONFIG = SearchConfig(

0 commit comments

Comments
 (0)