Skip to content
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

Add new functions for working with link completion in editor integrations #1129

Merged
merged 3 commits into from
Dec 19, 2024

Conversation

d-ronnqvist
Copy link
Contributor

Bug/issue #, if applicable: rdar://141689095

Summary

This adds new functions for working with link completion in editor integrations. It also deprecates the old types and API.

The implementation for the new API calls the same code that DocC uses to parse links, compute disambiguation, and match symbols against written link strings, so its behavior will be much closer to how DocC behaves when building documentation than the old, now deprecated API, was.

Dependencies

None.

Testing

Call the new API. It should behave like the examples in the added tests.

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

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

Copy link
Contributor

@mayaepps mayaepps left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks for the doc comment on LinkCompletionTools explaining the usage.

I had a question about whether the order of the parameter types in the matches method should be enforced.

- Iterate over identifiers instead of over disambiguations
- Add test to verify that order of parameters matter
- Use optional chaining instead of optional `map`.
@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist d-ronnqvist merged commit 28c03c5 into swiftlang:main Dec 19, 2024
2 checks passed
@d-ronnqvist d-ronnqvist deleted the link-completion-spi branch December 19, 2024 17:22
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