Skip to content

[5.9] Add convert to trailing closure and editor placeholder refactorings #1806

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 6 commits into from
Jun 21, 2023

Conversation

bnbarham
Copy link
Contributor

  • Explanation: Adds a placeholder expansion refactoring. Also cherry-picks a few incremental parse cherry-picks for fewer conflicts, but nothing is using incremental parsing at the moment
  • Scope: Refactorings
  • Risk: Low. Adds a new refactoring to expand placeholders.
  • Testing: Various new tests for expanding placeholders
  • Original PR: Add convert to trailing closure and editor placeholder refactorings #1485

@bnbarham bnbarham requested a review from ahoppen as a code owner June 16, 2023 23:20
@bnbarham
Copy link
Contributor Author

swiftlang/swift-stress-tester#239

@swift-ci please test

StevenWong12 and others added 6 commits June 20, 2023 21:14
This change is used to help us mark the changes in source file, which makes incremental parsing test easier.

(cherry picked from commit b605766)
We now properly strip trailing whitespace. Add in spacing after `{` and
before `}`.

(cherry picked from commit 195823b)
This was called `SourceEdit`, which would be nice to reserve for
refactorings rather than incremental parsing. Ideally we'd also move all
the incremental parsing types into `SwiftParser` as well.

(cherry picked from commit 40f2954)
This adds an additional text-based refactoring provider which the
original syntax-based provider now implements. This allows refactorings
that produce text rather than a full tree.

(cherry picked from commit bcf0d1f)
Adds three new refactorings:
  - `ConvertToTrailingClosures`
  - `ExpandEditorPlaceholder`
  - `ExpandEditorPlaceholders`

`ExpandEditorPlaceholders` is a combination of `ExpandEditorPlaceholder`
and `ConvertToTrailingClosures`, ie. it first expands any function-typed
closures at the end of a call using `ExpandEditorPlaceholder` and then
runs `ConvertToTrailingClosures` on that call.

Resolves rdar://107532856.

(cherry picked from commit c70e54a)
@bnbarham bnbarham force-pushed the cherry-placeholder-expansion branch from d66b191 to 3959af0 Compare June 21, 2023 04:16
@bnbarham
Copy link
Contributor Author

swiftlang/swift-stress-tester#239

@swift-ci please test

@bnbarham
Copy link
Contributor Author

swiftlang/swift-stress-tester#239

@swift-ci please test Windows platform

@bnbarham bnbarham merged commit f052676 into swiftlang:release/5.9 Jun 21, 2023
@bnbarham bnbarham deleted the cherry-placeholder-expansion branch June 21, 2023 21:56
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.

4 participants