fix(lsp): update Godot LSP setup for Neovim 0.11+
This commit is contained in:
committed by
Mathijs Bakker
parent
944ccdab2f
commit
98197f8102
@@ -2,7 +2,6 @@ local M = {}
|
|||||||
|
|
||||||
M.setup = function(config)
|
M.setup = function(config)
|
||||||
config = config or {}
|
config = config or {}
|
||||||
local lspconfig = require("lspconfig")
|
|
||||||
local utils = require("godotdev.utils")
|
local utils = require("godotdev.utils")
|
||||||
|
|
||||||
local host = config.editor_host or "127.0.0.1"
|
local host = config.editor_host or "127.0.0.1"
|
||||||
@@ -20,16 +19,18 @@ M.setup = function(config)
|
|||||||
cmd = vim.lsp.rpc.connect(host, port)
|
cmd = vim.lsp.rpc.connect(host, port)
|
||||||
end
|
end
|
||||||
|
|
||||||
lspconfig.gdscript.setup({
|
vim.lsp.config["gdscript"] = {
|
||||||
name = "godot_editor",
|
name = "godot_editor",
|
||||||
cmd = cmd,
|
cmd = cmd,
|
||||||
filetypes = { "gd", "gdscript", "gdshader" },
|
filetypes = { "gd", "gdscript", "gdshader", "gdscript3" },
|
||||||
root_dir = lspconfig.util.root_pattern("project.godot"),
|
root_markers = { "project.godot", ".git" },
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
utils.suppress_unsupported_lsp_messages(client, { "Method not found: godot/reloadScript" })
|
utils.suppress_unsupported_lsp_messages(client, { "Method not found: godot/reloadScript" })
|
||||||
end,
|
end,
|
||||||
})
|
}
|
||||||
|
|
||||||
|
vim.lsp.enable("gdscript")
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|||||||
Reference in New Issue
Block a user