diff options
author | David Luevano Alvarado <david@luevano.xyz> | 2024-02-29 23:15:32 -0600 |
---|---|---|
committer | David Luevano Alvarado <david@luevano.xyz> | 2024-02-29 23:15:32 -0600 |
commit | a9a58ce7512acbb5be786af52c393904e8465b4d (patch) | |
tree | beb087a7c0a244d9e45b52fcb4b1662b0f94c3c3 | |
parent | 4246511c9f9d63a299bd7f0462fb47403aa0e404 (diff) |
feat: add linux/win support for gdscript cmd
-rw-r--r-- | lua/plugins/lspconfig.lua | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index d9395ff..a5cb52a 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -10,6 +10,14 @@ local function get_lua_lib() } end +local function get_gdscript_cmd() + local port = os.getenv('GDScript_Port') or '6005' + if vim.loop.os_uname().sysname == 'Linux' then + return { 'nc', 'localhost', port } + end + return { 'ncat', 'localhost', port } +end + local servers = { clangd = {}, gopls = { -- just the key for the gopls config @@ -175,7 +183,13 @@ return { setup_server('ruff_lsp') setup_server('lua_ls') -- assumes localhost is mirrored (networkingMode=mirrored in .wslconfig) - setup_server('gdscript') + -- setup_server('gdscript') + lspconfig['gdscript'].setup({ + capabilities = capabilities, + on_attach = on_attach, + settings = servers['gdscript'], + cmd = get_gdscript_cmd(), + }) end, }, } |