Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions generator/plugins/python/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def _reset(self):
self._imports: List[str] = [
"import enum",
"import functools",
"from typing import Any, Dict, Literal, Optional, Sequence, Tuple, Union",
"from typing import Any, Dict, Mapping, Literal, Optional, Sequence, Tuple, Union",
"import attrs",
"from . import validators",
]
Expand Down Expand Up @@ -356,7 +356,7 @@ def _generate_type_name(

if type_def.kind == "map":
# This kind defines a dictionary like object.
return f"Dict[{self._generate_type_name(type_def.key, class_name, prefix)}, {self._generate_type_name(type_def.value, class_name, prefix)}]"
return f"Mapping[{self._generate_type_name(type_def.key, class_name, prefix)}, {self._generate_type_name(type_def.value, class_name, prefix)}]"

if type_def.kind == "tuple":
# This kind defined a tuple like object.
Expand Down
12 changes: 6 additions & 6 deletions packages/python/lsprotocol/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import enum
import functools
from typing import Any, Dict, Literal, Optional, Sequence, Tuple, Union
from typing import Any, Dict, Mapping, Literal, Optional, Sequence, Tuple, Union
import attrs
from . import validators

Expand Down Expand Up @@ -1955,7 +1955,7 @@ class WorkspaceEdit:
cause failure of the operation. How the client recovers from the failure is described by
the client capability: `workspace.workspaceEdit.failureHandling`"""

changes: Optional[Dict[str, Sequence["TextEdit"]]] = attrs.field(default=None)
changes: Optional[Mapping[str, Sequence["TextEdit"]]] = attrs.field(default=None)
"""Holds changes to existing resources."""

document_changes: Optional[
Expand All @@ -1973,7 +1973,7 @@ class WorkspaceEdit:
only plain `TextEdit`s using the `changes` property are supported."""

change_annotations: Optional[
Dict[ChangeAnnotationIdentifier, "ChangeAnnotation"]
Mapping[ChangeAnnotationIdentifier, "ChangeAnnotation"]
] = attrs.field(default=None)
"""A map of change annotations that can be referenced in `AnnotatedTextEdit`s or create, rename and
delete file / folder operations.
Expand Down Expand Up @@ -2452,7 +2452,7 @@ class DocumentDiagnosticReportPartialResult:

# Since: 3.17.0

related_documents: Dict[
related_documents: Mapping[
str, Union["FullDocumentDiagnosticReport", "UnchangedDocumentDiagnosticReport"]
] = attrs.field()

Expand Down Expand Up @@ -5642,7 +5642,7 @@ class RelatedFullDocumentDiagnosticReport:
"""The actual items."""

related_documents: Optional[
Dict[
Mapping[
str,
Union[FullDocumentDiagnosticReport, "UnchangedDocumentDiagnosticReport"],
]
Expand Down Expand Up @@ -5703,7 +5703,7 @@ class RelatedUnchangedDocumentDiagnosticReport:
diagnostic request for the same document."""

related_documents: Optional[
Dict[
Mapping[
str, Union[FullDocumentDiagnosticReport, UnchangedDocumentDiagnosticReport]
]
] = attrs.field(default=None)
Expand Down
Loading