mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
refactor complete_fn_fields
function and correct branch checks
This commit is contained in:
parent
8296b16f38
commit
5c0c8ceaf7
2 changed files with 22 additions and 45 deletions
|
@ -148,7 +148,9 @@ pub(crate) fn render_field(
|
|||
.set_documentation(field.docs(db))
|
||||
.set_deprecated(is_deprecated)
|
||||
.lookup_by(name);
|
||||
if ty.is_fn() || ty.is_closure() {
|
||||
|
||||
let is_field_access = matches!(dot_access.kind, DotAccessKind::Field { .. });
|
||||
if !is_field_access || ty.is_fn() || ty.is_closure() {
|
||||
let mut builder = TextEdit::builder();
|
||||
// Using TextEdit, insert '(' before the struct name and ')' before the
|
||||
// dot access, then comes the field name and optionally insert function
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue