Add `Package::exports()` to replace `Package::namespace().exports`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 337
- Forks
- 32
- Avg merge
- 8d 17h
- Merged PRs (30d)
- 11
Description
From https://github.com/posit-dev/ark/pull/1306#discussion_r3512781622
This should be a
Package::exports()query mirroringFile::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 https://github.com/posit-dev/ark/blob/e62a6753c72569f70480ffd5d3f1b5f3258ccd50/crates/ark/src/lsp/diagnostics.rs#L201 -
Do the documented symbols get added to
Package::exports()'s output? -
What is the exact return value
Vec<Name>? -
Is
Package::resolve()actually relevant here?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the requested Package::exports() query with File::exports(), then inspect the existing namespace().exports calls in crates/ark/src/lsp/diagnostics.rs. Resolve whether documented symbols belong in the Vec result and whether Package::resolve() is needed; update all callers so exports are obtained through the new method.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r, rust
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100