Community
Participate
Working Groups
Working on Bug 456715. The offsets I am getting don't match up because of the collapsed comments. I know I need to adjust the offsets based on the projection model, but we should also not be throwing exceptions for bad arguments. I have a JS file with two functions, each with collapsed JSDoc comments. When hovering I get a 'can't find property length of null exception. There are a couple of issues that we could fix to be more resilient. 1) At line 1499 we call model.getLineAtOffset(). The current implementation will return a lineIndex of -5 which goes against its JSDoc. 2) We use the returned lineIndex of -5 without checking whether it is valid, so _getNextOffset_W3C():1501 will throw an exception because the lineText will be null. 3) getNextOffset(), the public method the tooltip uses, does not specify its behaviour for bad offsets or edge cases (ex: finding the previous word to offset 0). If the unit option is 'line' and the next offset it out of range, it will return -1. In other cases I suspect it would return the current offset or throw an exception.
Silenio, can you take a look at this and think about what the best approach would be? I can provide a patch with my simple checks that prevent it from blowing up, but I think you will have a better fix in mind.
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see: https://dev.eclipse.org/mhonarc/lists/orion-dev/msg04002.html