aboutsummaryrefslogtreecommitdiff
path: root/crates/syntax/src
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2020-10-14 20:40:51 +0100
committerLukas Wirth <[email protected]>2020-10-15 17:31:33 +0100
commitbc11475a2a0f06d5083a7032764a50e5f8ade130 (patch)
treebc9f1fde67ad95fbd8061779469897576f233cc3 /crates/syntax/src
parentd983f18df7dd484ec43510111169180d7abe038d (diff)
Properly qualify trait methods in qualify_path assist
Diffstat (limited to 'crates/syntax/src')
-rw-r--r--crates/syntax/src/ast/make.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/syntax/src/ast/make.rs b/crates/syntax/src/ast/make.rs
index 74dbdfaf7..5b06cb767 100644
--- a/crates/syntax/src/ast/make.rs
+++ b/crates/syntax/src/ast/make.rs
@@ -172,6 +172,9 @@ pub fn expr_call(f: ast::Expr, arg_list: ast::ArgList) -> ast::Expr {
172pub fn expr_method_call(receiver: ast::Expr, method: &str, arg_list: ast::ArgList) -> ast::Expr { 172pub fn expr_method_call(receiver: ast::Expr, method: &str, arg_list: ast::ArgList) -> ast::Expr {
173 expr_from_text(&format!("{}.{}{}", receiver, method, arg_list)) 173 expr_from_text(&format!("{}.{}{}", receiver, method, arg_list))
174} 174}
175pub fn expr_ref(expr: ast::Expr, exclusive: bool) -> ast::Expr {
176 expr_from_text(&if exclusive { format!("&mut {}", expr) } else { format!("&{}", expr) })
177}
175fn expr_from_text(text: &str) -> ast::Expr { 178fn expr_from_text(text: &str) -> ast::Expr {
176 ast_from_text(&format!("const C: () = {};", text)) 179 ast_from_text(&format!("const C: () = {};", text))
177} 180}