Commit fe2a33f
authored
Merge existing JSDoc comments (#27978)
* Correct indentation, using correct (I hope) indentation code
Note that part of the code, in formatting.ts, is cloned but should be
extracted to a function instead.
* Remove some possibly-superfluous code
But I see 4 failures with whitespace, so perhaps not.
* Restrict indentation change to avoid breaking baselines
The indentation code is very complex so I'm just going to avoid breaking
our single-line tests for now, plus add a simple jsdoc test to show that
multiline jsdoc indentation isn't destroyed in the common case.
* Switched over to construction for @return/@type
Still doesn't merge correctly though
* Add @return tags to emitter
* Merge multiple jsdocs
(not for @param yet)
* Merge multiple jsdoc for parameters too
* Emit more jsdoc tags
Not all of them; I got cold feet since I'll have to write tests for
them. I'll do that tomorrow.
* Many fixes to JSDoc emit
And single tests (at least) for all tags
* Cleanup in textChanges.ts
* Cleanup in formatting.ts
(Plus a little more in textChanges.ts)
* Cleanup in inferFromUsage.ts
* Fix minor omissions
* Separate merged top-level JSDoc comments with \n
instead of space.
* Don't delete intrusive non-jsdoc comments
* Cleanup from PR comments
1. Refactor emit code into smaller functions.
2. Preceding-whitespace utility is slightly easier to use.
3. Better casts and types in inferFromUsage make it easier to read.
* Fix bogus newline
* Use @Andy-MS' cleanup annotateJSDocParameters1 parent e46c846 commit fe2a33f
File tree
20 files changed
+654
-249
lines changed- src
- compiler
- services
- codefixes
- formatting
- tests
- baselines/reference/api
- cases/fourslash
20 files changed
+654
-249
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
862 | 862 | | |
863 | 863 | | |
864 | 864 | | |
865 | | - | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
866 | 893 | | |
867 | 894 | | |
868 | 895 | | |
| |||
2584 | 2611 | | |
2585 | 2612 | | |
2586 | 2613 | | |
| 2614 | + | |
| 2615 | + | |
| 2616 | + | |
| 2617 | + | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
| 2651 | + | |
| 2652 | + | |
| 2653 | + | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
| 2665 | + | |
| 2666 | + | |
| 2667 | + | |
| 2668 | + | |
| 2669 | + | |
| 2670 | + | |
| 2671 | + | |
| 2672 | + | |
| 2673 | + | |
| 2674 | + | |
| 2675 | + | |
| 2676 | + | |
| 2677 | + | |
| 2678 | + | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
| 2683 | + | |
| 2684 | + | |
| 2685 | + | |
| 2686 | + | |
| 2687 | + | |
| 2688 | + | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
| 2753 | + | |
| 2754 | + | |
| 2755 | + | |
| 2756 | + | |
| 2757 | + | |
| 2758 | + | |
| 2759 | + | |
| 2760 | + | |
| 2761 | + | |
2587 | 2762 | | |
2588 | 2763 | | |
2589 | 2764 | | |
| |||
2875 | 3050 | | |
2876 | 3051 | | |
2877 | 3052 | | |
| 3053 | + | |
| 3054 | + | |
| 3055 | + | |
| 3056 | + | |
| 3057 | + | |
2878 | 3058 | | |
2879 | 3059 | | |
2880 | 3060 | | |
| |||
2944 | 3124 | | |
2945 | 3125 | | |
2946 | 3126 | | |
2947 | | - | |
| 3127 | + | |
| 3128 | + | |
| 3129 | + | |
| 3130 | + | |
| 3131 | + | |
| 3132 | + | |
2948 | 3133 | | |
2949 | 3134 | | |
2950 | 3135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2170 | 2170 | | |
2171 | 2171 | | |
2172 | 2172 | | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
2173 | 2224 | | |
2174 | 2225 | | |
2175 | 2226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2447 | 2447 | | |
2448 | 2448 | | |
2449 | 2449 | | |
2450 | | - | |
| 2450 | + | |
2451 | 2451 | | |
2452 | 2452 | | |
2453 | 2453 | | |
| |||
5532 | 5532 | | |
5533 | 5533 | | |
5534 | 5534 | | |
5535 | | - | |
| 5535 | + | |
| 5536 | + | |
5536 | 5537 | | |
5537 | | - | |
| 5538 | + | |
5538 | 5539 | | |
5539 | 5540 | | |
5540 | | - | |
5541 | | - | |
5542 | | - | |
| 5541 | + | |
| 5542 | + | |
| 5543 | + | |
5543 | 5544 | | |
5544 | 5545 | | |
5545 | | - | |
5546 | | - | |
5547 | | - | |
5548 | | - | |
| 5546 | + | |
| 5547 | + | |
| 5548 | + | |
| 5549 | + | |
5549 | 5550 | | |
5550 | 5551 | | |
5551 | | - | |
5552 | | - | |
| 5552 | + | |
| 5553 | + | |
5553 | 5554 | | |
5554 | 5555 | | |
5555 | 5556 | | |
5556 | | - | |
5557 | | - | |
5558 | | - | |
| 5557 | + | |
| 5558 | + | |
| 5559 | + | |
5559 | 5560 | | |
5560 | | - | |
5561 | | - | |
| 5561 | + | |
| 5562 | + | |
5562 | 5563 | | |
5563 | 5564 | | |
5564 | 5565 | | |
| |||
5598 | 5599 | | |
5599 | 5600 | | |
5600 | 5601 | | |
| 5602 | + | |
5601 | 5603 | | |
5602 | 5604 | | |
5603 | 5605 | | |
| |||
0 commit comments