Commit Graph
2818 Commits
Author SHA1 Message Date
Dominik Jain b28f705fee Exclude new LSP tools in JetBrains mode 2026-05-05 17:59:43 +02:00
Michael Panchenko 626e370a89 Merge pull request #1447 from oraios/hook_extension
Hook extension
2026-05-05 17:35:39 +02:00
Michael Panchenko 9f4e29c8b0 Changelog, readme, project.yml - minor changes 2026-05-05 17:31:15 +02:00
Michael Panchenko 53d5e6e898 Merge branch 'main' into hook_extension
# Conflicts:
#	src/solidlsp/ls_config.py
2026-05-05 17:24:30 +02:00
a-simeshin ba6170bab1 feat(jdtls): surface Lombok-generated methods in document symbols, bump jdtls version (#1434)
* feat(jdtls): surface Lombok-generated methods in document symbols

JDTLS' DocumentSymbolHandler filtered out every SourceMethod where
JDTUtils.isGenerated() was true, so Lombok-synthesised methods (getX/setX,
builder(), equals/hashCode/toString, withX, fluent accessors, ...) never
reached the LSP client. As a result Serena's symbol-aware tools — find_symbol,
get_symbols_overview, replace_symbol_body, insert_before_symbol,
insert_after_symbol — could not see, address or edit any Lombok-generated
member; only search_for_pattern / replace_content (text-based) worked.

Upstream introduced an opt-in preference java.symbols.includeGeneratedCode
in eclipse-jdtls/eclipse.jdt.ls#3706 (merged 2026-02-24) and surfaced it
through redhat-developer/vscode-java#4335. First vscode-java release with
the new JDTLS build is v1.53.0 (2026-02-26). Serena was pinned to v1.42.0-561,
well before the fix existed.

Changes:
- New ls_specific_settings.java.lombok_show_generated setting (default true);
  forwarded to JDTLS as java.symbols.includeGeneratedCode in initialize
  params. Older servers ignore the unknown preference key silently.
- Bump bundled vscode-java DEFAULT 1.42.0-561 -> 1.54.0-923 (brings JRE
  21.0.10, Lombok 1.18.39 and Equinox launcher 1.7.100). INITIAL stays at
  1.42.0-561, so per the per-version install-dir convention from #1438 the
  new build lands in vscode-java-1.54.0-923/ while legacy vscode-java/
  caches and any explicit vscode_java_version: '1.42.0-561' override keep
  working.
- New VsixResourcePaths dataclass + INITIAL/DEFAULT_VSCODE_JAVA_PATHS pin
  the JRE / Lombok / launcher filenames *inside* the VSIX. Without this,
  bumping the archive would break users on legacy 1.42.0-561 because
  resource paths inside the archive change between releases. Resolution
  mirrors SHA pinning: known versions get their pinned paths; any other
  version raises SolidLSPException with a pointer to upstream-jdtls mode
  (which derives paths dynamically and needs no pinning).
- Drop dead 'static/vscode-java/...' placeholder in initialize params; the
  real runtimes[] is overwritten below from runtime_dependency_paths
  .jre_home_path, which is correct in both default-VSIX and upstream-jdtls
  modes.
- Test fixtures: Lombok provided dep in test_repo/pom.xml plus
  LombokModel / FluentLombokModel / DefaultGreeter covering @Data, @Builder
  (toBuilder=true), @With, @Delegate, @AllArgsConstructor, @NoArgsConstructor
  and @Accessors(fluent=true). Regression test in test_java_basic.py
  asserts every generated-method shape lands in document symbols.

Closes #1432
2026-05-05 15:06:04 +02:00
3122384822 feat: Add Angular, HTML, and SCSS / Sass language servers (#1439)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Pavlo Basanets <Pavlo_Basanets@epam.com>
2026-05-05 14:33:51 +02:00
Michael Panchenko e643e91cd7 Merge pull request #1418 from meirLixen/feature/cross-package-typescript-references
Add cross-package reference support via additional_workspace_folders
2026-05-04 20:17:03 +02:00
Michael Panchenko 4bd60f18d4 Tests: removed csharp tests relying on mocks 2026-05-04 19:39:58 +02:00
Michael Panchenko 6eb3587dcc Hooks: adjust output to work for codex, extended docs 2026-05-04 17:51:21 +02:00
Michael Panchenko 4b0865c33b Hooks: improve heuristics for code file detection 2026-05-04 17:51:21 +02:00
Michael Panchenko 8b858d1cab FilenameMatcher: fix in new method string_contains_relevant_filename 2026-05-04 17:48:51 +02:00
Andrew Newell ce3a67b42c fix: search subdirectories for mix.exs to prevent Expert deadlock in monorepos (#1444) 2026-05-04 16:40:38 +02:00
Michael Panchenko d2651bc1a6 Merge branch 'main' into hook_extension
# Conflicts:
#	CHANGELOG.md
2026-05-04 14:54:44 +02:00
Michael Panchenko 2c03fe3318 Docs, minor 2026-05-04 14:30:40 +02:00
Michael Panchenko 64e604630e Merge branch 'main' into feature/cross-package-typescript-references
# Conflicts:
#	CHANGELOG.md
#	src/solidlsp/ls.py
2026-05-04 14:26:20 +02:00
Michael Panchenko f0c1568e71 LS: improved handling of additional workspace folders
Previously, a field was set outside init and generally a bunch of related code was unnecessary and poorly named.
2026-05-04 14:22:21 +02:00
meir lixenbrg 862af5b42c Add documentation for additional_workspace_folders
- Add 'Additional Workspace Folders' section to project configuration docs
- Add cross-reference note to TypeScript LS settings section
- Include configuration example and usage notes
2026-05-04 14:22:20 +02:00
meir lixenbrgandClaude Opus 4.6 34575f9898 Add support for additional_workspace_folders, currently only for TS
The TypeScript language server was initialized with a single workspace folder,
so tsserver could not discover references across sibling packages in a monorepo.

This adds an `additional_workspace_folders` setting in
`ls_specific_settings` that accepts a list of directory paths.
Each folder is registered as an LSP workspace folder during initialization,
and a representative .ts file is opened from each to trigger tsserver project
loading. This enables `find_referencing_symbols` and `request_references` to
return results from across package boundaries.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-04 14:22:20 +02:00
Michael PanchenkoandClaude Opus 4.7 024d31ba22 fix(lsp): omit optional Content-Type header from outgoing messages (#1442)
Per the LSP spec, Content-Type is optional and defaults to
application/vscode-jsonrpc; charset=utf-8 (the exact value we were
sending). Spec-compliant servers behave identically with or without it.

In practice some servers have stricter parsers. Notably, Godot's
GDScript LSP (LSPeer::handle_data in
modules/gdscript/language_server/gdscript_language_protocol.cpp)
extracts the body length via header.substr(16).to_int() and silently
drops messages that contain any header beyond Content-Length.

Sending only Content-Length is interoperable across the spec-compliant
servers we use today and unblocks Godot's LSP. Also tightens the type
signature of create_message from tuple[bytes, bytes, bytes] to
tuple[bytes, bytes] now that there is no Content-Type element.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 11:43:04 +02:00
Sam CarsonandMichael Panchenko 16d1a30397 hooks: extend auto-approve to Claude Code's auto permission mode (#1445)
* hooks: extend auto-approve to Claude Code's auto permission mode

Closes #1386

---------

Co-authored-by: Michael Panchenko <35432522+MischaPanch@users.noreply.github.com>
2026-05-04 11:27:09 +02:00
Dr. Dominik Jain c5a27ed9ec Merge pull request #1438 from oraios/fix_downloaded_dependency_versioning
Fix downloaded dependency versioning
2026-05-02 20:56:45 +02:00
Dominik Jain 3a0afadf47 Improve project creation/config docs 2026-05-02 20:53:20 +02:00
Michael Panchenko 90c4e78e54 LS: fix unversioned runtime dependency paths, keeping backwards compatibility 2026-05-02 10:05:57 +02:00
kurushimeeandClaude Opus 4.7 7aeb7bc482 fix(lsp): omit optional Content-Type header from outgoing messages
Per the LSP spec, Content-Type is optional and defaults to
application/vscode-jsonrpc; charset=utf-8 (the exact value we were
sending). Spec-compliant servers behave identically with or without it.

In practice some servers have stricter parsers. Notably, Godot's
GDScript LSP (LSPeer::handle_data in
modules/gdscript/language_server/gdscript_language_protocol.cpp)
extracts the body length via header.substr(16).to_int() and silently
drops messages that contain any header beyond Content-Length.

Sending only Content-Length is interoperable across the spec-compliant
servers we use today and unblocks Godot's LSP. Also tightens the type
signature of create_message from tuple[bytes, bytes, bytes] to
tuple[bytes, bytes] now that there is no Content-Type element.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 20:53:05 +07:00
Dominik Jain 30ee9235fa Update TestSerenaAgent.test_find_declaration_error 2026-04-30 21:10:53 +02:00
Dr. Dominik Jain d9d49fae7d Merge pull request #1433 from oraios/features/diagnostics_and_ls_extensions
Features: diagnostics and LS extensions
2026-04-30 18:26:23 +02:00
Dominik Jain 90d6f2cde8 Merge remote-tracking branch 'origin/main' into features/diagnostics_and_ls_extensions
Conflicts:
	CHANGELOG.md
2026-04-30 18:25:22 +02:00
Dominik Jain 4f0c3f83e3 Update change log and README to consider new diagnostics/declaration/implementations tools 2026-04-30 15:31:27 +02:00
Dominik Jain 2e0167f818 Refactor LSP tools for symbol declaration retrieval
* Apply common functionality already used in JetBrainsFindDeclarationTool
* Remove location-based tool (counteracts Serena's principle to eschew line numbers)
* Apply renaming to use "find declaration" instead of "find defining symbol"
2026-04-30 15:31:27 +02:00
Dominik Jain 371d70f87e Refactoring: Introduce abstraction GroupedDiagnostics, removing duplication 2026-04-30 15:31:27 +02:00
Dominik Jain 5ab912ca0b CodeEditor: Remove unused management of edited files
Management was unnecessarily introduced by AI in 133e1be2a780ee875a9b7d739e076b85d81b29fd
2026-04-30 15:31:27 +02:00
Dominik Jain 061020ce22 Refactor EditingToolWithDiagnostics
* Add context manager to simplify usage, improving output handling
* Add util module ls_diagnostics, reifying DiagnosticsDiff
2026-04-30 15:31:27 +02:00
Michael Panchenko 66d223c9e1 Hooks: read hook only fires on read of code files
Using heuristics to determine whether it's a read of a code file based on the command
2026-04-30 13:31:48 +02:00
Michael Panchenko 7df64bcee0 Extended Language to distinguish between programming and non-programming languages 2026-04-30 13:22:05 +02:00
Michael Panchenko d7852341f7 Refactoring: Make FilenameMatcher accept file extensions instead of patterns
Makes the matching both simpler and faster
2026-04-30 13:20:40 +02:00
octo-patchandOctopus 84e117c5c2 fix(hooks): detect grep/read shell commands in Codex exec_command (fixes #1394)
When the Codex client sends shell work via `exec_command`, the tool name is
always `exec_command` and the actual command is under `tool_input.cmd`.  The
previous `is_grep_tool` / `is_read_file_tool` checks inspected only the tool
name and therefore never fired for Codex grep/read workflows.

Add `_GREP_SHELL_COMMANDS` and `_READ_SHELL_COMMANDS` frozensets and a helper
`_get_exec_command_name()` that extracts the basename of the first token in
`cmd`.  Both detection methods now use these to classify `exec_command` calls
when the client is `HookClient.CODEX`, leaving all other client paths unchanged.

Co-Authored-By: Octopus <liyuan851277048@icloud.com>
2026-04-30 11:54:25 +02:00
Dominik Jain 15858e6cd9 Refactoring: Introduce base class EditingToolWithDiagnostics 2026-04-29 23:52:26 +02:00
Michael Panchenko da59a19c50 Fixes in various LS and in tests to accommodate diagnostics edge behavior
Also minor fix in go test expectations of symbol name
2026-04-29 23:52:26 +02:00
Michael Panchenko bd7e64e85a Fixed diagnostics files uri handling, added low-level tests 2026-04-29 23:52:26 +02:00
Michael Panchenko d198d67a9f Added JetBrains diagnostics tools, WIP 2026-04-29 23:52:26 +02:00
Michael Panchenko 940bbb31de Restructured serena_agent tests, reifying the cases
Removed some cases (haxe, msl) during cherry pick due to conflicts. We don't need to cover these languages in this test
2026-04-29 23:52:26 +02:00
Michael Panchenko c55e0c900e Diagnostics, implementation and definition tools (WIP) 2026-04-29 23:52:26 +02:00
Dr. Dominik Jain 4ce53eca11 Merge pull request #1437 from oraios/feature/added-modes
Revamp mode configuration
2026-04-29 19:14:23 +02:00
Dominik Jain dc491db2d4 Improve comment on web_dashboard_open_on_launch 2026-04-29 19:12:34 +02:00
Dominik Jain 4991b025a5 Update project.yml 2026-04-29 18:10:52 +02:00
Dominik Jain b9996cd663 Update language list (based on scripts/print_language_list.py) 2026-04-29 18:05:38 +02:00
Dominik Jain 1184a9b5bd Remove outdated list of tools, add link to tool list instead 2026-04-29 18:05:38 +02:00
Dominik Jain dfe1c3d7d1 Revamp mode selection
* Breaking change: Projects (project.yml) can no longer override `base_modes`.
   Instead, they can define `added_modes` to add modes on top of base and default modes.
   This allows `base_modes` to be fully applied for the computation of the base toolset
   as they are no longer dynamic.
 * Serena's default configuration now uses `interactive` and `editing` as `base_modes`
   instead of as `default_modes`.
2026-04-29 18:05:38 +02:00
Robin Jehn 37c837ffd3 Send languageId 'typescriptreact' / 'javascriptreact' for .tsx / .jsx files (#1436)
* Fix: send languageId 'typescriptreact' / 'javascriptreact' for .tsx / .jsx

Without this, .tsx files are opened with languageId 'typescript', so
tsserver parses JSX as syntax errors and recovers by truncating the
enclosing symbol's range at the first multi-line JSX expression. The
resulting symptoms:

- find_symbol(name, include_body=True) on a React component returns a
  body that ends mid-component, hiding everything below.
- The same component shows up as multiple Method-kind symbols (one per
  call site) plus a separately-tracked Constant for the definition,
  because tsserver mistakes JSX-tag tokens for member access.

Reproducer (before fix, real-world TSX file):
  SidebarPDF range = [11:1-25:207]   (truncated at first JSX, line 25)
After fix:
  SidebarPDF range = [11:1-281:2]    (full body)

The base SolidLanguageServer._get_language_id_for_file is explicitly
designed for this — its docstring says "Override in subclasses to
return file-specific language IDs." This change just exercises that
hook for the React file extensions.

Adds a regression test + jsx_component.tsx fixture covering the same
arrow-function-with-multi-line-JSX-ternary pattern that triggers the
truncation in real codebases (see oraios/serena#1029 for an earlier
report whose root cause was not identified).
2026-04-29 18:03:41 +02:00
Dominik Jain 28c2866bf4 SolidLanguageServer: Improve docstrings [skip ci] 2026-04-29 16:31:25 +02:00