aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_assists/src/utils.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-05-09 17:51:06 +0100
committerAleksey Kladov <[email protected]>2021-05-09 17:55:43 +0100
commit4f3c0adc5aafea465c71c85f36484da970df1ba2 (patch)
tree4cb502a6c345c3ecfb4090067ab1de2cfd69ed55 /crates/ide_assists/src/utils.rs
parent680a0d54e4d2d474ae41f4f4a95c749495a02883 (diff)
internal: introduce `ast::make::ext` module with common shortcuts
There's a tension between keeping a well-architectured minimal orthogonal set of constructs, and providing convenience functions. Relieve this pressure by introducing an dedicated module for non-orthogonal shortcuts. This is inspired by the django.shortcuts module which serves a similar purpose architecturally.
Diffstat (limited to 'crates/ide_assists/src/utils.rs')
-rw-r--r--crates/ide_assists/src/utils.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ide_assists/src/utils.rs b/crates/ide_assists/src/utils.rs
index 5a90ad715..0dcf20c61 100644
--- a/crates/ide_assists/src/utils.rs
+++ b/crates/ide_assists/src/utils.rs
@@ -159,8 +159,8 @@ pub fn add_trait_assoc_items_to_impl(
159 match fn_def.body() { 159 match fn_def.body() {
160 Some(_) => fn_def, 160 Some(_) => fn_def,
161 None => { 161 None => {
162 let body = 162 let body = make::block_expr(None, Some(make::ext::expr_todo()))
163 make::block_expr(None, Some(make::expr_todo())).indent(edit::IndentLevel(1)); 163 .indent(edit::IndentLevel(1));
164 fn_def.with_body(body) 164 fn_def.with_body(body)
165 } 165 }
166 } 166 }