ruff/crates/ty_python_semantic/src
UnboundVariable b0b65c24ff
[ty] Initial implementation of signature help provider (#19194)
This PR includes:
* Implemented core signature help logic
* Added new docstring method on Definition that returns a docstring for
function and class definitions
* Modified the display code for Signature that allows a signature string
to be broken into text ranges that correspond to each parameter in the
signature
* Augmented Signature struct so it can track the Definition for a
signature when available; this allows us to find the docstring
associated with the signature
* Added utility functions for parsing parameter documentation from three
popular docstring formats (Google, NumPy and reST)
* Implemented tests for all of the above

"Signature help" is displayed by an editor when you are typing a
function call expression. It is typically triggered when you type an
open parenthesis. The language server provides information about the
target function's signature (or multiple signatures), documentation, and
parameters.

Here is how this appears:


![image](https://github.com/user-attachments/assets/40dce616-ed74-4810-be62-42a5b5e4b334)

---------

Co-authored-by: UnboundVariable <unbound@gmail.com>
Co-authored-by: Micha Reiser <micha@reiser.io>
2025-07-10 19:32:00 -07:00
..
module_resolver [ty] Add an instance of an `Any` subclass to the property tests (#19180) 2025-07-08 10:53:50 +01:00
semantic_index [ty] Initial implementation of signature help provider (#19194) 2025-07-10 19:32:00 -07:00
types [ty] Initial implementation of signature help provider (#19194) 2025-07-10 19:32:00 -07:00
util [ty] Add environment variable to dump Salsa memory usage stats (#18928) 2025-06-26 21:27:51 +00:00
ast_node_ref.rs [ty] Add environment variable to dump Salsa memory usage stats (#18928) 2025-06-26 21:27:51 +00:00
db.rs Update Rust toolchain to 1.88 and MSRV to 1.86 (#19011) 2025-06-28 20:24:00 +02:00
dunder_all.rs [ty] Remove `ScopedExpressionId` (#19019) 2025-07-02 17:57:32 +02:00
lib.rs [ty] Add "kind" to completion suggestions 2025-07-09 12:03:56 -04:00
lint.rs [ty] Add environment variable to dump Salsa memory usage stats (#18928) 2025-06-26 21:27:51 +00:00
list.rs [ty] Add environment variable to dump Salsa memory usage stats (#18928) 2025-06-26 21:27:51 +00:00
module_name.rs [ty] Add environment variable to dump Salsa memory usage stats (#18928) 2025-06-26 21:27:51 +00:00
node_key.rs [ty] Add environment variable to dump Salsa memory usage stats (#18928) 2025-06-26 21:27:51 +00:00
place.rs [ty] Bare `ClassVar` annotations (#15768) 2025-07-07 15:04:27 +02:00
program.rs Update Rust toolchain to 1.88 and MSRV to 1.86 (#19011) 2025-06-28 20:24:00 +02:00
pull_types.rs Update Rust toolchain to 1.88 and MSRV to 1.86 (#19011) 2025-06-28 20:24:00 +02:00
python_platform.rs Hug closing `}` when f-string expression has a format specifier (#18704) 2025-06-17 07:39:42 +02:00
semantic_index.rs [ty] Support declaration-only attributes (#19048) 2025-07-07 12:55:32 +02:00
semantic_model.rs [ty] Add "kind" to completion suggestions 2025-07-09 12:03:56 -04:00
site_packages.rs Auto-generate environment variable references for ty (#19205) 2025-07-08 10:48:31 -04:00
suppression.rs Update Rust toolchain to 1.88 and MSRV to 1.86 (#19011) 2025-06-28 20:24:00 +02:00
types.rs [ty] Initial implementation of signature help provider (#19194) 2025-07-10 19:32:00 -07:00
unpack.rs [ty] Remove countme from salsa-structs (#19257) 2025-07-10 11:45:09 +00:00