Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Re: Change of IUnitOfWork behaviour in 2.0M7
Re: Change of IUnitOfWork behaviour in 2.0M7 [message #669060] Mon, 09 May 2011 09:23 Go to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Ed,

#modify will record the changes that you make in the model and use the
serializer to reflect this changes in the document as soon as your
transaction is over. However, #readonly activities may run in parallel.
If you need to provide the results of your analysis for all subsequent
components (such as outline, highlighting, ..), I'd recommend to use
AbstractCleaningLinker#afterModelLinked to perform the analysis. It is
ensured, that #afterModelLinked is part of the reconciling step after
the partial parsing and therefore part of an internal modify
transaction. Others will not perform read operation on the model at the
same time.

Hope that helps,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 09.05.11 10:56, schrieb Ed Willink:
> Hi Sebastian
>
> I'm not sure whether the 'old' or the 'new' behaviour is the intended
> functionality. It's very easy for me to change from modify to readonly,
> indeed it is not entirely clear whether my downstream analysis of the CS
> Resource constitutes a readonly activity or not.
>
> Regards
>
> Ed Willink
>
> On 09/05/2011 08:48, Sebastian Zarnekow wrote:
>> Hi Ed,
>>
>> I'm not aware of any changed line of code that may be the cause for
>> the described change. Could you please file a ticket with a small
>> reproducable example? That would be very helpful.
>>
>> Regards,
>> Sebastian
>
Re: Change of IUnitOfWork behaviour in 2.0M7 [message #669268 is a reply to message #669060] Mon, 09 May 2011 16:27 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Sebastian

None of those seem to quite match the scenario I'm looking at.

I have an EmbeddedXtextEditor which supervises an OCL edit in a Console
view.

In M6, I could edit, then on hitting Enter an InputKeyListener would do
a modify, pick up the CS resource and proceed.

In M7, if I type Enter rapidly after entering a couple of keys, the
overall text shows the full content but a modify can
be invoked for a CS resource that does not use all the source text. e.g.
evaluating "45gh" with "gh" typed rapidly
successully processes a CS document corresponding to "45". Changing to
readonly ensures that the CS resource represents
all the characters and has the expected syntax error on the bad number.

Regards

Ed Willink

On 09/05/2011 10:23, Sebastian Zarnekow wrote:
> Hi Ed,
>
> #modify will record the changes that you make in the model and use the
> serializer to reflect this changes in the document as soon as your
> transaction is over. However, #readonly activities may run in
> parallel. If you need to provide the results of your analysis for all
> subsequent components (such as outline, highlighting, ..), I'd
> recommend to use AbstractCleaningLinker#afterModelLinked to perform
> the analysis. It is ensured, that #afterModelLinked is part of the
> reconciling step after the partial parsing and therefore part of an
> internal modify transaction. Others will not perform read operation on
> the model at the same time.
>
> Hope that helps,
> Sebastian
Re: Change of IUnitOfWork behaviour in 2.0M7 [message #669275 is a reply to message #669268] Mon, 09 May 2011 17:07 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Ed,

looking at the code it seems like IXtextDocument#modify does not force
the reconciler to process pending document events prior to passing the
resource to the unit of work. This looks like a bug to me but I cannot
tell for sure whether a fix will make it into 2.0. A workaround may be
to trigger an empty #readOnly transaction followed by a #modify to
change the model. Before the resource is passed to a readonly
transaction, all pending changes are processed.

I've no idea why this should have worked in M6, though.

I created ticket: https://bugs.eclipse.org/bugs/show_bug.cgi?id=345171

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 09.05.11 18:27, schrieb Ed Willink:
> Hi Sebastian
>
> None of those seem to quite match the scenario I'm looking at.
>
> I have an EmbeddedXtextEditor which supervises an OCL edit in a Console
> view.
>
> In M6, I could edit, then on hitting Enter an InputKeyListener would do
> a modify, pick up the CS resource and proceed.
>
> In M7, if I type Enter rapidly after entering a couple of keys, the
> overall text shows the full content but a modify can
> be invoked for a CS resource that does not use all the source text. e.g.
> evaluating "45gh" with "gh" typed rapidly
> successully processes a CS document corresponding to "45". Changing to
> readonly ensures that the CS resource represents
> all the characters and has the expected syntax error on the bad number.
>
> Regards
>
> Ed Willink
>
> On 09/05/2011 10:23, Sebastian Zarnekow wrote:
>> Hi Ed,
>>
>> #modify will record the changes that you make in the model and use the
>> serializer to reflect this changes in the document as soon as your
>> transaction is over. However, #readonly activities may run in
>> parallel. If you need to provide the results of your analysis for all
>> subsequent components (such as outline, highlighting, ..), I'd
>> recommend to use AbstractCleaningLinker#afterModelLinked to perform
>> the analysis. It is ensured, that #afterModelLinked is part of the
>> reconciling step after the partial parsing and therefore part of an
>> internal modify transaction. Others will not perform read operation on
>> the model at the same time.
>>
>> Hope that helps,
>> Sebastian
>
Previous Topic:"Greedy" Content Assist
Next Topic:Serializer seems to be unaware of namespaces
Goto Forum:
  


Current Time: Fri Apr 26 19:31:33 GMT 2024

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

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

Back to the top