如何在 Eclipse 中启用 gradle 语法高亮?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33806126/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to enable gradle syntax highligting in Eclipse?
提问by smwikipedia
回答by Sergey
I use Groovy editor from Groovy-Eclipse plugin to edit Gradle files. Since Gradle is basically Groovy it works very well. The plugin is available in the Eclipse Marketplace and GitHub.
我使用 Groovy-Eclipse 插件中的 Groovy 编辑器来编辑 Gradle 文件。因为 Gradle 基本上是 Groovy,所以它工作得很好。该插件在 Eclipse Marketplace 和GitHub 中可用。
Buildship does not support source highlighting and probably never will due to planned transition from Groovy to Kotlin.
Buildship 不支持源代码突出显示,并且可能永远不会因为计划从 Groovy 过渡到 Kotlin。
There is the following post in their forum: "this is planned to be supported by Buildship at some point in the future. But, we do not have this on our immediate road map".
他们的论坛中有以下帖子:“计划在未来的某个时候得到 Buildship 的支持。但是,我们的近期路线图上没有这个”。
回答by Ianrakisa
Use EGradle editor plugin - supports Syntax highlighting, code completion, error handling, and tool tip.
使用 EGradle 编辑器插件 - 支持语法高亮、代码完成、错误处理和工具提示。
Install this plugin from market place:
从市场安装这个插件:
回答by aboyko
Try installing this as an alternative: http://marketplace.eclipse.org/content/nodeclipseenide-gradle-eclipse
尝试安装它作为替代:http: //marketplace.eclipse.org/content/nodeclipseenide-gradle-eclipse
It's for highlighting the gradle build file text. It's different from Groovy Eclipse plugin highlighting
它用于突出显示 gradle 构建文件文本。它与 Groovy Eclipse 插件突出显示不同
回答by Daniel
It seems as if buildship does not plan to provide better editor-support for groovy-gradle.
似乎 buildship 不打算为 groovy-gradle 提供更好的编辑器支持。
According to this (closed as wontfix) buildship-bugzilla-bugthe .gradle editor support is currently not planned.
根据这个(关闭为 wontfix)buildship-bugzilla-bug目前没有计划支持 .gradle 编辑器。
Quote from mentioned above bug
[...]Actually, we have no plans for providing editor support for the current Groovy DSL, because groovy-eclipse is essentially unmaintained.
We will provide integration with the Kotlin Eclipse plugin, since Kotlin will be the future preferred language for Gradle build scripts.[...]
引用上面提到的错误
[...]实际上,我们没有计划为当前的 Groovy DSL 提供编辑器支持,因为 groovy-eclipse 基本上没有维护。
我们将提供与 Kotlin Eclipse 插件的集成,因为 Kotlin 将成为 Gradle 构建脚本的未来首选语言。[...]
回答by Dime
Editor from the Groovy-Eclipse plugin does not seem to be much of help for gradle scripts. I would recommend http://marketplace.eclipse.org/content/minimalist-gradle-editor.
Groovy-Eclipse 插件中的编辑器似乎对 gradle 脚本没有太大帮助。我会推荐http://marketplace.eclipse.org/content/minimalist-gradle-editor。
It is also not perfect, but still better than nothing.
它也不完美,但总比没有好。
回答by E-Riz
According to this, STS's Gradle tooling does not include an editor (it relies on the Groovy Eclipse plug-ins to provide the Groovy editor, Gradle is basically specialized Groovy).
根据此,STS的摇篮工具不包括编辑器(它依赖于Groovy的Eclipse插件提供的Groovy编辑器,摇篮基本上是专业的Groovy)。
The Eclipse Buildshipproject doesinclude an editor. You can install it via the Eclipse Marketplace.
在Eclipse中Buildship项目的确包含一个编辑器。您可以通过 Eclipse Marketplace安装它。