Throw NullPointerException if null is passed to NodeIterator constructor
to prevent iterator state where hasNext() and hasPrevious() always
return true, but getNext() and getPrevious() always return null.
Similarly, throw NPE for null passed to constructors of NodeIterable,
BasicNodeIterator and BasicNodeIterable. Added unit tests for all four
classes.
Signed-off-by: Robert Lewis <rablewis@algo-pop.com>
Throw NullPointerException if null is passed to NodeIterator constructor
to prevent iterator state where hasNext() and hasPrevious() always
return true, but getNext() and getPrevious() always return null.
Signed-off-by: Robert Lewis <rablewis@algo-pop.com>
[#1316] Add end line and end column positions to Issue. Also initialise lines and columns with 0.
Previously, end line and end column information was not part of Issue, IssueImpl, IssueLocation, AbstractDiagnostic, and ExceptionDiagnostic. It is helpful to have this information in these classes, because otherwise (i.e. now in LanguageServerImpl#toDiagnostic(Issue)) this information has to be computed by loading the Document again.
closes#1316
Signed-off-by: mmews <marcus.mews@numberfour.eu>
The usage of Xtend in the Xtext code base should be reduced where the
usage of Xtend is not super beneficial. Replaced Xtend classes by the
compiled code and refactored the code to more readable Java. Performed
source cleanup action.
Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
The usage of Xtend in the Xtext code base should be reduced where the
usage of Xtend is not super beneficial. Replaced Xtend classes by the
compiled code and refactored the code to more readable Java.
Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
before any other filter operation
there is a performance benefit, when first exclude all irrelevant
resources before considering their IEObjectDescriptions
Signed-off-by: gabrield <d.gabriel@bachmann.info>
- Remove unnecessary modeling32.png file and all the references to it.
The modeling32.png file has been replaced by the xtext32.png file.
Signed-off-by: Tamas Miklossy <miklossy@itemis.de>
* 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>
- Add the computeEObjectReferencedInComment(XtextResource,
int) method to the IJavaDocTypeReferenceProvider interface.
- Add implementation to the MultiLineJavaDocTypeReferenceProvider class.
See also https://github.com/eclipse/xtext-xtend/issues/372
Signed-off-by: Tamas Miklossy <miklossy@itemis.de>