Commit Graph
3164 Commits
Author SHA1 Message Date
Dominik Jain d2cf18ddcb Refactoring: Rename Language to LanguageServerId
This resolves a long-standing naming issue in Serena & SolidLSP.
2026-07-22 20:55:36 +02:00
Dr. Dominik Jain ef0e218fb1 Allow language server priorities to be configured in serena_config.yml (#1736) 2026-07-22 17:26:56 +02:00
xormania 9debf7742a Add Grok Build support (context, setup, native hooks)
Adds first-class support for xAI's Grok Build CLI, following the
existing client-integration pattern (Claude Code, CodeBuddy, Codex):

- grok context: single-project, shaped like claude-code.yml, with the
  file-tool exclusions appropriate for a CLI agent that has its own
  read/edit/shell tools. structured_tool_output is left at the auto
  default (as in the codex and codebuddy contexts); claude-code's
  explicit false is a Claude-Code-specific bug workaround that is not
  carried over.
- serena setup grok: registers Serena as a user-scoped MCP server via
  "grok mcp add" after detecting a compatible grok CLI.
- serena-hooks --client=grok: Grok-native PreToolUse output
  ({decision, reason}) instead of the Claude-style hookSpecificOutput
  envelope; grep/read detection extended to Grok's tool names and
  shell payloads (target_file/targetFile path keys, non-string command
  values handled defensively). The payload-parsing refinements live in
  the remind hook's client-agnostic parsing and apply to all hook
  clients: a non-string command value previously raised, and
  target_file/targetFile paths were not recognized.
- Docs (030_clients.md #grok), unit tests for setup/hooks/context, and
  scripts/live_test_grok.py - a zero-inference, state-preserving live
  smoke test against a real grok installation (documented in
  CONTRIBUTING.md). Its M5 check verifies the structured-output wire
  shape: the grok context (auto default) serves an output schema and
  structuredContent for string-returning tools, while the claude-code
  context (explicit false workaround) serves plain text only.
2026-07-21 21:18:16 +02:00
Tyce Herrman 96ee9b65e2 Add BasedPyright as alternative LSP for Python (#1705) 2026-07-21 20:11:32 +02:00
Dominik Jain 2c10e25c97 Set version to v1.6.2.dev0 2026-07-21 17:34:25 +02:00
Dominik Jain bcac0969fb Release v1.6.1 2026-07-21 17:34:25 +02:00
Dominik Jain 4c82b2bf19 Dashboard: indicate when a newer Serena version is available 2026-07-21 14:51:32 +02:00
Dr. Dominik Jain 4903da5ac0 Merge pull request #1524 from BinarySo1o/fix/ts-coverage-dirname-ignore
TypeScript: stop hard-ignoring source directories named `coverage`
2026-07-21 13:30:50 +02:00
Dr. Dominik Jain 0c96c39a90 Merge branch 'main' into fix/ts-coverage-dirname-ignore 2026-07-21 13:29:54 +02:00
Dr. Dominik Jain 9b710a7193 Merge pull request #1731 from oraios/fup-ls-file-system-sync
F'up: LS file system sync
2026-07-21 13:27:42 +02:00
Dominik Jain 4cf2bf04e4 Document tool file sync requirements, adding missing sync call in RenameSymbolTool 2026-07-21 13:10:21 +02:00
Dominik Jain 574110fc28 Initialise file change notifier (establishing baseline) upon construction 2026-07-21 13:10:21 +02:00
Dominik Jain ba7cdffc02 FindReferencingSymbolsTool: Limit file system sync to the necessary case
(i.e. no full symbol search), adding tests that specifically test the tool path
2026-07-21 13:10:21 +02:00
Dr. Dominik Jain 690904098e Merge pull request #1728 from arimu1/fix/1724-content-modified-retry
Retry LSP ContentModified (-32801) errors instead of failing hard
2026-07-21 12:54:16 +02:00
Dominik Jain a9c72f93e4 Fix: Order of ignore patterns passed to language servers was not respected
Resolves #1729
2026-07-21 12:52:53 +02:00
Dominik Jain 101d7a01d9 SymbolDictGrouper: Allow grouper to be temporarily disabled via disabled_context 2026-07-21 12:33:23 +02:00
Dominik Jain d6993fe8b6 Fix docstring change being applied to the wrong 'find references' tool 2026-07-21 12:04:43 +02:00
arimu1 8fa6759646 Gate ContentModified retry on declared retryOnContentModified methods
Review on #1728 found two blocking issues in the previous commit:

1. pyrefly_server.py wraps send_request with its own 5x/0.2s retry for
   RequestCancelled/ContentModified. The base-class retry nested inside
   it, so a persistent ContentModified produced 5x5=25 round-trips.

2. The base-class retry applied to every request on every server, but
   general.staleRequestSupport.retryOnContentModified in InitializeParams
   is the client's contract with the server about exactly which requests
   it will reissue. rust-analyzer declares only the three semanticTokens
   methods and haskell-language-server declares none; blanket-retrying
   e.g. textDocument/hover (or workspace/executeCommand, which is not
   idempotent) contradicts that declared capability.

Fix: send_request now only retries a method if it was registered via
the new LanguageServerInterface.set_content_modified_retry_methods,
which SolidLanguageServer._create_initialize_params populates from
each server's own general.staleRequestSupport.retryOnContentModified
list right after building it. The mechanism is opt-in per method, per
server, and mirrors what we actually told the server -- so it's a
no-op wherever nothing is declared.

rust-analyzer now declares textDocument/hover in that list (the method
issue #1724's repro -- test_find_symbol[rust_add_function] with
include_info=True -- actually needs), in addition to the pre-existing
semanticTokens methods.

This also resolves the pyrefly double-retry: pyrefly never declares
general.staleRequestSupport, so the base-class retry is a no-op for
every pyrefly request and pyrefly's own wrapper remains the sole
handler for both RequestCancelled and ContentModified there, exactly
as before this PR. pyrefly_server.py is intentionally left untouched;
narrowing its retry tuple, as literally suggested, would have removed
ContentModified handling for it entirely once the base layer stopped
covering it too.

Also: reduced _CONTENT_MODIFIED_MAX_ATTEMPTS from 5 to 3 (now the max
per allowlisted method only, so worst-case added latency for hover is
2 * request_timeout + 0.4s instead of 4 * request_timeout + 0.8s), and
restructured send_request around a _send_request_once helper so the
final failed attempt raises directly instead of falling through to a
trailing `raise AssertionError("unreachable")`. Retry tests now
monkeypatch time.sleep and gained coverage for the allowlist gate
(undeclared method, executeCommand, default-empty registration).

Fixes #1724
2026-07-21 10:08:20 +07:00
arimu1 30073d36d8 Retry LSP ContentModified (-32801) errors instead of failing hard
Per the LSP spec, ContentModified means the server discarded a stale,
in-flight computation because the workspace changed underneath it, not
that the request itself is invalid, so a well-behaved client is
expected to retry. LanguageServerInterface.send_request previously
converted any such response straight into a hard SolidLSPException,
with no retry, for every language server.

This was flaking test_find_symbol[rust_add_function] on windows-latest:
rust-analyzer returns ContentModified for hover requests cancelled by
concurrent indexing (its internal retry set does not cover hover), and
nothing on the client side retried it.

send_request now retries ContentModified responses a bounded number of
times with a short delay before giving up. This is generic to the base
request path, so it applies to every language server, not just
rust-analyzer. RequestCancelled (-32800) is left alone since the LSP
spec defines it as client-initiated.

Fixes #1724
2026-07-21 09:24:32 +07:00
Dominik Jain 9383bf788c Merge branch 'main' of github.com:oraios/serena 2026-07-21 01:26:26 +02:00
Dominik Jain 75ab3e5cc8 Bump anthropic from 0.59.0 to 0.117.0
0.59.0 caused a compatibility warning to be printed when run with Python 3.14

Resolves #1725
2026-07-21 01:25:16 +02:00
Dr. Dominik Jain 0a3226377a Merge pull request #1726 from oraios/ls-file-change-notifier
Fix: Language servers were not notified of external file system changes
2026-07-21 01:22:56 +02:00
Dominik JainandNiccolò Franzin 16e8e24da1 Fix: Language servers were not notified of external file system changes,
causing some symbolic operations (such as `find_referencing_symbols`) to report stale information.
An explicit file system synchronisation mechanism is now used to detect changes prior to the
affected tool executions.

Note that tools like `find_symbol` and `get_symbols_overview` do not need the synchronisation,
because they explicitly open all the relevant files themselves.

Resolves #1718

Co-authored-by: Niccolò Franzin <niccolo@cognitivext.com>
2026-07-21 01:18:08 +02:00
Vasil Boychev f631a4bceb PHP: expose file_filter via ls_specific_settings (#1710) (#1711)
- PHP/Intelephense: expose `file_filter` via `ls_specific_settings["php"]`, so that additional
  extensions containing PHP sources (e.g. Drupal's `.module` / `.install` / `.inc` / `.theme`)
  become visible to the symbol tools and are indexed by the language server
- PHP: treat `.phtml` files as PHP sources by default (all PHP language servers)
2026-07-20 11:47:29 +02:00
Dominik Jain 5c85d961a0 LanguageServerDependencyProviderUvx: Use 'uv tool run' instead of 'uv x' (more widely supported)
Resolves #1721
2026-07-19 21:49:13 +02:00
Dominik Jain f5824231be Fix: Properly differentiate between raw and high-level symbol cache fingerprints,
avoiding unnecessary invalidations of the raw cache when only the derived
high-level representation changes

Fixes #1722
2026-07-19 21:24:36 +02:00
Dominik Jain 4379b4e58a Increase robustness of SerenaAgent tests
* Do not unnecessarily call apply_ex instead of apply (timeout can occur)
* Increase tool timeout to 10 minutes (for slow CI cases)
* TestPromptProvision: Raise exceptions in apply_ex (such that outputs don't
  inadvertently check against exception messages)

Resolves #1695
2026-07-19 20:29:13 +02:00
Dr. Dominik Jain c4d7768078 Merge pull request #1530 from tphakala/fix/gopls-type-var-const-keyword-duplication
Fix gopls replace_symbol_body corrupting type/var/const declarations
2026-07-19 19:15:08 +02:00
Dominik Jain 4dc109281f Gopls: Adjust cache fingerprint to account for implementation changes
simplifying the fingerprint logic
2026-07-19 16:25:51 +02:00
Tomi P. Hakala 61cf7c7d38 Fix gopls replace_symbol_body corrupting type/var/const declarations
gopls reports the document-symbol range of single type/var/const
declarations starting at the identifier (after the keyword), unlike func
declarations whose range includes the func keyword. Serena derives both
the displayed body and the replacement range from that range, so the
keyword was dropped from both for these declarations and a
keyword-inclusive edit corrupted the file (type Foo became type type Foo).

Override request_document_symbols in gopls to extend the range start back
to the keyword when only the keyword and indentation precede the
identifier, recomputing the body so it stays consistent with the
replacement range. Funcs, grouped declarations, and selectionRange are
left untouched.

Adds a unit test for the symbol body and range plus an end-to-end
replace_symbol_body round-trip regression test.
2026-07-19 16:12:32 +02:00
18d4cc007b Java (JDT-LS): allow registering additional JRE/JDK runtimes via config (#1715)
* Java (JDT-LS): allow registering additional JRE/JDK runtimes via config

JDT-LS resolves each imported module's JRE_CONTAINER/.../JavaSE-NN/
classpath entry against its own "Installed JREs" list, which Serena
previously hardcoded to a single JavaSE-21 entry pointing at the
bundled JRE. Projects whose source/target level exceeds that bundled
JDK (e.g. sourceCompatibility = VERSION_25) get a container that never
resolves, so every JDK type -- java.lang.Object, java.util.*, etc. --
comes back "cannot be resolved", silently breaking diagnostics and
cross-module resolution. There was no config key to tell JDT-LS about
an installed newer JDK.

Add an optional `runtimes` list under ls_specific_settings.java,
mirroring VS Code's java.configuration.runtimes shape (name, path,
optional default/sources/javadoc). Entries are validated (name+path
required, path must exist) via the new _resolve_configured_runtimes(),
then merged with the bundled JavaSE-21 default: configured runtimes
extend the list; an entry reusing the "JavaSE-21" name overrides the
bundled one; if a configured entry claims `default`, the bundled
runtime's own default flag is cleared so JDT-LS doesn't see two
defaults. The `runtimes` key is also added to the JDTLS workspace-hash
inputs so changing it lands in a fresh workspace instead of reusing a
stale Buildship/Maven import.

Testing: added 14 unit tests in
test/solidlsp/java/test_jdtls_path_resolution.py covering
_resolve_configured_runtimes validation (missing keys, wrong types,
nonexistent paths) and the merge behavior in
_create_base_initialize_params (extension, name-collision override,
default hand-off). Ran `poe format`, `poe type-check`, and
`pytest test/solidlsp/java -m "not java"` (69 passed, 8 deselected
real-JDTLS tests that require a JDK) locally.

Fixes #1478

* docs: document java.runtimes in configuration guide

Address review feedback on #1715 by documenting ls_specific_settings.java.runtimes
in 050_configuration.md (settings table, note, and example).

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: arimu1 <19286898+arimu1@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-19 16:03:25 +02:00
dev_Hakazeandarimu1 a9067050f2 Fix: dashboard "Last Execution" panel stuck on "Loading..." when no execution exists (#1714)
loadLastExecution()'s success handler only called displayLastExecution()
when the backend returned a non-null last_execution, so on a fresh server
(no tool run yet) the initial "Loading..." placeholder was never replaced.
displayLastExecution(null) already renders the correct empty state
("No executions yet.") — it just wasn't being called.

Add the missing else branch, mirroring how the Tool Usage and Executions
Queue panels already handle their empty states.

Fixes #1713

Co-authored-by: arimu1 <19286898+arimu1@users.noreply.github.com>
2026-07-19 14:00:33 +02:00
Dominik Jain 96e95c0b5d Adjust Docker compose template (compose.yaml): Expose ports to host only 2026-07-18 13:01:13 +02:00
Dominik Jain d88ebafee7 Add news on trusted projects 2026-07-18 11:17:49 +02:00
bymebyu 7c34662996 search_for_pattern: add a snippet stage to the overflow shortening chain (#1667)
This adds an intermediate stage returning line numbers plus the matched text truncated to 60 characters.

Test contributed by @AmirF194 in review.
2026-07-17 17:45:09 +02:00
Dominik Jain 369e3a05a0 Remove obsolete Python 2 compatibility code 2026-07-17 17:29:33 +02:00
Dr. Dominik Jain 1e8e45fa93 Merge pull request #1701 from AmirF194/fix/1498-clamp-symbol-body-range
fix(ls): clamp out-of-bounds symbol ranges before constructing SymbolBody
2026-07-17 17:28:22 +02:00
Dominik Jain 0f5111c17a Replace InvalidTextLocationError with SolidLSPException subclass 2026-07-17 17:27:04 +02:00
Amir Fathi 3a67ea2086 fix(ls): correct SymbolBody.get_text for the one-line-past-EOF range
An LSP server can end a symbol range one line past EOF: the convention
for a range covering whole lines ends it at the start of the following,
non-existent line. SymbolBody.get_text indexes self._lines[end_line]
directly, so that well-defined case raised IndexError.

get_text now corrects exactly that case (end_line == len(lines), end_col=0) to end
at the actual last line, in get_text itself so it also applies to a
cached SymbolBody, not just a freshly constructed one. Any other
out-of-range end_line now raises InvalidTextLocationError.

Fixes #1498
2026-07-17 17:22:01 +02:00
Dr. Dominik Jain 2af877912b Merge pull request #1575 from zerone0x/fix/ignored-paths-yaml-hint-1561
fix: improve ignored_paths YAML guidance
2026-07-17 17:13:18 +02:00
zerone0xandClaude bd9c4c9e89 fix: improve ignored_paths YAML guidance
Fixes #1561

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-17 17:10:31 +02:00
Dr. Dominik Jain ea268a47ee Merge pull request #1703 from oraios/delete-symbol-clean-empty-lines
Add heuristic to remove superfluous empty lines after deleting a symbol
2026-07-17 17:00:43 +02:00
Dominik Jain d0aea5fd06 Update test snapshots following updates to symbol delete logic, improving base Python file
(which contained atypical comments)
2026-07-17 16:58:21 +02:00
Dominik Jain c379c30af4 Add heuristic to remove superfluous empty lines when deleting a symbol #1697 2026-07-17 16:58:21 +02:00
Dominik Jain 736e4f182d Add mcp version change to changelog 2026-07-17 15:51:14 +02:00
Dominik Jain 1940fc6d43 JetBrainsCodeEditor: Use FileProxy to support reading of external files
This adds support for external files to JetBrainsFindDeclarationTool

CodeEditor: Guard use of edited_file_context against use with ext. files
2026-07-17 14:27:47 +02:00
dependabot[bot] 04445da438 Bump mcp from 1.27.0 to 1.28.1 in the uv group across 1 directory
---
updated-dependencies:
- dependency-name: mcp
  dependency-version: 1.28.1
  dependency-type: direct:production
  dependency-group: uv
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-17 13:31:00 +02:00
Michael Panchenko ad2fdf1fa6 Merge pull request #1708 from ebarkhordar/fix/search-text-exclusive-end-line
fix(search): do not mark the following line as matched when a match ends at a line break
2026-07-17 10:27:28 +02:00
Ehsan Barkhordar 844535f623 fix(search): do not mark the following line as matched when a match ends at a line break
`search_text` mapped the match's exclusive end index to a line number via
`get_line_from_index`, which resolves an index at a line start to the following
line. A match ending with a newline was therefore attributed one line too many,
and `context_lines_after` was shifted by the same amount.
2026-07-17 07:27:22 +00:00
Dominik Jain c7ee15c016 Fix f-string 2026-07-17 06:05:50 +02:00