33204 Commits

Author SHA1 Message Date
Wesley Wigham
4d2fb5407c
Preserve the distributivity of inlined conditional types in declaration emit (#48592) 2022-04-06 17:21:46 -07:00
Wesley Wigham
94d33ba85d
Ensure late painted statements are only transformed once, so inner substitutions are consistently read (#48558)
* Ensure late painted statements are only transformed once, so inner substitutions are consistently read

* PR suggestion

* Fix lint
2022-04-06 16:36:42 -07:00
Mateusz Burzyński
702bc5222b
Add additional tests for intra expression inference (#48584) 2022-04-06 16:17:53 -07:00
Sheetal Nandi
4c6f25a998
More refactoring of tsc baselines to help with easier updates (#48572)
* Some refactoring of baselines

* Some refactoring of baselines
2022-04-06 14:10:08 -07:00
Anders Hejlsberg
8f6e626d1c
Permit type alias variance annotations only for certain object types (#48589)
* Permit type alias variance annotations only for certain object types

* Accept new baselines
2022-04-06 14:04:42 -07:00
Sheetal Nandi
3fd8a6e443
Some refactoring for baselining for easy update (#48516)
* Some refactoring for baselining for easy update

* Set modified time in baseline

* Some renames per feedback
2022-04-06 12:46:34 -07:00
Nathan Shively-Sanders
16b6f0f533
manually update webworker to remove AbortSignal.abort (#48580) 2022-04-05 17:08:17 -07:00
Andrew Casey
76e74370ab
Only report isDefinition when FAR is triggered on a definition (#48566)
* Don't report isDefinition unless the starting node is a declaration

* Drop isDefinition everywhere it isn't specifically needed

* Fix tsserver tests

* Update shim comment

* Update baselines

* Add tests for isDefinition

* Update doc comment

* Clear isDefinition from all references if the first one lacks it
2022-04-05 17:04:18 -07:00
jihndai
f7c457d207
Update Intl.DisplayNames types for better spec compliance (#48442)
* update display names types

* update baselines

* add tests and baselines

* add another test
2022-04-05 16:58:25 -07:00
Oleksandr T
9881c993fc
fix(48544): allow to convert default exports to names for import type nodes (#48550) 2022-04-05 16:53:01 -07:00
Minh Quy
50a5bc839a
fix(48540): Extract to typedef from (invalid) type with comments in JS file causes assertion failure (#48545)
* fix(48540): Remove comments from jsdoc union type expression

* fix(48540) - Remove comment for top level import and add extract typedef tests

* fix(48540) - Remove comments from jsdoc's descendant

* fix(48540) - Using no nested comments instead of traversing
2022-04-05 16:51:32 -07:00
Nathan Shively-Sanders
42032df06d
Update DOM for 4.7 beta (#48577) 2022-04-05 16:47:25 -07:00
jihndai
88f31d72c2
Add more options to DateTimeFormatOptions.timeZoneName (#48467)
* update timeZoneName

* add tests and baselines
2022-04-05 13:46:54 -07:00
Leonard Ginters
312737b430
feat(46907): Add Intl.ListFormat type declarations (#47254)
* feat(46907): Add ListFormat type declarations

* feat(46907): Fix JSDoc return type

* feat(46907): Use correct formatToParts list parameter type description, link to Array MDN page

* refactor(46907): Change ListFormatLocaleMatcher MDN link to match the rest

* feat(46907): Add explicit undefined to ListFormatOptions
2022-04-05 13:38:38 -07:00
Daniel Rosenwasser
c99afde6ad
Run API tests with 'strict' and 'exactOptionalProperties'. (#48574) 2022-04-05 13:35:21 -07:00
Anders Hejlsberg
a3c22187c9
Improve inference for context sensitive functions in object and array literal arguments (#48538)
* Use intra-expression inference sites in type argument inference

* Accept new baselines

* Add tests
2022-04-05 13:08:59 -07:00
Ron Buckton
7da80d79e2
Add 'extends' clause to 'infer' type (#48112)
* Add 'extends' clause to 'infer' type

* Revise parse for infer..extends, improve parenthesizer

* More aggressive parens to match existing DT tests

* tests 'infer' constraint using outer type parameter

* Adds a test showing 'infer' cannot reference other 'infer' in same 'extends'

* Emit extends clause for synthetic infer typesduring declaration emit
2022-04-05 12:35:28 -07:00
Minh Quy
6e0447fdf1
[Feature] - Automatically create sort groups based on newlines (#48330)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
2022-04-05 11:53:19 -07:00
David Sherret
f654f18d86
fix: ensure ts source file with no-default-lib that augments the global scope gets emitted with incremental program (#48412)
* fix: do not classify non-declaration files as default library source files

* Add test.
2022-04-05 10:00:37 -07:00
Zzzen
370d34cdca
narrow type for generic variables inside TypeQuery (#48434) 2022-04-05 09:33:19 -07:00
Minh Quy
25aecd4c3e
fix(48109) - 'Convert to arrow function' refactoring adds extra indent (#48440)
* fix(48109) - Remove extra indent when converting to arrow function

* fix(48109) - Only treat curly brace in object literal as block

* Apply suggestions from code review

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2022-04-04 17:57:34 -07:00
Jake Bailey
276719753e
Allow arrow function parameter parsing to bail out during speculation, redo (#48493)
* Allow arrow function parameter parsing to bail out during speculation, redo

* Add correct baselines

* Allow await/yield keywords for more graceful error reporting

* Add test for other parser issue

* Address some PR feedback

* Add extra comment

* Add async variants
2022-04-04 16:57:26 -07:00
Andrew Casey
493ddc2447
Remove non-baselining fourslash FAR validation (#48564)
* Fix fourslash failures

* Delete unused FAR fourslash helpers
2022-04-04 16:54:10 -07:00
Gabriela Araujo Britto
99ea99b386
Properly check singleton labeled tuple before unwrapping (#48554)
* properly check if singleton labeled tuple has optional element

* also check if labeled element is rest
2022-04-04 15:53:41 -07:00
Oleksandr T
aa3c5a787c
fix(48418): allow using empty tuple (#48420) 2022-04-04 14:56:35 -07:00
Oleksandr T
e5ca3e4386
fix(48406): resolve JSDoc host of property signature (#48407) 2022-04-04 14:42:50 -07:00
Pablo Sabater Jiménez
3b12284fc4
fixed code duplication (#48425)
* fixed code duplication

* updated baselines
2022-04-04 14:16:21 -07:00
Wesley Wigham
9d2f72b285
Remove nightly-only flagging for nodenext features (#48555) 2022-04-04 14:07:32 -07:00
Oleksandr T
7465f04666
fix(48542): omit parameter info of contextual union type (#48549) 2022-04-04 14:05:20 -07:00
Oleksandr T
e02998f70d
fix(48541): forbid function extraction to arrow function with expression body (#48548) 2022-04-04 12:27:49 -07:00
Andrew Casey
d5f5c6d61e
Convert many tests from verify.singleReferenceGroup to verify.baselineFindAllReferences (#48518)
* Convert referenceToClass to baselining

* Delete stray marker from findAllRefsInsideWithBlock

* Bulk convert tests that just call verify.singleReferenceGroup

* Update tests with duplicate names

* Bulk update verify.singleReferenceGroup tests with BOMs

* Semi-automatically convert FAR tests with explicit range code

* Convert findAllReferencesDynamicImport2 to baselines
2022-04-04 09:23:58 -07:00
magic-akari
99620117be
Fix crash when circular reference in variance annotations (#48539)
* Fix crash when circular reference in variance annotations

* chore: clean code
2022-04-04 08:33:47 -07:00
Oleksandr T
2db17fdda2
fix(48520): fix getting parameter type by index (#48521) 2022-04-03 21:42:37 -07:00
csigs
b1a25fd8b1
LEGO: Merge pull request 48534
LEGO: Merge pull request 48534
2022-04-03 03:46:54 -07:00
csigs
fd4943bd9c
LEGO: Merge pull request 48526
LEGO: Merge pull request 48526
2022-04-02 05:36:37 -07:00
Andrew Casey
337d1326fb
Sync fourslash shims and shims-pp (#48507)
It appears that they were intended to be identical so, in each case, I updated the side that looked less correct.
2022-04-01 11:14:14 -07:00
Andrew Casey
8020072281
Respect @BaselineFile in fourslash tests and tidy up quickInfoDisplayPartsVarShims (#48506) 2022-04-01 09:24:14 -07:00
csigs
acb927e8a5
LEGO: Merge pull request 48512
LEGO: Merge pull request 48512
2022-04-01 05:41:47 -07:00
Wesley Wigham
54fa69cb47
Fix API under exactOptionalPropertyTypes (#48505) 2022-03-31 21:45:34 -07:00
Ryan Cavanaugh
9153eaaee0
Reserve a core in runtests-parallel on non-CI machines (#48502) 2022-03-31 21:27:58 -07:00
Andrew Casey
70585aa0c0
Correct node used for isDefinition calculation (#48499)
It should be adjusted as in `getReferencedSymbolsForNode`.  The baseline changes show that it was incorrectly returning false at keywords preceding definitions.
2022-03-31 12:18:12 -07:00
Oleksandr T
9cfa6e25af
fix(48405): emit dummy members from a mapped type (#48481) 2022-03-31 10:15:12 -07:00
Anders Hejlsberg
fd601ddf20
CFA for dependent parameters typed by generic constraints (#48411)
* Obtain apparent type in parameter destructuring check

* Add regression test
2022-03-30 16:33:01 -07:00
Anders Hejlsberg
3f483d87b4
No contextual typing from return types for boolean literals (#48380)
* No contextual typing from return types for boolean literals

* Accept new baselines

* Add regression tests
2022-03-30 16:32:24 -07:00
Oleksandr T
e62f960648
fix(47733): omit JSDoc comment template suggestion on node with existing JSDoc (#47748) 2022-03-30 15:36:47 -07:00
Jake Bailey
3c6c2799b6
Ensure that we copy empty NodeArrays during transform (#48490) 2022-03-30 15:33:51 -07:00
Adam Foxman
41aca7c337
Add a new compiler option moduleSuffixes to expand the node module resolver's search algorithm (#48189)
* Add moduleSuffixes compiler option and related tests. Update baselines for compiler options tests.

* Add a flag to the command-line parser which allows "list" params to preserve "falsy" values such as empty strings. Falsy values are normally stripped out.

* Add tests. Rework resolver logic to only run module-suffix code when needed.

* PR feedback

* Add test

* Remove unnecessary conditional.
2022-03-30 15:23:26 -07:00
Oleksandr T
c639d3afb9
feat(27615): Add missing member fix should work for type literals (#47212) 2022-03-30 12:55:18 -07:00
Gabriela Araujo Britto
f57bdaa097
Add label details to completion entry (#48429)
* add label details to completion entry

* Use label details for obj literal method completions

* add label details support flag

* add label details support to fourslash

* support both label details and non-label details in object literal method snippets

* CR fixes

* fixes after rebasing

* fix tsserver tests
2022-03-30 12:45:56 -07:00
Gabriela Araujo Britto
e25f04a30f
Enable method signature completion for object literals (#48168)
* skeleton of new feature

* working prototype

* refactor print and format code into its own function

* minor changes; don't support overloads

* have two completion entries

* get rid of accessor support

* add snippet support

* add formatting

* add trailing comma

* add sourcedisplay

* support auto-imports via completion details

* add user preference option and fix ordering of entries

* cleanup

* don't return code actions for no import fixes

* make sortText lower priority for snippets

* get rid of flag

* use optional member sort text

* update baselines

* don't collect method symbols if insert text is not supported

* remove comment

* return undefined if type is not function type

* only slice if needed

* use union reduction; more test cases

* WIP: modify sort text system

* Improve new sort text system

* add signature and union type check

* re-add flag

* fix tests

* rename sort text helper

* fix test and code for union case

* add new flag to protocol type

* fix spaces

* CR: minor fixes

* CR: more fixes

* CR: restructure main flow

* minor fix
2022-03-29 17:19:02 -07:00