mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-29 06:44:12 +00:00
internal: Simplify DotAccess representation in completions
This commit is contained in:
parent
d5965aa871
commit
697ade6f8d
4 changed files with 57 additions and 53 deletions
|
@ -7,7 +7,9 @@ use stdx::{format_to, to_lower_snake_case};
|
|||
use syntax::SmolStr;
|
||||
|
||||
use crate::{
|
||||
context::{CompletionContext, DotAccess, NameRefContext, PathCompletionCtx, PathKind},
|
||||
context::{
|
||||
CompletionContext, DotAccess, DotAccessKind, NameRefContext, PathCompletionCtx, PathKind,
|
||||
},
|
||||
item::{Builder, CompletionItem, CompletionItemKind, CompletionRelevance},
|
||||
render::{compute_exact_name_match, compute_ref_match, compute_type_match, RenderContext},
|
||||
CallableSnippets,
|
||||
|
@ -209,7 +211,10 @@ fn should_add_parens(ctx: &CompletionContext) -> bool {
|
|||
|
||||
if matches!(
|
||||
ctx.nameref_ctx(),
|
||||
Some(NameRefContext { dot_access: Some(DotAccess::Method { has_parens: true, .. }), .. })
|
||||
Some(NameRefContext {
|
||||
dot_access: Some(DotAccess { kind: DotAccessKind::Method { has_parens: true }, .. }),
|
||||
..
|
||||
})
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue