mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Move more things into PathCompletionContext
This commit is contained in:
parent
e475bcdcc6
commit
4eabcb2c01
8 changed files with 62 additions and 46 deletions
|
@ -14,7 +14,7 @@ fn snippet(ctx: &CompletionContext, cap: SnippetCap, label: &str, snippet: &str)
|
|||
}
|
||||
|
||||
pub(crate) fn complete_expr_snippet(acc: &mut Completions, ctx: &CompletionContext) {
|
||||
if !(ctx.is_trivial_path && ctx.function_def.is_some()) {
|
||||
if !(ctx.is_trivial_path() && ctx.function_def.is_some()) {
|
||||
return;
|
||||
}
|
||||
let cap = match ctx.config.snippet_cap {
|
||||
|
@ -22,7 +22,7 @@ pub(crate) fn complete_expr_snippet(acc: &mut Completions, ctx: &CompletionConte
|
|||
None => return,
|
||||
};
|
||||
|
||||
if ctx.can_be_stmt {
|
||||
if ctx.can_be_stmt() {
|
||||
snippet(ctx, cap, "pd", "eprintln!(\"$0 = {:?}\", $0);").add_to(acc);
|
||||
snippet(ctx, cap, "ppd", "eprintln!(\"$0 = {:#?}\", $0);").add_to(acc);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue