Skip to content

Commit

Permalink
[flow][refactor] Refactor implementation of normalizing non-generic r…
Browse files Browse the repository at this point in the history
…ender type to prepare for inserting render type code action

Summary:
Later, I want to use some of the same code to power a code action to insert render type declaration, since it already has some logic to infer the user intention and use the right render variant.

This diff mostly reorganizes the code into a module, and ensure that we emit all errors at the end. The latter is important, since for the code action use case, we don't want to actually emit the error but only to use it as a guide to decide what to put as render type.

Changelog: [internal]

Reviewed By: panagosg7

Differential Revision: D62278126

fbshipit-source-id: 437a9f2d974e17088df7345237bcda76946a2f78
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Sep 10, 2024
1 parent 56d52e2 commit c3a54be
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 120 deletions.
2 changes: 1 addition & 1 deletion src/typing/annotation_inference.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,7 @@ module rec ConsGen : S = struct
TypeCollector.collect c
in
let is_iterable_for_better_error _ _ = false in
Flow_js_utils.mk_non_generic_render_type
Flow_js_utils.RenderTypes.mk_non_generic_render_type
cx
reason
renders_variant
Expand Down
Loading

0 comments on commit c3a54be

Please sign in to comment.