mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-13 20:15:20 +00:00
TypeScript: make the tsserver progress-start grace configurable, raise the default
find_referencing_symbols/request_references could return incomplete results on large TypeScript projects. _wait_for_indexing_start_or_completion waits only _INDEXING_START_GRACE_S (hardcoded 2.0s) for tsserver to *start* emitting $/progress after opening files; if nothing has appeared by then, it assumes no indexing is needed and proceeds immediately. On a large project, tsserver can take longer than that just to resolve the project graph before it even creates the first progress token, so the first cross-file reference query can race a project that is still loading. Every caller of _wait_for_indexing_start_or_completion (the base TypeScript path and the Svelte companion) always calls expect_indexing() first, so the "no progress observed" branch is reached specifically when indexing is already expected; it cannot distinguish "nothing to do" from "not started yet", because the two look identical from the client for as long as tsserver stays quiet. That ambiguity cannot be resolved from client-observable signals alone, so this makes the grace an ls_specific_settings knob (`indexing_start_grace`), the same way indexing_timeout and server_ready_timeout already are, and raises the default from 2.0s to 5.0s. Fixes #1586
This commit is contained in:
1 parent
05468d9685
commit
61ca9ba5de
4 files changed
+63
-7
No files matched your search
@@ -1118,8 +1118,9 @@ Supported settings:
|
||||
| `typescript_version` | `5.9.3` | Override the bundled `typescript` npm package version Serena installs when `ls_path` is not set. |
|
||||
| `typescript_language_server_version` | `5.1.3` | Override the bundled `typescript-language-server` npm package version Serena installs when `ls_path` is not set. |
|
||||
| `npm_registry` | `null` | Override the npm registry Serena uses for the managed install. |
|
||||
| `indexing_timeout` | `30.0` | Timeout in seconds for waiting on tsserver's `$/progress` project-indexing signal (both at startup and before the first cross-file reference query). If indexing does not complete within this window, Serena logs a warning and proceeds anyway. Increase it for very large projects. |
|
||||
| `indexing_timeout` | `30.0` | Timeout in seconds for waiting on tsserver's `$/progress` project-indexing signal to *drain* once it has started (both at startup and before the first cross-file reference query). If indexing does not complete within this window, Serena logs a warning and proceeds anyway. Increase it for very large projects. |
|
||||
| `server_ready_timeout` | `10.0` | Timeout in seconds for waiting on the server-ready signal after initialization. If the signal does not arrive within this window, Serena logs a message and proceeds anyway. |
|
||||
| `indexing_start_grace` | `5.0` | Timeout in seconds to wait for tsserver to *start* reporting `$/progress` before the first cross-file reference query. tsserver must resolve the project graph before it can emit the first progress token, and that can take longer than the default on a very large project; if it takes longer than this window, Serena assumes no indexing was needed and may return incomplete cross-file references. Raising `indexing_timeout` alone does not help here, since this grace elapses first. Increase this for very large projects if `find_referencing_symbols`/`request_references` returns incomplete results shortly after project load. |
|
||||
|
||||
#### Svelte
|
||||
|
||||
|
||||
Reference in new issue
Block a user