简体   繁体   English

Intellij gradle 在插件扩展中找不到声明

[英]Intellij gradle cannot find declaration in plugins extensions

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. Intellij 没有帮助自动完成或识别 build.gradle 的符号,我想知道这是否是因为 groovy 凭借其 dsl 和 IntelliJ 难以识别扩展而变得神奇。

I've created a simple example with an extension like this:我创建了一个带有如下扩展的简单示例:

class DbConnectionsExtension {

    public final NamedDomainObjectContainer<DbConnectionInfo> connections

    DbConnectionsExtension(Project project) {
        def objects = project.getObjects()
        this.connections = project.container(DbConnectionInfo) {
            name -> objects.newInstance(DbConnectionInfo.class, name)
        }
    }

    void connections(Action<NamedDomainObjectContainer<DbConnectionInfo>> action) {
        action.execute(connections)
    }
    
    void connections(Closure<Object> closure) {
        connections.configure(closure)
    }

}

And Intellij isn't able to recognize the connections field并且 Intellij 无法识别连接字段

在此处输入图像描述

In Github you can find all the code of the example.Github您可以找到示例的所有代码。

Such navigation is not supported currently.目前不支持此类导航。 Please vote for IDEA-197182 request.请投票支持IDEA-197182请求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM