Commit 71cd5d5
Fix two issues with ConvertToTypeOnlyExport codefix (microsoft#40490)
* Modify test case to reproduce error
* Fix TypeOnlyExport codefix to work with 3 or more type exports in the same declaration
The check to ensure that a fixed export declaration wasn't fixed again
was reversed. This only surfaced when 3 or more type exports existed in
the same declaration.
* Add failing test cases for comments being duplicated
* Fix convertToTypeOnlyExport codefix from duplicating leading comments
* Simplify convertToTypeOnlyExport when change is just inserting `type` keyword
Co-authored-by: Andrew Branch <[email protected]>1 parent 9ed608b commit 71cd5d5
File tree
3 files changed
+30
-18
lines changed- src/services/codefixes
- tests/cases/fourslash
3 files changed
+30
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 38 | + | |
48 | 39 | | |
49 | 40 | | |
50 | 41 | | |
| |||
61 | 52 | | |
62 | 53 | | |
63 | 54 | | |
64 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
65 | 59 | | |
66 | 60 | | |
67 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
18 | 21 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
16 | 22 | | |
17 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
18 | 29 | | |
19 | | - | |
| 30 | + | |
20 | 31 | | |
21 | 32 | | |
22 | 33 | | |
23 | 34 | | |
24 | | - | |
| 35 | + | |
| 36 | + | |
25 | 37 | | |
26 | 38 | | |
27 | | - | |
28 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
29 | 44 | | |
0 commit comments