Compare commits

..

10 Commits

Author SHA1 Message Date
61fcb7a627 fix: actually provide the start_editor_server method 2026-01-10 10:01:05 -03:00
568b6420e6 fix: don't install parser if it is already configured 2026-01-10 10:00:32 -03:00
mathijs-bakker
79d9315988 Fix: Deprecated LSP setup to match Neovim's 0.11+ LSP changes 2025-10-10 10:16:09 +02:00
Mathijs Bakker
ae94fa8abb Fix: socket path to match internal GodotStartEditorServer cmd 2025-10-10 09:51:56 +02:00
Mathijs Bakker
57f0beba5f Update hide-files-in-file-explorers.md 2025-10-02 15:38:54 +02:00
Mathijs Bakker
aee49df082 Update hide-files-in-file-explorers.md 2025-10-02 15:38:28 +02:00
Mathijs Bakker
798df8c3a3 Update hide-files-in-file-explorers.md 2025-10-02 15:34:01 +02:00
Mathijs Bakker
e5e19e4651 Update README.md 2025-10-02 15:32:39 +02:00
Mathijs Bakker
e875c5f93c Add: Oil.nvim view_options setup 2025-10-02 15:23:28 +02:00
mathijs-bakker
98197f8102 fix(lsp): update Godot LSP setup for Neovim 0.11+ 2025-09-25 11:34:39 +02:00
6 changed files with 62 additions and 14 deletions

View File

@@ -91,13 +91,13 @@ godotdev.nvim provides a complete Neovim environment for Godot 4.x development,
### Optional settings ### Optional settings
```lua ```lua
require("godotdev").setup({ vim.lsp.config("godotdev") = {
editor_host = "127.0.0.1", -- Godot editor host editor_host = "127.0.0.1", -- Godot editor host
editor_port = 6005, -- Godot LSP port editor_port = 6005, -- Godot LSP port
debug_port = 6006, -- Godot debugger port debug_port = 6006, -- Godot debugger port
csharp = true, -- Enable C# Installation Support csharp = true, -- Enable C# Installation Support
autostart_editor_server = true, -- Enable auto start Nvim server autostart_editor_server = true, -- Enable auto start Nvim server
}) }
``` ```
### Optimize Godot editor for Neovim ### Optimize Godot editor for Neovim
@@ -184,7 +184,9 @@ Make sure `gdformat` is installed and in your PATH. If not, you will see a warni
For more info on indentation: `:help godotdev-indent` For more info on indentation: `:help godotdev-indent`
## Hints/Tips ## Hiding Godot Project Files in oil.nvim and mini.files
Godot generates files and folders like `.uid`, `.import`, or `.godot/` that can clutter your file explorer.
- [Hide Godot related files in file explorers](doc/hide-files-in-file-explorers.md) You can hide them in both [oil.nvim](https://github.com/stevearc/oil.nvim) and [mini.files](https://github.com/nvim-mini/mini.nvim
) by filtering against their patterns.
[Show me how](doc/hide-files-in-file-explorers.md)

View File

@@ -1,4 +1,39 @@
# File Explorers: hide Godot files # File Explorers: hide Godot files
The following setups are for [Lazy.nvim](https://github.com/folke/lazy.nvim)
## oil.nvim
```lua
return {
"stevearc/oil.nvim",
lazy = false,
opts = {
default_file_explorer = true,
-- Make sure you have this in your options:
view_options = {
show_hidden = false,
is_hidden_file = function(name, _)
local godot_patterns = {
'%.uid[/]?$', -- .uid files
'%.import[/]?$', -- .import files
'^%.godot[/]?$', -- .godot directory
'^%.mono[/]?$', -- .mono directory
'godot.*%.tmp$', -- godot temp files
}
for _, pat in ipairs(godot_patterns) do
if name:match(pat) then
return true
end
end
return false
end,
},
},
dependencies = { "nvim-tree/nvim-web-devicons" },
keys = {
{ "-", "<CMD>Oil<CR>", desc = "Open parent directory" },
},
}
```
## mini.files ## mini.files

View File

@@ -83,7 +83,7 @@ This setup allows you to click on a script in Godot and open it directly in Neov
shift shift
fi fi
SOCKET="/private/tmp/godot.pipe" # Neovim socket path SOCKET="/tmp/godot.pipe" # Neovim socket path
NVR="/Library/Frameworks/Python.framework/Versions/3.8/bin/nvr" NVR="/Library/Frameworks/Python.framework/Versions/3.8/bin/nvr"
OPEN_MODE="window" OPEN_MODE="window"

View File

@@ -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

View File

@@ -12,6 +12,8 @@ local function start_editor_server(pipe)
vim.notify("Godot editor server started on " .. pipe, vim.log.levels.INFO) vim.notify("Godot editor server started on " .. pipe, vim.log.levels.INFO)
end end
M.start_editor_server = start_editor_server
-- User command -- User command
vim.api.nvim_create_user_command("GodotStartEditorServer", function(opts) vim.api.nvim_create_user_command("GodotStartEditorServer", function(opts)
start_editor_server(opts.args ~= "" and opts.args or nil) start_editor_server(opts.args ~= "" and opts.args or nil)

View File

@@ -1,3 +1,12 @@
local parsers_ok, ts_parsers = pcall(require, "nvim-treesitter.parsers")
if not parsers_ok then
return
end
if ts_parsers.has_parser('gdshader') then
return
end
local ok, ts_configs = pcall(require, "nvim-treesitter.configs") local ok, ts_configs = pcall(require, "nvim-treesitter.configs")
if not ok then if not ok then
return return
@@ -17,7 +26,6 @@ vim.filetype.add({
}, },
}) })
local parsers_ok, ts_parsers = pcall(require, "nvim-treesitter.parsers")
if parsers_ok then if parsers_ok then
local parser_configs = ts_parsers.get_parser_configs() local parser_configs = ts_parsers.get_parser_configs()
parser_configs.gdshader = { parser_configs.gdshader = {