30549 Commits

Author SHA1 Message Date
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
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
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
Wenlu Wang
59ad375234
Add deprecated related feature (#38523)
* Add deprecated related feature

* Add more support

* fix navtree

* Add identifier check

* Add more deprecated

* fix crash

* fix more crash

* fix crash

* improve diagnostic

* avoid new tag

* avoid tags

* accept baseline

* Check deprecated in binder

* fix baseline

* fix jsdoc cache

* fix incorrect fix

* Avoid useless changes

* Accept baseline

* Add tests

* fix perf

* fix public api

* Adjust deprecated mark on qualifed name

* Revolve alias symbol

* Use modifier flags insted of symbol props

* Fix modifier flag resolve

* Make lint happy

* Fix crash

* fix crash

* Add cached utils function

* Accept baseline

* Add more tests

* try pinning octokit again

* Avoid tests

* Use utils some

* Deprecated perf test (#3)

* check valueDeclaration only

* check without modifierFlags

* donot check alias

* use cached tag

* remove call to jsdoc

* use deprecated tag

* revert changes

* Revert mission changes

* use node flags

* cache result

* cache

* avoid modifier flags

* Opts

* fix jsdoc include modifier

* fix tests

* fix again

* use symbol flag

* set @octokit/rest back to latest

* fix trailing spacel int

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-06-18 17:41:26 -07:00
Alexey Shvayka
520103fab0
Rename callbackfn params to predicate where possible (#39150)
* Rename `callbackfn` params to `predicate` where possible

* Perform `gulp baseline-accept`
2020-06-18 16:44:57 -07:00
Kan Adachi
37831de587
Adds [unit] and [unitDisplay] to NumberFormatOptions (#38013)
* Adds [unit] and [unitDisplay] to NumberFormatOptions

* Adds [unit] and [unitDisplay] to ResolvedNumberFormatOptions

* Updates tests for NumberFormatOptions and ResolvedNumberFormatOptions

* move unit[Display] from es5 to es2020

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-06-18 15:03:11 -07:00
Jacob Bandes-Storch
8136047a3d
Code fix for accidental calls to get-accessors (#38749)
* add code fix

* fix forEachChild and update some baselines

* excluding them from forEachChild is easier!

* cleanup

* review feedback

* fix whitespace
2020-06-18 13:58:42 -07:00
Sheetal Nandi
b977f86abd
Allows emitting buildInfo when --noEmit is specified (#39122)
* Some tests

* Allow noEmit with incremental and composite
Fixes #38440
2020-06-18 11:05:37 -07:00
csigs
8683b8a95d
LEGO: Merge pull request 39148
LEGO: Merge pull request 39148
2020-06-18 09:11:27 -07:00
csigs
5039105602 LEGO: check in for master to temporary branch. 2020-06-18 16:10:41 +00:00
ShuiRuTian
8293e517c0
fix rename cause import change wrongly (#38462)
* use canonical file name when resolve module

* renameSync in vfs supports same folder.

* Update src/harness/vfsUtil.ts

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>

* change tss rather than compiler.

* remove useless comment.

* use fileName rather than path.

Co-authored-by: Song Gao <song.gao@laserfiche.com>
Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
2020-06-18 08:31:30 -07:00
csigs
859be3f2b9 LEGO: check in for master to temporary branch. 2020-06-18 10:10:51 +00:00
Noj Vek
f697d26ca1
reset soft with master for single commit (#38720) 2020-06-18 00:22:32 -07:00
csigs
7bf3e2d117 LEGO: check in for master to temporary branch. 2020-06-18 04:10:43 +00:00
csigs
b3cf04a913 LEGO: check in for master to temporary branch. 2020-06-17 22:10:58 +00:00
Nathan Shively-Sanders
c3c6be6618
In JSDoc, parse postfix-? below conditional types/tuple types (#39123)
Outside of JSDoc comments, postfix-? is parsed at lower precedence than
the `?` of conditional types, and a postfix-? inside a tuple type
results in the type being marked optional.

This PR changes JSDoc parsing to behave the same way, which means that

1. Conditional types are allowed in JSDoc. Fixes #37166.
2. Tuple types' postfix-? syntax is interpreted correctly in JSDoc.
Fixes #38747.

The breaking change is that a postfix-? type followed by another postfix type,
like `[]` or `!`, is parsed as a conditional type. [Postfix-? is not
common](https://github.com/microsoft/TypeScript/issues/37166#issuecomment-612274456),
so this is an acceptable breaking change.

A postfix-? type `T?` is still parsed everywhere else and treated as `T | null`.
2020-06-17 14:06:39 -07:00
Orta
d7aa5f3ee1
Show a diff when the public api baselines fail (#39108)
* Add semantic highlighting pt1

* Make the public API unit tests echo out a diff
2020-06-17 17:00:46 -04:00
Dmitri
0bc29acc08
Add a type-guard overload of Array.every (#38200)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-06-17 13:02:30 -07:00
Sheetal Nandi
4105d32b7e
Fix crash in reporting unresolved project reference as part of compilerOptions verification (#39095)
* Fix crash in reporting unresolved project reference as part of compilerOptions verification
Fixes #38143

* Fix typo
2020-06-17 11:20:02 -07:00
csigs
dd574ff963 LEGO: check in for master to temporary branch. 2020-06-17 16:10:38 +00:00
csigs
190dc6cbe1 LEGO: check in for master to temporary branch. 2020-06-17 10:10:44 +00:00
Eli Barzilay
7611579421 Small fix in getObjectLiteralIndexInfo
Fixes #38175
2020-06-17 03:29:10 -04:00
Eli Barzilay
f560560f82 Fix two test typos 2020-06-17 03:28:55 -04:00
csigs
90b1ad8321 LEGO: check in for master to temporary branch. 2020-06-17 04:10:35 +00:00
Ron Buckton
eb3645f16b
Refactor node factory API, use node factory in parser (#35282)
* Refactor node factory API, use node factory in parser

* Move UnparsedSource nodes to factory

* Make most Node properties read-only

* Make pos/end/parent and JSDoc 'comment' read-only

* Update function/constructor-type factories

* Remove treeStateObserver

* Simplify Debug.deprecate

* Remove unused factory methods, simplify lazy factory methods

* Fix base factory used for source file updates

* Update test baseline due to merge from master

* Rename factory methods to be more consistent (#39058)
2020-06-16 16:55:03 -07:00
Sheetal Nandi
0232d4ae8e
Fixes issues with reload because of output emit (#39030)
* If there is no changes to folder structure when watching directories recursively, send the updates to fileNames only
Fixes #37994

* Ignore excluded directories from wild card watching

* Testcase showing that renaming file with non sync directory watcher displays correct error in the end
Testcase for #38684
2020-06-16 16:39:48 -07:00
Andrew Branch
540c219980
Make debug mode work with new VS Code JS debugger (#39098) 2020-06-16 16:06:13 -07:00
csigs
3f10a12fd4 LEGO: check in for master to temporary branch. 2020-06-16 22:11:05 +00:00
Wenlu Wang
6c11ceb8db
Assignment operator is definite assignment (#39087)
Co-authored-by: Orta Therox <orta.therox@gmail.com>
2020-06-16 16:44:01 -04:00
Sheetal Nandi
25f6232d45
Syntax only server creates inferred project with all the open files w… (#38561)
* Syntax only server creates inferred project with all the open files with noResolve and can handle semantic operations

* No Watching

* Disable tests

* Add and fix tests

* Only support selected commands

* Revert "Disable tests"

This reverts commit 90d8a966ebfae3dd6aeac24686b5cbc723b6e380.

* Dont log request details for unsupported commands
2020-06-16 13:39:20 -07:00
Nathan Shively-Sanders
e97003f263
Merge pull request #37721 from benmccann/NumberFormatOptions-notation
Add support for NumberFormatOptions notation
2020-06-16 11:19:25 -07:00
Nathan Shively-Sanders
32be76090b Merge branch 'master' into NumberFormatOptions-notation 2020-06-16 10:49:51 -07:00
Nathan Shively-Sanders
cefee947e7
Merge pull request #39093 from microsoft/fix-oodate-baseline-
fix out-of-date baseline
2020-06-16 10:49:23 -07:00
Ryan Cavanaugh
823f5fba86
Update README.md (#39074)
* Update README.md

Updates 404 link per #38974. Not sure if this is the best destination.

* Update README.md

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

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-06-16 10:26:28 -07:00
Nathan Shively-Sanders
372dc6a1a5 fix out-of-date baseline 2020-06-16 10:24:53 -07:00
Nathan Shively-Sanders
70a5d27292 Move notation to es2020.intl.d.ts 2020-06-16 10:08:07 -07:00