YouCompleteMe with Kotlin

step0、参考:language servers used with YCM

step1、安装依赖

下载时git
编译时JDK
运行时JDK

step2、创建~/.lsp/kotlin-language-server目录

mkdir -p ~/.lsp/kotlin-language-server

step3、使用git命令下载源代码

git -C ~/.lsp clone https://github.com/fwcd/kotlin-language-server

step4、进入~/.lsp/kotlin-language-server目录并查看内容

step5、在settings.gradle的开头处加入如下代码

pluginManagement {
    repositories {
        maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
    }
}

step6、将所有的build.gradle中的mavenCentral()替换为如下的代码:

maven { url "https://maven.aliyun.com/repository/public" }

step7、编译:

./gradlew --no-daemon server:installDist

step8、在~/.vimrc中加入如下的配置:

let g:ycm_language_server = [
    \{  'name': 'kotlin',
    \   'filetypes': [ 'kotlin' ],
    \   'cmdline': [ expand( '$HOME/.lsp/kotlin-language-server/server/build/install/server/bin/kotlin-language-server' ) ],
    \}
]