Skip to content

Add initializer to LinkCompletionTools.SymbolInformation that accepts a SymbolGraph.Symbol #1253

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

Conversation

matthewbastien
Copy link
Member

@matthewbastien matthewbastien commented Jul 22, 2025

Summary

Adds a new public initializer to LinkCompletionTools.SymbolInformation that will extract the function signature (if any) from a SymbolGraph.Symbol. This will primarily be used by SourceKit-LSP so that it doesn't have to re-implement the logic for constructing parameter and return type disambiguations.

Checklist

  • [ ] Added tests
  • Ran the ./bin/test script and it succeeded
  • [ ] Updated documentation if necessary

No new tests needed: this only exposes existing functionality to SourceKit-LSP.

@matthewbastien
Copy link
Member Author

Related SourceKit-LSP PR: swiftlang/sourcekit-lsp#2216

@matthewbastien matthewbastien force-pushed the sourcekit-lsp-func-disambiguations branch from b1d0e17 to ca40173 Compare July 23, 2025 15:25
@matthewbastien
Copy link
Member Author

@swift-ci please test

Copy link
Contributor

@d-ronnqvist d-ronnqvist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this.

It makes sense to leverage existing internal logic to ensure that the suggested link is based on the same information, parsed the same way, as DocC would use when later resolving the link.

@d-ronnqvist
Copy link
Contributor

@swift-ci please test

@d-ronnqvist d-ronnqvist merged commit 01cdb27 into swiftlang:main Jul 29, 2025
2 checks passed
@matthewbastien matthewbastien deleted the sourcekit-lsp-func-disambiguations branch July 29, 2025 20:26
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