Skip to content

Commit

Permalink
allowed AnnotatedTextEdit
Browse files Browse the repository at this point in the history
  • Loading branch information
rchl committed Aug 20, 2024
1 parent ee0b9ba commit 1dcaba8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugin/core/edit.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations
from .logging import debug
from .protocol import AnnotatedTextEdit
from .protocol import Position
from .protocol import TextEdit
from .protocol import UINT_MAX
Expand All @@ -8,7 +9,7 @@
import sublime


WorkspaceChanges = Dict[str, Tuple[List[TextEdit], Optional[int]]]
WorkspaceChanges = Dict[str, Tuple[List[TextEdit | AnnotatedTextEdit], Optional[int]]]


def parse_workspace_edit(workspace_edit: WorkspaceEdit) -> WorkspaceChanges:
Expand All @@ -25,8 +26,8 @@ def parse_workspace_edit(workspace_edit: WorkspaceEdit) -> WorkspaceChanges:
version = text_document.get('version')
edits = document_change.get('edits')
for edit in edits:
if 'annotationId' in edit or 'snippet' in edit:
debug('Ignoring unsupported edit type')
if 'snippet' in edit:
debug('Ignoring unsupported SnippetTextEdit')
continue
changes.setdefault(uri, ([], version))[0].append(edit)
else:
Expand Down

0 comments on commit 1dcaba8

Please sign in to comment.