I’m trying to integrate atom with Ensime for Scala development. When doing stuff like “go to type” I need to communicate with Ensime using a protocol which is one-dimensional for positions in file/buffer. So I need to convert the two-dimensional Point i get from:
in this case to a one dimensional character offset. It’s really important that this is performant as well, it doesn’t seem reasonable to need to traverse the whole buffer up to the row I’m at and sum up the characters. Isn’t there a one-dimensional position lying around there somewhere that I can use?