Commit graph

30755 commits

Author SHA1 Message Date
csigs bf128ed7c9 LEGO: check in for master to temporary branch. 2020-06-26 04:10:37 +00:00
Wenlu Wang 6b4d0bff40
Avoid effect of element access expression (#39174)
* Avoid effect of element access expression

* Avoid unnecessary copy

* Add more tests
2020-06-25 17:38:05 -07:00
Ron Buckton d610bbdaef
Update typescript-eslint to 3.4.1-alpha.1 (#39260) 2020-06-25 14:38:43 -07:00
Anders Hejlsberg ee4aee0531
Handle 'keyof' for generic tuple types (#39218)
* Handle keyof T where T is generic tuple type

* Add tests

* Accept new baselines

* Address CR feedback

* Accept new baselines
2020-06-25 13:49:20 -07:00
Anders Hejlsberg 8df85b5cae
Disable unsound T[K] rule in subtype relations (#39249)
* Disable unsound T[K] rule in subtype relations

* Add test
2020-06-25 10:22:48 -07:00
csigs 04509c6f56
LEGO: Merge pull request 39257
LEGO: Merge pull request 39257
2020-06-25 09:11:33 -07:00
csigs 4eea47e830 LEGO: check in for master to temporary branch. 2020-06-25 16:10:42 +00:00
Ron Buckton cc7cb9eadb
Upgrade typescript-eslint version (#39242)
* Upgrade typescript-eslint version

* Update TS version used by typescript-eslint
2020-06-24 16:43:03 -07:00
Wesley Wigham a3ee09ddc9
Handle recursive type references up to a certain level of expansion in inference (#38011)
* Handle recursive type references up to a certain level of expansion in inference

* Move object cases into the same conditional branch
2020-06-24 14:24:34 -07:00
Wesley Wigham d1ebf126d2
Do not consider binding patterns in contextual types for return type inference where all the signature type parameters have defaults (#39081) 2020-06-24 13:45:17 -07:00
csigs 785e44704c
LEGO: Merge pull request 39233
LEGO: Merge pull request 39233
2020-06-24 09:11:35 -07:00
csigs 038f0115c6 LEGO: check in for master to temporary branch. 2020-06-24 16:10:43 +00:00
Wesley Wigham 7893c9fc7e
Do not add reexported names to the exportSpecifiers list of moduleinfo (#39213) 2020-06-23 17:56:44 -07:00
TypeScript Bot 5d9b7855c7
Update user baselines (#39214)
Co-authored-by: typescript-bot <typescript@microsoft.com>
2020-06-23 17:47:46 -07:00
Ron Buckton 0b1d4a9c96
Leverage syntax cursor as part of reparse (#39216) 2020-06-23 17:32:58 -07:00
Ron Buckton fbd1c958e5
Update failed test tracking to support Mocha 6+ (#39211)
* Update failed test tracking to support Mocha 6+

* grep should not be an array
2020-06-23 15:19:30 -07:00
TypeScript Bot 964e47415f
Update user baselines (#39196)
Co-authored-by: typescript-bot <typescript@microsoft.com>
2020-06-23 14:26:30 -07:00
csigs 9f70d498f2
LEGO: Merge pull request 39203
LEGO: Merge pull request 39203
2020-06-22 21:11:29 -07:00
csigs 906d2172c9 LEGO: check in for master to temporary branch. 2020-06-23 04:10:38 +00:00
Anders Hejlsberg d4792062bf
Variadic tuple types (#39094)
* Initial implementation of variadic tuple types

* Accept new baselines

* Handle variadic elements in tuple type inference

* Special case inference between tuples with matching structure

* Restore check that rest element is last element

* Handle variadic tuples in relationship checking

* Accept new baselines

* Infer readonly constraints when inferring from readonly tuples

* Fix lint issues

* T assignable to readonly [...T] and [...T] assignable to T

* Consistent tuple normalization

* Create variadic tuple types from array literal expressions

* Accept new baselines

* Array literals have tuple types when contextual type is readonly

* Accept new baselines

* Optional elements before required elements become required elements

* Update logic for rest parameters and spread arguments

* Revert special case of contextual readonly array type

* Accept new baselines

* Fix lint issue

* Switch entirely to createTupleType based on element flags

* Don't infer readonly tuple types when inferring to variadic elements

* Handle mapped types applied to generic tuple types

* Handle constraint of indexed access type with generic tuple type

* Accept new baselines

* Address CR feedback

* Simplify indexed access types involving generic tuple types

* Propagate checkMode into getSpreadArgumentType

* Guard against missing globalArrayType

* Inference to [...T, ...U] based on implied arity of T

* Accept new baselines

* Add tests

* Emit .d.ts from tests

* Address CR feedback
2020-06-22 18:35:43 -07:00
Daniel Rosenwasser e6aedfd38b
Merge pull request #37907 from Jack-Works/feat/class-to-classname
feat: add a codefix to fix class to className in react & add spelling suggest for JSX attributes
2020-06-22 18:32:24 -07:00
Daniel Rosenwasser 0476a1aba7
Merge pull request #39112 from microsoft/lego/hb_998_20200617161036026
LEGO: Pull request from lego/hb_998_20200617161036026 to master
2020-06-22 18:18:57 -07:00
Daniel Rosenwasser 17490efec9
Merge pull request #39136 from microsoft/lego/hb_998_20200618041040315
LEGO: Pull request from lego/hb_998_20200618041040315 to master
2020-06-22 18:18:38 -07:00
Daniel Rosenwasser 20ce465e17
Merge pull request #39141 from microsoft/lego/hb_998_20200618101048830
LEGO: Pull request from lego/hb_998_20200618101048830 to master
2020-06-22 18:18:06 -07:00
Daniel Rosenwasser f30030f079
Merge pull request #39125 from microsoft/lego/hb_998_20200617221056165
LEGO: Pull request from lego/hb_998_20200617221056165 to master
2020-06-22 18:17:31 -07:00
Daniel Rosenwasser a13f25d68b
Merge pull request #39107 from microsoft/lego/hb_998_20200617101042356
LEGO: Pull request from lego/hb_998_20200617101042356 to master
2020-06-22 18:17:06 -07:00
Daniel Rosenwasser bc4debee95
Merge pull request #39104 from microsoft/lego/hb_998_20200617041034351
LEGO: Pull request from lego/hb_998_20200617041034351 to master
2020-06-22 18:16:33 -07:00
Daniel Rosenwasser cee65e4d99
Merge pull request #39097 from microsoft/lego/hb_998_20200616221103922
LEGO: Pull request from lego/hb_998_20200616221103922 to master
2020-06-22 18:15:50 -07:00
Jack Works 8dc4f7e3d2 chore: resolve suggestions 2020-06-23 08:06:46 +08:00
Andrew Branch 086e00de91
Expand auto-import to all package.json dependencies (#38923)
* Start experiment

* Add logging

* Go back to a single program

* Fix forEachExternalModuleToImportFrom

* Move auxiliary program to language service

* Add logging

* Don’t use resolution cache

* Fix(?) containingProjects for ScriptInfo in auxiliary program

* Fix ScriptInfo project inclusion

* Add test for default project of auto-importable ScriptInfo

* Add fourslash server test

* Don’t create auto import provider inside node_modules

* Add monorepo-like test

* WIP

* Naively ensure autoImportProvider is up to date after package.json change

* Start limiting when auto update provider gets updated

* Respond to changes in node_modules

* Don’t create auto-import provider until a file is open that would use it

e.g., don’t create them during cross-project find-all-refs

* Clean up naming, @internal marking, and fix empty project creation bug

* Drop devDependencies, include peerDependencies

* Add additional compiler options

* Fix interaction with importSuggestionsCache

* Move option to UserPreferences, allow inclusion of devDependencies

* Don’t filter out peerDependencies

* Watch unparseable package.jsons

* But don’t filter packages out due to an invalid package.json

* Update test

* Don’t use autoImportProvider in codefixes where it can never be used (or any refactors)

* Add CompletionEntry property for telemetry

* Add assertion for isPackageJsonImport to fourslash

* Fix missing pushSymbol argument

* Add isPackageJsonImport to tests and API baselines

* Fix unit test

* Host auto import provider in new Project kind

* Fix InferredProject attaching on AutoImportProvider-included files, load eagerly

* Update Public APIs

* Simplify PackageJsonCache host

* Remove unneeded markAsDirty

* Defer project finished event until after AutoImportProvider is created

* Make AutoImportProviderProject always report isOrphan = true

* Close and remove AutoImportProviderProject when host project closes

* Don’t set pendingEnsureProjectForOpenFiles

* Use hasAddedOrRemovedFiles instead of hasNewProgram

* Use host-wide watchOptions for package.json watching

* Add to `printProjects`

* Clean up

* Get autoImportProvider directly from LanguageServiceHost

* Clean up

* Clean up

* Close auto import provider on disableLanguageService

* Move AutoImportProvider preload to project updateGraph

* Clear auto import suggestion cache when provider program changes

* Fix tests

* Revert yet-unneeded change

* Use projectService host for module resolution host

* Don’t re-resolve type directives if nothing has changed

* Update src/server/project.ts

Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>

* Use ts.emptyArray

Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
2020-06-22 16:34:27 -07:00
Nathan Shively-Sanders ac87e82f08 inline local functions 2020-06-22 15:11:30 -07:00
ShuiRuTian d76e85d94e
Update bigint declaration file (#38526)
* update toLocalString function signature

* update test.

* fix lint

* follow review advice.

* format and better comment.

* format

* add case

* fix symbol.

* remove subtype and string union in interface.

* remove useless code.

Co-authored-by: Song Gao <song.gao@laserfiche.com>
2020-06-22 14:55:04 -07:00
TypeScript Bot d10beaa8b5
Update user baselines (#39077)
Co-authored-by: typescript-bot <typescript@microsoft.com>
2020-06-22 10:12:25 -07:00
csigs 0ae5cb662b
LEGO: Merge pull request 39189
LEGO: Merge pull request 39189
2020-06-22 09:11:36 -07:00
csigs 32f317c37e LEGO: check in for master to temporary branch. 2020-06-22 16:10:43 +00:00
Nathan Shively-Sanders acac035aed
Add missing index.ts files to user projects (#39163)
This makes the language service treat .js files inside node_modules as
part of the parent project, so that you can view the same errors in the
editor as you see in the baselines.

Also update a comment in the parser that I missed in an earlier PR.
2020-06-22 08:46:14 -07:00
Pranav Senthilnathan 2f793892f1
Add reason for a disabled code action (#37871)
* add reason for a disabled code action

* add addOrRemoveBracesToArrowFunction

* use user preferences

* add error reason

* accept baseline changes

* fix lint rules

* move messages to diagnosticMessages.json

* rename 'error' to 'notApplicableReason'

* accept baseline change

* address comments
2020-06-22 08:16:47 -07:00
Jack Williams fd0ad2985b
Minor fix for assertion predicates (#38710) 2020-06-20 18:27:51 -07:00
Ron Buckton 9ff24b6fc8
Update LKG (#39173) 2020-06-19 22:18:55 -07:00
Ron Buckton fe33e61823
Reparse top level 'await' in modules (#39084)
* Reparse top-level 'await' in modules

* Add more tests and additional diagnostics

* One more incremental parse test
2020-06-18 23:43:18 -07:00
Jack Works ddfab9640e change 2020-06-19 11:37:06 +08:00
Jack Works 41a1cd9128 chore: more change 2020-06-19 11:35:35 +08:00
Jack Works 4fce495303
chore: resolve review 2020-06-19 11:28:06 +08:00
Jack Works d33256cc5a chore: save space 2020-06-19 10:50:40 +08:00
Jack Works cdd14ccec6 fix: lint error 2020-06-19 10:50:37 +08:00
Jack Works ffb35a3eb1 test: add test for it 2020-06-19 10:50:35 +08:00
Jack Works c36fe2339a chore: make isJsxAttr required 2020-06-19 10:50:33 +08:00
Jack Works d38096ab90 chore: revert change in checker 2020-06-19 10:50:31 +08:00
Jack Works 5853d2ab69 feat: re-impl react class name fix 2020-06-19 10:50:28 +08:00
Jack Works c8abf6fe67 Revert "feat: add a codefix to fix class to className in react"
This reverts commit 15133266893f113d7d60f8696480adc75aba9827.
2020-06-19 10:50:27 +08:00