feat: add GDScript (Godot Engine) language server support

Closes #1446. Adds Language.GDSCRIPT backed by a new TCPLanguageServer
that extends LanguageServerInterface directly — no intermediate transport
abstraction layer.

Changes:
- ls_process.py: adds TCPConnectionInfo dataclass and TCPLanguageServer,
  a LanguageServerInterface subclass that manages a TCP socket directly
  (mirroring how StdioLanguageServer manages a subprocess). Stop order
  closes the socket before the BufferedReader wrapper to avoid a deadlock
  where BufferedReader.close() blocks on its internal read lock while
  readline() holds it waiting for data.
- ls_config.py: adds Language.GDSCRIPT with .gd/.gdscript file matcher.
- language_servers/godot_language_server.py: GodotLanguageServer connects
  to the Godot editor's TCP LSP (port 6008, same for Godot 3 and 4),
  registers Godot-specific notification handlers, and performs the
  initialize/initialized handshake. Godot version is auto-detected from
  config_version in project.godot.
- docs: adds GDScript to the language support list and a dedicated setup
  guide covering prerequisites, setup steps, performance characteristics
  (no workspace/symbol support → first full scan is slow, disk cache
  persists across sessions), and known limitations.

Tested against Godot 4.6.1 on Linux (Fedora 41): TCP connection,
initialize handshake, textDocument/documentSymbol returning full symbol
tree, and clean shutdown in <1s.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Erik M JacobsandClaude Sonnet 4.6 committed 2026-05-12 16:20:54 -04:00
1 parent 70d939739a
commit 1ab1c460cb
5 files changed
+376

No files matched your search

@@ -71,6 +71,10 @@ Some languages require additional installations or setup steps, as noted.
(requires [.NET v8.0+](https://dotnet.microsoft.com/en-us/download/dotnet); uses FsAutoComplete/Ionide, which is auto-installed; for Homebrew .NET on macOS, set DOTNET_ROOT in your environment)
* **Fortran**
(requires installation of fortls: `pip install fortls`)
* **GDScript** (Godot Engine)
(requires the Godot editor to be running with its built-in LSP enabled — default on port 6008;
Serena connects over TCP and does not launch Godot itself;
see the [GDScript Setup Guide](../03-special-guides/godot_gdscript_setup_guide_for_serena) for details)
* **Go**
(requires installation of `gopls`)
* **Groovy**