-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable buggood first issueGood for newcomersGood for newcomershelp wantedIssues identified as good community contribution opportunitiesIssues identified as good community contribution opportunitiesneeds PR
Description
The following code fails mypy type checking:
from lsprotocol.types import WorkspaceEdit, TextEdit, Range, Position
pos = Position(0, 0)
changes = {"file:///tmp/foo.txt": [TextEdit(Range(pos, pos), new_text="hello world")]}
WorkspaceEdit(changes=changes)
Because changes is a dict[str, list[TextEdit]] while WorkspaceEdit's changes expects a dict[str, Sequence[TextEdit]] and dict is invariant -- but we can't actually create a Sequence!
I think the type annotations should probably use Mapping instead of Dict?
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable buggood first issueGood for newcomersGood for newcomershelp wantedIssues identified as good community contribution opportunitiesIssues identified as good community contribution opportunitiesneeds PR