rust-analyzer/crates
bors 6d61be8e65 Auto merge of #13681 - lowr:fix/extract-function-tail-expr, r=Veykril
fix: check tail expressions more precisely in `extract_function`

Fixes #13620

When extracting expressions with control flows into a function, we can avoid wrapping tail expressions in `Option` or `Result` when they are also tail expressions of the container we're extracting from (see #7840, #9773). This is controlled by `ContainerInfo::is_in_tail`, but we've been computing it by checking if the tail expression of the range to extract is contained in the container's syntactically last expression, which may be a block that contains both tail and non-tail expressions (e.g. in #13620, the range to be extracted is not a tail expression but we set the flag to true).

This PR tries to compute the flag as precise as possible by utilizing `for_each_tail_expr()` (and also moves the flag to `Function` struct as it's more of a property of the function to be extracted than of the container).
2022-11-27 12:18:42 +00:00
..
base-db ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
cfg ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
flycheck Properly implement Drop for JodGroupChild 2022-11-24 21:30:15 +01:00
hir ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
hir-def Auto merge of #13676 - fasterthanlime:subtree-fix, r=Veykril 2022-11-25 21:27:46 +00:00
hir-expand Encode the variants of HirFileId in a u32 with MSB as the tag 2022-11-25 23:28:35 +01:00
hir-ty ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
ide Auto merge of #13671 - Veykril:goto-decl, r=Veykril 2022-11-25 09:28:39 +00:00
ide-assists fix: check if range contains tail expression 2022-11-27 00:31:02 +09:00
ide-completion Auto merge of #13611 - yue4u:fix/completion-after-colon, r=yue4u 2022-11-26 17:55:00 +00:00
ide-db Encode the variants of HirFileId in a u32 with MSB as the tag 2022-11-25 23:28:35 +01:00
ide-diagnostics ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
ide-ssr ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
limit ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
mbe ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
parser ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
paths ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
proc-macro-api ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
proc-macro-srv ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
proc-macro-srv-cli ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
proc-macro-test ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
profile ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
project-model Auto merge of #13667 - Veykril:detached-files-sysroot, r=Veykril 2022-11-24 09:21:44 +00:00
rust-analyzer Auto merge of #13611 - yue4u:fix/completion-after-colon, r=yue4u 2022-11-26 17:55:00 +00:00
sourcegen ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
stdx ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
syntax ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
test-utils ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
text-edit ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
toolchain ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
tt ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
vfs ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00
vfs-notify ⬆️ rust-analyzer 2022-11-23 17:24:03 +02:00