DESCRIPTION

Introduce caching for resource decorations

With this change a simple caching mechanism for resource decorations
is introduced that is based on two timestamps: one timestamp is
resource-specific and the other one is valid for the entire
workspace.

There are mainly two types of events that GitLightWeightDecorator
handles: on the one hand IResourceChangeEvent, an event that only
affects a dedicated set of resources, and on the other hand various
events that are related to the connected Git repository.

The Git repository events are generic and thus result in firing a
LabelProviderChangedEvent that is handled by views showing decorated
content (e.g. package explorer). Before firing this event the
timestamp on workspace-level now is updated to indicate that all
cached decorations (with a lower timestamp) are invalid.

When handling an IResourceChangeEvent the resource-specific timestamp
is cleared. This means that the cached decoration for this specific
resource is no longer valid. Afterwards the same generic
LabelProviderChangedEvent is fired instead of an event for the
dedicated set of changed resources. This allows every view to
decide what to update instead of forcing an update of invisible
resources as well - which was the case before. This leads to more
re-decorations, but due to the fact that for all unchanged resources
cached information is available, this is very fast and in the end
avoids unnecessary decorations of invisible resources - as mentioned
above.

Change-Id: Iafd0fa15db3ec65d7ce8668f21819ec50733d820
Signed-off-by: Reed Meza xxx@xxx.xxx

COMMENTS

