Skip to content

fix: quickfix insert param types - #5576

Open
jny0444 wants to merge 1 commit into
meta:mainfrom
jny0444:fix/quickfix-insert-param-types
Open

jny0444 wants to merge 1 commit into
meta:mainfrom
jny0444:fix/quickfix-insert-param-types

Conversation

@jny0444

@jny0444 jny0444 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

A quick fix now inserts the type an inlay hint is already showing.

Fixes #4231

An unannotated declaration, as in yyy = grow(1) or def grow(x: int):, shows : int or -> int as an inlay hint, but writing that hint down meant typing it by hand. Code actions on the declaration now offer Insert inferred type …, applying the hint's annotation and any imports it needs. The action follows the variable-type and return-type inlay settings and skips argument-name hints. In a notebook, the edit lands in the cell that triggered it.

  • I am a human, and I fully understand the code I am submitting.

Test plan

  • cargo test -p pyrefly --lib insert_inferred_type
  • Covered variables, returns, class attributes, imports, CRLF, disabled inlay hints, a multi-hint selection, and a notebook cell.

@meta-cla meta-cla Bot added the cla signed label Nov 7, 2026
@github-actions github-actions Bot added the size/l label Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

✅ This PR meets all requirements from our pull request checklist.

Optional recommendations:

  • This PR is on the larger side. If parts of it could be merged on their own, consider splitting it into separate PRs for faster review. If you've already split it as far as is practical, no action is needed.

Note: this comment updates automatically after changes to the PR. Updates may take up to half an hour.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quickfix insert parameter types

2 participants