Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Xtext 2.2] Is there a centralized place where I can turn off scope resolution for certain files?
[Xtext 2.2] Is there a centralized place where I can turn off scope resolution for certain files? [message #793618] Wed, 08 February 2012 10:55 Go to next message
Alex Ruiz is currently offline Alex RuizFriend
Messages: 103
Registered: March 2011
Senior Member
Greetings,

Xtext performance has been and continues to be great. We currently have a use case in the protocol buffer editor where a project has a 16k+ lines! (yikes!)...When building a project that contains this file, scope resolution can take a few minutes, even with caching.

We are thinking about adding something like a filter based on file size, similar to what CDT has. CDT's index can ignore files of certain size, in MB (the size is configurable via a preference page.) I looked at Xtext code to see where IScopeProvider is used...and it is used in many, many places.

Is there a centralized place where I can stop scope resolution after checking the size of a file?

Many thanks in advance,
-Alex
Re: [Xtext 2.2] Is there a centralized place where I can turn off scope resolution for certain files [message #793655 is a reply to message #793618] Wed, 08 February 2012 11:52 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3107
Registered: July 2009
Senior Member
Hi Alex,

you could disable proxy resolution in the validator. See
org.eclipse.xtext.validation.ResourceValidatorImpl.validate(Resource,
CheckMode, CancelIndicator)

I won't disable scoping since it is actually triggered on demand (the
validator will resolve all proxies). Having navigation in place is still
handy for bigger files.

If other components rely on resolved proxies (e.g. outline or semantic
coloring), you could guard those as well.

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

Am 08.02.12 11:55, schrieb Alex Ruiz:
> Greetings,
>
> Xtext performance has been and continues to be great. We currently have
> a use case in the protocol buffer editor where a project has a 16k+
> lines! (yikes!)...When building a project that contains this file, scope
> resolution can take a few minutes, even with caching.
>
> We are thinking about adding something like a filter based on file size,
> similar to what CDT has. CDT's index can ignore files of certain size,
> in MB (the size is configurable via a preference page.) I looked at
> Xtext code to see where IScopeProvider is used...and it is used in many,
> many places.
>
> Is there a centralized place where I can stop scope resolution after
> checking the size of a file?
>
> Many thanks in advance,
> -Alex
Re: [Xtext 2.2] Is there a centralized place where I can turn off scope resolution for certain files [message #793668 is a reply to message #793655] Wed, 08 February 2012 12:18 Go to previous messageGo to next message
Alex Ruiz is currently offline Alex RuizFriend
Messages: 103
Registered: March 2011
Senior Member
Thanks Sebastian! I'll be working on it Smile

Cheers,
-Alex
Re: [Xtext 2.2] Is there a centralized place where I can turn off scope resolution for certain files [message #794093 is a reply to message #793668] Wed, 08 February 2012 22:52 Go to previous messageGo to next message
Alex Ruiz is currently offline Alex RuizFriend
Messages: 103
Registered: March 2011
Senior Member
Hi Sebastian,

It turns out that when building a project, ClusteringBuilderState.writeNewResourceDescriptions is called before the validator. This constructor CopiedResourceDescription (line 335) triggers scope resolution when creating a copy of the original description (by calling getExportedObjects.)

I've been trying, without success, to override the behaviour in ClusteringBuilderState to ignore the 16k-line file. ClusteringBuilderState is configured in SharedModule and it seems that there is no way to override the binding (unless I'm missing something, which is quite probable.)

Any hints on how to ignore this huge file from building will be greated appreciated Smile

Thanks,
-Alex
Re: [Xtext 2.2] Is there a centralized place where I can turn off scope resolution for certain files [message #794109 is a reply to message #794093] Wed, 08 February 2012 23:16 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13416
Registered: July 2009
Senior Member
Hi,

this (custom bindings for the shared module) is what the extension point org.eclipse.xtext.ui.shared.overridingGuiceModule is for

~Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [Xtext 2.2] Is there a centralized place where I can turn off scope resolution for certain files [message #794112 is a reply to message #794109] Wed, 08 February 2012 23:19 Go to previous messageGo to next message
Alex Ruiz is currently offline Alex RuizFriend
Messages: 103
Registered: March 2011
Senior Member
Thanks so much Christian! Crossing fingers that I'm in the right path to solve this issue Smile
Re: [Xtext 2.2] Is there a centralized place where I can turn off scope resolution for certain files [message #794421 is a reply to message #794112] Thu, 09 February 2012 09:06 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3107
Registered: July 2009
Senior Member
Hi Alex,

please keep in mind that the mentioned extension point is only meant to
be used in a closed world, e.g. there can only be exactly one contributor.

Did you try to specialize
org.eclipse.xtext.resource.impl.DefaultResourceDescriptionManager.internalGetResourceDescription(Resource,
IDefaultResourceDescriptionStrategy) and return a lightweight resource
description (e.g. no reference descriptions) in case of large resources?

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

Am 09.02.12 00:19, schrieb Alex Ruiz:
> Thanks so much Christian! Crossing fingers that I'm in the right path to
> solve this issue :)
Previous Topic:trigger multiple generators from code
Next Topic:Is "plugin manifest editor"-like doable with Xtext ?
Goto Forum:
  


Current Time: Tue Mar 31 00:08:05 GMT 2020

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

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

Back to the top