Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » semantic highlighting stopped working for comments ?
semantic highlighting stopped working for comments ? [message #897662] Wed, 25 July 2012 01:23 Go to next message
Henrik Lindberg is currently offline Henrik Lindberg
Messages: 2500
Registered: July 2009
Senior Member
Hi,
Since some version back (2.2.1) I have an issue with semantic
highlighting. There seems to be some sort of optimization because I no
longer see semantic highlighting being applied to comments.

I have the same problem in 2.3.0 (Juno release).

It seems like all my other semantic highlighting kicks in, but for
comments it seems like only the default token based highlighting is
applied. (When I change the style under preferences it *is* applied in
all open editors.

Need some hints regarding debugging/ fixing of this, and if something
has changed that I need to be aware of.

Regards
- henrik
Re: semantic highlighting stopped working for comments ? [message #897664 is a reply to message #897662] Wed, 25 July 2012 02:20 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik Lindberg
Messages: 2500
Registered: July 2009
Senior Member
On 2012-25-07 3:23, Henrik Lindberg wrote:
> Hi,
> Since some version back (2.2.1) I have an issue with semantic
> highlighting. There seems to be some sort of optimization because I no
> longer see semantic highlighting being applied to comments.
>
> I have the same problem in 2.3.0 (Juno release).
>
> It seems like all my other semantic highlighting kicks in, but for
> comments it seems like only the default token based highlighting is
> applied. (When I change the style under preferences it *is* applied in
> all open editors.
>
> Need some hints regarding debugging/ fixing of this, and if something
> has changed that I need to be aware of.
>

What I found out so far, is that it is an ordering issue. During
validation/linking I detect the conditions that should apply when
styling (e.g. imagine a link in documentation being colored differently
depending on what it refers to (or nothing).

I currently do the processing in my specialization of
LazyLinkingResource when resolveLazyCrossReferences is called.
Seems I need to perform all computations that have an effect on semantic
highlighting before that - say in updateInternalState that *is* called
before highlighting is computed.

(Seems like I have to sacrifice highlighting based on result of linking
in favor of having it kick in at the right time).

- henrik
Re: semantic highlighting stopped working for comments ? [message #897710 is a reply to message #897664] Wed, 25 July 2012 07:03 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian Zarnekow
Messages: 2908
Registered: July 2009
Senior Member
Henrik,

did you try to invoke #resolveLazyCrossReferences as the first thing in
your highlighting computer?

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

Am 25.07.12 04:20, schrieb Henrik Lindberg:
> On 2012-25-07 3:23, Henrik Lindberg wrote:
>> Hi,
>> Since some version back (2.2.1) I have an issue with semantic
>> highlighting. There seems to be some sort of optimization because I no
>> longer see semantic highlighting being applied to comments.
>>
>> I have the same problem in 2.3.0 (Juno release).
>>
>> It seems like all my other semantic highlighting kicks in, but for
>> comments it seems like only the default token based highlighting is
>> applied. (When I change the style under preferences it *is* applied in
>> all open editors.
>>
>> Need some hints regarding debugging/ fixing of this, and if something
>> has changed that I need to be aware of.
>>
>
> What I found out so far, is that it is an ordering issue. During
> validation/linking I detect the conditions that should apply when
> styling (e.g. imagine a link in documentation being colored differently
> depending on what it refers to (or nothing).
>
> I currently do the processing in my specialization of
> LazyLinkingResource when resolveLazyCrossReferences is called.
> Seems I need to perform all computations that have an effect on semantic
> highlighting before that - say in updateInternalState that *is* called
> before highlighting is computed.
>
> (Seems like I have to sacrifice highlighting based on result of linking
> in favor of having it kick in at the right time).
>
> - henrik
>
>
>
>
>
Re: semantic highlighting stopped working for comments ? [message #897919 is a reply to message #897710] Wed, 25 July 2012 12:39 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik Lindberg
Messages: 2500
Registered: July 2009
Senior Member
On 2012-25-07 9:03, Sebastian Zarnekow wrote:
> Henrik,
>
> did you try to invoke #resolveLazyCrossReferences as the first thing in
> your highlighting computer?
>
A bit tricky, since linking potentially can take a long time, and a
CancelIndicator should be passed - don't know how to obtain one in the
highlighting computer.

Think I will just break out the part of the logic that is required for
highlighting, and then do the second step during validation/linking.
Also think this may improve on performance/feedback while editing.

....let's see what happens...

- henrik
Re: semantic highlighting stopped working for comments ? [message #897935 is a reply to message #897919] Wed, 25 July 2012 13:14 Go to previous message
Henrik Lindberg is currently offline Henrik Lindberg
Messages: 2500
Registered: July 2009
Senior Member
On 2012-25-07 14:39, Henrik Lindberg wrote:
> On 2012-25-07 9:03, Sebastian Zarnekow wrote:
>> Henrik,
>>
>> did you try to invoke #resolveLazyCrossReferences as the first thing in
>> your highlighting computer?
>>
> A bit tricky, since linking potentially can take a long time, and a
> CancelIndicator should be passed - don't know how to obtain one in the
> highlighting computer.
>
> Think I will just break out the part of the logic that is required for
> highlighting, and then do the second step during validation/linking.
> Also think this may improve on performance/feedback while editing.
>
> ...let's see what happens...
>
Worked like a charm. Doing the first part in resource
updateInternalState, and then validation of that during
validation/linking. (Nevermind coloring things based on linkage result -
will just use error/warning markers instead.

Regards
- henrik
Previous Topic:Xtext and scopes
Next Topic:How do I filter the result of AbstractDeclarativeScopeProvider.delegateGetScope()?
Goto Forum:
  


Current Time: Sat Oct 25 17:03:30 GMT 2014

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

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