Skip to content

(Sources-1) Teach SemanticIndex about NamespacedAccesses - #1286

Merged
DavisVaughan merged 4 commits into
mainfrom
sources/1-namespaced-accesses
Jun 25, 2026
Merged

(Sources-1) Teach SemanticIndex about NamespacedAccesses#1286
DavisVaughan merged 4 commits into
mainfrom
sources/1-namespaced-accesses

Conversation

@DavisVaughan

@DavisVaughan DavisVaughan commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Progress towards #1234

The SemanticIndex now records instances of :: and ::: in its CST walk.

This is going to be useful as one of many ways to detect which packages are used by a workspace.

They are recorded as

pub struct NamespacedAccess {
    package: String,
    symbol: String,
    kind: NamespacedAccessKind,
    offset: TextSize,
}

Realllllly for package source requests we only need package, but my hypothesis is that the rest of this information is going to be useful in the future as well, and I think they should be pretty small. And if you take a step back, it also seems like it would be a bit weird for the SemanticIndex to expose the package list, but not where it originated from.

Comment thread crates/oak_semantic/src/semantic_index.rs Outdated
Comment thread crates/oak_semantic/src/semantic_index.rs Outdated
@DavisVaughan
DavisVaughan force-pushed the sources/1-namespaced-accesses branch 2 times, most recently from 6ce3651 to 81c0e7f Compare June 24, 2026 17:45
For tracking namespace accesses within a file, easing future lookup

Use accessors
And restrict the `new()` method to `pub(crate)`
@DavisVaughan
DavisVaughan force-pushed the sources/1-namespaced-accesses branch from 81c0e7f to 7e54b08 Compare June 25, 2026 19:54
@DavisVaughan
DavisVaughan merged commit 4949fad into main Jun 25, 2026
17 checks passed
@DavisVaughan
DavisVaughan deleted the sources/1-namespaced-accesses branch June 25, 2026 20:04
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 25, 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.

2 participants