diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-01-10 19:59:08 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-01-10 19:59:08 +0000 |
commit | 19eb7fa1db7da8417314ddfafe7addbbd9c3b46a (patch) | |
tree | df758cb96a83238d7c7f515f38333d2385ba587b /crates/ra_hir_expand/src | |
parent | 029c02982b4ab89dc785bc162456dbe25a22446c (diff) | |
parent | dca9195f75a1aa356dba63d39b72da790ec80c13 (diff) |
Merge #2787
2787: Add missing expr cases for expand macro r=flodiebold a=edwin0cheng
I will open another issues for tracking adding back the cases implemented in the PR.
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_hir_expand/src')
-rw-r--r-- | crates/ra_hir_expand/src/db.rs | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/crates/ra_hir_expand/src/db.rs b/crates/ra_hir_expand/src/db.rs index d41b34161..5d12c1584 100644 --- a/crates/ra_hir_expand/src/db.rs +++ b/crates/ra_hir_expand/src/db.rs | |||
@@ -178,6 +178,7 @@ fn to_fragment_kind(db: &dyn AstDatabase, macro_call_id: MacroCallId) -> Fragmen | |||
178 | 178 | ||
179 | match parent.kind() { | 179 | match parent.kind() { |
180 | MACRO_ITEMS | SOURCE_FILE => FragmentKind::Items, | 180 | MACRO_ITEMS | SOURCE_FILE => FragmentKind::Items, |
181 | ITEM_LIST => FragmentKind::Items, | ||
181 | LET_STMT => { | 182 | LET_STMT => { |
182 | // FIXME: Handle Pattern | 183 | // FIXME: Handle Pattern |
183 | FragmentKind::Expr | 184 | FragmentKind::Expr |
@@ -188,7 +189,28 @@ fn to_fragment_kind(db: &dyn AstDatabase, macro_call_id: MacroCallId) -> Fragmen | |||
188 | TRY_EXPR => FragmentKind::Expr, | 189 | TRY_EXPR => FragmentKind::Expr, |
189 | TUPLE_EXPR => FragmentKind::Expr, | 190 | TUPLE_EXPR => FragmentKind::Expr, |
190 | PAREN_EXPR => FragmentKind::Expr, | 191 | PAREN_EXPR => FragmentKind::Expr, |
191 | ITEM_LIST => FragmentKind::Items, | 192 | |
193 | // FIXME: Add tests for following cases in hir_ty | ||
194 | FOR_EXPR => FragmentKind::Expr, | ||
195 | PATH_EXPR => FragmentKind::Expr, | ||
196 | LAMBDA_EXPR => FragmentKind::Expr, | ||
197 | CONDITION => FragmentKind::Expr, | ||
198 | BREAK_EXPR => FragmentKind::Expr, | ||
199 | RETURN_EXPR => FragmentKind::Expr, | ||
200 | BLOCK_EXPR => FragmentKind::Expr, | ||
201 | MATCH_EXPR => FragmentKind::Expr, | ||
202 | MATCH_ARM => FragmentKind::Expr, | ||
203 | MATCH_GUARD => FragmentKind::Expr, | ||
204 | RECORD_FIELD => FragmentKind::Expr, | ||
205 | CALL_EXPR => FragmentKind::Expr, | ||
206 | INDEX_EXPR => FragmentKind::Expr, | ||
207 | METHOD_CALL_EXPR => FragmentKind::Expr, | ||
208 | AWAIT_EXPR => FragmentKind::Expr, | ||
209 | CAST_EXPR => FragmentKind::Expr, | ||
210 | REF_EXPR => FragmentKind::Expr, | ||
211 | PREFIX_EXPR => FragmentKind::Expr, | ||
212 | RANGE_EXPR => FragmentKind::Expr, | ||
213 | BIN_EXPR => FragmentKind::Expr, | ||
192 | _ => { | 214 | _ => { |
193 | // Unknown , Just guess it is `Items` | 215 | // Unknown , Just guess it is `Items` |
194 | FragmentKind::Items | 216 | FragmentKind::Items |