Skip to content

[ty] Do not suggest argument completion when at value of keyword argument#24669

Merged
dylwil3 merged 5 commits intoastral-sh:mainfrom
dylwil3:fn-kwarg-value-completion
Apr 16, 2026
Merged

[ty] Do not suggest argument completion when at value of keyword argument#24669
dylwil3 merged 5 commits intoastral-sh:mainfrom
dylwil3:fn-kwarg-value-completion

Conversation

@dylwil3
Copy link
Copy Markdown
Collaborator

@dylwil3 dylwil3 commented Apr 16, 2026

In the following situation:

def foo(y_true,y_pred): ...

y_true = 1
y_pred = 2

foo(y_true=y<CURSOR>)

the completion suggestions began with y_true= and y_pred=. But it is never the right thing to suggest an argument completion (i.e. something=) when the cursor is at the value of a keyword argument. So this PR introduces an early exit to the logic for deciding to suggest arguments.

@dylwil3 dylwil3 added the ty Multi-file analysis & type inference label Apr 16, 2026
@astral-sh-bot astral-sh-bot Bot requested a review from charliermarsh April 16, 2026 02:25
Comment thread crates/ty_ide/src/completion.rs Outdated
@dylwil3
Copy link
Copy Markdown
Collaborator Author

dylwil3 commented Apr 16, 2026

(I didn't find an existing issue/PR for this but it's both possible and probable that I'm bad at searching GitHub.)

@carljm carljm removed their request for review April 16, 2026 04:42
@AlexWaygood AlexWaygood added the server Related to the LSP server label Apr 16, 2026
@dylwil3 dylwil3 merged commit ddd6a30 into astral-sh:main Apr 16, 2026
49 checks passed
@dylwil3 dylwil3 deleted the fn-kwarg-value-completion branch April 16, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

server Related to the LSP server ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants