Commit Graph
2351 Commits
Author SHA1 Message Date
Michael Panchenko 37d700e39c Skip ansible tests on Windows due to incompatibility of ansible ls there 2026-03-23 23:42:02 +01:00
Michael Panchenko 091b2245e3 Kotlin LS: remove unused _java_home field from DependencyProvider 2026-03-23 18:17:15 +01:00
b898677b1c feat: add ignored_memory_patterns config option for regex-based memory exclusion (#1145)
Co-authored-by: Bokai Yang <22804145+YouJianFengXue@users.noreply.github.com>
Co-authored-by: Michael Panchenko <35432522+MischaPanch@users.noreply.github.com>
2026-03-23 18:12:30 +01:00
code4lala bf92f3cb49 feat: Support project-level ls_specific_settings (#1192) 2026-03-23 18:03:57 +01:00
VoidChecksumandVoidChecksum d39d168523 fix: detect rust-analyzer from PATH without rustup (#1173)
* fix: check PATH for rust-analyzer before common locations, with functionality validation

Fixes #800 - rust-analyzer fails if rustup is not installed even when
rust-analyzer exists in PATH (e.g. NixOS, distro packages).

Changes:
- Move PATH check (shutil.which) before common location fallbacks
- Add _is_rust_analyzer_functional() to validate PATH-found binaries
  by running --version, catching broken rustup proxy symlinks
- Add tests for Nix PATH detection and broken proxy skip scenarios

* fix: make test_skip_broken_rustup_proxy_in_path work on Windows

The test used hardcoded Unix paths (/usr/bin/rust-analyzer) and
os.path.expanduser("~/.cargo/bin/rust-analyzer") which doesn't
include the .exe extension. On Windows, the production code builds
common paths using pathlib with "rust-analyzer.exe", so the mock
paths never matched, causing RuntimeError instead of finding the
cargo fallback.

Use platform-appropriate paths: on Windows, use .exe extension and
pathlib.Path.home() to match how the production code constructs paths.

---------

Co-authored-by: VoidChecksum <Admin@CyberNord>
2026-03-23 18:01:31 +01:00
Michael Panchenko 2ccd396d74 Merge pull request #1188 from habaneraa/main
Fix: Handle Non-Standard SymbolKind Values from Language Servers
2026-03-23 15:05:22 +01:00
Michael Panchenko 9509320083 Format 2026-03-23 14:36:34 +01:00
Michael Panchenko 6734e5d03c Merge branch 'main' into habaneraa/main 2026-03-23 14:34:49 +01:00
Michael Panchenko 958b4ffd95 Disabled F# tests in CI, mentioned bugs in readme 2026-03-23 14:33:48 +01:00
Michael Panchenko efb895e2b3 Minor typing issue 2026-03-23 11:09:16 +01:00
Michael Panchenko 01bbf7254e Removed duplicated SymbolKind definition
Adjusted comment in autogenerated code, which from now on will be maintained manually
2026-03-23 11:07:53 +01:00
Michael Panchenko f834571d41 Merge pull request #1195 from Asher-/fix/agent-shutdown-lifecycle
Fix agent shutdown lifecycle: no-op shutdown, orphaned LS processes, missing MCP cleanup
2026-03-23 10:23:26 +01:00
Michael Panchenko 793af0a470 Merge pull request #1197 from Asher-/fix/ls-copy-paste-bugs
Fix copy-paste bugs in language server init params
2026-03-23 10:20:42 +01:00
Michael Panchenko 7ed2862b08 Merge pull request #1198 from Asher-/fix/shell-command-safety
Use shlex.quote for shell argument escaping on POSIX
2026-03-23 10:18:28 +01:00
Michael Panchenko b1a8db35f1 Merge pull request #1202 from Asher-/fix/cosmetic-error-messages
Fix copy-paste error messages in log strings
2026-03-23 10:12:00 +01:00
Michael Panchenko b9ae3b9a12 Merge pull request #1204 from Asher-/fix/dashboard-root-redirect
Redirect root URL to /dashboard/
2026-03-23 10:04:55 +01:00
Asher Haig 7978d42c4b Redirect root URL to /dashboard/
Navigating to localhost:24282 returned a 404 because no route handled
the root path. Added a redirect from / to /dashboard/.

Fixes #1194.
2026-03-21 23:24:06 -04:00
Asher Haig 239f480cbb Use shlex.quote for shell argument escaping on POSIX
quote_arg() only wrapped arguments containing spaces in double quotes.
Shell metacharacters ($, backtick, ;, |, &, etc.) were left unescaped.

On POSIX, use shlex.quote() which single-quotes to prevent all shell
interpretation. Retain original Windows behavior since cmd.exe does not
interpret single-quoted strings.
2026-03-21 23:21:16 -04:00
Asher Haig 57e720bc79 Fix copy-paste bugs in language server init params
1. clangd + ccls: workspace folder name was literal "$name" placeholder
   instead of os.path.basename(repository_absolute_path).

2. Erlang: rootUri used f"file://{path}" instead of
   pathlib.Path(...).as_uri(), producing malformed URIs on Windows.

3. F#: symbolKind valueSet used range(1, 26) (1-25) instead of
   range(1, 27) (1-26), missing TypeParameter.
2026-03-21 23:20:54 -04:00
asher 48025c7ddf Fix agent shutdown lifecycle: no-op shutdown, orphaned LS processes, missing MCP cleanup
Three related bugs preventing proper cleanup of language server processes:

1. SerenaAgent.shutdown() checked `hasattr(self, "_is_initialized")` but that
   attribute was never set, making shutdown always return early (no-op).
   Replace with `hasattr(self, "_active_project")` which is set early in
   __init__ and correctly guards against __del__ on partial construction.

2. _activate_project() replaced self._active_project without shutting down
   the previous project first, orphaning its language server processes.
   Now calls old_project.shutdown() before switching.

3. MCP server_lifespan() logged "shutting down" but never called
   agent.shutdown(), so language servers were orphaned on MCP server exit.
   Now calls agent.shutdown() in a try/finally block.
2026-03-21 23:20:30 -04:00
Asher Haig 55f3253ab7 Fix copy-paste error messages in log strings
1. agent.py: f-string had literal 'f' before variable, producing
   "Find the current log file here: f/Users/..." instead of the path.

2. ls.py: delete_text_between_positions logged "insert_text_at_position
   called before Language Server started" — wrong method name.
2026-03-21 21:37:16 -04:00
habaneraa 4f0863dec5 fix: Update SymbolKind handling to use Enum _missing_ method 2026-03-19 19:02:52 +08:00
habaneraa c51887dc2f Fix: Enhance SymbolKind handling for non-standard values 2026-03-19 18:19:49 +08:00
Dr. Dominik Jain 0c915bd18d Merge pull request #1183 from diegobonato/fix/handle-oserror-in-project-path-validation
Handle OSError when validating registered project paths on startup
2026-03-17 13:50:25 +01:00
Diego BonatoandClaude Opus 4.6 e45b90e64e Handle OSError when validating registered project paths on startup
When a registered project path points to a stale or unreachable
filesystem (e.g. a disconnected SSHFS mount), `path.exists()` raises
`OSError: [Errno 5] Input/output error` instead of returning False.
This uncaught exception crashes the entire MCP server on startup,
making all Serena tools unavailable.

Wrap the `path.exists()` call in a try/except OSError so that
inaccessible paths are gracefully skipped with a warning, matching
the existing behavior for non-existent paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 11:52:34 +01:00
Dominik Jain 6a16b5b9e9 ProjectConfig: Improve handling of overridden keys when saving
* Save only non-overridden keys to project.yml
* Save only overriden keys to project.local.yml
2026-03-17 03:45:50 +01:00
Dominik Jain e357323051 Fix: Ensure that local overrides from project.local.yml are never written to project.yml
Previously, only project.yml resave due to incomplete config accounted for this,
but dynamic language changes triggered via the dashboard (which triggered a save
to update the language list) did not.

Since ProjectConfig can always contain local overrides,
* we handle configuration updates by explicitly updating on disk only the
  keys known to have been changed
* we explicitly represent the presence of local overrides, such that
  inadmissible save operations are detectable.
2026-03-17 01:37:57 +01:00
Dominik Jain b659f915f0 Fix: project.local.yml entries were not applied in ProjectConfig.load 2026-03-16 23:04:55 +01:00
Sergey Belov ff1b9057c0 Add limited Ansible language server support (#1170)
References and definition not working yet. Since ansible resolves same files as yaml LS, we will need to add disambiguation later.

Work in progress, improvements on the language server itself are being worked on, ansible support in Serena will be extended accordingly in the future.
2026-03-16 22:40:58 +01:00
Mikha Davids 70edc0d1cc fix: add meta property to flake.nix (#1167) 2026-03-16 10:01:27 +01:00
Dominik Jain 22394cfad8 Dashboard log view style improvements
* Fix container not fully resizing to fit page
* Increase font size from 12px to 14px
2026-03-16 00:54:41 +01:00
Dr. Dominik Jain ae93a40a84 Merge pull request #1164 from TheSmallKiwi/fix/hlsl-language-server-shutdown
Fix HLSL language server leaving orphaned processes on shutdown
2026-03-15 18:18:05 +01:00
Dominik Jain 7a1dcfeeda Auto-generate the tool list in the documentation 2026-03-15 17:26:20 +01:00
Dominik Jain 3690215e72 Delete roadmap
Resolves #1136 [skip ci]
2026-03-15 13:11:57 +01:00
Dr. Dominik Jain 45aa625bb3 Merge pull request #1120 from sachmata/ts-lsp-error
Use $/typescriptVersion notification as TypeScript LSP readiness signal
2026-03-15 13:05:09 +01:00
010ed1015d docs: clarify inheritance of global defaults
Fixes #1155

Co-Authored-By: Dominik Jain <dominik.jain@oraios-ai.de>
Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-15 12:59:42 +01:00
Dominik Jain e615c54d80 Improve documentation of HTTP mode and multiple agents in general
Resolves #1118
2026-03-15 12:36:10 +01:00
Dominik Jain d6e325e2a0 Project.get_language_server_manager_or_raise: Fix error message generation
Fixes #1168
2026-03-14 23:00:39 +01:00
TheSmallKiwiandClaude Opus 4.6 97130e7c13 Fix HLSL language server leaving orphaned processes on shutdown
The base _shutdown() calls process.terminate() directly on the subprocess,
which on Windows with shell=True only kills the cmd.exe wrapper, leaving
the shader-language-server binary running as an orphan. Override stop() in
HlslLanguageServer to use psutil to terminate the full process tree before
the standard shutdown.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-13 20:07:22 -04:00
Vinh Tran 6d6f55308f feat(solidlsp): add Solidity language server support (#1156)
Integrates the Nomic Foundation @nomicfoundation/solidity-language-server
as a new Language.SOLIDITY backend (experimental). Supports .sol files with
go-to-definition, find references, document symbols, hover, and diagnostics.
The server is automatically installed via npm on first use.
2026-03-13 13:14:09 +01:00
Terrance Orletsky 18cee10fa9 Fix PHP symbol retrieval: declare missing Intelephense client capabilities (#1099)
Fix PHP symbol retrieval via Intelephense LSP

* intelephense.py: Add missing client capability declarations for
  documentSymbol (with hierarchical support), references, hover, and
  workspace symbol. Without these, Intelephense does not advertise
  documentSymbolProvider and returns empty results for get_symbols_overview.

Add PHP tests validating hierarchical symbols and LS routing fix

- test_document_symbols_hierarchical_structure: verifies Intelephense
  returns DocumentSymbol[] with class/method hierarchy (not flat
  SymbolInformation[]) when hierarchicalDocumentSymbolSupport is declared

- test_full_symbol_tree_within_file: verifies request_full_symbol_tree
  scoped to sample.php returns Dog/Animal/greet/fetch with Dog containing
  greet as a child (not at root level)

- test_find_symbol_within_php_file: verifies find_symbol with a PHP
  file path (relative_path=) routes to the PHP language server via
  get_language_server() rather than iterating all servers

Peripheral changes:

- symbol.py (LanguageServerSymbolRetriever.find_symbols): When searching
  within a specific file, route to the file-type-appropriate language server
  via get_language_server() instead of querying all servers. This ensures
  PHP files are served by Intelephense and not silently skipped.
2026-03-12 15:19:11 +01:00
StayBlue b3a6045f7e Add Luau language support (#1152) 2026-03-12 11:58:45 +01:00
Dan Rosen 09c007d1e1 Add Lean 4 language support (#1137) 2026-03-12 11:32:31 +01:00
Dr. Dominik Jain f561204840 Merge pull request #1154 from zerone0x/fix/allow-project-creation-without-detected-languages
fix: allow project creation when no LSP-supported languages are detected
2026-03-11 00:40:05 +01:00
zerone0xandClaude 9e9b5edc53 fix: allow project creation when no LSP-supported languages are detected
Previously, ProjectConfig.autogenerate() raised a ValueError when no
recognized source files were found (e.g. empty dir, JetBrains project,
or project with only gitignored files). This prevented users from
creating Serena projects in valid scenarios, especially with the
JetBrains backend where language servers are not used at all.

Now, autogenerate() creates the project with an empty languages list
and logs a warning explaining that symbol tools will be unavailable
for the LSP backend. Users can add languages later via the dashboard
or by editing the project configuration manually.

Fixes #1053

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-10 16:44:27 +01:00
Dominik Jain 3f047f9a66 Fix: Prevent _default_language_server from becoming stale #1151 2026-03-10 12:22:51 +01:00
Dr. Dominik Jain 6ccea87be1 Merge pull request #1140 from cek/feature/configurable-line-ending
feat: Add configurable line_ending setting for file writes
2026-03-09 23:34:45 +01:00
Dominik Jain f51ba805f0 Add comment explaining that JavaScript is supported via the TypeScript LS
Resolves #1141
2026-03-09 23:29:19 +01:00
Dominik Jain 65f5145ab0 Refactoring: Improve dependency structure of LanguageServerSymbolRetriever & CodeEditors
Simplify dependency injections by depending on Project instead of low-level instances
* LanguageServerSymbolRetriever(Project) - contains the instance
* LanguageServerCodeEditor(LanguageServerSymbolRetriever)
* CodeEditor(Project)

Move retrieval methods for LS manager from SerenaAgent to Project, including
the exception-based problem report
2026-03-09 23:20:45 +01:00
Dominik Jain 6bf71ef10b Improve line ending configuration
* Keep unset in project.yml by default (only explicit override)
* Fix member docstrings and member grouping in SerenaConfig
* Fix missing migration in SerenaConfig (ensure setting is saved)
2026-03-09 23:20:45 +01:00