26804 Commits

Author SHA1 Message Date
Wesley Wigham
e982240500
Instantiating a signature in the context of another should infer from return type predicates if they match up (#30242)
* Instantiating a signature in the context of another should infer from return type predicates if they match up

* Invert condition per PR feedback
2019-03-07 17:39:58 -08:00
Wesley Wigham
4c9ad08610
Add fix for webpack history merge bug (#29339)
* Add fix for webpack history merge bug

* Add test case
2019-03-07 13:34:28 -08:00
Sheetal Nandi
3f7357d37f
Merge pull request #30247 from Microsoft/recursiveDirectoryIgnore
Ignore the directories or files in node_modules starting with "." and any file or directory starting with ".git" even in the recursive directory watching logic
2019-03-07 11:24:03 -08:00
Sheetal Nandi
825cde2a4e
Merge pull request #30244 from Microsoft/declarationEmitError
Handle error when type parameter of mapped type uses private type
2019-03-07 00:16:22 -08:00
Sheetal Nandi
ec2ee9ff3a Ignore anything starting with ".git"
Fixes #29782
2019-03-06 15:00:26 -08:00
Sheetal Nandi
79a1f29727 In recursive directory watching ignore folders and files in node_modules starting with "."
Fixes #30004
2019-03-06 14:46:14 -08:00
Sheetal Nandi
fe9f42480a Handle error when type parameter of mapped type uses private type
Fixes #30201
2019-03-06 13:30:48 -08:00
Gabriela Britto
d2364f555f
Merge pull request #30089 from Microsoft/convert-to-named-parameters
Convert to named parameters
2019-03-06 09:33:01 -08:00
Gabriela Araujo Britto
60b2d6a2f5 remove unnecessary closures 2019-03-05 16:56:30 -08:00
Sheetal Nandi
d62c8a403c
Merge pull request #30107 from Microsoft/applyChangesToOpenFiles
Add UpdateOpen to request
2019-03-05 15:54:34 -08:00
Alexander T
d20132026e remove sudo: false setting from travis.yml (#30231) 2019-03-05 15:06:30 -08:00
Sheetal Nandi
e55fbffed6 Rename the request as updateOpen 2019-03-05 14:34:08 -08:00
TypeScript Bot
a5f93ef7a4 Update user baselines (#30211) 2019-03-04 13:19:39 -08:00
Gabriela Araujo Britto
8c4ab69d09 add test for non-transient symbol 2019-03-04 09:34:04 -08:00
Anders Hejlsberg
8794ebdff5
Merge pull request #30179 from Microsoft/fixGetParameterNameAtPosition2
Fix out-of-bounds issue in getParameterNameAtPosition
2019-03-02 05:17:36 -10:00
Anders Hejlsberg
22a2eb8e96 Accept new baselines 2019-03-01 16:34:33 -08:00
Anders Hejlsberg
d9bb869341 Add regression test 2019-03-01 16:34:23 -08:00
Anders Hejlsberg
3afe0a4d43 Fix out-of-bounds issue in getParameterNameAtPosition 2019-03-01 16:34:09 -08:00
Gabriela Araujo Britto
98a146dcfc use getTouchingToken 2019-03-01 13:23:59 -08:00
Gabriela Araujo Britto
cd060e75fe use interface for ValidVariableDeclaration 2019-03-01 09:17:44 -08:00
TypeScript Bot
f776bead4f Update user baselines (#30168) 2019-03-01 07:59:17 -08:00
Gabriela Araujo Britto
1f91aa1c9b remove inlineable 2019-02-28 16:55:40 -08:00
Jack Williams
5bef1aa13c Add regressions for conditional types that affect parameter variance (#30146) 2019-02-28 16:14:16 -08:00
Daniel Rosenwasser
e383b0d4f7 Accepted baselines. 2019-02-28 15:33:03 -08:00
Daniel Rosenwasser
00bf32ca39 Update LKG. 2019-02-28 14:35:03 -08:00
Wesley Wigham
b1a73ab560
Resolve aliases to jsx namespace symbol (#30160) 2019-02-28 13:52:57 -08:00
Anders Hejlsberg
7f5052bf7b
Merge pull request #30114 from Microsoft/contextualGenericRestParameter
Improve contextual typing by generic rest parameters
2019-02-28 11:00:12 -10:00
Anders Hejlsberg
237c33b444
Merge pull request #30109 from Microsoft/circularConstraintErrors
Consistently error on circular constraints
2019-02-28 10:57:01 -10:00
Wesley Wigham
a6a3ae00a6
Only collect inferences which actually have inferences into the returnMapper (#30111) 2019-02-28 12:46:24 -08:00
Gabriela Araujo Britto
617d5af67e add diagnostics message for refactor description 2019-02-28 11:22:05 -08:00
Gabriela Araujo Britto
51616a4043 use sortAndDeduplicate instead of deduplicate 2019-02-28 09:50:57 -08:00
Gabriela Araujo Britto
7fd6868f8b minor refactors to convertToNamedParameters 2019-02-27 16:42:54 -08:00
Gabriela Araujo Britto
54c7996ff5 refactor getGroupReferences 2019-02-27 16:19:01 -08:00
Ryan Cavanaugh
5ec5e0466d
Merge pull request #30136 from RyanCavanaugh/no-mkdir-race
Don't crash if someone created a folder while we were checking to see if it exists
2019-02-27 15:43:14 -08:00
Ryan Cavanaugh
93fa734162 Don't crash if someone created a folder while we were checking to see if it exists 2019-02-27 14:33:25 -08:00
Nathan Shively-Sanders
be2db9db12
Add globalThis (#29332)
* Restore original code from bind-toplevel-this

With one or two additional comments

* Working in JS, but the symbol is not right.

Still need to

1. Make it work in Typescript.
2. Add test (and make them work) for the other uses of GlobalThis:
window, globalThis, etc.

* Check in TS also; update some tests

Lots of tests still fail, but all but 1 change so far has been correct.

* Update baselines

A couple of tests still fail and need to be fixed.

* Handle type references to globalThis

The type reference must be `typeof globalThis`. Just `globalThis` will
be treated as a value reference in type position -- an error.

* Restore former behaviour of implicitThis errors

I left the noImplicitThis rule for captured use of global this in an
arrow function, even though technically it isn't `any` any more --
it's typeof globalThis.  However, you should still use some other method
to access globals inside an arrow, because captured-global-this is super
confusing there.

* Test values with type globalThis

I ran into a problem with intersecting `Window & typeof globalThis`:

1. This adds a new index signature to Window, which is probably not
desired. In fact, with noImplicitAny, it's not desired on globalThis
either I think.
2. Adding this type requires editing TSJS-lib-generator, not this repo.

So I added the test cases and will probably update them later, when
those two problems are fixed.

* Add esnext declaration for globalThis

* Switch to symbol-based approach

I decided I didn't like the import-type-based approach.

Update baselines to reflect the difference.

* Do not suggest globals for completions at toplevel

* Add tests of element and property access

* Look up globalThis using normal resolution

globalThis is no longer constructed lazily. Its synthetic Identifier
node is also now more realistic.

* Update fourslash tests

* Add missed fourslash test update

* Remove esnext.globalthis.d.ts too

* Add chained globalThis self-lookup test

* Attempt at making globalThis readonly

In progress, had to interrupt for other work.

* Add/update tests

* Addres PR comments:

1. Add parameter to tryGetThisTypeAt to exclude globalThis.
2. Use combined Module flag instead combining them in-place.
3. SymbolDisplay doesn't print 'module globalThis' for this expressions
anymore.
2019-02-27 14:14:34 -08:00
Wesley Wigham
13c08ab32b
Use identity with the permissive instantation to detect nongenric instances and disable variance probing on nongeneric instances (#29981)
* Use identity with the restrictive instantation to detect nongenric instances and disable variance probing on nongeneric instances

* Generalize to also include interfaces, add test case, still perform argument comparisons for postive comparisons if possible

* Actually accept baselines, lol

* Reduce deep nesting limit just a bit so yargs still builds

* Handle circular identities in isNonGeneric

* Use a simple traversal of the types rather than the restrictive instantiation

* Cache the bits using an existing field to further reduce any time nongeneric check takes

* Revert to using an existing mapper, use permissive > restrictive

* Revert constant change

* And revert the comment, too
2019-02-27 14:12:30 -08:00
Sheetal Nandi
03377f70b7 Apply changes in reverse order even in new API to match behaviour with internal api 2019-02-27 14:07:15 -08:00
Nathan Shively-Sanders
0d93eb9218
Merge pull request #30133 from Microsoft/revert-conditional-type-invariance
Revert "Merge pull request #27697 from mattmccutchen/issue-27118"
2019-02-27 13:25:04 -08:00
Nathan Shively-Sanders
f77b43ca09 Update baselines 2019-02-27 12:42:30 -08:00
Nathan Shively-Sanders
aedffe049d Revert "Merge pull request #27697 from mattmccutchen/issue-27118"
This reverts commit 2dfb6202ed03e04ba1dcc330eea219c50fe48c66, reversing
changes made to bbf559b9c7fd21b984d7cb538140c74e3d6a6b45.
2019-02-27 11:50:04 -08:00
Sheetal Nandi
4718ff8f21
Merge pull request #30110 from Microsoft/revertExecFileSync
Revert execFileSync
2019-02-27 10:52:49 -08:00
Gabriela Araujo Britto
006fe14bcc refactor utilities 2019-02-26 16:22:08 -08:00
Daniel Rosenwasser
e8e7e88b2a
Merge pull request #30094 from Kingwl/improve_completions_for_optional_props
check completions with assignable rather than identity
2019-02-26 16:19:50 -08:00
Sheetal Nandi
fd10c12116 Revert "Use execFileSync in typing installer"
This reverts commit bc386c11fd3f026ca84ec556b1b8fb4a2eee0038.
2019-02-26 14:01:42 -08:00
Sheetal Nandi
3e4b9c07d2 Revert "Do not wrap npm path with quotes"
This reverts commit 1ed5e1c63b71e0a4e7fd0493a37e43a7ef518ebb.
2019-02-26 14:01:03 -08:00
Anders Hejlsberg
0716b87b75 Merge branch 'master' into contextualGenericRestParameter 2019-02-26 14:00:41 -08:00
Wesley Wigham
288851066b
Dont create a union type to infer conditional type branches (#30010) 2019-02-26 13:43:41 -08:00
Wesley Wigham
2533d8294e
Make a fresh empty object literal not a subtype of a type with an index signaure (#29975)
* Forbid inferable index checkign during subtype relationship checking

* Merge object.values and object.entries overloads to work around subtype change

* Invert subtype relationship between fresh empty objects and non-empty object types

* Remvoe comment

* Revert lib change

* Remove trailing whitespace ffs
2019-02-26 13:43:22 -08:00
Anders Hejlsberg
ecebc9ffeb Accept new baselines 2019-02-26 12:44:18 -08:00