From a9a58ce7512acbb5be786af52c393904e8465b4d Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Thu, 29 Feb 2024 23:15:32 -0600 Subject: feat: add linux/win support for gdscript cmd --- lua/plugins/lspconfig.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'lua/plugins') 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, }, } -- cgit v1.2.3-70-g09d2