Skip to content

feat(scip-lib): Add symbol visited callback#51

Merged
JamyDev merged 2 commits into
uber:mainfrom
prathshenoy:symbol-visit-callback
May 13, 2026
Merged

feat(scip-lib): Add symbol visited callback#51
JamyDev merged 2 commits into
uber:mainfrom
prathshenoy:symbol-visit-callback

Conversation

@prathshenoy
Copy link
Copy Markdown
Contributor

Description

What:

  • Add a callback that fires for every non-local symbol during index scanning.
  • Expose it through both the partial loader and registry layers.

Why:

  • Allow consumers to build auxiliary data structures (e.g., search indices) from all symbols as SCIP files are scanned, without requiring a second pass over the file.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test improvement

Component(s) Affected

  • Language Server (ULSP)
  • SCIP Generation (Python utilities)
  • VS Code/Cursor Extension
  • Java Aggregator
  • Build System (Bazel)
  • Documentation
  • Tests

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes (bazel test //...)
  • I have tested this manually with a real project

Manual Testing Details

Describe how you tested these changes:

  • IDE used for testing: N/A
  • Project(s) tested against: N/A
  • Specific features/scenarios verified: N/A

Checklist

  • My code follows the existing code style and conventions
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have updated BUILD.bazel files if I added new source files
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots/Logs (if applicable)

N/A

Related Issues

N/A

Additional Notes

This is a breaking interface change; any external implementations of PartialIndex or Registry will need to add the new method. The callback mirrors the existing SetDocumentLoadedCallback pattern.

@JamyDev
Copy link
Copy Markdown
Collaborator

JamyDev commented Mar 31, 2026

Thanks for your PR, a couple of thoughts I had while reviewing (and I'll be honest the documentLoaded callback was added hastily without much thought):

  1. There likely will be more callbacks beyond documentLoaded and SymbolVisited. We may want to transition this to a separate struct for just all the callbacks that could happen in the registry.
  2. Currently that callback is synchronous. This could be detrimental to performance if the underlying consumer is doing a lot of work; I would probably want to generalize this as a callback worker goroutine that can separate this from the critical path.
  3. There may be other places that symbols get loaded that may need to trigger the callback.

I'd like #2 addressed primarily (and 3 but I assume there's nothing to do there), and then we can discuss what the callback struct may look like in a separate issue.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 6, 2026

CLA assistant check
All committers have signed the CLA.

@JamyDev JamyDev merged commit 3d804b1 into uber:main May 13, 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.

5 participants