staysail / nova-gobee

Go support for Nova
MIT License
14 stars 2 forks source link

Handle an LSP to Nova range no-newline-at-EOF case #3

Closed jfieber closed 1 year ago

jfieber commented 1 year ago

When a file in Nova has no newline at the end, and gopls formatting decides to append one, it sends an LSP range one past the end of the Nova line array.

This manifests by deleting your document on format because the default Nova range is [0, document.length].

jfieber commented 1 year ago

A bit wonky to discover and reproduce what was wrong because gopls seems a little inconsistent about whether it wants to put a newline at the end. Compare with this nugget in my own mothballed go extension, so I apparently ran into this in the past.

gdamore commented 1 year ago

Good catch.

gdamore commented 1 year ago

I will cut a new release shortly with this.