[SR-17] Refactoring
| Previous ID | SR-17 |
| Radar | None |
| Original Reporter | krusche (JIRA User) |
| Type | New Feature |
| Status | Closed |
| Resolution | Done |
Additional Detail from JIRA
| Votes | 11 |
| Component/s | |
| Labels | New Feature |
| Assignee | @bitjammer |
| Priority | Medium |
md5: ce13c69509de60ecfe1aaced5dc7c844
Issue Description:
Swift is a statically typed language and it would be great, if refactoring would be supported!
I've got plans for the following refactoring actions:
-
Rename symbol
-
Conform to protocol
-
Extract expression to:
-
local
-
property
-
module function
-
method
-
default parameter
-
Please let me know which other refactoring actions you'd like to see.
Comment by Stephan Krusche (JIRA)
Thank you for the quick reply. Glad to here that there are already plans for refactorings in Swift. Your list sounds like a very good starting point. I am curious to try them out! https://sourcemaking.com/refactoring/refactorings offers a good overview of possible refactorings.
In my opinion, support for the following refactorings would also be interesting:
-
Add / remove / change parameters in functions
-
Move functions to other types
-
Pull up or push down methods / properties in class hierarchies
-
Extract protocol
-
Extract superclass
-
Extract subclass
Comment by Nikita Leonov (JIRA)
@bitjammer Martin Fowler covered a lot of refactoring techniques — http://refactoring.com/catalog/
It would be unfair to ask everything from it today, but it could be used a roadmap. Meanwhile your plan & priorities on refactoring is great. Looking forward for it. Thanks!
nikita (JIRA User) Nice resource - thanks!
Comment by Matthew Bischoff (JIRA)
I think it’d be swell to also have a command that allowed extracting a method or set of methods to an extension, optionally in a separate file.
Comment by Stephan Krusche (JIRA)
Any News on this request? When can we expect refactoring?
Hey, @nkcsgexi, we can probably close out this top-level bug by now, yeah? :-)
That's a good idea to close this generic task. If anyone has any new refactoring ideas for Swift to implement, please file separate issues describing the details.