The _is_ignored_relative_path method used to raise FileNotFoundError
when checking a path that does not exist on disk. This prevented
editing tools (replace_content, insert_after_symbol, etc.) from
operating on newly created files.
Since a non-existent file cannot be matched by ignore patterns,
returning False (not ignored) is semantically correct and safe.
Changes:
- _is_ignored_relative_path: return False instead of raising for
non-existent paths, with a debug log message
- validate_relative_path docstring: updated to reflect new behavior
- Added 3 test cases covering non-existent path scenarios
* constants.py should remain the central place where a root path
is determined based on source file location
* SerenaPaths should consistently use strings
Serena's file-to-language router already maps `.t` to the Perl LS
(`Language.PERL` in `solidlsp/ls_config.py`), but the
Perl::LanguageServer-side `fileFilter` was hardcoded to
`[".pm", ".pl"]`. As a result Perl::LanguageServer skipped `.t`
files entirely: symbol queries on a `.t` returned empty, and
references to `.pm`/`.pl` subs missed any callers defined in
`.t` files.
Add `.t` to the filter, deduplicate the two `fileFilter` literals
into a `_FILE_FILTER` class constant, and note the sync requirement
with `Language.PERL.get_source_fn_matcher()` in a comment. Cover
the behavior with a new cross-file references test plus a `helper.t`
fixture; the test fails on unpatched `main` and passes on this
branch.
fix(gdscript): detect broken TCP connection and fail fast on reconnect
When the Godot editor restarts or the LSP connection drops, the
TCPLanguageServer read loop exits but previously left self._sock set,
causing is_running() to return True. Subsequent LSP requests would
then send to a dead socket, log a broken-pipe error silently, and
block for the full tool timeout (235 s by default) before raising.
Two fixes in TCPLanguageServer:
- _send_payload: on OSError, clear self._sock/self._file and
immediately cancel all pending requests so callers fail fast
instead of waiting out the timeout.
- _read_loop: after unexpected exit, clear self._sock/self._file so
is_running() returns False and _ensure_functional_ls can trigger
an automatic reconnect on the next tool call.
Also fixes GodotLanguageServer so that ls_specific_settings.request_timeout
is respected as a cap on the per-request timeout. Previously the value
was read in _create_language_server_interface but then overridden by
the tool-timeout-derived value passed to set_request_timeout(). Now
set_request_timeout() applies min(incoming, configured) so users can
set a low request_timeout in their project.yml to fail fast without
lowering the global tool_timeout.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Combine DOTALL and MULTILINE into a single flag for "multi-line mode",
replacing the dotall parameter with multiline/regex_multiline
* Apply the parameter in SearchForPatternTool
* Remove the dotall flag from editing tools (ReplaceContentTool, EditMemoryTool)
because edits should always use multi-line mode, but keep the multiline parameter
as an option in ContentReplacer
- Rename LSP_PORT → DEFAULT_GODOT_LS_PORT and add DEFAULT_GODOT_REQUEST_TIMEOUT
- Make port and request_timeout overridable via ls_specific_settings["gdscript"]
by reading self._custom_settings in _create_language_server_interface
- Move self._conn_info setup into _create_language_server_interface so it can
consume ls_specific_settings (which requires super().__init__ to have run)
- Fix _detect_godot_version to return int | None instead of always defaulting to 4:
use an explicit config_version→major dict; return None for unrecognized versions
and detection failures; caller logs warning on None
- Update setup guide and configuration reference docs with new settings
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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>