diff options
author | Benjamin Coenen <[email protected]> | 2020-04-09 17:37:34 +0100 |
---|---|---|
committer | Benjamin Coenen <[email protected]> | 2020-04-09 18:12:50 +0100 |
commit | c1317d692321ba5ba8f138067ebefbb9559d098d (patch) | |
tree | e29a44577e4d2cf55b6f53e3428abea43bbd33d7 /crates/ra_assists/src/handlers/add_new.rs | |
parent | fc70cf9458c5234decafdd52b9aced790ac43d7a (diff) | |
parent | 30f0ad159a0f260f54356385de63c171722adb72 (diff) |
feat: add support for feature attributes in struct literal
Signed-off-by: Benjamin Coenen <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/handlers/add_new.rs')
-rw-r--r-- | crates/ra_assists/src/handlers/add_new.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_assists/src/handlers/add_new.rs b/crates/ra_assists/src/handlers/add_new.rs index 240b19fa3..c10397249 100644 --- a/crates/ra_assists/src/handlers/add_new.rs +++ b/crates/ra_assists/src/handlers/add_new.rs | |||
@@ -1,7 +1,8 @@ | |||
1 | use hir::Adt; | 1 | use hir::Adt; |
2 | use ra_syntax::{ | 2 | use ra_syntax::{ |
3 | ast::{ | 3 | ast::{ |
4 | self, AstNode, NameOwner, StructKind, TypeAscriptionOwner, TypeParamsOwner, VisibilityOwner, | 4 | self, AstNode, AstToken, NameOwner, StructKind, TypeAscriptionOwner, TypeParamsOwner, |
5 | VisibilityOwner, | ||
5 | }, | 6 | }, |
6 | TextUnit, T, | 7 | TextUnit, T, |
7 | }; | 8 | }; |
@@ -105,7 +106,7 @@ fn generate_impl_text(strukt: &ast::StructDef, code: &str) -> String { | |||
105 | if let Some(type_params) = type_params { | 106 | if let Some(type_params) = type_params { |
106 | let lifetime_params = type_params | 107 | let lifetime_params = type_params |
107 | .lifetime_params() | 108 | .lifetime_params() |
108 | .filter_map(|it| it.lifetime_token()) | 109 | .filter_map(|it| it.lifetime()) |
109 | .map(|it| it.text().clone()); | 110 | .map(|it| it.text().clone()); |
110 | let type_params = | 111 | let type_params = |
111 | type_params.type_params().filter_map(|it| it.name()).map(|it| it.text().clone()); | 112 | type_params.type_params().filter_map(|it| it.name()).map(|it| it.text().clone()); |