Commit 67172e4
Triple-slash reference type directives can override the import mode used for their resolution (#47732)
* Triple-slash reference type directives can override the import mode used for their resolution
They now use the file's default mode by default, rather than always using commonjs. The new arguments to the
reference directive look like:
```ts
///<reference types="pkg" resolution-mode="require" />
```
or
```ts
///<reference types="pkg" resolution-mode="import" />
```
* Omit redundant import modes in emitter
* Add test for #47806
* Add server test for triple-slash reference mode overrides
* Move FileReference mode into helper
* Update tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride3.ts
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>1 parent 1b1530a commit 67172e4
File tree
129 files changed
+3158
-102
lines changed- src
- compiler
- factory
- transformers
- server
- services
- testRunner/unittests/tsserver
- tests
- baselines/reference
- api
- cases
- conformance/node
- fourslash/server
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
129 files changed
+3158
-102
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42202 | 42202 | | |
42203 | 42203 | | |
42204 | 42204 | | |
42205 | | - | |
| 42205 | + | |
42206 | 42206 | | |
42207 | 42207 | | |
42208 | | - | |
42209 | | - | |
| 42208 | + | |
| 42209 | + | |
42210 | 42210 | | |
42211 | 42211 | | |
42212 | 42212 | | |
42213 | 42213 | | |
42214 | 42214 | | |
42215 | 42215 | | |
42216 | 42216 | | |
42217 | | - | |
| 42217 | + | |
42218 | 42218 | | |
42219 | 42219 | | |
42220 | 42220 | | |
| |||
42337 | 42337 | | |
42338 | 42338 | | |
42339 | 42339 | | |
42340 | | - | |
| 42340 | + | |
42341 | 42341 | | |
42342 | 42342 | | |
42343 | 42343 | | |
| |||
42355 | 42355 | | |
42356 | 42356 | | |
42357 | 42357 | | |
42358 | | - | |
| 42358 | + | |
42359 | 42359 | | |
42360 | 42360 | | |
42361 | 42361 | | |
42362 | 42362 | | |
42363 | 42363 | | |
42364 | | - | |
| 42364 | + | |
42365 | 42365 | | |
42366 | 42366 | | |
42367 | 42367 | | |
| |||
42412 | 42412 | | |
42413 | 42413 | | |
42414 | 42414 | | |
42415 | | - | |
| 42415 | + | |
42416 | 42416 | | |
42417 | | - | |
42418 | | - | |
| 42417 | + | |
| 42418 | + | |
42419 | 42419 | | |
42420 | 42420 | | |
42421 | 42421 | | |
42422 | | - | |
| 42422 | + | |
42423 | 42423 | | |
42424 | 42424 | | |
42425 | 42425 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1412 | 1412 | | |
1413 | 1413 | | |
1414 | 1414 | | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
1415 | 1423 | | |
1416 | 1424 | | |
1417 | 1425 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3993 | 3993 | | |
3994 | 3994 | | |
3995 | 3995 | | |
3996 | | - | |
3997 | | - | |
| 3996 | + | |
| 3997 | + | |
| 3998 | + | |
| 3999 | + | |
| 4000 | + | |
3998 | 4001 | | |
3999 | 4002 | | |
4000 | 4003 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6414 | 6414 | | |
6415 | 6415 | | |
6416 | 6416 | | |
6417 | | - | |
| 6417 | + | |
6418 | 6418 | | |
6419 | 6419 | | |
6420 | 6420 | | |
| |||
6435 | 6435 | | |
6436 | 6436 | | |
6437 | 6437 | | |
6438 | | - | |
| 6438 | + | |
| 6439 | + | |
| 6440 | + | |
| 6441 | + | |
| 6442 | + | |
| 6443 | + | |
| 6444 | + | |
6439 | 6445 | | |
6440 | 6446 | | |
6441 | 6447 | | |
| |||
6496 | 6502 | | |
6497 | 6503 | | |
6498 | 6504 | | |
| 6505 | + | |
| 6506 | + | |
6499 | 6507 | | |
6500 | 6508 | | |
6501 | 6509 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
| 300 | + | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
| 308 | + | |
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
343 | | - | |
344 | | - | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
345 | 356 | | |
346 | 357 | | |
347 | 358 | | |
| |||
362 | 373 | | |
363 | 374 | | |
364 | 375 | | |
365 | | - | |
| 376 | + | |
366 | 377 | | |
367 | 378 | | |
368 | 379 | | |
| |||
733 | 744 | | |
734 | 745 | | |
735 | 746 | | |
736 | | - | |
| 747 | + | |
737 | 748 | | |
738 | 749 | | |
739 | 750 | | |
740 | | - | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
741 | 756 | | |
742 | 757 | | |
743 | 758 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9306 | 9306 | | |
9307 | 9307 | | |
9308 | 9308 | | |
| 9309 | + | |
| 9310 | + | |
| 9311 | + | |
| 9312 | + | |
| 9313 | + | |
| 9314 | + | |
| 9315 | + | |
| 9316 | + | |
| 9317 | + | |
| 9318 | + | |
| 9319 | + | |
| 9320 | + | |
| 9321 | + | |
| 9322 | + | |
9309 | 9323 | | |
9310 | 9324 | | |
9311 | 9325 | | |
| |||
9351 | 9365 | | |
9352 | 9366 | | |
9353 | 9367 | | |
9354 | | - | |
| 9368 | + | |
9355 | 9369 | | |
9356 | 9370 | | |
9357 | 9371 | | |
9358 | 9372 | | |
9359 | | - | |
| 9373 | + | |
| 9374 | + | |
9360 | 9375 | | |
9361 | 9376 | | |
9362 | 9377 | | |
| |||
0 commit comments