summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <david@luevano.xyz>2024-02-29 23:15:32 -0600
committerDavid Luevano Alvarado <david@luevano.xyz>2024-02-29 23:15:32 -0600
commita9a58ce7512acbb5be786af52c393904e8465b4d (patch)
treebeb087a7c0a244d9e45b52fcb4b1662b0f94c3c3
parent4246511c9f9d63a299bd7f0462fb47403aa0e404 (diff)
feat: add linux/win support for gdscript cmd
-rw-r--r--lua/plugins/lspconfig.lua16
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,
},
}