[Xtext 2.2] Is there a centralized place where I can turn off scope resolution for certain files? [message #793618] |
Wed, 08 February 2012 05:55  |
Eclipse User |
|
|
|
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 06:52   |
Eclipse User |
|
|
|
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 #794421 is a reply to message #794112] |
Thu, 09 February 2012 04:06  |
Eclipse User |
|
|
|
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 :)
|
|
|
Powered by
FUDForum. Page generated in 0.03980 seconds