mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
internal: completion PathKind is not optional
This commit is contained in:
parent
dd3f5e0993
commit
57a9915c1f
12 changed files with 40 additions and 33 deletions
|
@ -197,10 +197,10 @@ fn should_add_parens(ctx: &CompletionContext) -> bool {
|
|||
}
|
||||
|
||||
match ctx.path_context {
|
||||
Some(PathCompletionCtx { kind: Some(PathKind::Expr), has_call_parens: true, .. }) => {
|
||||
Some(PathCompletionCtx { kind: PathKind::Expr, has_call_parens: true, .. }) => {
|
||||
return false
|
||||
}
|
||||
Some(PathCompletionCtx { kind: Some(PathKind::Use | PathKind::Type), .. }) => {
|
||||
Some(PathCompletionCtx { kind: PathKind::Use | PathKind::Type, .. }) => {
|
||||
cov_mark::hit!(no_parens_in_use_item);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ fn render(
|
|||
|
||||
let needs_bang = match completion.path_context {
|
||||
Some(PathCompletionCtx { kind, has_macro_bang, .. }) => {
|
||||
is_fn_like && kind != Some(PathKind::Use) && !has_macro_bang
|
||||
is_fn_like && kind != PathKind::Use && !has_macro_bang
|
||||
}
|
||||
_ => is_fn_like,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue