Skip to content

Conversation

@timholy
Copy link
Member

@timholy timholy commented Feb 21, 2019

Here's the beginning of real forward-movement on this package. The proposed public API is in CodeTracking.jl itself, the other files are internal. Comments welcome.

file, line = fileline(lin)
end
if !isabspath(file)
# This is a Base method
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or Core ?

@timholy timholy changed the title Implement definition(method, String) and add internal data Implement an initial API Feb 21, 2019
@codecov-io
Copy link

codecov-io commented Feb 21, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@4ba9c6f). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@          Coverage Diff          @@
##             master   #2   +/-   ##
=====================================
  Coverage          ?   0%           
=====================================
  Files             ?    3           
  Lines             ?   63           
  Branches          ?    0           
=====================================
  Hits              ?    0           
  Misses            ?   63           
  Partials          ?    0
Impacted Files Coverage Δ
src/data.jl 0% <0%> (ø)
src/CodeTracking.jl 0% <0%> (ø)
src/utils.jl 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ba9c6f...9b9f5cd. Read the comment docs.

@timholy
Copy link
Member Author

timholy commented Feb 21, 2019

Well, this has grown. I think this might be the complete API in terms of currently-planned functionality. I also have a local Revise branch that interacts successfully with this package.

@timholy
Copy link
Member Author

timholy commented Feb 22, 2019

I've pushed a teh/codetracking branch to Revise that uses this. I'm not sure I'll turn it into a PR (it is breaking, from the standpoint of internals, and I'm about to do a whole bunch more breaking...). But anyone who wants to play with this in the meantime can use it.

I'm eager to get this registered (3-day delay), so barring concerns about the API I will merge later this morning.

@timholy
Copy link
Member Author

timholy commented Feb 22, 2019

Should have pinged @KristofferC.

definition(method::Method) = definition(method, Expr)

"""
info = pkgfiles(id::PkgId)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PkgId itself is AFAIU undocumented and internal. So should the API be based on package name and UUID (which are public) rather than the internal struct PkgId?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or on PackageSpec (which is also exported, iirc)?

function pkgfiles(name::AbstractString)
project = Base.active_project()
uuid = Base.project_deps_get(project, name)
uuid == false && error("no package ", name, " recognized")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to error here or just return nothing like when it's a real installed package that just hasn't been loaded yet?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Erroring seems like a good choice to me. And it is at least the conservative choice which can be relaxed later.

@timholy timholy merged commit cea76d4 into master Feb 22, 2019
@timholy timholy deleted the teh/definition branch February 22, 2019 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants