Community
Participate
Working Groups
Setting the Resource save options OPTION_LINE_DELIMITER has no effect because org.eclipse.xtext.serializer.impl.Serializer.serialize(EObject obj, ITokenStream tokenStream, SaveOptions options) uses only the .isFormatting() aspect of SaveOptions. Surely at least OPTION_LINE_DELIMITER and OPTION_LINE_WIDTH should be respected?
Hi Ed, supporting org.eclipse.emf.ecore.resource.Resource.OPTION_LINE_DELIMITER may be possible. I wasn't aware of that flag, since it has been introduced recently (EMF 2.9). I would not want to make use of the constant org.eclipse.emf.ecore.xmi.XMLResource.OPTION_LINE_WIDTH because Xtext has no business with the XMLResource. Furthermore, line with of is the responsibility of the formatter. We'd have to discuss how the formatter should prioritize save options and formatter preferences.
(In reply to Moritz Eysholdt from comment #1) > supporting > org.eclipse.emf.ecore.resource.Resource.OPTION_LINE_DELIMITER > may be possible. I wasn't aware of that flag, since it has been introduced > recently (EMF 2.9). It's all part of the catchup to compensate for GIT not handling newlines. We need applications to be able to behave consistently all by themselves. So for my development projects I need \n even though I'm on Windows.
Ping! (In reply to Moritz Eysholdt from comment #1) > supporting org.eclipse.emf.ecore.resource.Resource.OPTION_LINE_DELIMITER > may be possible. I wasn't aware of that flag, since it has been introduced > recently (EMF 2.9). EMF 2.9 is no longer recent, particularly given that Xtext 2.8 totally blows away all forward compatibility for users.
Problem for the New DeclarativeFormatter. See Bug 564265 User/app does xtextResource.save(....emfSaveOptions) which the LazyLinkingResource largely ignores. Surely the SaveOptions that is constructed from emfSaveOptions should at least provide an ability to access the original options so that the standard line delimiter is accessible and also user-defined options such as tab-width, indentation? i.e. add an options field with getter and setter to SaveOptions.