Commit Graph
3148 Commits
Author SHA1 Message Date
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
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
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
Dr. Dominik Jain ceac7c0c67 Merge pull request #1702 from oraios/jb-read-ext-file
JetBrains: External file processing
2026-07-17 05:16:22 +02:00
Dominik Jain 956c0333e2 Merge remote-tracking branch 'origin/main' into jb-read-ext-file
Conflicts:
	CHANGELOG.md
2026-07-17 05:14:36 +02:00
Ehsan e8a550763b fix: normalize line endings in read_file's charset_normalizer fallback (#1706)
FileUtils.read_file has two return paths with different newline semantics.
The primary path, open(file_path, encoding=encoding).read(), uses the default
newline=None and therefore applies universal newlines, so CR never reaches
callers. The charset_normalizer fallback decodes the raw bytes instead
(match.raw.decode(match.encoding)), which performs no newline translation, so
any file that fails to decode with the project's configured encoding re-enters
Serena carrying its CR characters.

Normalize to LF at the fallback's return, matching the primary path.
2026-07-17 05:11:26 +02:00
Dominik Jain f3754c922d Improve documentation of line ending handling 2026-07-17 05:03:52 +02:00
Dominik Jain f3cf5d3f8d JetBrains: Allow external files from dependencies (e.g. "<ext:FileUtil.class|472e0a13>") to be
- read via `ReadFileTool`
  - searched via `SearchForPatternTool`
when using plugin version 2023.3.3+ (yet unreleased)

This is enabled via JetBrainsFileProxy (which reads the file through the IDE)
2026-07-16 17:04:58 +02:00
Dominik Jain f1486f7d60 Add JetBrainsPluginClient.read_file 2026-07-16 15:30:37 +02:00
Dominik Jain 063f872a01 Remove unused type ignore 2026-07-16 15:30:17 +02:00
Dr. Dominik Jain 1820240e97 Merge pull request #1700 from oraios/prepare-release-1.6.0
Prepare release 1.6.0
2026-07-16 13:59:05 +02:00
Dominik Jain bfcab428d2 Set version to v1.6.1.dev0 2026-07-16 11:03:05 +02:00
Dominik Jain 93b9544ea9 Release v1.6.0 2026-07-16 11:03:04 +02:00
Dominik Jain 41859b5fe1 Add news item for v1.6.0 release 2026-07-16 11:02:58 +02:00
Michael Panchenko 465c5eb627 Merge pull request #1696 from xormania/fix/ci-job-timeout
CI: add timeout-minutes backstop to the pytest matrix job
2026-07-16 10:35:29 +02:00
Ehsan Barkhordar 08bc0615f5 fix(tools): make read_file report the line numbers the editing tools use
read_file determined line indices via Python's splitlines, which breaks on
\f, \v, \x1c-\x1e, \x85, U+2028 and U+2029 in addition to the LSP-compliant
line breaks counted by delete_lines/replace_lines. In a file containing any
of those characters the indices reported by read_file referred to different
physical lines than the editing tools operate on, so an edit made after the
required read_file could silently hit the wrong line.

Use TextUtils.split_lines, as already applied to search_text and
MatchedConsecutiveLines.from_file_contents. Files whose line breaks are all
LSP-compliant are decomposed exactly as before.
2026-07-16 01:31:07 +02:00
AmirF194 cb38f6f82a fix(editing): delete last line of a file without a trailing newline
delete_lines/replace_lines address the position one line past the last line
(line == number of lines, col 0). get_index_from_line_col cannot resolve that
position when the file has no trailing newline (no closing newline to count),
so delete_text_between_positions raised InvalidTextLocationError and the delete
crashed on a very common file shape.

Clamp that past-EOF end position to end-of-file in delete_text_between_positions,
mirroring the guard insert_text_at_position already has. A file with no trailing
newline now deletes its last line identically to one with a trailing newline.

Adds TextUtils unit tests and a CHANGELOG entry.
2026-07-15 20:22:25 +02:00