Skip to content

Sugg structured snippet modifications wishlist #3683

Closed
@oli-obk

Description

@oli-obk

Our Sugg builder type has support for many code snippets, but in some cases we still fall back to strings. One such case is

format!("return {}", snip)
} else {
snip.to_string()
};
if parent_node_is_if_expr(&e, &cx) {
hint = format!("{{ {} }}", hint);

There are probably more, but for now we should add methods for

  • return $sugg (e.g. a return_expr method that wraps the current suggestion in a return call)
  • blockifying (turns the current suggestion into a block where the current suggestion is the trailing expression)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messages

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions