Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ This plugin helps you to set up:
- **LSP support** for GDScript and Godot shaders (`.gdshader` files)
- **Godot class docs** in Neovim, rendered from the official docs source as Markdown
- **Debugging** via `nvim-dap` for GDScript
- **Optional live run output** for `:GodotRun*` commands in a Neovim buffer or float
- **Treesitter syntax highlighting** for Godot shader files
- **Automatic formatting** of `.gd` files using `gdscript-formatter`
- **Optional C# support** (user-managed LSP, plus debugging and tooling checks)
Expand Down Expand Up @@ -169,6 +170,21 @@ require("godotdev").setup({
inline_hints = {
enabled = false, -- enable Neovim inlay hints when the attached server supports them
},
run = {
console = {
enabled = false, -- capture :GodotRun* output in Neovim; these runs are no longer detached
renderer = "buffer", -- "buffer" | "float"
buffer = {
position = "bottom", -- "right" | "bottom" | "current"
size = 0.3,
},
float = {
width = 0.8,
height = 0.25,
border = "rounded",
},
},
},
editor_server = {
address = nil, -- nil uses the current server or the platform default
remove_stale_socket = true,
Expand Down Expand Up @@ -232,6 +248,7 @@ treesitter = {
Default notes:
- `autostart_editor_server = false` is the safer default because starting a Neovim server is an external-editor concern and should be opt-in.
- `inline_hints.enabled = false` is the safer default because Godot's LSP support for inlay hints may vary by version and filetype.
- `run.console.enabled = false` is the safer default because live console capture changes `:GodotRun*` from detached launches to attached subprocesses managed by Neovim.
- `treesitter.auto_setup = true` stays enabled by default for convenience, but it is safe to turn off if you already configure `nvim-treesitter` yourself.
- `docs.fallback_renderer = "browser"` remains the default because browser fallback is the only option that can recover when rendered `.rst` docs cannot be fetched.
- The plugin uses Neovim's built-in LSP APIs; `nvim-lspconfig` is not required unless you want it for other servers in your own config.
Expand Down Expand Up @@ -357,6 +374,13 @@ Notes:
- These commands shell out to `godot` on your `PATH`.
- `:GodotRunScenePicker` requires Telescope to be installed; the rest do not.

Optional console capture:
- Set `run.console.enabled = true` to capture stdout/stderr from `:GodotRun*` inside Neovim.
- Choose `run.console.renderer = "buffer"` for a split buffer or `"float"` for a floating window.
- Use `:GodotShowConsole` to reopen the most recent captured console window.
- While console capture is enabled, the launched Godot process is managed by Neovim instead of using the plugin's detached launch path.
- This first implementation captures one active Godot run at a time; starting another captured run while one is still active shows a warning.

## Godot class docs

Open the official Godot class reference from Neovim:
Expand Down
24 changes: 24 additions & 0 deletions doc/godotdev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ game development using Neovim as an external editor. It provides:
- LSP support for GDScript and .gdshader files
- Optional inline hints via Neovim's built-in inlay hint API when supported by the attached Godot LSP client
- Debugging via nvim-dap
- Optional live run output for `:GodotRun*` commands in a Neovim buffer or float
- Treesitter syntax highlighting
- Optional C# support (user-managed LSP) with dotnet, csharp-ls/OmniSharp, and netcoredbg
- Autoformatting `.gd` files with `gdscript-formatter`
Expand Down Expand Up @@ -49,6 +50,21 @@ Example setup:
inline_hints = {
enabled = false, -- enable Neovim inlay hints when the attached server supports them
},
run = {
console = {
enabled = false, -- capture :GodotRun* output in Neovim; these runs are no longer detached
renderer = "buffer", -- "buffer" | "float"
buffer = {
position = "bottom", -- "right" | "bottom" | "current"
size = 0.3,
},
float = {
width = 0.8,
height = 0.25,
border = "rounded",
},
},
},
editor_server = {
address = nil, -- nil uses the current server or the platform default
remove_stale_socket = true,
Expand Down Expand Up @@ -104,6 +120,7 @@ Default notes:

- `autostart_editor_server = false` is the safer default because starting a Neovim server is an external-editor concern and should be opt-in.
- `inline_hints.enabled = false` is the safer default because Godot's LSP support for inlay hints may vary by version and filetype.
- `run.console.enabled = false` is the safer default because live console capture changes `:GodotRun*` from detached launches to attached subprocesses managed by Neovim.
- `treesitter.auto_setup = true` stays enabled by default for convenience, but it is safe to turn off if you already configure `nvim-treesitter` yourself.
- `docs.fallback_renderer = "browser"` remains the default because browser fallback is the only option that can recover when rendered `.rst` docs cannot be fetched.
- The plugin uses Neovim's built-in LSP APIs; `nvim-lspconfig` is optional and not required for Godot LSP support.
Expand Down Expand Up @@ -201,6 +218,13 @@ Notes:
- These commands shell out to `godot` on your `PATH`.
- `:GodotRunScenePicker` requires Telescope to be installed; the rest do not.

Optional console capture:
- Set `run.console.enabled = true` to capture stdout/stderr from `:GodotRun*` inside Neovim.
- Choose `run.console.renderer = "buffer"` for a split buffer or `"float"` for a floating window.
- Use `:GodotShowConsole` to reopen the most recent captured console window.
- While console capture is enabled, the launched Godot process is managed by Neovim instead of using the plugin's detached launch path.
- This first implementation captures one active Godot run at a time; starting another captured run while one is still active shows a warning.

==============================================================================
Godot docs *godotdev-docs*

Expand Down
5 changes: 5 additions & 0 deletions lua/godotdev/run.lua
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ local function run_godot(args)
local cmd = { "godot", "--path", root }
vim.list_extend(cmd, args or {})

local run_console = require("godotdev.run_console")
if run_console.is_enabled() then
return run_console.start(cmd, root)
end

vim.system(cmd, { detach = true, text = true }, function(result)
if result.code == 0 then
return
Expand Down
Loading
Loading