Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » XtextResource.save() containing strings with carriage return
XtextResource.save() containing strings with carriage return [message #1396601] Tue, 08 July 2014 14:35 Go to next message
Stephane Bouchet is currently offline Stephane BouchetFriend
Messages: 280
Registered: July 2009
Senior Member
Hi,

i'm trying something quite simple, but face a problem using xtext resource.

i've got a very simple dsl :

'begin' content=STRING


in the editor, i can write:
begin "hello
world"

without problem.

now i want to create the same file contents using only the API.
I create an XtextResource with a content set to "hello\nworld".
when i save this resource, and open it using an editor, i get:
begin "hello\nworld"


is there an option i missed to not serialize the \n but the real carriage return char ?

Thanks,

[Updated on: Tue, 08 July 2014 14:36]

Report message to a moderator

Re: XtextResource.save() containing strings with carriage return [message #1396701 is a reply to message #1396601] Tue, 08 July 2014 17:07 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13275
Registered: July 2009
Senior Member
hmm looks like you need to customize STRINGValueConverter

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
[solved] XtextResource.save() containing strings with carriage return [message #1397270 is a reply to message #1396701] Wed, 09 July 2014 13:25 Go to previous message
Stephane Bouchet is currently offline Stephane BouchetFriend
Messages: 280
Registered: July 2009
Senior Member
Thanks ! i've modified the toString() method of STRINGValueConverter and worked .
Previous Topic:No EObjectDescription could be found in Scope when saving a model
Next Topic:Xtext Editor / CellEditor in e4 RCP
Goto Forum:
  


Current Time: Thu Dec 12 19:26:21 GMT 2019

Powered by FUDForum. Page generated in 0.01589 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top