-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[ty] Fix bug #879 in signature help #19542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
carljm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
|
|
||
| if offset >= call_expr.end() { | ||
| return None; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the doc comment on get_call_expr, it seems like a violation of its contract (aka a bug) for it to return a call expression that ends before offset. So wouldn't it be slighly better to handle this inside get_call_expr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you're correct. This fix wasn't sound. I've introduced a better fix — along with some tests to cover this case — in a new PR. The problem is that the old code was using a zero-length range when calling covering_node, and this returned the node to the left of the cursor position.
|
I don't think this is an issue but just wanted to point it out. Wouldn't this lead to signature help disappearing for nested calls? For example, in the Screen.Recording.2025-07-25.at.09.47.57.mov |
This PR fixes bug [#879](astral-sh/ty#879) where the signature help popup remains visible after typing the closing paren in a call expression. Co-authored-by: UnboundVariable <unbound@gmail.com>
|
@dhruvmanila, yes, you're correct. This fix wasn't sound. I've introduced a better fix — along with some tests to cover this case — in a new PR. |
This PR improves the "signature help" language server feature in two ways: 1. It adds support for the recently-introduced "stub mapper" which maps symbol declarations within stubs to their implementation counterparts. This allows the signature help to display docstrings from the original implementation. 2. It incorporates a more robust fix to a bug that was addressed in a [previous PR](#19542). It also adds more comprehensive tests to cover this case. Co-authored-by: UnboundVariable <unbound@gmail.com>
This PR fixes bug #879 where the signature help popup remains visible after typing the closing paren in a call expression.