Skip to content

Store the replacement string in IncrementalEdit #2527

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

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Mar 5, 2024

IIRC the main reason that IncrementalEdit didn’t contain the replacement string was that the edits needed to be transferred over XPC at some point and transferring strings over XPC is always a little tricky. Since the actual contents weren’t actually needed, the actual contents weren’t actually needed.

I would like to use ConcurrentEdits(fromSequential:) in SourceKit-LSP and for that I need the actual replacement contents. Instead of rolling our own sequential to concurrent replacement (which is non-trivial), let’s re-use the one in SwiftSyntax.

@ahoppen
Copy link
Member Author

ahoppen commented Mar 5, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Mar 6, 2024

@swift-ci Please test macOS

Copy link
Contributor

@Matejkob Matejkob left a comment

Choose a reason for hiding this comment

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

Should we add a note to the changelog about this change?

IIRC the main reason that `IncrementalEdit` didn’t contain the replacement string was that the edits needed to be transferred over XPC at some point and transferring strings over XPC is always a little tricky. Since the actual contents weren’t actually needed, the actual contents weren’t actually needed.

I would like to use `ConcurrentEdits(fromSequential:)` in SourceKit-LSP and for that I need the actual replacement contents. Instead of rolling our own sequential to concurrent replacement (which is non-trivial), let’s re-use the one in SwiftSyntax.
@ahoppen ahoppen force-pushed the ahoppen/replacement-string-in-incremental-edit branch from 94a64f8 to 6cf8188 Compare March 7, 2024 01:00
@ahoppen
Copy link
Member Author

ahoppen commented Mar 7, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Mar 8, 2024

@swift-ci Please test Windows

@ahoppen ahoppen merged commit bdc3df2 into swiftlang:main Mar 9, 2024
@ahoppen ahoppen deleted the ahoppen/replacement-string-in-incremental-edit branch March 9, 2024 00:18
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.

3 participants