Skip to main content



      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 10:35 Go to next message
Eclipse UserFriend
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 10:36] by Moderator

Re: XtextResource.save() containing strings with carriage return [message #1396701 is a reply to message #1396601] Tue, 08 July 2014 13:07 Go to previous messageGo to next message
Eclipse UserFriend
hmm looks like you need to customize STRINGValueConverter
[solved] XtextResource.save() containing strings with carriage return [message #1397270 is a reply to message #1396701] Wed, 09 July 2014 09:25 Go to previous message
Eclipse UserFriend
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 Jul 10 07:30:45 EDT 2025

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

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

Back to the top