Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Possible move coloring after opening?(Possible move coloring after opening)
Possible move coloring after opening? [message #1037221] Tue, 09 April 2013 09:55 Go to next message
paul lu is currently offline paul lu
Messages: 14
Registered: April 2013
Junior Member
The syntax coloring in an xtext editor is done in opening; is it possible to make the color refresh after opening the editor? This will make the open faster, since we are developing a dsl no less complicated than java, with the coloring depending on cross references to make the color the same as the referenced element, then resolving cross references and loading more resources.

I tried putting the color refresh only in the partOpened method in a part listener, but in effect the editor won't show until the color refresh is finished in the listener, which then is the same as the default work flow.

A lot thanks if someone could help!!
Re: Possible move coloring after opening? [message #1037537 is a reply to message #1037221] Tue, 09 April 2013 17:23 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6301
Registered: July 2009
Senior Member
Hi,

the semantic highlighting is actually not done on opening but asychronosly afterwards.
the syntactic highlighting is done on opening.
Re: Possible move coloring after opening? [message #1037740 is a reply to message #1037537] Wed, 10 April 2013 00:38 Go to previous messageGo to next message
paul lu is currently offline paul lu
Messages: 14
Registered: April 2013
Junior Member
Hi, thanks for replying
But in opening it does "installHighlightingHelper", which then calls "HighlightingReconciler" to do the semantic highlighting:

document.readOnly(new IUnitOfWork.Void<XtextResource>() {
public void process(XtextResource state) throws Exception{
modeChanged(state);
}
});
...........
}
Is it asynchronous? In effect, the editor doesn't show up until this is done...

Re: Possible move coloring after opening? [message #1037876 is a reply to message #1037740] Wed, 10 April 2013 05:42 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6301
Registered: July 2009
Senior Member
Hmmm you are right. i was sure it was done async.
may Sebastian can answer this?
Re: Possible move coloring after opening? [message #1038531 is a reply to message #1037876] Thu, 11 April 2013 01:33 Go to previous message
paul lu is currently offline paul lu
Messages: 14
Registered: April 2013
Junior Member
Hi,
What I tried later is running the refresh in reconciler.install in another thread. The effect is perfect: the editor shows up with only syntax highlight, then comes the semantic highlighting in a few seconds. Is there any risk of doing this?
Previous Topic:Need a hint for dynamic imports
Next Topic:mismatched input '<EOF>' expecting
Goto Forum:
  


Current Time: Thu Sep 18 07:47:48 GMT 2014

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

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