Search in sources :

Example 1 with ILineSeparatorInformation

use of org.eclipse.xtext.formatting.ILineSeparatorInformation in project xtext-core by eclipse.

the class DefaultGeneratorModule method configureLineSeparatorInformation.

public void configureLineSeparatorInformation(final Binder binder) {
    final ILineSeparatorInformation _function = () -> {
        return this.code.getLineDelimiter();
    };
    binder.<ILineSeparatorInformation>bind(ILineSeparatorInformation.class).toInstance(_function);
}
Also used : ILineSeparatorInformation(org.eclipse.xtext.formatting.ILineSeparatorInformation)

Example 2 with ILineSeparatorInformation

use of org.eclipse.xtext.formatting.ILineSeparatorInformation in project xtext-core by eclipse.

the class GrammarAccessExtensions method getSerializer.

private ISerializer getSerializer() {
    final String delimiter = this.codeConfig.getLineDelimiter();
    ISerializer result = this.xtextSerializerByLineDelimiter.get(delimiter);
    if ((result != null)) {
        return result;
    }
    final ILineSeparatorInformation _function = () -> {
        return delimiter;
    };
    GrammarAccessExtensions.LineSeparatorModule _lineSeparatorModule = new GrammarAccessExtensions.LineSeparatorModule(_function);
    final Injector injector = Guice.createInjector(_lineSeparatorModule);
    result = injector.<ISerializer>getInstance(ISerializer.class);
    this.xtextSerializerByLineDelimiter.put(delimiter, result);
    return result;
}
Also used : ILineSeparatorInformation(org.eclipse.xtext.formatting.ILineSeparatorInformation) Injector(com.google.inject.Injector) ISerializer(org.eclipse.xtext.serializer.ISerializer)

Aggregations

ILineSeparatorInformation (org.eclipse.xtext.formatting.ILineSeparatorInformation)2 Injector (com.google.inject.Injector)1 ISerializer (org.eclipse.xtext.serializer.ISerializer)1