Getting error from a custom Language plugin


I am writing a custom language plugin. I get the following error.

java.lang.IndexOutOfBoundsException: Wrong offset: 126. Should be in range: [0, 10] Lexer: ...

This error is generated from the class I specifically believe the error comes from the myEnds array in that class containing some spurious data. However I would like to know

  • What exactly makes a SegmentArray?
  • Who gives it 'segment' data? Is it the highlighting lexer or some other entity?


1 comment
Comment actions Permalink

Hi Siddharth,

SegmentArray is a generic-purpose class. It's a part of Community Edition, so, you can check its usages and contract:

        This class is a data structure specialized for working with the indexed     segments, i.e. it holds numerous mappings like

'index <-> (start; 
and provides convenient way for working with them, e.g. find     index by particular offset that belongs to target
(start; end)
    segment etc.     

      Not thread-safe.     

Regarding the exception - it's not possible to say anything about that without stack trace (it can provide information about particular use-case where SegmentArray is used).

Regards, Denis


Please sign in to leave a comment.