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
94 changes: 47 additions & 47 deletions crates/ty_ide/src/goto_type_definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,14 @@ mod tests {

assert_snapshot!(test.goto_type_definition(), @r#"
info[goto-type-definition]: Type definition
--> stdlib/builtins.pyi:890:7
--> stdlib/builtins.pyi:892:7
|
888 | def __getitem__(self, key: int, /) -> str | int | None: ...
889 |
890 | class str(Sequence[str]):
890 | def __getitem__(self, key: int, /) -> str | int | None: ...
891 |
892 | class str(Sequence[str]):
| ^^^
891 | """str(object='') -> str
892 | str(bytes_or_buffer[, encoding[, errors]]) -> str
893 | """str(object='') -> str
894 | str(bytes_or_buffer[, encoding[, errors]]) -> str
|
info: Source
--> main.py:4:13
Expand All @@ -228,14 +228,14 @@ mod tests {

assert_snapshot!(test.goto_type_definition(), @r#"
info[goto-type-definition]: Type definition
--> stdlib/builtins.pyi:890:7
--> stdlib/builtins.pyi:892:7
|
888 | def __getitem__(self, key: int, /) -> str | int | None: ...
889 |
890 | class str(Sequence[str]):
890 | def __getitem__(self, key: int, /) -> str | int | None: ...
891 |
892 | class str(Sequence[str]):
| ^^^
891 | """str(object='') -> str
892 | str(bytes_or_buffer[, encoding[, errors]]) -> str
893 | """str(object='') -> str
894 | str(bytes_or_buffer[, encoding[, errors]]) -> str
|
info: Source
--> main.py:2:22
Expand Down Expand Up @@ -344,14 +344,14 @@ mod tests {

assert_snapshot!(test.goto_type_definition(), @r#"
info[goto-type-definition]: Type definition
--> stdlib/builtins.pyi:890:7
--> stdlib/builtins.pyi:892:7
|
888 | def __getitem__(self, key: int, /) -> str | int | None: ...
889 |
890 | class str(Sequence[str]):
890 | def __getitem__(self, key: int, /) -> str | int | None: ...
891 |
892 | class str(Sequence[str]):
| ^^^
891 | """str(object='') -> str
892 | str(bytes_or_buffer[, encoding[, errors]]) -> str
893 | """str(object='') -> str
894 | str(bytes_or_buffer[, encoding[, errors]]) -> str
|
info: Source
--> main.py:4:18
Expand Down Expand Up @@ -413,14 +413,14 @@ f(**kwargs<CURSOR>)

assert_snapshot!(test.goto_type_definition(), @r#"
info[goto-type-definition]: Type definition
--> stdlib/builtins.pyi:2888:7
--> stdlib/builtins.pyi:2890:7
|
2886 | """See PEP 585"""
2887 |
2888 | class dict(MutableMapping[_KT, _VT]):
2888 | """See PEP 585"""
2889 |
2890 | class dict(MutableMapping[_KT, _VT]):
| ^^^^
2889 | """dict() -> new empty dictionary
2890 | dict(mapping) -> new dictionary initialized from a mapping object's
2891 | """dict() -> new empty dictionary
2892 | dict(mapping) -> new dictionary initialized from a mapping object's
|
info: Source
--> main.py:6:5
Expand All @@ -444,14 +444,14 @@ f(**kwargs<CURSOR>)

assert_snapshot!(test.goto_type_definition(), @r#"
info[goto-type-definition]: Type definition
--> stdlib/builtins.pyi:890:7
--> stdlib/builtins.pyi:892:7
|
888 | def __getitem__(self, key: int, /) -> str | int | None: ...
889 |
890 | class str(Sequence[str]):
890 | def __getitem__(self, key: int, /) -> str | int | None: ...
891 |
892 | class str(Sequence[str]):
| ^^^
891 | """str(object='') -> str
892 | str(bytes_or_buffer[, encoding[, errors]]) -> str
893 | """str(object='') -> str
894 | str(bytes_or_buffer[, encoding[, errors]]) -> str
|
info: Source
--> main.py:3:17
Expand Down Expand Up @@ -537,14 +537,14 @@ f(**kwargs<CURSOR>)

assert_snapshot!(test.goto_type_definition(), @r#"
info[goto-type-definition]: Type definition
--> stdlib/builtins.pyi:890:7
--> stdlib/builtins.pyi:892:7
|
888 | def __getitem__(self, key: int, /) -> str | int | None: ...
889 |
890 | class str(Sequence[str]):
890 | def __getitem__(self, key: int, /) -> str | int | None: ...
891 |
892 | class str(Sequence[str]):
| ^^^
891 | """str(object='') -> str
892 | str(bytes_or_buffer[, encoding[, errors]]) -> str
893 | """str(object='') -> str
894 | str(bytes_or_buffer[, encoding[, errors]]) -> str
|
info: Source
--> main.py:4:27
Expand All @@ -568,13 +568,13 @@ f(**kwargs<CURSOR>)

assert_snapshot!(test.goto_type_definition(), @r#"
info[goto-type-definition]: Type definition
--> stdlib/types.pyi:921:11
--> stdlib/types.pyi:922:11
|
919 | if sys.version_info >= (3, 10):
920 | @final
921 | class NoneType:
920 | if sys.version_info >= (3, 10):
921 | @final
922 | class NoneType:
| ^^^^^^^^
922 | """The type of the None singleton."""
923 | """The type of the None singleton."""
|
info: Source
--> main.py:3:17
Expand All @@ -585,14 +585,14 @@ f(**kwargs<CURSOR>)
|

info[goto-type-definition]: Type definition
--> stdlib/builtins.pyi:890:7
--> stdlib/builtins.pyi:892:7
|
888 | def __getitem__(self, key: int, /) -> str | int | None: ...
889 |
890 | class str(Sequence[str]):
890 | def __getitem__(self, key: int, /) -> str | int | None: ...
891 |
892 | class str(Sequence[str]):
| ^^^
891 | """str(object='') -> str
892 | str(bytes_or_buffer[, encoding[, errors]]) -> str
893 | """str(object='') -> str
894 | str(bytes_or_buffer[, encoding[, errors]]) -> str
|
info: Source
--> main.py:3:17
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ error[invalid-argument-type]: Argument to function `loads` is incorrect
| ^ Expected `str | bytes | bytearray`, found `Literal[5]`
|
info: Function defined here
--> stdlib/json/__init__.pyi:218:5
--> stdlib/json/__init__.pyi:220:5
|
216 | """
217 |
218 | def loads(
218 | """
219 |
220 | def loads(
| ^^^^^
219 | s: str | bytes | bytearray,
221 | s: str | bytes | bytearray,
| -------------------------- Parameter declared here
220 | *,
221 | cls: type[JSONDecoder] | None = None,
222 | *,
223 | cls: type[JSONDecoder] | None = None,
|
info: rule `invalid-argument-type` is enabled by default

Expand Down
6 changes: 3 additions & 3 deletions crates/ty_vendored/vendor/typeshed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ Typeshed supports Python versions 3.9 to 3.14.

## Using

If you're just using a type checker ([mypy](https://github.com/python/mypy/),
[pyright](https://github.com/microsoft/pyright),
[pytype](https://github.com/google/pytype/), PyCharm, ...), as opposed to
If you're just using a type checker (e.g. [mypy](https://github.com/python/mypy/),
[pyright](https://github.com/microsoft/pyright), or PyCharm's built-in type
checker), as opposed to
developing it, you don't need to interact with the typeshed repo at
all: a copy of standard library part of typeshed is bundled with type checkers.
And type stubs for third party packages and modules you are using can
Expand Down
2 changes: 1 addition & 1 deletion crates/ty_vendored/vendor/typeshed/source_commit.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
08225953c98cfd375d80bc88865e5aae77d2c07f
9ab7fde0a0cd24ed7a72837fcb21093b811b80d8
1 change: 1 addition & 0 deletions crates/ty_vendored/vendor/typeshed/stdlib/VERSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ compileall: 3.0-
compression: 3.14-
concurrent: 3.2-
concurrent.futures.interpreter: 3.14-
concurrent.interpreters: 3.14-
configparser: 3.0-
contextlib: 3.0-
contextvars: 3.7-
Expand Down
2 changes: 1 addition & 1 deletion crates/ty_vendored/vendor/typeshed/stdlib/_ctypes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class _PyCPointerType(_CTypeBaseType):
def from_buffer_copy(self: type[_typeshed.Self], buffer: ReadableBuffer, offset: int = 0, /) -> _typeshed.Self: ...
def from_param(self: type[_typeshed.Self], value: Any, /) -> _typeshed.Self | _CArgObject: ...
def in_dll(self: type[_typeshed.Self], dll: CDLL, name: str, /) -> _typeshed.Self: ...
def set_type(self, type: Any, /) -> None: ...
def set_type(self, type: _CTypeBaseType, /) -> None: ...
if sys.version_info < (3, 13):
# Inherited from CType_Type starting on 3.13
def __mul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues]
Expand Down
3 changes: 3 additions & 0 deletions crates/ty_vendored/vendor/typeshed/stdlib/_decimal.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ if sys.version_info >= (3, 11):
on entry to the with-statement and restore the previous default context when
exiting the with-statement. If no context is specified, a copy of the current
default context is used.

"""

else:
Expand All @@ -77,13 +78,15 @@ else:
on entry to the with-statement and restore the previous default context when
exiting the with-statement. If no context is specified, a copy of the current
default context is used.

"""

if sys.version_info >= (3, 14):
def IEEEContext(bits: int, /) -> Context:
"""Return a context object initialized to the proper values for one of the
IEEE interchange formats. The argument must be a multiple of 32 and less
than IEEE_CONTEXT_MAX_BITS.

"""

DefaultContext: Context
Expand Down
10 changes: 10 additions & 0 deletions crates/ty_vendored/vendor/typeshed/stdlib/_frozen_importlib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def __import__(
being imported (e.g. ``from module import <fromlist>``). The 'level'
argument represents the package location to import from in a relative
import (e.g. ``from ..pkg import mod`` would have a 'level' of 2).

"""

def spec_from_loader(
Expand Down Expand Up @@ -80,6 +81,7 @@ class ModuleSpec:

Only finders (see importlib.abc.MetaPathFinder and
importlib.abc.PathEntryFinder) should modify ModuleSpec instances.

"""

def __init__(
Expand Down Expand Up @@ -109,6 +111,7 @@ class BuiltinImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader)

All methods are either class or static methods to avoid the need to
instantiate the class.

"""

# MetaPathFinder
Expand All @@ -120,6 +123,7 @@ class BuiltinImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader)
If 'path' is ever specified then the search is considered a failure.

This method is deprecated. Use find_spec() instead.

"""

@classmethod
Expand All @@ -136,6 +140,7 @@ class BuiltinImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader)
"""Load the specified module into sys.modules and return it.

This method is deprecated. Use loader.exec_module() instead.

"""

@classmethod
Expand All @@ -152,6 +157,7 @@ class BuiltinImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader)
"""Return repr for the module.

The method is deprecated. The import machinery does the job itself.

"""
if sys.version_info >= (3, 10):
@staticmethod
Expand All @@ -175,6 +181,7 @@ class FrozenImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader):

All methods are either class or static methods to avoid the need to
instantiate the class.

"""

# MetaPathFinder
Expand All @@ -184,6 +191,7 @@ class FrozenImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader):
"""Find a frozen module.

This method is deprecated. Use find_spec() instead.

"""

@classmethod
Expand All @@ -200,6 +208,7 @@ class FrozenImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader):
"""Load a frozen module.

This method is deprecated. Use exec_module() instead.

"""

@classmethod
Expand All @@ -216,6 +225,7 @@ class FrozenImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader):
"""Return repr for the module.

The method is deprecated. The import machinery does the job itself.

"""
if sys.version_info >= (3, 10):
@staticmethod
Expand Down
Loading