-
Notifications
You must be signed in to change notification settings - Fork 108
Open
Labels
Milestone
Description
Follow-up to #1325 and posit-dev/ark#870.
We now examine the DESCRIPTION
and NAMESPACE
files of a package to statically determine its exports, but we don't support the exportPattern()
NAMESPACE
directive yet, which exports all symbols matching a regex.
It's tricky because packages are installed without their source code, which means we can't statically discover what objects are defined in a namespace. To do this, we'll need access to the source code of the project dependencies: #2286. Then we'll be able to:
-
Parse the source code and detect all top-level assignments
-
For dynamic assignments, packages will have to declare the symbols:
# Declaration foo <- function(my, signature) {} .onLoad <- function(...) { # Dynamic definition. This case is analysable in principle but the namespace # might be modified in more complex ways, e.g. via `.Call()`, hence the need # for declarations in general foo <<- function(my, signature) body }
-
Apply export pattern to known namespace objects