lsp: Support change events with no range

range is optional

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentContentChangeEvent
This commit is contained in:
Sonny Piers 2022-12-04 15:10:52 +01:00
parent 039d88ab45
commit f7aa7d0be2

View file

@ -51,6 +51,9 @@ class OpenFile:
def apply_changes(self, changes):
for change in changes:
if "range" not in change:
self.text = change["text"]
continue
start = utils.pos_to_idx(
change["range"]["start"]["line"],
change["range"]["start"]["character"],