Commit graph

31832 commits

Author SHA1 Message Date
Ron Buckton 38fdce9440
Expose 'reservedInNestedScopes' option when creating temp and loop variables (#43083) 2021-03-04 15:37:45 -08:00
Nathan Shively-Sanders e234f0c094
Update the DOM: March 03, 2021 (#43070)
* Update the DOM: March 03, 2021

Mostly Typescript-DOM-lib-generator#915

* update baselines
2021-03-04 06:28:00 -08:00
Daniel Rosenwasser 1f6a8d7aee
Do a shallow clone for Docker tests. (#42966)
* Do a shallow clone for docker tests.

* Remove the 'pull' step from the Docker files.
2021-03-03 22:35:48 -08:00
TypeScript Bot 3e05aa6f0d Update package-lock.json 2021-03-04 06:23:49 +00:00
Klaus Meinhardt 15e69acc20
capture thisArg of optionalChaining in parens (#35494)
Fixes: #35476
2021-03-03 19:35:17 -08:00
Armando Aguirre 8a81a6722d
Merge pull request #43055 from armanio123/FixDefineForClassFields
Filter transient flags to fix useDefineForClassFields
2021-03-03 15:38:41 -08:00
Klaus Meinhardt 7751ecb544
fix receiver on calls of imported and exported functions (#35877)
* fix receiver of imported and exported functions

fixes: #35420

* Rebase against master and clean up substitution flow

* Add evaluator tests

* Fix evaluator tests

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
2021-03-03 10:38:32 -08:00
TypeScript Bot a8742e35cb Update package-lock.json 2021-03-03 06:24:15 +00:00
Armando Aguirre 652199ace6 Added tests 2021-03-02 20:38:37 -08:00
Nathan Shively-Sanders 6cd87d00b3
Delete old, different-case name of quickInfoJSDocTags.baseline (#43052) 2021-03-02 17:43:20 -08:00
Sheetal Nandi 0cf834ceec
Move fixed chunk size polling as a watch option and move it out of server (#42542)
* Move fixed chunk size polling as a watch option and move it out of server
Fixes #41549

* Feedback
2021-03-02 16:45:53 -08:00
Nathan Shively-Sanders 5dbb110497
Baseline completions and signature help (#43049)
* Initial implementation+first big transitions

* about 10 more

* Change baseline filename + more baselines

1. Use containing file name instead of first @Filename.
2. Switch the rest of the tests I need for @link over to baselines.

* fix lint

* Remove unused/incorrectly named fourslash baselines

* fix incorrectly updated baselines

* dedupe non-unique filenames

* Add names to marker baselines

Also rename another duped test filename.

* Fix semicolon lint
2021-03-02 16:33:32 -08:00
Oleksandr T f1c911b6c6
fix(43006): skip trivia in a function name (#43021) 2021-03-02 16:32:28 -08:00
Nathan Shively-Sanders c497b487a7
Add undefined to Symbol.valueDeclaration (#43033)
* About halfway through the checker

I'm going to merge with master to avoid clashing with the declaration
fix.

* Add undefined to Symbol.valueDeclaration

Also add undefined to a number of utility functions that have always
accepted it, but never added it to their type.

* Fix lint from code review

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>

* remove obsoleted fix from inferFromUsage

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2021-03-02 12:36:26 -08:00
Zen 3d1c6e8f2f
fix(42765): require should not work in ts files (#42792)
* add failing test

* fix(42765): require should not work in ts files
2021-03-02 06:54:31 -08:00
pushkine 0b337f12b5
Update project.ts (#42900) 2021-03-02 06:37:22 -08:00
Suryadevelops 82de139b97
Fixed typo error. (#42816)
* Fixed three typo errors

* Reverted

* Reverted

* Fixed typo
2021-03-02 06:36:31 -08:00
pushkine 2834737bc1
typo (#42899)
* Update editorServices.ts

* Fix baselines

Co-authored-by: Orta <git@orta.io>
2021-03-02 06:35:11 -08:00
TypeScript Bot 2b95b5edf9 Update package-lock.json 2021-03-02 06:24:00 +00:00
Andrew Branch 56f95d2a3f
Only filter ignored paths from module specifier generation if there exists a better option (#43024)
* Only filter ignored paths from module specifier generation if there exists a better option

* Nit
2021-03-01 16:12:03 -08:00
Andrew Branch 4b67b4a7bc
Support go-to-definition for imports of arbitrary files (#42539)
* Support go-to-definition for imports of scripts and arbitrary files

* Support go-to-definition for non-existent files

* Add missing file property

* Use `isExternalModuleNameRelative` instead of `!pathIsBareSpecifier`

* Add partial semantic test

* Combine with symbol search for non-source-file file references

* Fix and accept API baselines

* Fix useless or

* A definition is unverified if the file path was a guess, even if a source file has that path
2021-03-01 15:15:09 -08:00
Nathan Shively-Sanders aa67b16e99
Add undefined to Symbol.declarations' type (#42975)
* Add undefined to Symbol.declarations' type

Symbol.declarations now has type `Declaration[] | undefined`.

I made a mistake somewhere in the checker related to JS checking, so
there are quite a few test failures right now.

* undo clever change to getDeclaringConstructor

* Address PR comments

1. More early-returns.
2. More line breaks.
2021-03-01 14:32:28 -08:00
Daniel Rosenwasser 2a49cf7d3c
Update package-lock.json. (#43028) 2021-03-01 13:46:45 -08:00
Andrew Branch 993c503c84
Add 'data' property to completion entry for better coordination between completions and completion details (#42890)
* Add 'data' property to completion entry for better cooperation between completions and completion details

* Add doc comment

* Update API baselines

* Add server test

* Test session’s Full result

* Fix tests

* stableSort to fix server fourslash test

* Explicit verification of data parameter
2021-03-01 12:09:45 -08:00
Andrew Casey 41b5abf342
Tracing: dump more information about types (#42962)
* Tracing: dump more info about substitution types

* Tracing: dump more info about reverse-mapped types

* Tracing: dump more info about destructuring types

* Tracing: dump more info about evolving-array types

* Tracing: dump more info about tuple types

* Tracing: dump more info about type references

* Fix lint errors

* Tracing: extract getLocation helper
2021-03-01 09:22:15 -08:00
TypeScript Bot c44b3ba223 Update package-lock.json 2021-03-01 06:24:38 +00:00
Anders Hejlsberg ef2c98fc35
Optimize checking involving large discriminated union types (#42556)
* No array literal subtype reduction when contextual type is present

* Accept new baselines

* Fast path in relations and filtering of pure discriminated union types

* Create maps for mixed unions, but not for small or primitive only unions

* Create many-to-many mapping with certain limits, also use in CFA

* Use constituent maps in CFA for switch statements, cleanup, add comments

* Revert change to apparent contextual type / better criteria for map eligibility

* Deduplicate array literal element types

* Accept new baselines

* Filter in false case only when discriminant property has unit type

* Only subtype reduce unions with less than 100 distinct types

* Accept new baselines

* Caching and quick discriminant checks in subtype reduction

* Accept new baselines

* Remove deduplication logic now that subtype reduction was optimized
2021-02-28 16:38:20 -08:00
TypeScript Bot 1db60035d6 Update package-lock.json 2021-02-28 06:23:59 +00:00
TypeScript Bot 3821ef011a Update package-lock.json 2021-02-27 06:23:38 +00:00
Andrew Branch 3c32f6e154
Fix preserveSourceNewlines sibling node comparison (fixes extra newlines in organize imports) (#42630)
* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* More sophisticated check for source position comparability

* Fix organize imports by looking at the nodes positions

* Rollback formatting changes

* Added tests, fixed organizeImports algorithm

* Fix autoformatting again

* Make sibling node comparison work for all lists

* Don’t run siblingNodePositionsAreComparable at all unless `preserveSourceNewlines` is true

* Move getNodeAtPosition back

* Optimize

* Use node array index check instead of tree walk

* Revert unneeded change

Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
Co-authored-by: Armando Aguirre <armanio123@outlook.com>
2021-02-26 10:37:51 -08:00
Ron Buckton 68b0323b72
Refactor emit substitution into transform (#42676)
* Refactor emit substitution into transform

* Add reusable state machine for binary expressions

* Allow emitBinary to use state machine for comments/sourcemaps

* Switch core trampoline state back to arrays

* Switch binder to parallel stacks, temporarily partially revert emitBinary

* Add link to benchmark when posting perf results

* Ensure work stacks are per-execution

* Reenable comments and sourcemaps
2021-02-25 23:01:41 -08:00
Daniel Rosenwasser df5ffc0ea1
Remove special any assignability for numeric index signatures (#41660)
* Only enable special assignability rule on string index signatures to 'any'.

* Accepted baselines.

* Added test.

* Accepted baselines.

* Renamed test files.

* Add non-erroring version of bclas'subClassThisTypeAssignable01.ts'

* Accepted baselines.

Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
2021-02-25 17:36:09 -08:00
Nathan Shively-Sanders 2c5cee59f0
Fix: checkAliasSymbol crash when checking for @deprecated (#42971)
* Fix: checkAliasSymbol crash when checking for @deprecated

It's possible that we shouldn't be creating symbol with no declarations
from non-homomorphic mapped types, but for 4.2, the right fix is to make
the @deprecated-check in checkAliasSymbol ensure that
target.declarations is defined.

* Add bug number and accept baselines
2021-02-25 16:26:16 -08:00
Anders Hejlsberg ccdd688e4f
Properly handle duplicate enum types in type inference (#42943)
* Ensure no duplicates in named union list

* Add regression test
2021-02-25 13:54:14 -08:00
Orta Therox a2f09ed4fc
Expose EncodedSemanticClassificationsRequest in protocol.d.ts (#42640)
* Expose EncodedSemanticClassificationsRequest in protocol.d.ts

* Adds the response for encoded semantic highlights too

* Update types:

* Also include classificationtype anyway

* Fix feedback
2021-02-25 21:40:52 +00:00
Wesley Wigham 576bfbd9d5
Use yarn resolutions to inject nightly TS version across whole workspace in fabric test (#42961) 2021-02-25 11:12:09 -08:00
pushkine fc64b77b52
Update editorServices.ts (#42951) 2021-02-25 09:00:08 -08:00
Wesley Wigham 3b35522fd0
Type lookup in getIntrinsicAttributestypeFromJsxOpeningLikeElement should match getIntrinsicTagSymbol (#42819) 2021-02-24 22:36:04 -08:00
TypeScript Bot 5c0b8391c4 Update package-lock.json 2021-02-25 06:24:19 +00:00
Armando Aguirre 5c5d374b8d
Merge pull request #42904 from a-tarasyuk/fix/42339
fix(42339): "import" missing in transpiled code when variable typed as `unknown`
2021-02-24 18:25:53 -08:00
Armando Aguirre 0791bb0f84
Merge pull request #42332 from a-tarasyuk/fix/42259
fix(42259): Outline and breadcrumb show wrong namespace name
2021-02-24 17:35:36 -08:00
Oleksandr T 896a2b49ac
fix(42923): add go-to-definition on unresolved shorthand properties (#42924) 2021-02-24 10:53:27 -08:00
Sheetal Nandi 5f5437af66
Do not cache directory structure for symlinked directories (#42868)
Fixes #42839
2021-02-24 09:51:19 -08:00
TypeScript Bot 26bbdf1173 Update package-lock.json 2021-02-24 06:23:58 +00:00
Andrew Branch 56cf2e68e8
Never-reducing intersections are not untyped function call targets (#42917)
* Never-reducing intersections are not untyped function call targets

* Don’t attempt to reduce union types
2021-02-23 17:22:41 -08:00
Wesley Wigham 8d58c8d90b
Base signatures resolve only the type parameters local to the signature, not all type parameters (#42703) 2021-02-23 16:17:57 -08:00
Wesley Wigham 6da262591c
Bail when comparing a specialized form of an already ongoing comparison (#42727)
* When structurally comparing similar types, check if we are already in the middle of a more general comparison of those same types

* Do the same, but with only string manipulations
2021-02-23 16:13:59 -08:00
Sheetal Nandi c117c266e0
Refactor to simplify project references tsc-watch and tsserver tests (#42926) 2021-02-23 11:27:16 -08:00
Andrew Branch 2a01f923ca
Improve JSON parser error recovery (#42657)
* Improve JSON parser error recovery

* Add error baselines

* Move tsconfig root checking out of common JSON checking function

* Use new function in parseConfigFileTextToJson

* Fix test

* Replace non-null assertion with explicit debug assertion
2021-02-23 09:31:09 -08:00
Oleksandr T 9de8dbbfb8
fix(42833): add return type to methods with overloads (#42881) 2021-02-23 14:24:47 +00:00