33567 Commits

Author SHA1 Message Date
navya9singh
3cade4ca24 String.prototype.replace docs fix.
Co-authored-by: graphemecluster <graphemecluster@gmail.com>
2022-07-25 11:53:20 -07:00
TypeScript Bot
a179e910dd Update package-lock.json 2022-07-25 06:06:48 +00:00
Anders Hejlsberg
4026c6fd80
Properly handle null and undefined in getCommonSupertype (#50021)
* Properly handle null and undefined in getCommonSupertype

* Add tests

* Add more tests
2022-07-24 08:09:14 -07:00
Alex Hsu
165a1c4a40
LEGO: Merge pull request 50024
LEGO: Merge pull request 50024
2022-07-24 03:31:04 -07:00
Jake Bailey
966e732ed4
Remove uses of visitNodes and visitNode in visitEachChild (#49992) 2022-07-22 19:35:39 -07:00
Andrew Branch
6aefc1dcea
More fixes to uncalled function checks in && expressions (#49868) 2022-07-22 16:06:16 -07:00
Jake Bailey
4e23f515e0
Protect watcher from double close (#49990) 2022-07-22 13:32:16 -07:00
Oleksandr T
455ea9b41f
fix(49964): handle auto-import dependencies/omit duplicate constraints (#50004) 2022-07-22 11:01:43 -07:00
Armando Aguirre
7b764164ed
Fixed closing JSDoc when adding multiple blocks (#49888)
* Fixed closing JSDoc when adding multiple blocks

* Fixed linting errors

* Refactored to use `some`

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>

* Removed empty lines

Co-authored-by: Armando Aguirre <araguir@microsoft.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-07-21 13:16:40 -07:00
Oleksandr T
5d2e62a810
fix(49854): fix start index to emit statements after super (#49858) 2022-07-20 16:02:30 -07:00
Oleksandr T
5702941c2f
fix(49719): Incorrect error 2301 when using ES standard class properties (#49725)
* fix(49719): omit TS2301 error with enabled usedefineforclassfields

* show error for target lower than esnext with useddefineforclassfields enabled

* change target from esnext to es2022
2022-07-20 14:36:35 -07:00
Nathan Shively-Sanders
2f51a9e859
Update DOM lib for 4.8 RC (#49976) 2022-07-20 11:37:57 -07:00
TypeScript Bot
2644fb0b5c Update package-lock.json 2022-07-20 06:07:22 +00:00
Oleksandr T
f6ac10958f
fix(49704): Code folding not working in file with simple syntax error (#49743)
* fix(49704): parse type arguments in super call expression

* omit duplicate errors
2022-07-19 16:26:56 -07:00
Nathan Shively-Sanders
7f3ca9f8f7
Copy type parameters to function with @type tag (#49960)
* Copy type parameters to function with @type tag

Previously, type references to generic types would fail to copy type
parameters from type references in an `@type` tag. Now the type
parameter is copied.

Note that I left 3 places in the checker unchanged, even though they
should technically also get type parameters from type refereneces:

1. getOuterTypeParameters -- not fixing this means that nested function
still won't get instantiated correctly. I'll see how hard this is to
fix.
2. getLocalTypeParameterOfClassOrInterfaceOrTypeAlias -- only applies to
constructor functions which have a type annotation, which doesn't type
check in the first place.
3. isThislessType -- This function is conservative, so should be
possible to make it more conservative without writing a lot of code.

Fixes #49039

* Update API baselines
2022-07-19 15:40:53 -07:00
Jake Bailey
aba867d15a
Clean up inference of type parameters, contravariant types (#49915) 2022-07-19 15:30:48 -07:00
Andrew Casey
8402d657ab
Document order-dependence of isLocal flag (#49959) 2022-07-19 14:38:35 -07:00
Oleksandr T
5a53e9bb5e
fix(49838): "Extract function" refactoring action is disabled for a wrong reason (#49840)
* fix(49838): allow extracting functions with a break statement inside loop context

* remove useless flag

* add more tests
2022-07-19 13:06:45 -07:00
TypeScript Bot
298b3a432c Update package-lock.json 2022-07-19 06:08:11 +00:00
Jake Bailey
05d20760af
Don't leak EvolvingArray out of code flow (#49943) 2022-07-18 19:00:18 -07:00
Oleksandr T
3863cc4a20
feat(49786): show completions in expression with type arguments (#49810) 2022-07-18 14:55:15 -07:00
Oleksandr T
91f7cfc501
fix(49392): show optional class methods with enabled strict option (#49768) 2022-07-18 14:49:13 -07:00
Zzzen
efbe03a33c
check base constraint when checking operand of plus (#49918) 2022-07-18 09:42:50 -07:00
TypeScript Bot
aa2b2352e1 Update package-lock.json 2022-07-18 06:06:43 +00:00
TypeScript Bot
481357a4c8 Update package-lock.json 2022-07-16 06:06:22 +00:00
Anders Hejlsberg
2c68ded954
Improve narrowing logic for instanceof, type predicate functions, and assertion functions (#49625)
* Improve narrowing logic for instanceof, type predicates, and assertions

* Accept new baselines

* Add tests

* Tweak algorithm

* Accept new baselines

* Optimize for discriminated unions
2022-07-15 14:01:55 -10:00
TypeScript Bot
4f29633934 Update package-lock.json 2022-07-15 06:06:35 +00:00
Jake Bailey
cf3af3febd
Properly propagate ObjectFlags.NonInferrableType, clean up non-inferrable code paths (#49887) 2022-07-14 18:33:09 -07:00
Gabriel Grubba
4902860302
Fix(49472): Added docs for Set and Map types (#49522)
* wip: started map object

* Feat: Added docs on collection objects

* Accepted baselines.

* Accepted baselines.

* fix: removed unecessary comments

* Adjusted JSDocs as requested

* fix: adjusted more comments

* fix: removed params without description
2022-07-14 16:59:05 -07:00
Mateusz Burzyński
cd3bd5522b
Fixed an issue with generic naked T not being allowed as async generator's return (#49023) 2022-07-14 15:51:03 -07:00
Nathan Shively-Sanders
a21024dbe7
Delete unused code in object literal binding (#49879)
It doesn't do anything anymore. I'm not sure what it used to do; it's
been there basically forever.
2022-07-14 13:22:14 -07:00
TypeScript Bot
bb913f8340 Update package-lock.json 2022-07-14 06:06:42 +00:00
Mateusz Burzyński
2ef3901940
Fixed initializaiton-time inference for class properties assigned through element access (#49374) 2022-07-13 14:43:23 -07:00
TypeScript Bot
6aad28f174 Update package-lock.json 2022-07-13 06:08:21 +00:00
Babak K. Shandiz
8e6e87fea6
🐛 Fix smart selection of propery signatures having JSDoc comments (#49804)
* 🐛 Avoid grouping JSDoc nodes of propery signatures with others in smart selection

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>

* ⚗️ Add test case for JSDoc smart selection (#39618)

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>

* ⚗️ Add test baseline for JSDoc smart selection (#39618)

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>

* 🐛 Fix skipping SyntaxList first child's JSDoc in smart selection

Signed-off-by: GitHub <noreply@github.com>

* ⚗️ Add tests to ensure not skipping first SyntaxList child's JSDoc

Signed-off-by: GitHub <noreply@github.com>

* 🔨 Exclude JSDoc token from tokens pivoting property signature

Signed-off-by: GitHub <noreply@github.com>

* ⚗️ Update test case to also include modifier

Signed-off-by: GitHub <noreply@github.com>

* ⚗️ Update test case reference baseline

Signed-off-by: GitHub <noreply@github.com>
2022-07-12 09:04:21 -07:00
TypeScript Bot
12600813e2 Update package-lock.json 2022-07-12 06:07:59 +00:00
Andrew Branch
695b24d187
Move DebugTypeMapper to debug.ts (#49864)
* Move DebugTypeMapper to debug.ts

* export `DebugType`
2022-07-11 13:25:33 -07:00
TypeScript Bot
1622247636 Update package-lock.json 2022-07-09 06:07:13 +00:00
TypeScript Bot
28dc248e5c Update package-lock.json 2022-07-08 06:07:03 +00:00
Anders Hejlsberg
c2897189cb
Defer types like keyof (T & {}) (#49696)
* 'keyof undefined' and 'keyof null same as 'keyof never'

* Update tests

* Defer types like `keyof (T & {})`

* Restore test

* Update test

* Accept new baselines

* Add tests
2022-07-07 11:54:22 -10:00
Anders Hejlsberg
2eaf49f56e
Handle pseudo-references in getFlowCacheKey (#49828)
* Handle pseudo-references in getFlowCacheKey

* Add tests

* Accept new baselines
2022-07-07 11:53:30 -10:00
Andrew Branch
9dde56c6fc
Add path completions for package.json exports with wildcards (#49644)
* Support path completions for exports wildcards

* Break up results by directory

* Share code between typesVersions and exports processing

* Revert completion kind change

* Add kinds to tests

* Update existing test

* Support nested conditions, improve recursive globbing
2022-07-07 12:26:18 -07:00
Mateusz Burzyński
fefe2208f4
Fixed outdated expectation comments (#49691) 2022-07-07 11:45:52 -07:00
AlCalzone
f6684be95e
fix: correct name length criterion for spelling fixes (#49575)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
2022-07-07 09:08:37 -07:00
Jake Bailey
59238dbf90
Make contextFlags an explicitly required parameter (#49720) 2022-07-06 16:11:39 -07:00
Oleksandr T
8ae1e9e7c7
fix(49685): omit incorrect visibility error when setter precedes getter (#49697) 2022-07-06 15:59:05 -07:00
Oleksandr T
7584e6aad6
fix(49642): resolve JsDoc comments/tags if accessors exist in symbol declarations (#49654) 2022-07-06 15:41:50 -07:00
Jake Bailey
94a65769d4
Add debug format helpers for more enums (#49732) 2022-07-06 15:35:57 -07:00
Wesley Wigham
9872184483
Remove dependence on module compiler option to consider mts/cts files always modules (#49815) 2022-07-06 13:26:36 -07:00
Wesley Wigham
eb430f27ea
More documentation on the impliedNodeFormat SourceFile field (#49816) 2022-07-06 13:25:58 -07:00