rust/crates
Marijn Suijten d33edb4e9c ssr: Allow replacing expressions with statements
Now that statements can be matched and replaced (#6587) some usecases
require expressions to be replaced with statements as well. This happens
when something that can ambiguously be an expression or statement like
`if` and loop blocks appear in the last position of a block, as trailing
expression. In this case a replacement pattern of the form `if
foo(){$a();}==>>$a();` will only substitute `if` blocks in the list of
statements but not if they (implicitly) end up in the trailing
expression, where they are not wrapped by an EXPR_STMT (but the pattern
and template are, as parsing only succeeds for the `stmt ==>> stmt`
case).

Instead of adding two rules that match an expression - and emit
duplicate matching errors - allow the template for expressions to be a
statement if it fails to parse as an expression.
2021-01-04 10:55:09 +01:00
..
arena
assists Merge #7115 2021-01-03 08:56:17 +00:00
base_db Add support for Rust 2021. 2021-01-01 17:22:23 +01:00
cfg Remove some redundant allocations 2020-12-12 12:27:09 -05:00
completion Handle case where detail doesn't exist without giving up on completion 2021-01-02 21:53:52 +11:00
flycheck
hir Merge #7068 2021-01-03 09:03:15 +00:00
hir_def Merge #7128 2021-01-03 08:49:59 +00:00
hir_expand Fixed nested eager macro bug 2021-01-03 17:56:59 +08:00
hir_ty Fixed nested eager macro bug 2021-01-03 17:56:59 +08:00
ide Merge #7068 2021-01-03 09:03:15 +00:00
ide_db Fix type error with .and_then 2021-01-02 21:53:52 +11:00
mbe Introduce HygieneFrames for proper token hyginee 2021-01-02 20:39:57 +08:00
parser parser,syntax: Add separate parser for stmt with optional semicolon 2021-01-03 12:05:52 +01:00
paths
proc_macro_api Remove serde_stacker which depends on cc 2021-01-01 15:26:55 +08:00
proc_macro_srv Fix spacing in proc-macro tokens to_string 2020-12-31 13:36:19 +08:00
proc_macro_test
profile
project_model Add support for Rust 2021. 2021-01-01 17:22:23 +01:00
rust-analyzer Merge #7068 2021-01-03 09:03:15 +00:00
ssr ssr: Allow replacing expressions with statements 2021-01-04 10:55:09 +01:00
stdx
syntax parser,syntax: Add separate parser for stmt with optional semicolon 2021-01-03 12:05:52 +01:00
test_utils
text_edit
toolchain
tt Move TokenExpander to base_db and rename it 2020-12-27 15:29:47 +01:00
vfs
vfs-notify