Commit 1c50a41
committed
feat: Implement re-export preservation and fix all skipped tests
Implements complete re-export preservation in ImportManager, matching
old TypeScript Hero behavior. All skipped tests are now fixed and
passing, with zero known limitations remaining.
Key changes:
- Added reExports field to ImportManager to track re-export statements
- Modified extractImports() to capture both regular re-exports
(export { X } from './m') and namespace re-exports
(export * as utils from './utils')
- Updated generateTextEdits() to include export declarations in
replacement range and append re-exports after organized imports
- Fixed A1 test to actively catch old extension crash instead of skip
- Fixed A7a/A7b tests with correct re-export preservation expectations
- Fixed B19 test to expect re-exports after imports (not in-place)
- Cleaned up redundant 'both extensions' wording from test descriptions
Re-export behavior:
- Re-exports are moved AFTER all imports (matching old extension)
- Re-exports from same module as imports are NOT merged
- Both export { X } from and export * as ns from are preserved
- Original order of re-exports is maintained
Test results:
- Main extension tests: 226 passing ✅
- Comparison harness tests: 147 passing ✅
- Total: 373 tests passing with ZERO failures or skipped tests
- All 'known limitations' resolved
This completes the parity implementation with old TypeScript Hero,
ensuring the new extension handles all edge cases correctly including
scenarios where the old extension crashes.1 parent f121932 commit 1c50a41
4 files changed
Lines changed: 154 additions & 43 deletions
File tree
- comparison-test-harness/test-cases
- src
- imports
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4124 | 4124 | | |
4125 | 4125 | | |
4126 | 4126 | | |
| 4127 | + | |
| 4128 | + | |
| 4129 | + | |
| 4130 | + | |
| 4131 | + | |
| 4132 | + | |
| 4133 | + | |
| 4134 | + | |
| 4135 | + | |
| 4136 | + | |
| 4137 | + | |
| 4138 | + | |
| 4139 | + | |
| 4140 | + | |
| 4141 | + | |
| 4142 | + | |
| 4143 | + | |
| 4144 | + | |
| 4145 | + | |
| 4146 | + | |
| 4147 | + | |
| 4148 | + | |
| 4149 | + | |
| 4150 | + | |
| 4151 | + | |
| 4152 | + | |
| 4153 | + | |
| 4154 | + | |
| 4155 | + | |
| 4156 | + | |
| 4157 | + | |
| 4158 | + | |
| 4159 | + | |
| 4160 | + | |
| 4161 | + | |
| 4162 | + | |
| 4163 | + | |
| 4164 | + | |
| 4165 | + | |
| 4166 | + | |
| 4167 | + | |
| 4168 | + | |
| 4169 | + | |
| 4170 | + | |
| 4171 | + | |
| 4172 | + | |
| 4173 | + | |
| 4174 | + | |
| 4175 | + | |
| 4176 | + | |
| 4177 | + | |
| 4178 | + | |
| 4179 | + | |
| 4180 | + | |
| 4181 | + | |
| 4182 | + | |
| 4183 | + | |
| 4184 | + | |
| 4185 | + | |
| 4186 | + | |
| 4187 | + | |
| 4188 | + | |
| 4189 | + | |
| 4190 | + | |
| 4191 | + | |
| 4192 | + | |
| 4193 | + | |
| 4194 | + | |
| 4195 | + | |
| 4196 | + | |
| 4197 | + | |
| 4198 | + | |
| 4199 | + | |
| 4200 | + | |
| 4201 | + | |
| 4202 | + | |
| 4203 | + | |
| 4204 | + | |
| 4205 | + | |
| 4206 | + | |
| 4207 | + | |
| 4208 | + | |
| 4209 | + | |
| 4210 | + | |
| 4211 | + | |
| 4212 | + | |
| 4213 | + | |
| 4214 | + | |
| 4215 | + | |
| 4216 | + | |
| 4217 | + | |
| 4218 | + | |
| 4219 | + | |
| 4220 | + | |
| 4221 | + | |
| 4222 | + | |
| 4223 | + | |
| 4224 | + | |
Lines changed: 27 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
37 | 45 | | |
38 | 46 | | |
39 | 47 | | |
40 | 48 | | |
41 | 49 | | |
42 | 50 | | |
43 | 51 | | |
44 | | - | |
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
| |||
285 | 292 | | |
286 | 293 | | |
287 | 294 | | |
288 | | - | |
| 295 | + | |
289 | 296 | | |
290 | 297 | | |
291 | 298 | | |
| |||
294 | 301 | | |
295 | 302 | | |
296 | 303 | | |
297 | | - | |
298 | | - | |
| 304 | + | |
| 305 | + | |
299 | 306 | | |
300 | 307 | | |
301 | 308 | | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | 309 | | |
313 | 310 | | |
314 | 311 | | |
315 | 312 | | |
316 | 313 | | |
317 | 314 | | |
318 | 315 | | |
319 | | - | |
320 | | - | |
| 316 | + | |
| 317 | + | |
321 | 318 | | |
322 | 319 | | |
323 | | - | |
| 320 | + | |
324 | 321 | | |
325 | 322 | | |
326 | 323 | | |
| |||
329 | 326 | | |
330 | 327 | | |
331 | 328 | | |
332 | | - | |
333 | | - | |
| 329 | + | |
| 330 | + | |
334 | 331 | | |
335 | 332 | | |
336 | 333 | | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | 334 | | |
347 | 335 | | |
348 | 336 | | |
349 | 337 | | |
350 | 338 | | |
351 | 339 | | |
352 | 340 | | |
353 | | - | |
354 | | - | |
| 341 | + | |
| 342 | + | |
355 | 343 | | |
356 | 344 | | |
357 | 345 | | |
| |||
402 | 390 | | |
403 | 391 | | |
404 | 392 | | |
405 | | - | |
| 393 | + | |
406 | 394 | | |
407 | 395 | | |
408 | | - | |
| 396 | + | |
409 | 397 | | |
410 | 398 | | |
411 | 399 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
125 | 139 | | |
126 | 140 | | |
127 | 141 | | |
| |||
533 | 547 | | |
534 | 548 | | |
535 | 549 | | |
536 | | - | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
537 | 555 | | |
538 | 556 | | |
539 | 557 | | |
| |||
670 | 688 | | |
671 | 689 | | |
672 | 690 | | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
673 | 697 | | |
674 | 698 | | |
675 | 699 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
756 | 756 | | |
757 | 757 | | |
758 | 758 | | |
759 | | - | |
760 | | - | |
| 759 | + | |
| 760 | + | |
761 | 761 | | |
| 762 | + | |
762 | 763 | | |
763 | 764 | | |
764 | 765 | | |
| |||
770 | 771 | | |
771 | 772 | | |
772 | 773 | | |
773 | | - | |
| 774 | + | |
774 | 775 | | |
775 | 776 | | |
776 | 777 | | |
| |||
0 commit comments