Open Rubonnek opened 7 months ago
I have a working neovim
setup but I'm not sure if it's worth it to write as there are multiple ways to configure this. For example I use:
LazyVim
: as the plugin manager.lspconfig
(gdscript
): as the lsp, needs tweaks. If using windows, there is no pipe
support.null-ls
(gdtoolkit
: gdformat
and gdlint
): for formatting and linting.My vim.lsp.buf.hover
works fine, unless the issue is another thing:
works fine, unless the issue is another thing
To my knowledge there's no issue other than missing documentation.
I have a working
neovim
setup but I'm not sure if it's worth it to write as there are multiple ways to configure this
As long as it's consistent, concise and clear I think it's enough. By this I mean trying to stick to a specific way of configuring Neovim if provided by the plugin manager instead of mixing/matching different ways of configuring it (say vimscript + lua + some plugin manager setting).
For example, LazyVim
provides a user plugin specification which seems to suffice. This is what I have on mine to support LSP + DAP:
$HOME/.config/nvim/lua/plugins/godot-support-spec.lua
return {
-- add the LSP server configuration through lspconfig
{
"neovim/nvim-lspconfig",
---@class PluginLspOpts
opts = {
-- ---@type lspconfig.options
servers = {
gdscript = {}, -- NOTE: To change the port, you need to set the environment variable GDScript_Port to the correct port number.
},
},
},
-- add an nvim-dap configuration for gdscript and a DAP client adapter configuration for it.
{
"mfussenegger/nvim-dap",
opts = {},
config = function(_, opts)
local dap = require("dap")
dap.configurations.gdscript = {
{
type = "godot",
request = "launch",
name = "Launch scene",
project = "${workspaceFolder}",
launch_scene = true,
},
}
dap.adapters.godot = {
type = "server",
host = "127.0.0.1",
port = 6006,
}
end,
},
}
The only thing missing above is syntax highlighting which is provided by nvim-treesitter
but which needs to be configured in one place only. I currently have that in a separate base-spec.lua
$HOME/.config/nvim/lua/plugins/base-spec.lua
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"gdscript", -- there are other entries in this list but only gdscript is included to be concise
},
},
},
That's roughly what I was planning to submit but I've not gotten around to it because I've not tested the DAP plugin thoroughly.
* `null-ls` (`gdtoolkit`: `gdformat` and `gdlint`): for formatting and linting.
Do you have this configured through a LazyVim
plugin spec? Sounds like it would be a nice to have in the documentation.
@Rubonnek yes I'm familiar with the spec, but my config itself might be a bit of a mess. You can find my config in my nvim
repo. It's just a matter of installing gdtoolkit
either through mason
or system package manager (or pip) and then setting the sources in null-ls
(now none-ls
):
Currently, I had to install gdtoolkit
manually as well as an extra dependency missing from upstream, until they fix that then mason can be used no problem. Other than this, I have basically the same config except for the debugger as I don't really use it, I think I have nvim-dap
setup for something else but I ended up not even using it.
Your Godot version: v4.2.1.stable.official
Issue description: Simulating an
stdio
connection against the LSP server through a piped TCP connection might cause issues that seem server-sided such astextDocument/hover
not working correctly as reported on https://github.com/godotengine/godot/issues/87192 when in reality the issue is client-sided.This issue is specific to Neovim -- it would be nice to have working examples of LSP client configurations for NeoVim in the documentation.
URL to the documentation page (if already existing): https://docs.godotengine.org/en/stable/tutorials/editor/external_editor.html