Commit 459bd19
authored
Add unqualified JSDoc member references (microsoft#44202)
* Add unqualified JSDoc member references
This allows unqualified references like:
```ts
class Zero {
/** @param buddy Must be {@link D_HORSE} or {@link D_DOG}. */
deploy(buddy: number) { }
static D_HORSE = 1
static D_DOG = 2
}
```
I surveyed @see and @link again to estimate how common this is. I found
a little over 200 uses, which is around 2%. Sorted by frequency, this
*is* the next feature on the list, along with the `module:` prefix.
So I think this is about the right point to stop adding code.
In this case, however, I liked most of the uses -- there were a lot
of deprecated functions that referenced a function just below, where it
would be wordy to qualify the name, but the reader would benefit from a
link.
Note that unqualified references do *not* work inside type or object
literals. The code I ended up with is quite complicated and I didn't
observe any uses in the wild.
Fixes microsoft#43595
* Remove type/object literal container check
Since they don't work anyway1 parent 3ffa245 commit 459bd19
File tree
2 files changed
+121
-22
lines changed- src/compiler
- tests/baselines/reference
2 files changed
+121
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39335 | 39335 | | |
39336 | 39336 | | |
39337 | 39337 | | |
39338 | | - | |
| 39338 | + | |
| 39339 | + | |
| 39340 | + | |
| 39341 | + | |
| 39342 | + | |
| 39343 | + | |
| 39344 | + | |
| 39345 | + | |
39339 | 39346 | | |
39340 | 39347 | | |
39341 | 39348 | | |
| |||
39374 | 39381 | | |
39375 | 39382 | | |
39376 | 39383 | | |
| 39384 | + | |
| 39385 | + | |
39377 | 39386 | | |
39378 | | - | |
| 39387 | + | |
39379 | 39388 | | |
39380 | | - | |
39381 | | - | |
39382 | | - | |
39383 | | - | |
39384 | | - | |
39385 | | - | |
39386 | | - | |
39387 | | - | |
| 39389 | + | |
| 39390 | + | |
| 39391 | + | |
| 39392 | + | |
| 39393 | + | |
| 39394 | + | |
| 39395 | + | |
39388 | 39396 | | |
39389 | 39397 | | |
39390 | 39398 | | |
39391 | | - | |
| 39399 | + | |
| 39400 | + | |
39392 | 39401 | | |
39393 | 39402 | | |
39394 | 39403 | | |
39395 | | - | |
| 39404 | + | |
39396 | 39405 | | |
39397 | 39406 | | |
39398 | 39407 | | |
| |||
Lines changed: 100 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
147 | 165 | | |
148 | 166 | | |
149 | 167 | | |
| |||
219 | 237 | | |
220 | 238 | | |
221 | 239 | | |
222 | | - | |
223 | | - | |
| 240 | + | |
| 241 | + | |
224 | 242 | | |
225 | 243 | | |
226 | 244 | | |
| |||
340 | 358 | | |
341 | 359 | | |
342 | 360 | | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
343 | 379 | | |
344 | 380 | | |
345 | 381 | | |
| |||
426 | 462 | | |
427 | 463 | | |
428 | 464 | | |
429 | | - | |
430 | | - | |
| 465 | + | |
| 466 | + | |
431 | 467 | | |
432 | 468 | | |
433 | 469 | | |
| |||
544 | 580 | | |
545 | 581 | | |
546 | 582 | | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
547 | 601 | | |
548 | 602 | | |
549 | 603 | | |
| |||
606 | 660 | | |
607 | 661 | | |
608 | 662 | | |
609 | | - | |
610 | | - | |
| 663 | + | |
| 664 | + | |
611 | 665 | | |
612 | 666 | | |
613 | 667 | | |
| |||
712 | 766 | | |
713 | 767 | | |
714 | 768 | | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
715 | 787 | | |
716 | 788 | | |
717 | 789 | | |
| |||
801 | 873 | | |
802 | 874 | | |
803 | 875 | | |
804 | | - | |
805 | | - | |
| 876 | + | |
| 877 | + | |
806 | 878 | | |
807 | 879 | | |
808 | 880 | | |
| |||
890 | 962 | | |
891 | 963 | | |
892 | 964 | | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
893 | 983 | | |
894 | 984 | | |
895 | 985 | | |
| |||
0 commit comments