Commit Graph
3056 Commits
Author SHA1 Message Date
xormania 9580a6aec7 Svelte + TypeScript: fail loudly on companion TS timeouts; deterministic test fixture
Make the Svelte companion TypeScript server raise on readiness and
indexing timeouts instead of silently proceeding with a partial index,
turning flaky/wrong cross-file results into clear failures:

- TypeScriptLanguageServer: timeout handling factored into overridable
  hooks (_handle_server_ready_timeout, _handle_project_indexing_timeout);
  the base server keeps its historical permissive behavior, so plain
  TypeScript setups are unchanged.
- SvelteTypeScriptServer: both overrides raise TimeoutError; only the
  indexing-timeout error includes describe_indexing_state(), instead of
  serving requests from a cold or partially indexed program.
- Configurable server_ready_timeout / indexing_timeout via
  ls_specific_settings.
- SvelteLanguageServer: file-open failures during companion preparation
  raise SvelteCompanionPreparationError with a count-first file listing
  (capped at 10), chained to the first underlying error so the cause is
  visible without DEBUG logging.

Apply the same fail-loudly principle to the test fixture bootstrap:

- Svelte test repo: npm ci with a committed package-lock.json, removing
  dependency-resolution non-determinism from CI runs.
- Run svelte-kit sync explicitly during fixture setup and fail loudly if
  .svelte-kit/tsconfig.json cannot be generated. The fixture's "prepare"
  script masks sync failures ("svelte-kit sync || echo ''"), and a known
  npm bug (npm/cli#4828) can silently skip platform-specific optional
  dependencies; the result is unresolvable $lib path aliases and
  cross-file tests failing with partial results instead of a clear,
  actionable error.
- codespell: skip third-party fixture repositories, using the anchored
  pattern ./test/resources/repos (codespell matches skip globs against
  the ./-prefixed paths it walks, so an anchor-less pattern never
  matches).

Also add direct regression tests for the timeout-policy split
(test/solidlsp/test_typescript_timeout_policy.py: base stays
permissive, companion raises, settings plumbing and precedence, and
start-or-completion indexing-wait semantics). The tests use no mocking or
patching of any kind; a hand-written call-recording fake drives the companion
guard against real file discovery under a pytest tmp_path. They spawn no LS
process and avoid external readiness races; one wait test uses a real Timer
with a 30s ceiling.

The configuration docs state that the TypeScript table lists both knobs; the
Svelte table lists indexing_timeout, with readiness inheritance documented in
prose.
2026-07-11 18:06:17 -04:00
Dr. Dominik Jain e08e964d0c Merge pull request #1660 from AmirF194/fix/jdtls-ignored-dirname-hides-packages
Java (eclipse_jdtls): don't hard-ignore packages named dist/lib/classes/out (#1645)
2026-07-07 12:29:28 +02:00
AmirF194 e08dfc7133 Java (eclipse_jdtls): don't hard-ignore packages named dist/lib/classes/out (#1645)
EclipseJDTLS.is_ignored_dirname hard-ignored directories named target/build/bin/out/classes/dist/lib. Several of these (dist, lib, classes, out) are valid Java package identifiers, so any source file whose package path contained one was dropped from directory traversal and became invisible to the symbol tools (find_symbol, get_symbols_overview, find_referencing_symbols) even when git check-ignore reported nothing.

Per maintainer guidance in #1645, remove the override entirely: the base is_ignored_dirname already skips _ALWAYS_IGNORED_DIRS (VCS/venv/cache/IDE internals), and real build output is already excluded via .gitignore, so the hardcoded list was both redundant and harmful.

Adds a regression test (no Java/JDTLS process required) that fails on main and asserts the formerly-hardcoded names are no longer ignored while _ALWAYS_IGNORED_DIRS still are.
2026-07-06 15:32:51 -06:00
Dr. Dominik Jain f6b6efa65b Merge pull request #1652 from xormania/fix/hlsl-cargo-install-locked
HLSL: build shader_language_server with cargo --locked to fix macOS CI
2026-07-06 12:29:27 +02:00
Dr. Dominik Jain 21eec22fb6 Merge pull request #1658 from osmanrafiq/fix/1657-gradle-java-home
Fix Java Gradle import JAVA_HOME fallback (#1657)
2026-07-06 12:28:14 +02:00
osmanrafiq 9ccd5f02a2 Fix Java Gradle import JAVA_HOME fallback (#1657) 2026-07-06 00:14:28 +02:00
xormania de370b4d00 HLSL: build shader_language_server with cargo --locked to fix macOS CI
Without --locked, cargo install freshly resolves shader-sense ^1.3.1,
which since 2026-07-04 picks shader-sense 1.4.0. That release removed
the public field GlslCompilationParams.preamble (split into
preamble_path/preamble_content), which shader_language_server 1.3.1's
server_config.rs still constructs, so the from-source build fails with
E0560 and cargo exits 101. macOS is the only platform that builds the
server from source (Linux/Windows download prebuilt release binaries),
so only the macOS CI jobs fail: all 15 test/solidlsp/hlsl fixtures
error at setup (run 28726267725, job 85184119276).

--locked makes cargo honor the Cargo.lock packaged with the published
crate, which pins shader-sense 1.3.1 - the dependency set the 1.3.1
release was built and tested from - and immunizes the build against
future lockstep releases of the two crates. Verified locally: the
unlocked build reproduces the exact E0560/exit-101 failure; the locked
build compiles cleanly and yields a working binary reporting v1.3.1.

Also adds --locked to the manual-install help text, matching the
existing convention in taplo_server.py.
2026-07-05 02:22:43 -04:00
Dr. Dominik Jain 6171c484d6 Merge pull request #1644 from oraios/ts-subclass-init-params
F'up InitializeParams: Update remaining LS, force impl via @abstractmethod
2026-07-03 15:42:46 +02:00
Dominik Jain a7b638528b Cache FilenameMatcher instances, effectively turning them into per-language singletons 2026-07-03 15:25:11 +02:00
Dominik Jain 6d39822363 Make _create_base_initialize_params fully abstract, forcing subclasses to implement it 2026-07-03 15:14:20 +02:00
Dominik JainandClaude Opus 4.8 cb7ba3f905 SolidLSP: Apply InitializeParamsBuilder to Angular/Svelte/Vue main servers
The AngularLanguageServer, SvelteLanguageServer and VueLanguageServer
classes (the primary ngserver/svelte-language-server/vue-language-server
processes, all direct SolidLanguageServer subclasses) still hand-rolled
their initialize params via _get_initialize_params, bypassing the builder.
Only their companion *TypeScript* server classes (AngularTypeScriptServer,
etc.) had been migrated previously.

Convert the three main classes to _create_base_initialize_params so their
processId/rootPath/rootUri/clientInfo/workspaceFolders are now supplied
centrally by the InitializeParamsBuilder, consistent with every other
language server. Server-specific initializationOptions (ngProbeLocations,
svelte plugin configuration, Vue hybridMode) are preserved.

Also update the Angular companion-cleanup test to monkeypatch the renamed
_create_base_initialize_params (it patched the now-removed
_get_initialize_params).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 15:01:16 +02:00
Dominik Jain fd91dd10f6 Clean up language server settings classes, improving docstrings 2026-07-03 14:20:08 +02:00
Dominik Jain 352b3d3fed Allow to overrride entries of initializationOptions via LS-specific settings 2026-07-03 12:49:56 +02:00
Dominik Jain f00d3cfa19 Add docstrings 2026-07-03 12:40:26 +02:00
Dominik Jain 9157e25671 Improve docs 2026-07-03 12:25:18 +02:00
Dr. Dominik Jain f54ffaa8ab Merge pull request #1631 from oraios/ls-init-options
Centralise creation of LSP InitializeParams, adding support for configurable workspace folders across all LS
2026-07-03 11:42:05 +02:00
Dominik Jain 81b664bb32 Merge branch 'main' into ls-init-options
Conflicts:
	src/solidlsp/language_servers/typescript_language_server.py
2026-07-03 11:41:18 +02:00
bymebyu 81b1bc804d TypeScript/VTS: event-based indexing wait and no automatic typing acquisition (#1639)
* TypeScript/VTS: event-based indexing wait, no automatic typing acquisition

- Set disableAutomaticTypingAcquisition in initializationOptions (TS and VTS)
  so tsserver does not download type packages from the network during
  language server initialization.
- Replace the fixed 2-second wait before cross-file reference requests with
  $/progress-based indexing tracking: a pre-open hook arms the tracking
  (expect_indexing) before didOpen, then the request waits until indexing
  progress drains (wait_for_indexing), bounded by a configurable
  'indexing_timeout' (ls_specific_settings, default 30s). If tsserver does
  not start reporting progress within a 2-second grace period (the previous
  fixed wait), the request proceeds — so the fast path is never slower than
  before, while slow indexing is actually awaited instead of guessed at.
2026-07-03 11:38:53 +02:00
Dominik JainandClaude Opus 4.8 05181b62e5 Docs: Update add-language guide for _create_base_initialize_params pattern
Document the new LSP initialization pattern in the "adding new language
support" memory: override _create_base_initialize_params (server-specific
keys only), let the InitializeParamsBuilder supply the common keys, and call
_create_initialize_params() in _start_server. Includes notes on
builder-resolved workspace folders, nested initializationOptions folder
lists, and opting out via set_workspace_folders=False.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 01:05:40 +02:00
Dominik JainandClaude Opus 4.8 1c12156901 SolidLSP: Apply InitializeParamsBuilder across all remaining language servers
Convert every remaining SolidLanguageServer subclass from the old
_get_initialize_params method to the new _create_base_initialize_params
override, so common LSP initialize keys (processId, rootPath, rootUri,
clientInfo, workspaceFolders) are provided centrally by the
InitializeParamsBuilder rather than by each server.

- Drop the per-server processId/rootPath/rootUri/workspaceFolders and all
  clientInfo entries (including the VS Code spoofs in rust_analyzer and
  sourcekit); these are now set centrally.
- Preserve nested capabilities.workspace.workspaceFolders flags and any
  server-specific initializationOptions.workspaceFolders (e.g. kotlin,
  eclipse_jdtls).
- omnisharp keeps loading its JSON template but no longer sets the
  centrally-managed keys.
- Update _start_server call sites to self._create_initialize_params() and
  drop now-unnecessary cast()/type: ignore wrappers.

angular, svelte and vue are intentionally left as-is: they already override
_create_base_initialize_params for their TypeScript companion server, and
their remaining _get_initialize_params drives a separate language server
process.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 01:05:40 +02:00
Dominik Jain c904efed5e SolidLSP: Allow workspace folders to be flexibly configured across all language servers
that use the newly introduced InitializeParamsBuilder

- Add new configuration option `ls_workspace_folders` to allow indexed source folders to be specified
  explicitly. In monorepos, this allows the set of indexed folders to be restricted to a subset of
  the repository. #1627
- Rename configuration option `additional_workspace_folders` to `ls_additional_workspace_folders`
  and support the option across all language servers that use an InitializeParamsBuilder
  (previously limited strictly to the TypeScript server).
  Moved the option from SolidLSPSettings to LanguageServerConfig, where it belongs.

Apply InitializeParamsBuilder in TypeScriptLanguageServer and its subclasses.
2026-07-03 01:05:40 +02:00
Dominik Jain 6f1f05407d Introduce InitializeParamsBuilder base class and default implementation
which sets common settings centrally:
- processId
- rootPath
- rootUri
- clientInfo
- workspaceFolders

Apply builder in SolidLanguageServer, adding new abstract method
_create_base_initialize_params to be implemented by subclasses.
Applied in PyrightServer.
2026-07-02 23:51:39 +02:00
Dr. Dominik Jain 4f4b862802 Merge pull request #1636 from oraios/refactor-ls-dependency-providers 2026-07-02 22:41:29 +02:00
bymebyu a7501b1c69 Fix: language composition percentages diluted by unrecognised files
determine_programming_language_composition computed percentages over the total
file count, so files belonging to no supported language (images, plain text,
licenses, lock files) diluted the numbers — a repository with 2 Python files
and 23 assets reported Python at 8%. Percentages are now relative to files
matching at least one supported language, and the counting runs in a single
pass over the file list instead of one pass per language.

The only consumer (ProjectConfig.autogenerate) sorts languages by percentage,
which is unaffected by the uniform rescaling.
2026-07-02 22:24:32 +02:00
Dominik Jain 8c418dc799 Support ls_base_cmd in LanguageServerDependencyProviderBaseCommand
ls_base_cmd allows the user to override the base command with a
multi-element command (e.g. ["npx", "-y", "/my/local/package"]),
generalising ls_path, which it takes precedence over.
2026-07-02 21:59:46 +02:00
Dominik Jain 60abdd5297 Support ls_args and ls_extra_args centrally in LanguageServerDependencyProviderBaseCommand
* ls_args overrides the internal command builder, fully defining the arguments
* ls_extra_args appends additional arguments to the launch command
2026-07-02 21:59:46 +02:00
Dominik Jain e93bbeedad solidlsp: Introduce LanguageServerDependencyProviderBaseCommand
Generalises launch command creation from a base command which
the user can override via custom settings.
SinglePath and Uvx dependency providers are now specialisations of it;
the uvx command construction was moved from common.py into the Uvx provider.

The language support guide memory is updated accordingly.
2026-07-02 21:59:38 +02:00
Dominik Jain 3c241bab0d Update project file 2026-07-02 14:16:41 +02:00
Dominik Jain 7d0481b8a4 Add poe ty as alias for type-check 2026-07-02 10:54:53 +02:00
weicongheandClaude b8a0882d29 fix(file_system): handle PermissionError on scandir in gitignore walker (#1634)
Wrap os.scandir() with PermissionError guard in _iter_gitignore_files'
scan() function to prevent crash when a subdirectory is not readable.

Previously, PermissionError on the scandir call itself crashed the
entire gitignore walker, even when the path was listed in ignored_paths.

Fixes oraios/serena#1624

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-02 10:53:22 +02:00
Jordan CarneyandDominik Jain dcbd8ce064 Add activation_command to project config (#1623)
Add activation_command to project config

Adds two optional fields to ProjectConfig:
- activation_command: shell command run in the project root before the
  language backend (LSP or JetBrains) initialises
- activation_command_timeout: safety backstop (default 180s); on expiry
  the process tree is killed and activation continues

The command is only executed for trusted projects (trusted_project_path_patterns).
Exit code is the primary completion signal; failures and timeouts are logged
but never abort activation (no return channel to the LLM at that point).

Closes #1606

---------

Co-authored-by: Dominik Jain <dominik.jain@oraios-ai.de>
2026-07-01 18:12:05 +02:00
Dr. Dominik Jain 684f457f0d Merge pull request #1630 from oraios/file-proxy 2026-07-01 18:01:57 +02:00
Dominik Jain d5d88d72eb Improve handling of glob support in FileProxy, fixing tests 2026-07-01 17:00:00 +02:00
Dominik Jain 3096ac4fe2 Fix in Project._is_ignored_relative_path: Filtering of files for source files ignored the language backend
The check is really only possible for LSP,
so the flag is now ignored for JetBrains (where there is no known list of languages).
2026-07-01 14:57:52 +02:00
Dominik Jain 423c04101d Make Project aware of the language backend (as it can affect its behaviour) 2026-07-01 14:57:52 +02:00
Dominik Jain f39906728d search_text: Remove obsolete option allow_multiline_match
The obsolete option was only used in tests, where adjusting the `multiline` parameter
restored the tested functionality.
2026-07-01 14:57:52 +02:00
Dominik Jain 6e518b5f7c Refactor search in files/iterative file processing
* Introduce abstractions: FileCollection, FileProxy
* Unify handling of pattern search in project files
  (source code vs. all files)

This prepares for processing of external files,
which can implement FileProxy differently.
2026-07-01 14:32:37 +02:00
Dominik Jain 103a17072e Update change log 2026-06-29 17:25:06 +02:00
Dr. Dominik Jain d1a25ddbc1 Merge pull request #1621 from oraios/ade-updates
ADE updates
2026-06-29 16:31:27 +02:00
Dominik Jain 673f657dcc Apply formatter, fix spelling 2026-06-29 16:19:41 +02:00
Michael PanchenkoandClaude Opus 4.8 3d9b953ac6 Add mode benchmark
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 16:04:44 +02:00
Dominik Jain 3a7757a390 Merge commit 'ee3e7506428d08c8786a90306a8bc5cf1734182f'
Conflicts:
  CHANGELOG.md
2026-06-29 16:00:17 +02:00
Dominik Jain 99ad6eaaee Fix JetBrainsPluginClient._make_request incorrectly passing None as data
Fixes #1615
2026-06-29 15:56:21 +02:00
ee3e750642 Update Serena system prompt
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Dominik Jain <dominik.jain@outlook.com>
2026-06-29 15:48:38 +02:00
6b0a5ec097 Update editing mode prompt
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Dominik Jain <dominik.jain@outlook.com>
2026-06-29 15:48:38 +02:00
Dominik Jain d589d09d85 Improve interactive mode prompt 2026-06-29 15:48:38 +02:00
Michael PanchenkoandClaude Opus 4.8 634460d32d Add agent instructions on tool descriptions and memories
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 15:48:38 +02:00
Michael Panchenko 310a01c1ac Bugfix: list_memories was not recursing into symlinked dirs. 2026-06-29 15:48:38 +02:00
Michael PanchenkoandClaude Opus 4.8 b174a2cf72 util/yaml: make save_yaml atomic (temp + os.replace, Windows retry)
A plain truncate-and-write (open(path,"w")) is not atomic: a concurrent writer
(a second Serena process updating the auto-managed registered-projects list) or an
interrupted write can leave the file half-overwritten -- a shorter value over a longer
one leaves a stale tail, corrupting the YAML so every later load fails. This is what
wedged native benchmark runs (serena MCP crashed at startup with a ruamel ScannerError
-> 0 tools registered -> agent silently degraded to Bash).

Write to a temp file in the same dir, then os.replace onto the target (atomic;
last-writer-wins, never a corrupt interleave). Retry os.replace on Windows
PermissionError (WinError 5/32 sharing violation under contention). Adds
test/serena/util/test_yaml.py covering the shorter-over-longer corruption signature
plus a concurrent-writers stress.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 15:48:38 +02:00
Michael Panchenko 75410c78e7 Use depth=-1 to enable lang-specific default for overview tools 2026-06-29 15:48:38 +02:00