-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[IDE] [Signature Help] Extract primitive CodeCompletionString creation into CodeCompletionStringBuilder
#83646
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
hamishknight
merged 1 commit into
swiftlang:main
from
a7medev:refactor/extract-code-completion-string-builder
Aug 28, 2025
Merged
[IDE] [Signature Help] Extract primitive CodeCompletionString creation into CodeCompletionStringBuilder
#83646
hamishknight
merged 1 commit into
swiftlang:main
from
a7medev:refactor/extract-code-completion-string-builder
Aug 28, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Aug 11, 2025
6ebbb12 to
2bb81c2
Compare
Contributor
hamishknight
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Couple more comments, but otherwise LGTM
cf00131 to
fb566f1
Compare
Member
Author
|
@hamishknight I've addressed all the comments. Can you please recheck? 🙏🏼 |
…lder [IDE] Move primitive completion function label into CodeCompletionStringBuilder [IDE] NFC: Remove unneeded string builder methods on CodeCompletionResultBuilder [IDE] Move addValueBaseName into CodeCompletionStringBuilder [IDE] Make CodeCompletionResultBuilder a CodeCompletionStringBuilder [IDE] Explicitly pass DeclContext in CodeCompletionStringBuilder [IDE] Reduce includes in CodeCompletionStringBuilder.h
fb566f1 to
ec1b146
Compare
hamishknight
approved these changes
Aug 26, 2025
Contributor
hamishknight
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Contributor
|
@swift-ci please test |
bnbarham
approved these changes
Aug 28, 2025
bnbarham
reviewed
Aug 28, 2025
870afba to
ec1b146
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
We're implementing signature help which needs to extract the signature label out of declarations or types similar to the existing behavior in code completion.
The problem is the logic for building a structured
CodeCompletionStringis currently tied to code completion. The logic mostly lives inCodeCompletionResultBuilderandCompletionLookupand requires completion-specific objects likeCodeCompletionContextandCodeCompletionResultSinkmaking them hard to reuse.Solution
To make this logic reusable, we introduce
CodeCompletionStringBuilderwhich is responsible for performing primitiveCodeCompletionStringbuilding logic (e.g. adding call arguments). We move most of the methods for buildingCodeCompletionStrings out ofCodeCompletionResultBuilderandCompletionLookupintoCodeCompletionStringBuilderwhich doesn't depend on completion-specific objects like the old implementation.Existing code completion logic should still behave exactly the same.