Commit ab87849
committed
fix(lsp): jump-to-definition hung forever when the server had no answer
The intermittent CI failure of "should jump to definition" (LegacyInteg:
EditorCommandHandlers) was not cold-start latency: the spec's first
NAVIGATE_JUMPTO_DEFINITION fired while tsserver was still loading the
project, the server answered with no definition, and doJumpToDef's deferred
only resolved inside `if (msgObj && msgObj.range)` - an empty result NEVER
settled it. The command promise then hung forever, and awaitsFor races each
poll invocation against the FULL timeout, so the "retry loop" never retried
once and the spec burned its whole budget on one dead promise (the
SpecRunner.js:141 stack in the CI logs). Manual jumps worked the whole time
- the server was healthy; the spec was pinned.
- DefaultProviders.doJumpToDef: settle (reject) when the server returns no
definition, and on a failed cross-file FILE_OPEN. Also fixes real users:
F12 on a symbol with no definition left a permanently pending command.
- src-node/lsp-client: on unexpected server exit, reject all in-flight
requests immediately - the dead process can never answer them, and they
previously hung callers until the 2-minute per-request timeout (only
graceful stops flushed the pending map).
- The spec: the one-time tsserver cold start now happens in the suite's
beforeAll warm-up (the TypeScript LSP suite's pattern, 90s budget there);
the spec itself waits max 15s, polling every 500ms with each jump attempt
time-boxed to 3s - a slow or rejected attempt is a retry, never a pin -
and a rejected jump no longer aborts awaitsFor via an exception.
LegacyInteg:EditorCommandHandlers Integration green 12/12 twice in a row
(including the focus-sensitive clipboard spec).1 parent 92cb4e8 commit ab87849
3 files changed
Lines changed: 58 additions & 7 deletions
File tree
- src-node
- src/languageTools
- test/spec
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
221 | 227 | | |
222 | 228 | | |
223 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
814 | 814 | | |
815 | 815 | | |
816 | 816 | | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
817 | 820 | | |
818 | 821 | | |
819 | 822 | | |
820 | 823 | | |
821 | 824 | | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
822 | 830 | | |
823 | 831 | | |
824 | 832 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
119 | 139 | | |
120 | 140 | | |
121 | 141 | | |
| |||
202 | 222 | | |
203 | 223 | | |
204 | 224 | | |
205 | | - | |
206 | | - | |
207 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
208 | 231 | | |
209 | 232 | | |
210 | | - | |
211 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
212 | 249 | | |
213 | 250 | | |
214 | 251 | | |
215 | | - | |
| 252 | + | |
216 | 253 | | |
217 | 254 | | |
218 | 255 | | |
| |||
0 commit comments