Skip to content

Commit

Permalink
fix detecting textEdits not applying because .get('newText') was falsy
Browse files Browse the repository at this point in the history
{'range': {'start': {'line': 1, 'character': 0}, 'end': {'line': 2, 'character': 0}}, 'newText': ''}
  • Loading branch information
predragnikolic committed Jul 12, 2024
1 parent d66ad92 commit c7ecd32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugin/core/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c7ecd32

Please sign in to comment.