Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Documentation Tip: Search Structurally @Provides #521

Open
jmfayard opened this issue Mar 8, 2016 · 1 comment
Open

Documentation Tip: Search Structurally @Provides #521

jmfayard opened this issue Mar 8, 2016 · 1 comment

Comments

@jmfayard
Copy link

jmfayard commented 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!

@JakeWharton
Copy link
Collaborator

This is amazing!

We actually have an IntelliJ plugin which is supposed to provide this functionality as well: https://github.com/square/dagger-intellij-plugin. Sadly it's fallen a bit out of favor with regard to upkeep, but we have plans to revive it and restore it to its former glory.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants