diff --git a/dot_config/nvim/lua/config/lsp.lua b/dot_config/nvim/lua/config/lsp.lua index 5d72446..9fca98d 100644 --- a/dot_config/nvim/lua/config/lsp.lua +++ b/dot_config/nvim/lua/config/lsp.lua @@ -51,10 +51,23 @@ vim.api.nvim_create_autocmd("LspAttach", { }) -- Enable LSP servers for Neovim 0.11+ +-- gdscript: Godot's LSP runs inside the Godot editor over TCP (no standalone binary). +-- Enable it in Godot via Editor Settings > Network > Language Server (default port 6005). +-- It is only available while the project is open in the Godot editor (or headless: +-- `godot --headless --editor --path .`); override the port with GDScript_Port. +if vim.fn.has("nvim-0.11") == 1 then + vim.lsp.config("gdscript", { + cmd = vim.lsp.rpc.connect("127.0.0.1", tonumber(os.getenv("GDScript_Port") or "6005")), + filetypes = { "gdscript" }, + root_markers = { "project.godot" }, + }) +end + vim.lsp.enable({ "lua_ls", "ols", "clangd", + "gdscript", }) -- Load Lsp on-demand, e.g: eslint is disable by default