Svelte + TypeScript: fail loudly on companion TS timeouts; deterministic test fixture#1648
Open
xormania wants to merge 1 commit into
Open
Svelte + TypeScript: fail loudly on companion TS timeouts; deterministic test fixture#1648xormania wants to merge 1 commit into
xormania wants to merge 1 commit into
Conversation
Contributor
Author
|
I looked into how you do things. I'll update PRs. BTW - I like what you're doing, you've answered some useful context issues. I get it now. |
aeab868 to
46e9e2f
Compare
1bd4216 to
c7e9e93
Compare
2 tasks
Contributor
Author
|
Ready |
c7e9e93 to
2bd0a96
Compare
xormania
added a commit
to xormania/serena
that referenced
this pull request
Jul 9, 2026
Drop the SvelteKit demo-template baggage that no test exercises: @fontsource/fira-mono, @neoconfetti/svelte, @tailwindcss/vite and tailwindcss, along with their only usages (the layout.css imports, the sverdle page's confetti effect, and the tailwind vite plugin). A regenerated lockfile shrinks from 119 to 91 package entries (-24%). rolldown and lightningcss remain: they are vite's own dependencies, not tailwind's. Test-relevant files are untouched: tests reference the sverdle page only as an expected member of reference/rename result sets, and its $lib imports (game.ts, Words.svelte) are preserved. Verified: clean npm install + svelte-kit sync + full svelte suite (16/16) against the trimmed fixture. Note: oraios#1648 commits a package-lock.json generated from the previous dependency set; whichever change lands second must regenerate it.
MischaPanch
requested changes
Jul 10, 2026
MischaPanch
left a comment
Member
There was a problem hiding this comment.
Thanks for the PR, rather minor comments
| @@ -0,0 +1,211 @@ | |||
| """Regression tests for the TypeScript/Svelte timeout policy split. | |||
Member
There was a problem hiding this comment.
I propose to delete this, there's too much mocking for this to be useful or maintainable
…tic 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: overrides the hooks to raise TimeoutError with
a diagnostic indexing-state summary (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,
start-or-completion indexing-wait semantics; no LS processes, fully
deterministic), and document the server_ready_timeout /
indexing_timeout settings in the TypeScript and Svelte sections of
the configuration docs.
2bd0a96 to
93b8c18
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make the Svelte companion TypeScript server raise on readiness and indexing timeouts instead of silently proceeding with a partial index. This turns flaky/wrong cross-file results into clear failures.
Changes
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(the companion owned bySvelteLanguageServer): overrides the hooks to raiseTimeoutErrorwith a diagnostic indexing-state summary (describe_indexing_state()) instead of serving requests from a cold or partially indexed program.server_ready_timeout/indexing_timeoutvials_specific_settings.SvelteCompanionPreparationError(raised when.sveltefiles cannot be opened on the companion) reports a count-first file listing capped at 10 entries and chains the first underlying error, so the cause is visible without DEBUG logging.npm ciwith a committedpackage-lock.json, removing dependency-resolution non-determinism from CI runs.svelte-kit syncexplicitly and fail loudly if.svelte-kit/tsconfig.jsoncannot be generated. The fixture'spreparescript masks sync failures (svelte-kit sync || echo ''), and a known npm bug ([BUG] Platform-specific optional dependencies not being included inpackage-lock.jsonwhen reinstalling withnode_modulespresent npm/cli#4828) can silently skip platform-specific optional dependencies — the result is unresolvable$libpath aliases and cross-file tests failing with confusing partial results instead of a clear, actionable error../test/resources/repos; codespell matches skip globs against the./-prefixed paths it walks, so an anchor-less pattern never matches).test/solidlsp/test_typescript_timeout_policy.py): pin the timeout-policy split directly — base server permissive, Svelte companion strict — plus the settings plumbing (including svelte-over-typescript precedence forindexing_timeout) and the internal start-or-completion indexing-wait semantics. No language-server processes are spawned and the policy tests use no mocks (a small hand-written fake drives the companion guard); the tests are fully deterministic.server_ready_timeout/indexing_timeoutrows in the TypeScript and Svelte settings tables indocs/02-usage/050_configuration.md, including the companion's settings inheritance and strict behavior.Checklist
CONTRIBUTING.mdregarding the scope of PRs.CHANGELOG.md, which concisely describes the change.