Caches in Code Generator [message #1790443] |
Mon, 11 June 2018 04:30  |
Eclipse User |
|
|
|
Hi,
I would like to cache certain information which is used in my code generator. The information is derived from my domain model (Ecore model). As calculation is expensive, I would like to cache the results.
The calculation takes several resources into account, so using a org.eclipse.xtext.util.OnChangeEvictingCache seems not to be feasible as the cache is only invalidated, if a resource is changed semantically.
In other words I would like to invalidate the cache for a certain resource every time org.eclipse.xtext.resource.IResourceDescription.Manager.isAffected(Delta, IResourceDescription) returns true.
Is this possible and does a corresponding implementation already exist?
An alternative approach is to invalidate the whole cache before every generator run (build). org.eclipse.xtext.builder.BuilderParticipant.build(IBuildContext, IProgressMonitor) seems a good method to hook in for the UI (Eclipse) scenario.
What do you think about these ideas or do you have any ready-made solution?
Kind regards
Oliver
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06389 seconds