Commit b1369b5
authored
fix: normalize paths in native resolver for .js → .ts remap (#600)
* fix: normalize paths in native resolver for .js → .ts extension remap
Adds clean_path() to properly resolve .. components before extension
probing. Also updates normalize_path() to use clean_path() internally.
The JS-side defense-in-depth (path.normalize + remapJsToTs) was already
in place; this fixes the root cause in the Rust native resolver.
Fixes #592
Impact: 3 functions changed, 6 affected
* fix: add clean_path tests, doc comment, and un-skip parity test (#600)
- Add #[cfg(test)] module with unit tests for clean_path covering
parent dir collapse, cur dir skip, absolute root, mixed segments,
and the known excess-parent-dir limitation.
- Document the silent-drop behavior of leading .. on empty base in
the clean_path doc comment.
- Un-skip the 'resolves parent directory traversal' parity test now
that the native engine properly normalizes paths.
Impact: 5 functions changed, 0 affected
* fix: re-skip parity test until native binary is published (#600)
The parity test requires the native binary to include the clean_path
fix, but CI tests run against the pre-built binary. Re-skip with an
updated comment explaining when to un-skip.1 parent 5660f75 commit b1369b5
File tree
2 files changed
+72
-3
lines changed- crates/codegraph-core/src
- tests/resolution
2 files changed
+72
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
13 | 36 | | |
14 | 37 | | |
15 | 38 | | |
16 | | - | |
| 39 | + | |
17 | 40 | | |
18 | 41 | | |
19 | 42 | | |
| |||
111 | 134 | | |
112 | 135 | | |
113 | 136 | | |
114 | | - | |
| 137 | + | |
115 | 138 | | |
116 | 139 | | |
117 | 140 | | |
| |||
246 | 269 | | |
247 | 270 | | |
248 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
0 commit comments