22626 Commits

Author SHA1 Message Date
Daniel Rosenwasser
5aa2eb744a Add 'insiders'. 2020-08-18 22:53:40 +00:00
TypeScript Bot
076db46a3f
Cherry-pick PR #40072 into release-4.0 (#40076)
Component commits:
1582b76053 Revert "Add '(approximate)' to the beginning of quick info requests in PartialSemantic mode (#40061)"
This reverts commit 2426eb4980d34c762e745cdb5062ca211e65f25e.

Co-authored-by: Daniel Rosenwasser <drosen@microsoft.com>
2020-08-16 19:01:12 -07:00
TypeScript Bot
c9c6cd29b6 Bump version to 4.0.2 and LKG 2020-08-15 01:16:37 +00:00
Daniel Rosenwasser
5f5dac0280 Add '(approximate)' to the beginning of quick info requests in PartialSemantic mode (#40061)
* Add '(approximate)' to the beginning of quick info requests.

* Use 'approximation' instead of 'approximate'.
2020-08-15 01:01:11 +00:00
Sheetal Nandi
10304555e7 Ensure file, include and exclude specs used are strings (#40041)
* Test displaying failure when specs used are not strings

* Ensure specs used are strings
Fixes #38164, #39856

* Feedback
2020-08-14 23:59:19 +00:00
TypeScript Bot
a1925515e2
Cherry-pick PR #40026 into release-4.0 (#40028)
Component commits:
8f442baa3c Revert to including only open files in partial semantic server mode

Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
2020-08-12 20:45:52 -07:00
TypeScript Bot
6620b251ef
🤖 Pick PR #40005 (feat(40004): Missing Compiler API p...) into release-4.0 (#40015)
* Cherry-pick PR #40005 into release-4.0

Component commits:
fa1ed85593 feat(40004): make isNamedTupleMember public

* Update LKG

Co-authored-by: Alexander T <alexander.tarasyuk@outlook.com>
Co-authored-by: typescript-bot <typescript@microsoft.com>
2020-08-12 00:10:04 -07:00
TypeScript Bot
7558de69b1
Cherry-pick PR #39702 into release-4.0 (#39985)
Component commits:
cd5dde5d79 Improve deprecated suggestion node position

6e39ee706e fix typo

a593fd03fe Simplify code

58f6f3daf2 merge helper function

Co-authored-by: kingwl <kingwenlu@gmail.com>
2020-08-11 23:33:56 -07:00
TypeScript Bot
3055018556
Cherry-pick PR #39950 into release-4.0 (#39951)
Component commits:
6e5d75b58b Use isUncalledFunctionReference for aliases too
Fixes bogus deprecated notices on imports of functions with deprecated
overloads, but with some non-deprecated overloads.

Fixes microsoft/vscode#104238

e2eb319e72 Just check all declarations, don't call isUncalledFunction

Co-authored-by: Nathan Shively-Sanders <nathansa@microsoft.com>
2020-08-07 10:40:44 -07:00
TypeScript Bot
264d27e779
🤖 Pick PR #39937 (Handle empty package.json files) into release-4.0 (#39938)
* Cherry-pick PR #39937 into release-4.0

Component commits:
0b9b321b0c Handle empty package.json files

* Update LKG

Co-authored-by: Andrew Branch <andrew@wheream.io>
Co-authored-by: typescript-bot <typescript@microsoft.com>
2020-08-06 10:37:28 -07:00
TypeScript Bot
071b649d59
Cherry-pick PR #39932 into release-4.0 (#39933)
Component commits:
f53db98f88 Add missing 'importName' for private field helpers

Co-authored-by: Ron Buckton <rbuckton@microsoft.com>
2020-08-06 09:56:58 -07:00
TypeScript Bot
10bfb7c6d0
🤖 Pick PR #39883 (Renames in servermode per feedback) into release-4.0 (#39888)
* Cherry-pick PR #39883 into release-4.0

Component commits:
d320625392 Server mode renames as per feedback

e8d798db59 More renames

508226eec3 Merge branch 'master' into serverModeRename

* Update LKG

Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
Co-authored-by: typescript-bot <typescript@microsoft.com>
2020-08-05 14:37:43 -07:00
Sheetal Nandi
eeea32be29 Handle the fact that noResolveResolution resolution is reused
Fixes #39795
2020-08-04 22:18:08 -07:00
TypeScript Bot
7cf61845c9
Cherry-pick PR #39889 into release-4.0 (#39890)
Component commits:
c3ac7fa2e7 Handle the fact that noResolveResolution resolution is reused Fixes #39795

Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
2020-08-03 22:19:53 -07:00
Nathan Shively-Sanders
3a6dde0b6b Make numeric Array constructors take ArrayLikeBuffer union
PR #38449 changed the second overload of the constructor for Int8,
Uint8, Int32, Uint32, Int16, Uint16, Float, Float64 -Array so that it no
longer includes `ArrayBufferLike`. It's just `ArrayLike<number>`.
This is fine except in the case that
the caller provides exactly `ArrayLike<number> | ArrayBufferLike`. This
PR adds ArrayBufferLike back so that the union is once again accepted.

This avoids a breaking change, in particular in one Microsoft-internal
codebase.
2020-08-03 16:57:29 -07:00
Daniel Rosenwasser
fe74f348bf Bump version to 4.0.1-rc. 2020-08-03 05:14:17 +00:00
Daniel Rosenwasser
e141dd19b1 Merge branch 'master' into release-4.0 2020-08-03 05:12:42 +00:00
csigs
b092fb37b1 LEGO: check in for master to temporary branch. 2020-08-03 04:10:44 +00:00
Sheetal Nandi
aee78acedb
Add separate flag serverMode for server mode (#39735)
* Add separate flag serverMode for server mode to allow back compatibility

* Addressed code review feedback.

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2020-08-02 18:18:26 -07:00
Andrew Branch
86a87c493c
Limit auto import provider project size (#39855)
* Limit auto import provider project size

* Add test

* Make option configurable

* Fix test

* Only bail when setting is auto

* Fix other test

* Update API baseline
2020-08-02 17:47:49 -07:00
Wesley Wigham
94989789df
In JS declaration emit, move imports painted in nested contexts to the root private context (#39818)
* In JS declaration emit, move imports painted in nested contexts to the root private context

* Add test for nathan
2020-07-31 18:25:37 -07:00
Nathan Shively-Sanders
d3877d294c
Redo in narrowing for intersections (#39637)
* Redo in-narrowing for intersections

Still need to carve out an exception for globalThis

* exempt globalThis from `in` narrowing
2020-07-30 14:58:22 -07:00
Ron Buckton
32934a9989
Merge pull request #39824 from microsoft/fix35484
Allow assignments to a narrowable reference to be considered narrowable
2020-07-30 15:27:34 -04:00
Andrew Branch
7119e2b74f
The iteration type of overloaded iterator signatures derives from the intersection of their return types (#39722) 2020-07-30 11:37:04 -07:00
Ron Buckton
315b5f4b78 PR Feedback 2020-07-30 11:13:58 -07:00
Orta Therox
faf128de15
Fix formatting scanner on JSX text that looks like trivia (#39718)
* Fix formatting scanner on JSX text that looks like trivia

* Combine if statements

Co-authored-by: Andrew Branch <andrew@wheream.io>
2020-07-30 13:56:14 -04:00
mshivaku99
bffe3540fa
Issue35876: Give better error message when Classic Module Resolution with incorrect path (#38105)
* added Error 5084 to diagnosticMessages.json

* added test case errorForBareSpecifierWithImplicitModuleResolution1 to tests/cases/compiler

* modified checker.ts to report error 5084 when classic resolution and incorrect path are used

* added baseline changes

* passes all test cases including src/testRunner/unittests/ tests

* Update with feedback

* Make it check whether it is the right module resolution kind

* Use the right diagnostic message in tsserver tests

Co-authored-by: Meera Shivakumar <mshivaku@umich.edu>
Co-authored-by: Orta <git@orta.io>
2020-07-30 13:45:29 -04:00
Eli Barzilay
a320e1b554 Make getLocalSymbolForExportDefault look harder for an export
Look for a symbol that has a `.localSymbol` property instead of blindly
using the first one.

Fixes #37829.
2020-07-30 13:09:21 -04:00
Micah Zoltu
b601487905
Updates Uint8ArrayConstructor to match MDN documentation. (#38449)
* Updates Uint8ArrayConstructor to match MDN documentation.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array
```
new Uint8Array(); // new in ES2017
new Uint8Array(length);
new Uint8Array(typedArray);
new Uint8Array(object);
new Uint8Array(buffer [, byteOffset [, length]]);
```
While the previous constructors aren't significantly different from the new, it would prevent someone from doing `new Uint8Array(myBuffer, undefined, undefined)` since there was no overload that accepted undefined as a second parameter and buffer as first.
Fixes #38446

* Fixes constructor defenition for all other typed arrays.

* Renames property to `array` since it is no longer an `arrayOrBuffer`.
2020-07-30 08:51:50 -04:00
Ron Buckton
21963ce337 Restore reference change 2020-07-29 18:41:05 -07:00
Ron Buckton
4c90ba9456 Temporary revert to compare user test baselines 2020-07-29 18:13:27 -07:00
Alexander T
bae111f0ae
fix(39245): change related diagnostic for missing rest parameter arguments (#39356)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-07-29 17:25:13 -07:00
Ron Buckton
b9db6413bf Allow assignments to a narrowable reference to be considered narrowable 2020-07-29 16:37:25 -07:00
Nathan Shively-Sanders
9b2d487392
Fix this-parameter emit for JSDocFunction types (#39814)
* Fix this parameter emit for JSDocFunction types

Previously, parameters with names that were not `new` were treated like
rest parameters. This is incorrect: parameters with the name `this`
should emit a `this` parameter.

Fixes #38550

* ❤️ quote style
2020-07-29 14:11:59 -07:00
Eli Barzilay
f2d1531768 Fix location for duplicate function implementation errors
Use only the relevant declarations (by collecting them in the for loop),
and use `declaration` if `getNameOfDeclaration` didn't work (useful for
`export default` with anonymous functions).

Fixes #39804.

Also, use `nodeIsPresent` once, and a random `?.`.
2020-07-29 16:07:00 -04:00
Andrew Casey
c66b69080b
Merge pull request #39792 from amcasey/OverloadErrors4
Reduce unnecessary error computation
2020-07-29 10:43:59 -07:00
Andrew Casey
189a6d75e0 Move off deprecated mocha types 2020-07-28 14:04:29 -07:00
Nathan Shively-Sanders
03b658035d
Make @enum,@this tag construction stricter (#39791)
The type expression is required, so the type should reflect that.
2020-07-28 13:49:42 -07:00
Andrew Casey
2480458821 Reduce unnecessary error computation
...during overload resolution.  Based on a trace that was spending 30%
of a (very slow) overload resolution elaborating errors that were then
dropped.
2020-07-28 13:03:31 -07:00
Andrew Branch
8f04f91ef5
Add diagnostic info to getNameForExportedSymbol crash (#39790)
* Add diagnostic info to getNameForExportedSymbol crash

* Add JS indicator
2020-07-28 12:53:56 -07:00
Andrew Casey
79e2ed2e77
Merge pull request #39776 from amcasey/OverloadErrors
Reduce unnecessary error computation
2020-07-28 10:35:22 -07:00
Andrew Branch
1f1521c2f1
Undo accidental change from #39772 (#39779)
* Undo accidental change

* Delete test
2020-07-27 16:55:59 -07:00
Andrew Branch
68ba670467
Add contextual type for generator return type (#39772)
* WIP

* Add contextual type for generator return type
2020-07-27 15:14:47 -07:00
Andrew Casey
195fad23a5 Reduce unnecessary error computation
...during overload resolution.  Based on a trace that was spending 30%
of a (very slow) overload resolution elaborating errors that were then
dropped.
2020-07-27 14:11:24 -07:00
Sheetal Nandi
48e58f44db
Handle unresolved baseType when trying to get completions for static member (#39731)
* Handle unresolved baseType when trying to get completions for static member
Fixes  #38067

* Update src/services/completions.ts

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

* correct the condition

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-07-24 16:37:28 -07:00
Anders Hejlsberg
c5d21e7987
Lower priority for speculative variadic tuple inferences (#39723)
* Inference to [...T, X?] has lower priority than inference to [...T, X]

* Update tests

* Accept new API baselines
2020-07-24 15:00:53 -07:00
Sheetal Nandi
823b69acb3
Fixes slow nav to issue by keeping project with result. (#39721)
Also cache the result of config file name for open files
Fixes #38491
2020-07-24 13:33:25 -07:00
csigs
7c5ed71ef8 LEGO: check in for master to temporary branch. 2020-07-22 22:10:54 +00:00
Andrew Branch
ec33814616
Make AutoImportProviderProject work with symlinked monorepos (#39679)
* Hack everything together

* Add test

* Remove realpath from program

* Ensure symlinked directories are directories

* Revert unnecessary change

* Update baselines

* Use host program realpath on AutoImportProviderProject files before program creation

* Which fixes hasRoots() too

* Apply suggestions from code review

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

* Lint

Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
2020-07-22 13:53:30 -07:00
Wesley Wigham
312a6f0efb
Add a fastpath for comparing common mapped types like Pick which avoids manufacturing intermediate type identities (#39696) 2020-07-22 11:59:16 -07:00