Tag: intellij idea

在kotlin中为Gradle脚本配置IntelliJ自动完成

我正在用IntelliJ中简单的hello-world应用程序试用gradle-script-kotlin 。 但IntelliJ自动完成不会在build.gradle.kts文件中弹出。 https://github.com/gradle/gradle-script-kotlin/tree/master/samples/hello-world build.gradle.kts: apply<ApplicationPlugin>() configure<ApplicationPluginConvention> { mainClassName = ".HelloWorld" } configure<JavaPluginConvention> { setSourceCompatibility(1.8) setTargetCompatibility(1.8) } repositories { jcenter() } dependencies { testCompile("junit:junit:4.12") } settings.gradle: rootProject.buildFileName = 'build.gradle.kts' 我安装了IntelliJ kotlin插件和gradle插件,并使用gradle 3.0。 示例应用程序使用gradle命令。 如何配置IntelliJ启用build.gradle.kts文件自动完成? 我正在使用IntelliJ 2016.2.2和kotlin插件版本:1.0.3-release-IJ2016.1-120

为什么intelliJ IDEA依赖范围是“提供”而不是“编译”?

我希望IntelliJ IDEA将我的库作为“编译”范围而不是“提供”范围。 这是我的gradle文件的一部分: apply plugin: 'java' sourceCompatibility = 1.8 repositories { mavenCentral() } dependencies { // Logging compile 'ch.qos.logback:logback-classic:1.2.1' compile 'com.getsentry.raven:raven-logback:7.8.2' // BigQuery compile 'com.google.api-client:google-api-client:1.20.0' compile 'com.google.apis:google-api-services-bigquery:v2-rev227-1.20.0' // Configuration management compile 'commons-configuration:commons-configuration:1.10' //Json compile 'org.json:json:20160810' //Kafka compile "org.apache.kafka:kafka-clients:0.10.1.1" testCompile group: 'junit', name: 'junit', version: '4.12' testCompile 'org.assertj:assertj-core:3.0.0' testCompile 'org.mockito:mockito-all:1.10.19' } task wrapper(type: Wrapper) { gradleVersion […]

IntelliJ:Kotlin没有自动完成功能?

我正在用Kotlin插件开发一个项目,但是IntelliJ似乎没有Kotlin的自动完成功能。 有没有办法来启用它,或者我应该只是处理它。

获取IntelliJ Kotlin插件和gradle匹配

我正在尝试IntelliJ 16,早期访问版本,但我的项目不会编译: Error:(16, 17) Kotlin: Unresolved reference: substring (note: this may be caused by the fact that some classes compiled with an incompatible version of Kotlin were found in the classpath. Such classes cannot be loaded properly by this version of Kotlin compiler. 据推测,Kotlin的Gradle和IntelliJ版本需要匹配,但安装的Kotlin插件是: 1.0.0-rc-1007-IJ143-11 我没有看到这在任何公共存储库。 我在Gradle项目中宣布的最新版本是: buildscript { ext.kotlin_version = ' 1.0.0-rc-1007-IJ143-11' 。 。 […]

在IntelliJ中Kotlin未解决的参考

我开始在IntelliJ学习Kotlin的教程 。当我尝试运行示例即 fun main(args: Array<String>) { println("lol") } 执行被暂停这个消息Error:(5, 5) Kotlin: Unresolved reference: println这是我第一次使用IntelliJ.I从来没有在一个Java项目上工作。我错过了什么? 编辑:我已经看到了另一个问题。答案是无效的我的情况。

Gradle kotlin脚本,>找不到id为`kotlin`的插件

我试图用Kotlin脚本将我的一个项目迁移到Gradle。 这些是我的步骤: 用这个替换/gradle/wrapper/gradle-wrapper.jar 更新gradle/wrapper/gradle-wrapper.properties与此处相同 创建了相应的build.gradle.kts 设置settings.gradle为rootProject.buildFileName = 'build.gradle.kts' 在这一点上,Intellij检测到并建议: 您可以配置Gradle包装来使用与源的分配。 它将为IDE提供Gradle API / DSL文档。 – >好的,应用建议! Gradle'hello-kotlin'项目刷新失败 错误:找不到id为'kotlin'的插件。 然后我也试着尝试一个官方样本 : 克隆回购 打开样品 同样的错误 …我究竟做错了什么? 我回到了官方示例,试图使缓存无效并重新启动,但没有奏效 我试图删除 apply { plugin("kotlin") } 刷新Gradle,再次添加,刷新Gradle,它工作 如果我打开一个src文件,Intellij说: Kotlin没有配置 然而,样本似乎现在运行.. Intellij 2017.1 EAP Kotlin 1.1m04