Skip to content

Commit

Permalink
Merge pull request #656 from uqbar-project/dev-1.4-#655-Quick-fix-req…
Browse files Browse the repository at this point in the history
…uired-superclass-constructor

Fix the quick fix :P required superclass constructor
  • Loading branch information
tesonep committed May 14, 2016
2 parents 14a99db + e3d15f2 commit 9871ddd
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ import org.uqbar.project.wollok.wollokDsl.WBlockExpression
* @author jfernandes
*/
class WollokDslQuickfixProvider extends DefaultQuickfixProvider {
val tabChar = "\t"
val returnChar ="\n"

@Inject
WollokClassFinder classFinder

Expand Down Expand Up @@ -147,8 +150,7 @@ class WollokDslQuickfixProvider extends DefaultQuickfixProvider {
def addConstructorsFromSuperclass(Issue issue, IssueResolutionAcceptor acceptor) {
acceptor.accept(issue, 'Add constructors from superclass', 'Add same constructors as superclass.', null) [ e, it |
val clazz = e as WClass

val constructors = clazz.parent.constructors.map[ '''\tnew(«parameters.map[name].join(',')») = super(«parameters.map[name].join(',')»)'''].join('\n')
val constructors = clazz.parent.constructors.map[ '''«tabChar»constructor(«parameters.map[name].join(',')») = super(«parameters.map[name].join(',')»)«returnChar»'''].join('\n')
addConstructor(clazz, constructors)
]
}
Expand Down

0 comments on commit 9871ddd

Please sign in to comment.