22
33CodeTracking is a minimal package designed to work with (a future version of)
44[ Revise.jl] ( https://github.com/timholy/Revise.jl ) .
5- Its main purpose is to support packages that need to know the location
6- (file and line number) of code that might move around as it's edited.
5+ Its main purpose is to support packages that need to interact with code that might move
6+ around as it's edited.
77
88CodeTracking is a very lightweight dependency.
99
@@ -23,6 +23,29 @@ In this (ficticious) example, `sum` moved because I deleted a few lines higher i
2323these didn't affect the functionality of ` sum ` (so we didn't need to redefine and recompile it),
2424but it does change the starting line number of the file at which this method appears.
2525
26+ Other features:
27+
28+ ``` julia
29+ julia> using CodeTracking, ColorTypes
30+
31+ julia> pkgfiles (ColorTypes)
32+ PkgFiles (ColorTypes [3 da002f7- 5984 - 5 a60- b8a6- cbb66c0b333f]):
33+ basedir: / home/ tim/ . julia/ packages/ ColorTypes/ BsAWO
34+ files: [" src/ColorTypes.jl" , " src/types.jl" , " src/traits.jl" , " src/conversions.jl" , " src/show.jl" , " src/operations.jl" ]
35+
36+ julia> m = @which red (RGB (1 ,1 ,1 ))
37+ red (c:: AbstractRGB ) in ColorTypes at / home/ tim/ . julia/ packages/ ColorTypes/ BsAWO/ src/ traits. jl: 14
38+
39+ julia> definition (m)
40+ :(red (c:: AbstractRGB ) = begin
41+ #= /home/tim/.julia/packages/ColorTypes/BsAWO/src/traits.jl:14 =#
42+ c. r
43+ end )
44+
45+ julia> definition (m, String)
46+ " red(c::AbstractRGB ) = c.r\n "
47+ ```
48+
2649## A few details
2750
2851CodeTracking won't do anything * useful* unless the user is also running Revise,
@@ -32,15 +55,12 @@ file/line info in the method itself if Revise isn't running.)
3255
3356However, Revise is a fairly large (and fairly complex) package, and currently it's not
3457easy to discover how to extract particular kinds of information from its internal storage.
35- CodeTracking will be designed to be the new "query" part of Revise.jl.
58+ CodeTracking is designed to be the new "query" part of Revise.jl.
3659The aim is to have a very simple API that developers can learn in a few minutes and then
3760incorporate into their own packages; its lightweight nature means that they potentially gain
3861a lot of functionality without being forced to take a big hit in startup time.
3962
40- ## Current state
63+ ## Status
4164
42- Currently this package is just a stub---it doesn't do anything useful,
43- but neither should it hurt anything.
44- Candidate users may wish to start ` import ` ing it and then file issues
45- or submit PRs as they discover what kinds of functionality they need
46- from CodeTracking.
65+ If you want CodeTracking to do anything useful, currently you have to check out the ` teh/codetracking `
66+ branch of Revise.
0 commit comments