From c7ecd320298258a93ac13a7f5f875991024bf6f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D1=80=D0=B5=D0=B4=D1=80=D0=B0=D0=B3=20=D0=9D=D0=B8?= =?UTF-8?q?=D0=BA=D0=BE=D0=BB=D0=B8=D1=9B?= Date: Fri, 12 Jul 2024 17:43:27 +0200 Subject: [PATCH] fix detecting textEdits not applying because .get('newText') was falsy {'range': {'start': {'line': 1, 'character': 0}, 'end': {'line': 2, 'character': 0}}, 'newText': ''} --- plugin/core/protocol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/core/protocol.py b/plugin/core/protocol.py index d810d40d4..f2e9aa651 100644 --- a/plugin/core/protocol.py +++ b/plugin/core/protocol.py @@ -6285,4 +6285,4 @@ def to_lsp(self) -> Position: def is_text_edit(value: Any) -> TypeGuard[TextEdit]: - return isinstance(value, dict) and bool(value.get('range')) and bool(value.get('newText')) + return isinstance(value, dict) and 'range' in value and 'newText' in value