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
[SR-5738] Refactoring action to convert to trailing closure #48308
Comments
CC/ @nkcsgexi 1) Assuming this is foo
.bar(x: { _ in .. })
.baz(y: { _ in .. }) to: foo
.bar { _ in .. }
.baz(y: { _ in .. }) Where the cursor should be on? Anywhere in range of " 2) Is there convenient way to retrieve context info from |
Or should I make it
|
I think this make sense, essentially:
I think that's a good idea. But instead of keeping track more expressions (which can be arbitrary how many parent expressions you want to look at) I recommend that SemaToken keeps track of the "containing" declaration (e.g. the function that contains the expression). Or perhaps the top-level containing statement. Then have a |
Thank you! I'll try that. |
Comment by KacperHarasim (JIRA) Hi @rintaro, are you working on this or is it available to implement? Thanks for letting me know 🙂 |
Hi kacperh (JIRA User), feel free to take this task 🙂 |
Comment by KacperHarasim (JIRA) @rintaro Thanks for the answer! Since you have implemented it partially I will find another refactoring task to take. 🙂 |
Implemented in #12268 |
Additional Detail from JIRA
md5: e5f9ca7e1032a74769619f94fc09552d
Issue Description:
Implement a refactoring action that can change code from:
to:
when applicable
The text was updated successfully, but these errors were encountered: