* Intern grammar elements when nodes are created from the cache
The node model contains nodes derived from AbstractNode. An
AbstractNode has an array describing its grammar elements. This array
is often identical for many AbstractNodes. There can be millions of
nodes in a node model so it makes sense to remove the duplicate arrays.
This GrammarElementsInterner tries to reuse an interned version of
such an array wherever possible. In particular, now we also intern
grammar elements when they are created during the load of a node model
from the node model cache.
Testing this modification on a largisch project showed that the
execution time of a clean build that accesses the node model cache
reduces by around 10%.
Signed-off-by: Mark Christiaens <mark.christiaens@sigasi.com>
Replaced ThreadLocal state.set(null) with state.remove(). And tried to decrement the calls of state.get() by keeping it in a variable if possible.
Might need a closer look, if this works.
Signed-off-by: Eva Poell <epoell@itemis.com>
Avoid calling isInstantiatableSubType to reduce number of conditions to
check until identity is checked.
Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
Added AbstractDeclarativeValidator#handleExceptionDuringValidation to
allow overriding of the default exception handling behavior. Clients
especially may want to propagate or handle NPEs more decent than just
swallowing it.
Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
Short:
Implement solution mentioned in above BUG report.
Longer:
Bug (?) can be triggered by e.g.:
IResourceServiceProvider sp = IResourceServiceProvider.Registry.INSTANCE.getResourceServiceProvider(fileUri);
IResourceSetProvider provider = sp.get(IResourceSetProvider.class);
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
// ... file etc
IProject project = file.getProject();
// Use the provider to get the resource set for the given project
// FIXME how to get the existing XtextResourceSet? Below just creates a new rs. :-(
ResourceSet rs = provider.get(project);
// ... run build to generate index used by namespace etc
BuildRequest request = new BuildRequest();
request.setResourceSet(rs);
request.setBaseDir(UriUtil.createFolderURI(new File(baseDir)));
request.setDirtyFiles(allFiles);
// ... copy paste code ...
indexState = incrementalBuilder.build(request, languages).getIndexState();
Hints for doing this correctly/cleaner is highly appreciated!
After the code above has been triggered doing a Project Clean will
trigger method from title to be called with a CurrentDescriptions.
Note that this commit goes together with a commit in xtext-eclipse (see
fork).
Signed-off-by: Anders Dahlberg <anders.xb.dahlberg@ericsson.com>
Update lower bound version constraints on platform related bundles with
versions from an Oxygen.3a platform.
Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>