From b51f1ae28924a752258e7607fbc3210f9b18eaac Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 22 Jul 2021 00:08:36 +0200 Subject: Updates based on Chris's lunarvim --- .config/nvim/ftplugin/kotlin.lua | 42 ++++------------------------------------ 1 file changed, 4 insertions(+), 38 deletions(-) (limited to '.config/nvim/ftplugin/kotlin.lua') diff --git a/.config/nvim/ftplugin/kotlin.lua b/.config/nvim/ftplugin/kotlin.lua index eb5f5f5..2677c28 100644 --- a/.config/nvim/ftplugin/kotlin.lua +++ b/.config/nvim/ftplugin/kotlin.lua @@ -1,38 +1,4 @@ -if require("cfg.utils").check_lsp_client_active "kotlin_language_server" then - return -end - ---- default config for gradle-projects of the ---- kotlin-language-server: https://github.com/fwcd/kotlin-language-server ---- ---- This server requires vim to be aware of the kotlin-filetype. ---- You could refer for this capability to: ---- https://github.com/udalov/kotlin-vim (recommended) ---- Note that there is no LICENSE specified yet. - -local util = require "lspconfig/util" - -local bin_name = DATA_PATH .. "/lspinstall/kotlin/server/bin/kotlin-language-server" -if vim.fn.has "win32" == 1 then - bin_name = bin_name .. ".bat" -end - -local root_files = { - "settings.gradle", -- Gradle (multi-project) - "settings.gradle.kts", -- Gradle (multi-project) - "build.xml", -- Ant - "pom.xml", -- Maven -} - -local fallback_root_files = { - "build.gradle", -- Gradle - "build.gradle.kts", -- Gradle -} - -require("lspconfig").kotlin_language_server.setup { - cmd = { bin_name }, - on_attach = require("cfg.lsp").common_on_attach, - root_dir = function(fname) - return util.root_pattern(unpack(root_files))(fname) or util.root_pattern(unpack(fallback_root_files))(fname) - end, -} +require("lang.kotlin").format() +require("lang.kotlin").lint() +require("lang.kotlin").lsp() +require("lang.kotlin").dap() -- cgit v1.2.3-70-g09d2