10529 Commits

Author SHA1 Message Date
Wesley Wigham
6c15fc6634
Fix devtools test (#20731)
* Fix devtools test

* Add small test case mimicing the issue from the user test
2017-12-18 14:47:45 -08:00
Andy
1562a278f8
Don't add completion for method if the this parameter doesn't match (#20616) 2017-12-18 11:28:04 -08:00
Andy
9a62454485
Include static 'this' accesses in references of class (#20483) 2017-12-18 10:54:22 -08:00
Andrew Casey
5e2dec7727
Merge pull request #20729 from amcasey/GH19839
Refine Extract Local
2017-12-15 16:51:25 -08:00
Wesley Wigham
ae73a9141d
Allow JSXAttributes types to be shortcut-spread into the spread type like normal objects (#19047)
* Bring jsx type resolution inline with normal objects, move jsx attribute property ignorign into relationship check

* Improved errors and reordered members

* Always use inferrential mode for jsx pass

* Add some missing skipLibChecks

* New check mode instead of odd type mapper

* Do not enable object literal freshness checks on jsx spreads

* Fix minor style nits

* Update order of type for test

* Accept corrected baseline
2017-12-15 16:13:28 -08:00
Wesley Wigham
dd933f4413
Fix get symbol at location to behave correctly for parameter assignments and jsx attributes (#20706)
* Fix get symbol at location to behave correctly got parameter assignments and jsx attributes

* Handle all those edge cases that weren;t explicitly handled

* Fix part of bug WRT getTypeAtLocation and for loops

* Baseline corrections pursuant to #20710

* Restore jsdoc tag interpretation

* Clean up some code, revert fourslash tests

* Cleanup types used by PR feedback
2017-12-15 15:50:22 -08:00
Andrew Casey
9efab94dfd Annotate fewer extracted constants with types
Expose `isContextSensitive` from the checker and omit type annotations
for expressions for which it returns false.
2017-12-15 15:11:17 -08:00
Wesley Wigham
d89d68f426
make jsx attributes mutable locations (#20710) 2017-12-15 10:02:56 -08:00
Wesley Wigham
e1278f091c
Get resolved module exports in symbol chain and not raw exports (#20661)
* Actually get module exports and not module exports sans export stars

* style update

* Trim test a bit
2017-12-13 14:01:23 -08:00
Wesley Wigham
2c6501db52
Allow multiple star-star globs in one pattern (#20639)
* Allow multiple starglobs in one pattern

* Add extra test case
2017-12-13 12:57:16 -08:00
Ryan Cavanaugh
f6603cd9f2
Merge pull request #20545 from RyanCavanaugh/codefixOmnibus
Omnibus fixes for telemetry-sourced crashes
2017-12-13 12:49:58 -08:00
Wesley Wigham
40029a0523
Use TypeFlags.UnionOrIntersection not TypeFlags.Union (#20662) 2017-12-12 16:32:55 -08:00
Andy
8ad4aeece1
Make ChangeTracker#newLineCharacter public, to avoid having to pass newLineCharacter around as a parameter (#20574)
* Make ChangeTracker#newLineCharacter public, to avoid having to pass newLineCharacter around as a parameter

* Don't require newLineCharacter as input to ChangeTracker methods, and make it private again
2017-12-12 12:23:13 -08:00
Nathan Shively-Sanders
43a5a271ee object spreads to {}
Specifically, when spreading `object` on the right, spread now returns the
left of the spread; previously it returned `object`, which loses
everything to the left.
2017-12-12 08:34:36 -08:00
Andy
d53af092c7
Always check a return expression in a generator (#20621) 2017-12-12 07:50:11 -08:00
Yuichi Nukiyama
792b8bb78e Fix error messeage (#20601)
* Fix error messeage

* delete extra lint
2017-12-11 18:05:49 -05:00
Wesley Wigham
eba15b5990
Preserve literal types in contextual unions (#19966)
* Cherrypick non-comparability related changes from prolific literals PR

* Renames and other style changes

* Accept changes to new tests

* Exclude the domain root from contextual typing literals except for type variables

* Readd simple preservation fix

* Add huge map test

* Revert changes to widening on destructuring initalizers

* Use tristate for subtype-reduction type

* Rename type and argument

* Move longer-running test to user suite
2017-12-11 18:03:38 -05:00
Wesley Wigham
d01f4d140a
Reimplement #20320 differently to handle multiple check orders better (#20588)
* Reimplement #20320 less elegantly but handle odd check orders better

* Consolidate 2 of 3 conditions
2017-12-11 13:32:16 -05:00
Andy
484758a3d3
Handle ! following a keyword in isClassMemberStart (#20617)
* Handle `!` following a keyword in isClassMemberStart

* Fix test
2017-12-11 09:45:36 -08:00
Wesley Wigham
9e51882d9c
Numeric separators (#20324)
* Add support into octal and binary literals

* Add hex support

* And finally support all numeric literals and fix spelling

* Update error message

* Refactor error in scanner to take a position

* Scan no separators in escape sequences, add escape sequence tests

* More decimal tests from the spec presentation examples

* Permissive scanning of excess separators

* Remove unnecessary assignment

* Make code easier to follow
2017-12-08 20:20:18 -05:00
Andy
47c1fc4022
Remove unused internal function (#20582) 2017-12-08 14:06:23 -08:00
Nathan Shively-Sanders
f90943d0d0
Merge pull request #20543 from Microsoft/in-keyword-narrow-string-indexer
Narrowing of `in` handles string index signatures
2017-12-07 15:45:00 -08:00
Ryan Cavanaugh
5c99c67b4b Fixes #20542 2017-12-07 12:39:17 -08:00
Andy
19ea189b42
Support a "getCombinedCodeFix" service (#20338)
* Support a "getCombinedCodeFix" service

* Rename things

* Code review

* Rename things

* Update API baselines

* CodeActionAll -> CombinedCodeActions

* Take a `scope` parameter instead of `fileName` for flexibility

* Renames and bugfixes

* Make API changes internal

* Code review

* Update comment
2017-12-07 12:14:18 -08:00
Nathan Shively-Sanders
d75ebd6a33 Narrowing of in handles string index signatures 2017-12-07 10:57:15 -08:00
Ryan Cavanaugh
ee283d1524
Merge pull request #20464 from RyanCavanaugh/fix20402
Don't add ambiently declared modules to ATA's unresolvedModules list
2017-12-06 13:55:54 -08:00
Ryan Cavanaugh
c15470595f Dedupe local types from ATA and reuse old programs correctly 2017-12-06 13:17:21 -08:00
Andy
18a7c3fb53
For import fix, prefer symlink over a real path (#20395)
* For import fix, prefer symlink over a real path

* fixes

* Use best result from all symlinks

* Make originalPath optional more

* Only include real path if a symlink isn't available
2017-12-06 11:27:38 -08:00
Ryan Cavanaugh
c2fc5eafb5
Merge pull request #15256 from IdeaHunter/in-typeguard
Add type guard for `in` keyword
2017-12-06 10:32:07 -08:00
Andy
8dca431733
Use InternalSymbolName.Default more (#20480) 2017-12-06 07:02:27 -08:00
IdeaHunter
04b9b304a3 Change isTypePresencePossible, accept baseline 2017-12-06 01:39:34 +03:00
IdeaHunter
069f73d0f2 Change type narrowing for optional properties 2017-12-06 00:02:36 +03:00
IdeaHunter
a5d6be150b Remove whitespace 2017-12-06 00:02:36 +03:00
IdeaHunter
9c3c2adfb0 Add initial support for 'in' typeguarding 2017-12-06 00:02:36 +03:00
Sheetal Nandi
7bb5fc22c2
Merge pull request #20427 from JoshuaKGoldberg/watch-immediate-clears
Added console clearing with a message to --watch starts
2017-12-05 10:54:54 -08:00
Andy
8153397e91
Lazily compute signature type predicates (#17600)
* Lazily compute signature type predicates

* Use an instance of IdentifierTypePredicate to represent an unresolved type predicate

* Simplify `getMaybeTypePredicate`

* Invert representation of `resolvedTypePredicate`

* Remove `__unresolvedTypePredicate` type and remember to use `noTypePredicate` instead of `undefined` when in all `createSignature` calls

* Fix style of getTypePredicateOfSignature

* Use in createGetSymbolWalker

* Fix bugs for unions of type predicates

* Code review

* Make noTypePredicate purely an implementation detail of getTypePredictateOfSignature

* Add test

* Add test for #19642

* Add test with reversed order
2017-12-05 08:32:34 -08:00
Josh Goldberg
cf9b8baa8c Merge branch 'master' into watch-immediate-clears
# Conflicts:
#	src/harness/unittests/tscWatchMode.ts
2017-12-04 23:22:00 -08:00
Josh Goldberg
a389ff5f39 Unit test failure; clearHostScreen function 2017-12-04 23:11:01 -08:00
Andy
37a40561ac
Support exponentiation operator in const enums (#20424) 2017-12-04 14:32:25 -08:00
Andy
d8142339f9
Use 'filter' array helper (#20452) 2017-12-04 13:36:01 -08:00
Josh Goldberg
a4f83b0835 Added console clearing with a message to --watch starts
I advocated against immediately clearing the console when starting --watch in #17756 because it was confusing to have the console suddenly become blank, wait a while, and _then_ give output. After using the feature for a little while, I think it's a little disorienting how the console will only start clearing after the first recompile. This change clears the console and immediately prints a new "Starting compilation in watch mode..." message.
2017-12-03 14:45:33 -08:00
Josh Goldberg
c9f044ef2d
Comment typo fix in es2015.ts: "propety" 2017-12-02 18:48:47 -08:00
benbraou
49a48ffd4d fix(es2018): add a target and an initial lib (#20385)
* run Jake LKG before es2018 addition

Fixes #20342

* fix(es2018): add a target and an initial lib

Fixes #20342
2017-12-02 11:16:59 -08:00
Josh Goldberg
08c6dc99c6 "tsc --watch should clear screen on new compilation" Two: Electric Boogaloo (#20389)
* tsc --watch should clear screen on new compilation

* added optional clearScreen method to System]
* implemented via `x1Bc`, reset screen
* fixes 13020

* Feedback on if statements; api .d.ts baseline additions

* Stopped clearing screen in tsc.js's reportWatchMode

* Added unit tests
2017-12-02 11:11:49 -08:00
Mohamed Hegazy
59e5bbc393
Make sure autoArrayType is unique, even if no lib is available (#20344)
* Make sure autoArrayType is unique, even if no lib is available

* fix typo
2017-12-01 19:51:14 -08:00
Wesley Wigham
1045d95a44
Always instantiate the extends clause, even in the presence of an error (#20232)
* Still instantiate the extends clause even when theres a noimplicitany error in js

* Only be permissive for JS

* In JS, instantiate classes even when they have too many type arguments, instead of returning unknownType
2017-12-01 21:09:06 -05:00
Anders Hejlsberg
f6b1a1de59
Merge pull request #20404 from Microsoft/fixUntypedFunctionCall
Fix untyped function call on constrained type variable
2017-12-01 17:19:32 -08:00
Anders Hejlsberg
5465a5aa72 Check apparent type instead of function type in isUntypedFunctionCall 2017-12-01 16:48:29 -08:00
Mohamed Hegazy
65af685b49
Remove periods from refactor/quickfix messages (#20237)
* Fix #19959 and #19958: Remove un-localizable messages

* Update message

* Reorder error messages

* Fix https://github.com/Microsoft/TypeScript/issues/15399: remove periods at the end of messages

* Accept baselines for error code changes

* accept baselines for removed periods

* Update diagnostic messages
2017-12-01 16:38:59 -08:00
Nathan Shively-Sanders
8d7c2a2a77
Merge pull request #20370 from Microsoft/cutoff-inference-for-recursive-mapped-types
Cut off inference for recursive mapped types
2017-12-01 15:10:06 -08:00