title: Intellij gradle cannot find declaration in plugins extensions
body: <p>Intellij's not helping to autocomplete or to recognize symbols for build.gradle, and I'm wondering if it's because groovy makes magic with its dsl and IntelliJ struggles to identify extensions.</p>
  <p>I've created a simple example with an extension like this:</p>
  <pre><code>class DbConnectionsExtension {
  
      public final NamedDomainObjectContainer&lt;DbConnectionInfo&gt; connections
  
      DbConnectionsExtension(Project project) {
          def objects = project.getObjects()
          this.connections = project.container(DbConnectionInfo) {
              name -&gt; objects.newInstance(DbConnectionInfo.class, name)
          }
      }
  
      void connections(Action&lt;NamedDomainObjectContainer&lt;DbConnectionInfo&gt;&gt; action) {
          action.execute(connections)
      }
      
      void connections(Closure&lt;Object&gt; closure) {
          connections.configure(closure)
      }
  
  }
  </code></pre>
  <p>And Intellij isn't able to recognize the connections field</p>
  <p><a href="https://i.stack.imgur.com/DuANl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DuANl.png" alt="enter image description here" /></a></p>
  <p>In <a href="https://github.com/ferranDelgado/gradle-sandbox" rel="nofollow noreferrer">Github</a> you can find all the code of the example.</p>