eclipse-lsp4j / lsp4j

A Java implementation of the language server protocol intended to be consumed by tools and language servers implemented in Java.
https://eclipse.org/lsp4j
Other
581 stars 141 forks source link

Position's line and character fields should be long, not int #823

Closed shuheiktgw closed 3 months ago

shuheiktgw commented 3 months ago

Currently, the Position's line and character fields are int, but according to the latest protocol definition, the fields should be uinteger, which can be 0 to 2^31 - 1. Therefore, I believe they should have been long 🙂

nixel2007 commented 3 months ago

Integer covers this range as well: https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html

pisv commented 3 months ago

Closing, as there is nothing to fix here.

shuheiktgw commented 3 months ago

@pisv Wait, why is it closing? IIUC, the Integer class mentioned above is different from int. Java's native int is a 32-bit signed integer, so the maximum value is not 2^31 - 1 but 2^30. I believe what @nixel2007 meant was that we could use the Integer class instead of long, but did I miss something? 🤔

shuheiktgw commented 3 months ago

Ah sorry, I must have misunderstood something. Let me think about it...

nixel2007 commented 3 months ago

int also uses the same boundaries :)

https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html

shuheiktgw commented 3 months ago

Yes, my bad, sorry I miscalculated it 🙇