#521·dagger

Documentation Tip: Search Structurally @Provides

Author: jmfayardCreated Mar 8, 2016Updated Mar 8, 2016

Hello, thanks for dagger, which is great.

A co-worker of mine who was unfamiliar with it was confused all the time from where those @Inject fields come from.

To make his life easier, here is a structural search pattern that people can use, it's quite useful


Action Search Structurally (or Edit > Find > Search Structurally)

Enter the following template

class $Class$ {
  @Provides( )
  $MethodType$ $MethodName$($ParameterType$ $ParameterName$);
}

In Edit variables, edit $MethodName$ like this image

Also edit $ParameterName$ image

Now when you serach Search Structurally, you get

image

Save it as template named Dagger @Provides so you can use it next time from (Copy from existing template)

Hope that helps!