Skip to content

fix: mark import occurrences with the Import role - #85

Merged
chrapkowski-sg merged 7 commits into
sourcegraph:scipfrom
maks-ivanov:scip
Nov 2, 2026
Merged

chrapkowski-sg merged 7 commits into
sourcegraph:scipfrom
maks-ivanov:scip

Conversation

@maks-ivanov

@maks-ivanov maks-ivanov commented May 17, 2023 •

Copy link
Copy Markdown
Contributor

Fixes #84.

Mark imported-target occurrences with Import | ReadAccess. Keep ordinary later references as ReadAccess.

This is an import-role change only. The unrelated historical pip subprocess changes are excluded; current package discovery is preserved.

In response to the earlier review question, retain ReadAccess for compatibility. Removing it is not necessary to supply the missing import bit and would change existing consumer-visible behavior without demonstrated benefit. Plain-import alias modeling is unchanged.

Verification

  • Added real-indexing assertions for local, standard-library, aliased and unresolved imports, plus subsequent runtime references. Tests inspect role bits directly.
  • Production/development builds, all 21 snapshots, all 7 SCIP Jest tests, and formatting passed locally on Linux with Node 24.4.1 and Python 3.10.22.
  • Native Windows/macOS execution was not performed locally.

this.document.occurrences.push(
new scip.Occurrence({
symbol_roles: scip.SymbolRole.ReadAccess,
symbol_roles: scip.SymbolRole.Import | scip.SymbolRole.ReadAccess,

@maks-ivanov maks-ivanov May 17, 2023 •

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.

I don't know if the ReadAccess role is load-bearing in these cases. If not, I would remove those

@maks-ivanov maks-ivanov changed the title adding import symbole roles to occurences created by visiting import … adding import symbol roles to occurences created by visiting import … May 18, 2023
@chrapkowski-sg chrapkowski-sg changed the title adding import symbol roles to occurences created by visiting import … fix: mark import occurrences with the Import role Nov 2, 2026
@chrapkowski-sg
chrapkowski-sg merged commit 2de8a44 into sourcegraph:scip Nov 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Import occurrences don't have correct role

2 participants