Skip to content

[rust-analyzer] function pointer fields are completed with parentheses #2200

@incertia

Description

@incertia

This isn't quite a bug, but when calling cmp.mapping.complete() on a field fptr: fn(&Self, ...) -> ..., I get something like (x.fptr)(). Sometimes, I just want x.fptr. Additionally, with SelectBehavior.Insert, this results in x.fptr)() which is kind of awkward. Is there a way to complete just the name and not apply anything if it is a function? Pressing backspace is fine but it gets extra annoying when the thing you want is the first completion item as I have no clue how to get it to insert without select next and then select previous. However, it becomes more or less unusable if people prefer SelectBehavior.Select as the only way to get the text is to confirm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions