Skip to content

Fix jump-to-definition to methods in swift interfaces that are in synthesized extensions #1185

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

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Apr 18, 2024

For example when trying to go-to-definition to filter on Array, we get a USR s:s14_ArrayProtocolPsE6filterySay7ElementQzGSbAEKXEKF::SYNTHESIZED::s:Sa. We were trying to look it up in the index, which failed because synthesized extension methods are not indexed.

Instead, consult the module and groupName that sourcekitd returns in the cursor info request to decide which module to jump to.

rdar://126240558

…thesized extensions

For example when trying to go-to-definition to `filter` on `Array`, we get a USR `s:s14_ArrayProtocolPsE6filterySay7ElementQzGSbAEKXEKF::SYNTHESIZED::s:Sa`. We were trying to look it up in the index, which failed because synthesized extension methods are not indexed.

Instead, consult the `module` and `groupName` that `sourcekitd` returns in the cursor info request to decide which module to jump to.

rdar://126240558
@ahoppen ahoppen requested a review from bnbarham April 18, 2024 17:30
@ahoppen ahoppen requested a review from benlangmuir as a code owner April 18, 2024 17:30
@ahoppen
Copy link
Member Author

ahoppen commented Apr 18, 2024

@swift-ci Please test

@ahoppen ahoppen merged commit 771d2a7 into swiftlang:main Apr 23, 2024
@ahoppen ahoppen deleted the ahoppen/jump-to-system-interface branch April 23, 2024 06:00
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.

2 participants