mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 16:58:56 +00:00
[xtext generator] Migrated 'Ecore2XtextValueConverterServiceFragment'
Signed-off-by: Christian Schneider <christian.schneider@itemis.de>
This commit is contained in:
parent
37218795e8
commit
c1186a05f9
2 changed files with 31 additions and 3 deletions
|
@ -0,0 +1,29 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2015 itemis AG (http://www.itemis.eu) and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*******************************************************************************/
|
||||
package org.eclipse.xtext.xtext.generator.ecore2xtext
|
||||
|
||||
import org.eclipse.xtext.common.services.Ecore2XtextTerminalConverters
|
||||
import org.eclipse.xtext.conversion.IValueConverterService
|
||||
import org.eclipse.xtext.xtext.generator.model.GuiceModuleAccess
|
||||
|
||||
import static extension org.eclipse.xtext.xtext.generator.model.TypeReference.*
|
||||
import org.eclipse.xtext.xtext.generator.AbstractXtextGeneratorFragment
|
||||
|
||||
/**
|
||||
* Contributes the registration of the {@link Ecore2XtextTerminalConverters}.
|
||||
*
|
||||
* @author Christian Schneider - Initial contribution and API
|
||||
*/
|
||||
class Ecore2XtextValueConverterServiceFragment2 extends AbstractXtextGeneratorFragment {
|
||||
|
||||
override generate() {
|
||||
new GuiceModuleAccess.BindingFactory()
|
||||
.addTypeToType(IValueConverterService.typeRef(), Ecore2XtextTerminalConverters.typeRef())
|
||||
.contributeTo(language.runtimeGenModule)
|
||||
}
|
||||
}
|
|
@ -218,9 +218,8 @@ class RuntimeProjectDescriptor extends TestedProjectDescriptor {
|
|||
«ENDIF»
|
||||
«IF fromExistingEcoreModels»
|
||||
|
||||
fragment = adapter.FragmentAdapter {
|
||||
fragment = ecore2xtext.Ecore2XtextValueConverterServiceFragment {}
|
||||
}
|
||||
fragment = ecore2xtext.Ecore2XtextValueConverterServiceFragment2 auto-inject {}
|
||||
|
||||
fragment = adapter.FragmentAdapter {
|
||||
fragment = ecore2xtext.FormatterFragment {}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue