-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Index] Don't report extensions with nothing to index #34338
Conversation
@swift-ci Please smoke test |
Nevermind, it looks like there was already a test about this! |
@swift-ci Please smoke test |
I think we may still need to still index empty extensions in user source code so global rename invoked on the type being extended will still be able to find and update the type names in the extensions themselves. IndexASTWalker has The previously failing test was actually using the old indexing API (in sourcekitd) that we don't really use anymore. To add a test for the above change it'd be better to take a look at test/Index/index_swift_only_system_module.swift. You basically want to copy it up to the end of the "Test-1" section and put an empty extension in your equivalent of Thanks for fixing this, and if you have any questions or want to look through it together feel free to Slack/video chat with me on Monday! |
The indexer was looking into “empty” extensions to public types, triggering computing their USR which could fail at deserializing the implementation-only imported types. As a solution, don’t index extensions with nothing to index in system modules. rdar://70225906
4317034
to
f6931c8
Compare
@swift-ci Please smoke test |
I tweaked the fix to apply only on serialized module files. We don’t load implementation-only dependencies for local or system serialized modules so this bug could affect any modules, only partial modules should be safe but I wouldn’t expect them to be used here (?). Thanks for the detailed guide for the test @nathawes! I’ve added |
Looks great - thanks! |
The indexer was looking into “empty” extensions to public types,
triggering the computation of the extension USR which could fail at
deserializing implementation-only imported types. As a solution,
don’t index extensions with no content to index.
rdar://70225906