diff options
| author | Shaygan Hooshyari <sh.hooshyari@gmail.com> | 2023-12-17 10:25:32 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-17 17:25:32 +0800 |
| commit | 5b6fc6dcd7f9fbeec815e5f6622394a40eb7865f (patch) | |
| tree | f71722dde51e3c5bfddf72392797a5b5cfb46225 /lua | |
| parent | docs: update server_configurations.md (diff) | |
| download | nvim-lspconfig-5b6fc6dcd7f9fbeec815e5f6622394a40eb7865f.tar nvim-lspconfig-5b6fc6dcd7f9fbeec815e5f6622394a40eb7865f.tar.gz nvim-lspconfig-5b6fc6dcd7f9fbeec815e5f6622394a40eb7865f.tar.bz2 nvim-lspconfig-5b6fc6dcd7f9fbeec815e5f6622394a40eb7865f.tar.lz nvim-lspconfig-5b6fc6dcd7f9fbeec815e5f6622394a40eb7865f.tar.xz nvim-lspconfig-5b6fc6dcd7f9fbeec815e5f6622394a40eb7865f.tar.zst nvim-lspconfig-5b6fc6dcd7f9fbeec815e5f6622394a40eb7865f.zip | |
feat(kotlin_language_server): Add storagePath to initilaztion options (#2930)
* feat(kotlin_language_server): add storagePath to initilaztion options
* docs(kotlin_language_server): add storage path
* refactor(psalm): reformat code
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/server_configurations/kotlin_language_server.lua | 29 | ||||
| -rw-r--r-- | lua/lspconfig/server_configurations/psalm.lua | 5 |
2 files changed, 12 insertions, 22 deletions
diff --git a/lua/lspconfig/server_configurations/kotlin_language_server.lua b/lua/lspconfig/server_configurations/kotlin_language_server.lua index 4f79b2a3..a151403a 100644 --- a/lua/lspconfig/server_configurations/kotlin_language_server.lua +++ b/lua/lspconfig/server_configurations/kotlin_language_server.lua @@ -24,6 +24,9 @@ return { filetypes = { 'kotlin' }, root_dir = util.root_pattern(unpack(root_files)), cmd = { bin_name }, + init_options = { + storagePath = util.root_pattern(unpack(root_files))(vim.fn.expand '%:p:h'), + }, }, docs = { description = [[ @@ -39,28 +42,16 @@ return { You could refer for this capability to: https://github.com/udalov/kotlin-vim (recommended) Note that there is no LICENSE specified yet. + + For faster startup, you can setup caching by specifying a storagePath + in the init_options. The default is your home directory. ]], default_config = { - root_dir = [[root_pattern("settings.gradle")]], + root_dir = [[See source]], cmd = { 'kotlin-language-server' }, - capabilities = [[ - smart code completion, - diagnostics, - hover, - document symbols, - definition lookup, - method signature help, - dependency resolution, - additional plugins from: https://github.com/fwcd - - Snipped of License (refer to source for full License): - - The MIT License (MIT) - - Copyright (c) 2016 George Fraser - Copyright (c) 2018 fwcd - - ]], + init_options = { + storagePath = [[Enables caching and use project root to store cache data. See source]], + }, }, }, } diff --git a/lua/lspconfig/server_configurations/psalm.lua b/lua/lspconfig/server_configurations/psalm.lua index 8c61839c..f0f25f2a 100644 --- a/lua/lspconfig/server_configurations/psalm.lua +++ b/lua/lspconfig/server_configurations/psalm.lua @@ -1,9 +1,8 @@ local util = require 'lspconfig.util' - return { default_config = { - cmd = {'psalm', '--language-server'}, + cmd = { 'psalm', '--language-server' }, filetypes = { 'php' }, root_dir = util.root_pattern('psalm.xml', 'psalm.xml.dist'), }, @@ -17,7 +16,7 @@ composer global require vimeo/psalm ``` ]], default_config = { - cmd = {'psalm', '--language-server'}, + cmd = { 'psalm', '--language-server' }, root_dir = [[root_pattern("psalm.xml", "psalm.xml.dist")]], }, }, |
