Skip to content

Feature Request: Matching repetitions of placeholders using SSR #9126

@maxammann

Description

@maxammann

I'm trying to match all functions, which:

  • start with "op_"
  • are public
  • arbitrary arguments
  • have an arbitrary return type (not equal to unit ())

I'm using the command line tool, and started witht he following query:

rust-analyzer search 'fn $a( $b:$c ) -> $d { $e }'

The problem is that the search really expects only one instance of $e. This means it matches only functions with exactly one statement in the body. Also it only matches functions with exactly one argument.

Is there already a way to achive this pattern maching? I would suspect something like $($e)* to be possible, with matches multiple statements in the body. This would be similar to rust macros.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ssrstructural search & replaceC-featureCategory: feature requestS-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions