Perl::LanguageServer only indexes files whose extension is in its
`perl.fileFilter` and skips directories in `perl.ignoreDirs`. Both were
hardcoded in PerlLanguageServer, so projects whose Perl source uses
non-standard extensions (e.g. .cgi / .psgi web handlers, which can
dominate a mature codebase) had no way to make those files visible to
symbol/reference queries without forking Serena (#1449).
Surface both lists through `ls_specific_settings["perl"]` (keys
`file_filter` and `ignore_dirs`), defaulting to the existing values so
behaviour is unchanged for current projects. The resolution lives in a
pure static method `_resolve_filter_settings` so the config plumbing is
covered by unit tests that don't require a Perl runtime.
Keep Serena's symbol index in sync with the LS (#1449, per review):
`find_symbol` and symbol indexing are driven by
`Language.PERL.get_source_fn_matcher()`, so adding an extension (e.g.
.cgi) to `file_filter` alone would leave the matcher untouched and the
extension's symbols invisible. Since that matcher is now a @cache'd
per-language singleton, add a `FilenameMatcher.add_extensions()` mutator
and call it from `PerlLanguageServer` so the configured extensions also
reach the symbol index, the ignore checks, and language composition.
Avoid cross-project leakage (per review): because the matcher is a
process-wide singleton, extensions added for one project would otherwise
persist into the next. `FilenameMatcher` now snapshots its initial
configuration and exposes `reset()`, and `SolidLanguageServer.__init__`
resets the matcher right after `self.language` is determined, so every
activation starts from the language's defaults before the subclass
re-applies its own `file_filter`.
This complements 860c5841 (which added .t to the default list as a
surface-level fix) by addressing the root configurability gap that the
maintainer acknowledged in #1449.
Hanging was never reproduced, this is preemptive hardening
- Add a 120s timeout to the server_ready wait (previously waited with no
timeout, so a server that crashed or never sent experimental/serverStatus
with quiescent=true would hang startup forever). On timeout we log a
warning and proceed, matching kotlin/matlab/powershell/etc.
- Harden the language/status and experimental/serverStatus notification
handlers to use dict.get() instead of raising KeyError on unexpected
payloads (a KeyError in the quiescent handler could itself prevent
server_ready from ever being set, feeding the hang).
- Relax the over-strict completionProvider capability check: an exact-dict
equality assertion crashed initialization whenever rust-analyzer changed
or added a completionProvider field. These values are not used downstream,
so a mismatch is now logged as a warning instead of asserted.
Language servers can report locations of generated files that are not on
disk. JDTLS does this for Lombok-generated types, reporting e.g.
target/classes/test_repo/LombokModel$LombokModelBuilder.class while
indexing; is_ignored_path then raised FileNotFoundError, turning an
intermittent indexing state into a hard test failure
(test_bare_symbol_names[java]; Tests run #4240, job jvm (macos-latest)).
Changes:
- is_ignored_path classifies missing paths with the usual lexical rules
instead of raising: ignored-dirname components, the unsupported-extension
rule, then the configured pathspec. A missing path is treated as a file
if its name has a suffix and as a directory otherwise (so the leaf of a
missing suffixless path is also checked against ignored dirnames).
Behavior for existing paths is unchanged: the checks were reordered
(ignored-dirname before unsupported-extension), but each check is pure,
so the outcomes are identical.
- SymbolLocationRequest.convert_location_item skips locations whose
absolute path does not exist (log + return None), so phantom build
artifacts never reach consumers regardless of ignore configuration.
- New unit tests (test double, no language server process; they run in
the catch-all CI batch) pin the missing-path classification — including
the exact Lombok .class path shape from the CI failure — and the
skipping of symbol locations that are not on disk.
Notes:
- The removed raise arrived verbatim with the multilspy import (2f607ff2)
and was never a deliberate guard.
- The Project layer's equivalent check already tolerates missing paths
(9c19d5f7), but returns False unconditionally. The LS layer instead
classifies lexically so that LS-reported build artifacts still classify
as ignored: with #1645 having removed the JDTLS build-dirname ignores,
it is the unsupported-extension rule that catches *.class paths.
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.
The Nomic solidity-language-server validates asynchronously: document
changes are debounced (~250ms), validation runs a forge/solc compile,
and completion is signalled with the custom notification
custom/validation-job-status -- emitted on every completion path
(success, validation failure, job errors; verified in the bundled 0.8.4
package, which publishes the document's diagnostics before the signal).
Serena ignored the signal ("Unhandled method
'custom/validation-job-status'") and waited a fixed 2.5s for a
non-empty publishDiagnostics, returning [] whenever validation finished
later. Warm environments fit the window; slow or cold ones (macOS and
Windows CI runners, which download solc 0.8.20 on every run -- the CI
cache only covers ~/.serena/language_servers/static, not
~/.local/share/svm) often do not. This is the root cause of the
empty-diagnostics failures of test_file_diagnostics[solidity]: xfailed
on macOS since its introduction (bd7e64e8) and failing on Windows on
Tests run #4236, job catch-all (windows-latest). Shrinking the wait
reproduces the exact failure signature (AssertionError: []) on Linux.
Changes:
- Handle custom/validation-job-status (threading.Event + last payload).
The payload carries no document URI, so the event is global to the
server instance.
- request_text_document_diagnostics keeps the 2.5s non-empty publish
wait as the fast path. When it misses, it awaits the completion
signal against a 60s deadline (aligned with the indexing wait) and
takes the generation-advancing publication for the request URI,
accepting an empty result as the validated answer; a completion that
brings no publication for the URI (e.g. one belonging to another
document) re-arms the wait until the deadline. If the signal never
arrives, a warning is logged and the previous empty-result behavior
applies, bounded by the deadline.
- Remove the darwin xfail from test_file_diagnostics; add regression
tests for the fallback delivery (fast path forced to miss), for the
never-signalled bound, and for re-arming on a spurious completion
belonging to another document.
- CHANGELOG entry under Language Servers.
Design notes:
- Mirrors #1639 (TypeScript/VTS: event-based indexing wait replacing a
fixed sleep).
- The simpler alternative -- accepting empty publications and raising
the fixed wait -- was rejected: without the completion signal, an
early clear-on-open publication would be taken as the answer, and
every clean file would stall for the full wait.
- Supersedes the quarantine approach of draft PR #1674 (broadening the
xfail to non-Linux); whichever lands second resolves the trivial
conflict on the xfail block.
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.
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.
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>
* 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.
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>
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>
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.
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.
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.
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.
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.
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.
Fixesoraios/serena#1624
Co-authored-by: Claude <noreply@anthropic.com>
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>
* 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.