Commit 0f40608
authored
fix(ci): add #[ignore] to ra_e2e_suite and install rust-analyzer in e2e job (#126)
* fix(ci): add #[ignore] to ra_e2e_suite and install rust-analyzer in e2e CI job
Without #[ignore], ra_e2e_suite was not picked up by the CI e2e filter
(--run-ignored ignored-only). Also adds rustup component add rust-analyzer
step on Linux/macOS; Windows skips the ra_e2e suite via MCPLS_SKIP_RA=1.
* fix(ci): run rust-analyzer e2e tests on Windows too
* fix(e2e): resolve rust-analyzer via rustup fallback on Windows, extend code_action timeout
- ra_probe: fall back to `rustup which rust-analyzer` when the binary is not
in PATH — fixes CI on Windows where rustup toolchain dirs are excluded from PATH
- sc_get_code_actions: increase retry loop from 15s to 30s and add 5s initial
warm-up sleep; type-checking must complete before code action fixes appear
- compute ca_end_col dynamically from the actual line length instead of a
hardcoded column
* fix(e2e): fix Windows file URI generation and code_action range
- path_to_uri: use Url::from_file_path instead of manual string formatting;
on Windows, canonicalize() returns \\?\ prefix which manual replace produced
invalid file:////?\... URIs — causing all LSP requests to fail with -32603
- sc_get_code_actions: extend range to ca_line+1 because rust-analyzer reports
the missing-semicolon diagnostic at the closing brace (one line below), so the
range must overlap that position to trigger the quickfix
- wait_until_ready: default timeout 120s on Windows (vs 60s on Linux/macOS)
- ci: bump test-e2e timeout-minutes from 15 to 20
* fix(bridge): strip \\?\ prefix in path_to_uri on Windows without breaking tests
Reverts to manual URI construction but strips the extended-path prefix
(\\?\) that canonicalize() adds on Windows. Using Url::from_file_path
panicked on unit tests that pass Unix-style paths (/test/file.rs) which
are invalid Windows absolute paths.
* test(e2e): add diagnostic logging to wait_until_ready for Windows debugging
* fix(e2e): resolve get_code_actions returning empty actions
Add codeActionLiteralSupport to LSP client capabilities so rust-analyzer
returns CodeAction objects instead of falling back to legacy Command-only
format. Without this capability declaration RA yields an empty response
for structural refactoring assists such as "Implement missing members".
Update sc_get_code_actions to use a point-cursor range on the impl line
and target the empty `impl Greet for CodeActionTarget` block.
Fix sc_get_cached_diagnostics to poll up to 15 s for the push-based
publishDiagnostics cache, which may arrive asynchronously after pull-based
diagnostics have already been satisfied by sc_get_diagnostics.
* refactor(lsp): use CodeActionKind constants for value_set instead of raw strings
* test(e2e): require 3 consecutive ready signals and extend Windows cached-diag timeout
Readiness gate now requires 3 consecutive hover successes to avoid false-positive
from transient RA analysis during workspace indexing (observed on Windows CI).
sc_get_cached_diagnostics timeout raised to 60 s on Windows where publishDiagnostics
notifications arrive later due to slower CI runners.
* fix(bridge): use path_to_uri for cached diagnostics lookup on Windows
Url::from_file_path on a canonicalized \?\-prefixed Windows path
produces a URI that does not match what rust-analyzer stores in
publishDiagnostics notifications (which omit the \?\ prefix).
Replace the Url::from_file_path call in handle_cached_diagnostics with
path_to_uri, which strips \?\ before building the URI, keeping the
cache lookup key consistent with the stored key.
* test(e2e): reduce cached-diagnostics timeout to 20 s on all platforms
The URI mismatch fix (path_to_uri instead of Url::from_file_path) means
the push cache lookup now works on Windows. The previous 60 s Windows
timeout combined with the ~32 s readiness gate was hitting the 120 s
nextest terminate-after limit.
20 s is sufficient: if the cache is populated (URI fix works) the data
is found on the first poll; if not, we fail clearly within budget.
* test(e2e): use lib.rs for cached-diagnostics push verification
Newer rust-analyzer versions skip publishDiagnostics push for files that
were already served via the pull-based textDocument/diagnostic API.
sc_get_diagnostics calls pull on broken.rs, so RA no longer pushes for it.
lib.rs is opened only via hover (wait_until_ready), never via pull
diagnostics, so RA unconditionally pushes publishDiagnostics for it after
initial workspace indexing. lib.rs also contains a guaranteed E0425 error
(undefined_variable in has_error) that RA always reports.
* fix(bridge): lowercase Windows drive letter in path_to_uri to match RA's URI normalization
rust-analyzer normalizes Windows drive letters to lowercase in file URIs
(e.g. C: → c:). path_to_uri was preserving the uppercase letter from
canonicalize(), causing push-diagnostic cache lookups to miss every time
on Windows CI — the stored key (RA's URI) and the lookup key (our URI)
differed only in drive-letter case.
* fix(bridge): normalize URI cache keys to lowercase on Windows
Different tools (rust-analyzer, std::fs::canonicalize) produce Windows
file URIs with inconsistent drive-letter casing (C: vs c:). Instead of
assuming one canonical form, normalize both sides to lowercase at the
cache boundary via uri_cache_key(). Applies to store, get, and clear
operations in NotificationCache.1 parent 6cae0e1 commit 0f40608
8 files changed
Lines changed: 194 additions & 85 deletions
File tree
- .github/workflows
- crates/mcpls-core
- src
- bridge
- lsp
- tests
- common
- fixtures/rust_workspace/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
| 229 | + | |
228 | 230 | | |
229 | 231 | | |
230 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
14 | 29 | | |
15 | 30 | | |
16 | 31 | | |
| |||
141 | 156 | | |
142 | 157 | | |
143 | 158 | | |
144 | | - | |
| 159 | + | |
| 160 | + | |
145 | 161 | | |
146 | 162 | | |
147 | 163 | | |
| |||
180 | 196 | | |
181 | 197 | | |
182 | 198 | | |
183 | | - | |
| 199 | + | |
184 | 200 | | |
185 | 201 | | |
186 | 202 | | |
| |||
201 | 217 | | |
202 | 218 | | |
203 | 219 | | |
204 | | - | |
| 220 | + | |
205 | 221 | | |
206 | 222 | | |
207 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
216 | 215 | | |
217 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
218 | 221 | | |
219 | 222 | | |
220 | 223 | | |
221 | | - | |
222 | 224 | | |
223 | 225 | | |
224 | 226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | | - | |
| 21 | + | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
1212 | 1211 | | |
1213 | 1212 | | |
1214 | 1213 | | |
1215 | | - | |
| 1214 | + | |
1216 | 1215 | | |
1217 | 1216 | | |
1218 | 1217 | | |
| |||
1222 | 1221 | | |
1223 | 1222 | | |
1224 | 1223 | | |
1225 | | - | |
1226 | 1224 | | |
1227 | 1225 | | |
1228 | 1226 | | |
| |||
1418 | 1416 | | |
1419 | 1417 | | |
1420 | 1418 | | |
1421 | | - | |
1422 | | - | |
1423 | | - | |
1424 | | - | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
1425 | 1422 | | |
1426 | 1423 | | |
1427 | 1424 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
294 | 296 | | |
295 | 297 | | |
296 | 298 | | |
| |||
343 | 345 | | |
344 | 346 | | |
345 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
346 | 367 | | |
347 | 368 | | |
348 | 369 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
42 | 53 | | |
| 54 | + | |
| 55 | + | |
43 | 56 | | |
44 | 57 | | |
45 | 58 | | |
| |||
Lines changed: 20 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 74 | + | |
| 75 | + | |
78 | 76 | | |
79 | 77 | | |
80 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
81 | 96 | | |
0 commit comments