Commit graph

32764 commits

Author SHA1 Message Date
Oleksandr T 1b6c8fd072
fix(45607): add snippet for type only import statements (#45873) 2021-09-23 16:13:17 -07:00
Orta Therox 61d2939359
Adds more Intl.ResolvedDateTimeFormatOptions, and hooks up Intl for ES2021 (#45905)
* Adds more ResolvedDateTimeFormatOptions to the Intl APIs

* Fix tests
2021-09-23 21:33:37 +01:00
Anders Hejlsberg a4f9bf0fce
Create type aliases for unresolved type symbols (#45976)
* Create type aliases for unresolved type symbols

* Accept new baselines

* Update fourslash tests

* Unresolved import aliases create tagged unresolved symbols

* Add comments

* Accept new baselines

* Add fourslash tests
2021-09-23 13:21:27 -07:00
Andrew Branch 039672332f
Revert "Stop looking at binding patterns for type argument inference" (#46013)
* Revert "Stop looking at binding patterns for type argument inference (#45719)"

This reverts commit be618b1446.

* Update error baseline for moved lib file declaration
2021-09-23 09:26:51 -07:00
TypeScript Bot efbce1099c Update package-lock.json 2021-09-23 06:06:09 +00:00
Ron Buckton 4c0a51e14b
Avoid Promise<Awaited<T>> in return type inference (#45925) 2021-09-22 16:29:07 -07:00
csigs 12f72caaa5
LEGO: Merge pull request 46014
LEGO: Merge pull request 46014
2021-09-22 16:14:11 -07:00
Armando Aguirre 24e3b6bf59
Added Jsx Snippet Completion feature (#45903)
* Added Jsx completion feature and tests

* Renamed jsxSnippetCompletion to jsxAttributeCompletionStyle

* Renamed tests files

* Changed boolean filter

* Escaped snippet
2021-09-22 16:09:00 -07:00
Nathan Shively-Sanders f0fe1b88ca
Make isDefinition aware of declaring symbol (#45920)
* Make isDefinition aware of target symbol

Initial code, haven't fixed any tests yet.

* Update baselines

This commit includes a regression for commonjs aliases:

```js
// @filename: a.js
function f() { }
module.exports.f = f

// @filename: b.js
const { f } = require('./a')
f/**/
```

Now says that `f` in b.js has 1 reference --
the alias `module.exports.f = f`. This is not correct (or not exactly
correct), but correctly fixing will involve re-creating the ad-hoc
commonjs alias resolution code from the checker. I don't think it's
worth it for an edge case like this.

* update more unit tests

* Fix symbol lookup for constructors

* More baselines + two fixes

1. Fix `default` support.
2. Add a secondary declaration location for commonjs assignment
declarations.

* Update rest of baselines

* Switch a few more tests over to baselines
2021-09-22 13:43:52 -07:00
Hossein 110b05987e
Fix GH-32798: Allow == null to narrow unknown to null | undefined (#45853)
* Fix GH-32798

* add assume true

* Address Gabby comments

* Address Gabby comments by adding Else branch
2021-09-22 10:54:59 -07:00
csigs 5a9e1af7de
LEGO: Merge pull request 46008
LEGO: Merge pull request 46008
2021-09-22 10:13:57 -07:00
csigs 9f12799b08
LEGO: Merge pull request 46002
LEGO: Merge pull request 46002
2021-09-22 04:15:23 -07:00
TypeScript Bot 6495544770 Update package-lock.json 2021-09-22 06:06:27 +00:00
Nathan Shively-Sanders 15722e6b64
Remove referenceGroups/noReferences from fourslash (#45988)
* Remove referenceGroups/noReferences from fourslash

I left most singleReferenceGroups because there were so many, and my current
PR doesn't affect many of them.

* update fourslash/server too

* Explicitly sort keys

Needed for node 10 compatibility

* Revert "Explicitly sort keys"

This reverts commit 1d1c58a4e3.
It shouldn't be needed now that we're not testing with node 10
2021-09-21 16:25:52 -07:00
csigs 826b6148dc
LEGO: Merge pull request 45997
LEGO: Merge pull request 45997
2021-09-21 16:18:34 -07:00
Nathan Shively-Sanders f30ab60579
Update github workflows node10 -> node16 (#45996) 2021-09-21 16:00:09 -07:00
Oleksandr T 9b3ba871fb
fix(45987): fix pasring invalid names (#45994) 2021-09-21 14:02:58 -07:00
csigs 252620b956
LEGO: Merge pull request 45989
LEGO: Merge pull request 45989
2021-09-21 10:13:58 -07:00
Eli Barzilay 3a8591b544 Fix const assertions on enums
Fixes #45977
2021-09-21 12:42:28 -04:00
TypeScript Bot 5546f207c5 Update package-lock.json 2021-09-21 06:06:18 +00:00
Ikko Ashimine c6f9732857
Fix typo in findAllReferences.ts (#45973)
occurences -> occurrences
2021-09-20 17:13:38 -07:00
Oleksandr T 15a46bb72d
fix(45489): add test to cover comparison operator with intersection type (#45936) 2021-09-20 16:35:55 -07:00
Wenlu Wang ec114b8931
Import assertion (#40698)
* Add parsing

* fix all api

* check gramma of import call

* Add more part of assertion

* Add some case

* Add baseline

* use module insted of target

* strip assertion in d.ts

* Update new baseline

* accept baseline

* Revert error number changes

* Update diagnostic message

* Accept baseline

* rename path

* Fix cr issues

* Accept baseline

* Accept baseline

* Error if assertion and typeonly import

* Accept baseline

* Make lint happy

* Add some comment

* Fix cr issues

* Fix more issue

* Incorporate PR feedback, fix module resolution for import()

* Add contextual type and completions for ImportCall options argument

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
2021-09-20 14:15:22 -07:00
Hiroshi Ogawa 5ef043987a
fix(45802): keep children of mismatched jsx element (#45839)
* fix(45802): keep children of mismatched jsx element

* Apply suggestions from code review

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

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-09-20 07:19:55 -07:00
TypeScript Bot 78472ec14c Update package-lock.json 2021-09-20 06:06:11 +00:00
csigs 285c0e2dcb
LEGO: Merge pull request 45947
LEGO: Merge pull request 45947
2021-09-17 16:17:42 -07:00
Armando Aguirre 8346143450
Fixed trimming comments on the remaining range (#45807)
* Fixed trimming comments on the remaining range

* Added test
2021-09-17 14:00:04 -07:00
csigs 3c27c3a5ca
LEGO: Merge pull request 45940
LEGO: Merge pull request 45940
2021-09-17 10:19:02 -07:00
csigs 3a4b19cdbf
LEGO: Merge pull request 45935
LEGO: Merge pull request 45935
2021-09-17 04:18:16 -07:00
csigs dfc6d7c08c
LEGO: Merge pull request 45931
LEGO: Merge pull request 45931
2021-09-17 03:37:55 -07:00
TypeScript Bot eda142e0ad Update package-lock.json 2021-09-17 06:06:23 +00:00
Ron Buckton b23f44aee5
Simplify a branch of the Awaited type and clean up comments (#45918) 2021-09-16 15:04:09 -07:00
Jack Bates 6aaefe41fe
Remove vestigial baselines (#45916)
* Remove vestigial baselines

* Update Baselines and/or Applied Lint Fixes

* Add --quiet

Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
2021-09-16 12:49:47 -07:00
Oleksandr T 534fc14c66
fix(45850): Preserve const enums should keep import refs for exported const enums exported via named exports (#45858) 2021-09-16 10:15:41 -07:00
csigs b2a6b49201
LEGO: Merge pull request 45914
LEGO: Merge pull request 45914
2021-09-16 10:13:44 -07:00
Orta Therox b250f0c85f
Fix main by using '.default' on the new ms release (#45910)
* Fix main by using '.default' on the new ms release

* Lock to v2

* Update v1 lockfile

* Revert code change
2021-09-16 09:52:54 -07:00
Justin Brown f7a80029a3
Fix for resolvedTrueType and resolvedFalseType of conditionType not resolved (#45838)
* Fix for Issue #45537

* tests/baselines/reference/* files updated
2021-09-16 09:26:43 -07:00
Orta Therox a4364dcc62
Update pr_owners.txt (#45911) 2021-09-16 09:20:00 -07:00
TypeScript Bot 4dde5cc4f1 Update package-lock.json 2021-09-16 06:06:02 +00:00
csigs d16ece0a44
LEGO: Merge pull request 45904
LEGO: Merge pull request 45904
2021-09-15 22:13:36 -07:00
csigs a42fcf23f0
LEGO: Merge pull request 45895
LEGO: Merge pull request 45895
2021-09-15 16:13:23 -07:00
Kevin Tan add85e1828
fix: add corresponding message for override error in js files (#45656)
* fix: add override errors for js class members

* fix: test failures of js override error message

* update diagnostic messages

* fix: test errors

* fix: lint errors
2021-09-15 15:19:58 -07:00
Orta Therox b2f9432c40
Support resolving @typescript/[lib] in node modules (#45771)
* Support resolving @typescript/x for libs

* Baselines

* Tightens up the PR

* Fix the build

* Add cache

* Better naming

* Fixes the lookup path
2021-09-15 21:25:08 +01:00
Orta Therox 7cba51947a
Go back to the old spelling of NumberFormatPartTypes to not break DT (#45889) 2021-09-15 18:21:39 +01:00
csigs 61ddc518ef
LEGO: Merge pull request 45892
LEGO: Merge pull request 45892
2021-09-15 10:14:24 -07:00
TypeScript Bot c620266c87 Update package-lock.json 2021-09-15 06:05:55 +00:00
Oleksandr T 40fa0c9f11
fix(44880): allow narrowing aliased conditions for catch variables (#45797) 2021-09-14 10:05:36 -07:00
Hiroshi Ogawa 4f8aa5239e
feat(45679): support 'did you mean' diagnostics for string literal union (#45723)
* feat(45679): support 'did you mean' diagnostics for string literal union

* Format suggested type with `typeToString`

* Address feedback
2021-09-14 08:53:36 -07:00
TypeScript Bot 8523ac8bc9 Update package-lock.json 2021-09-14 06:10:48 +00:00
Orta Therox 2eecb3d954
Adds back NumberFormatPartType to the global types from intl (#45843) 2021-09-13 20:02:38 +01:00