diff --git a/plugins/com.yakindu.solidity.ui/src/com/yakindu/solidity/ui/quickfix/SolidityQuickfixProvider.xtend b/plugins/com.yakindu.solidity.ui/src/com/yakindu/solidity/ui/quickfix/SolidityQuickfixProvider.xtend index df23667b..dafca1df 100644 --- a/plugins/com.yakindu.solidity.ui/src/com/yakindu/solidity/ui/quickfix/SolidityQuickfixProvider.xtend +++ b/plugins/com.yakindu.solidity.ui/src/com/yakindu/solidity/ui/quickfix/SolidityQuickfixProvider.xtend @@ -469,10 +469,12 @@ class SolidityQuickfixProvider extends ExpressionsQuickfixProvider { acceptor.accept(issue, 'Add default solidity pragma', 'Add solidity pragma ' + solcVersion + '.', null, new ISemanticModification() { override apply(EObject element, IModificationContext context) throws Exception { - if (element instanceof SourceUnit) { - element.fixPragmaSolidityDirective - } else if (element.eContainer instanceof SourceUnit) { - (element.eContainer as SourceUnit).fixPragmaSolidityDirective + if (element.eContainer instanceof SourceUnit) { + val sourceUnit = element.eContainer as SourceUnit + val pragma = createPragmaSolidityDirective => [ + version = solcVersion + ] + sourceUnit.pragma += pragma } } })