Hi,
When editing my source code in my DLTK based editor, I sometime have an exception in:
SourceModuleDocumentProvider.SourceModuleAnnotationModel.createPositionFromProblem
The exception is raised because the start position is greater than the documentLength which led to create a new Position with a negative length.
I suggest to modify the method and add the test below:
protected Position createPositionFromProblem(IProblem problem) {
int start = problem.getSourceStart();
if (start < 0)
return null;
int end = problem.getSourceEnd();
if (end == 0 && start == 0) {
return new Position(0, 0);
}
int length = end - start;
if (length < 0)
return null;
int documentLength = fDocument.getLength();
>>> if (start > documentLength)
>>> start = documentLength;
if(start + length > documentLength){
length = documentLength - start;
}
return new Position(start, length);
}
I'm using DLTK 2.0.
I also filled the Bug 323825 in bugzilla.
Thanks,
Eric