From #1306 (comment)
This should be a Package::exports() query mirroring File::exports(). I thought I had implemented it already, > but can't find it (maybe it was abandoned at some point).
There will be some complex resolution in the future (e.g. for regex exportPattern), so we should call a single > method everywhere exports are needed.
It'd return a vector of names that you can then resolve with top-level Package::resolve().
And maybe namespace() should be private?
I had some outstanding questions about this from this request:
-
What do we do with other existing calls to namespace().exports? We have a few, like
|
for export in &pkg.namespace().exports { |
-
Do the documented symbols get added to Package::exports()'s output?
|
// Start from explicit `NAMESPACE` exports |
|
let mut exports = package.namespace(context.db).exports.clone().into_vec(); |
|
|
|
// Add all documented symbols. This should cover documented datasets to avoid some |
|
// false positives in favor of allowing some false negatives. This is admittedly a |
|
// bit of a stopgap! |
|
if let Some(index) = package.index(context.db) { |
|
exports.extend(index.names().iter().cloned()); |
|
} |
-
What is the exact return value Vec<Name>?
-
Is Package::resolve() actually relevant here?
From #1306 (comment)
And maybe
namespace()should be private?I had some outstanding questions about this from this request:
What do we do with other existing calls to
namespace().exports? We have a few, likeark/crates/ark/src/lsp/diagnostics.rs
Line 201 in e62a675
Do the documented symbols get added to
Package::exports()'s output?ark/crates/ark/src/lsp/diagnostics.rs
Lines 965 to 973 in 59ba153
What is the exact return value
Vec<Name>?Is
Package::resolve()actually relevant here?