Skip to content

(7) Allow Package::resolve() to skip the namespace export check for base#1305

Merged
DavisVaughan merged 1 commit into
mainfrom
feature/sources-7-base-namespace
Jul 2, 2026
Merged

(7) Allow Package::resolve() to skip the namespace export check for base#1305
DavisVaughan merged 1 commit into
mainfrom
feature/sources-7-base-namespace

Conversation

@DavisVaughan

Copy link
Copy Markdown
Contributor

Branched from #1303
Closes #1303

I took a look at this and this seems to be the one place we use namespace().exports right now. Everything works as is if we just skip the gating check for base in particular. This works because every top level assignment in base is an export by construction, so we don't really need to check this anyways.

If we find ourself getting burned by this in other places, we can reconsider, but right now this feels way cleaner than trying to reconstruct a fake namespace for base. It seems like we simply don't need it!

@DavisVaughan DavisVaughan requested a review from lionel- June 29, 2026 18:10
// Note that this won't find primitives! These have no top-level binding.
let mut db = TestDb::new();
let (pkg, files) = setup_package(&mut db, "base", &[], &[(
"workspace/base/R/a.R",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Interesting that you could add the R sources in the workspace to get LSP analysis against dev base packages.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yea and I suppose the example should probably have really been using an "installed" Package version of base, but the setup_package() workspace package infra was right there already, and it mostly accomplishes the same thing, so I just went with that

@DavisVaughan DavisVaughan force-pushed the feature/sources-7-base-namespace branch from 4c546e2 to 0c676ce Compare July 2, 2026 18:27
@DavisVaughan DavisVaughan force-pushed the feature/sources-6-goto-definition-tests branch from e719a6a to 0b36e63 Compare July 2, 2026 18:27
@DavisVaughan DavisVaughan force-pushed the feature/sources-7-base-namespace branch from 0c676ce to c6c9a53 Compare July 2, 2026 18:31
@DavisVaughan DavisVaughan force-pushed the feature/sources-6-goto-definition-tests branch from 0b36e63 to 4c919a6 Compare July 2, 2026 18:32
@DavisVaughan DavisVaughan force-pushed the feature/sources-7-base-namespace branch from c6c9a53 to d25d9a0 Compare July 2, 2026 18:42
@DavisVaughan DavisVaughan force-pushed the feature/sources-6-goto-definition-tests branch 2 times, most recently from 571ad70 to ad23976 Compare July 2, 2026 18:53
@DavisVaughan DavisVaughan force-pushed the feature/sources-7-base-namespace branch from d25d9a0 to 00ce06b Compare July 2, 2026 18:53
@DavisVaughan DavisVaughan force-pushed the feature/sources-6-goto-definition-tests branch from ad23976 to 47ba23c Compare July 2, 2026 18:59
@DavisVaughan DavisVaughan force-pushed the feature/sources-7-base-namespace branch 2 times, most recently from 9a01684 to 5befce0 Compare July 2, 2026 19:04
@DavisVaughan DavisVaughan force-pushed the feature/sources-6-goto-definition-tests branch 2 times, most recently from 64f6196 to 10867ff Compare July 2, 2026 19:11
@DavisVaughan DavisVaughan force-pushed the feature/sources-7-base-namespace branch from 5befce0 to 12a956a Compare July 2, 2026 19:11
@DavisVaughan DavisVaughan force-pushed the feature/sources-6-goto-definition-tests branch from 10867ff to 82f4d0c Compare July 2, 2026 19:12
@DavisVaughan DavisVaughan force-pushed the feature/sources-7-base-namespace branch from 12a956a to 7dcb821 Compare July 2, 2026 19:12
Base automatically changed from feature/sources-6-goto-definition-tests to main July 2, 2026 19:13
@DavisVaughan DavisVaughan force-pushed the feature/sources-7-base-namespace branch from 7dcb821 to e8c0589 Compare July 2, 2026 19:13
@DavisVaughan DavisVaughan merged commit 9533c48 into main Jul 2, 2026
17 checks passed
@DavisVaughan DavisVaughan deleted the feature/sources-7-base-namespace branch July 2, 2026 19:20
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mock Package::namespace() result for base

2 participants