6311 Commits

Author SHA1 Message Date
Tycho Grouwstra
1d6863ab0b loosen number index check, fixes #15768 2017-08-14 02:18:47 +08:00
Wesley Wigham
d03d1074ee Make compiler options which map to a flag case-insensitive again (#17755) 2017-08-11 19:59:43 -07:00
Ron Buckton
09487b8a1d Added tests, pr feedback 2017-08-11 15:31:09 -07:00
Ron Buckton
e3b6df64b3 Add support to infer the quote style for import quick fixes 2017-08-11 14:26:25 -07:00
Yui
d352e3b03f [Master] fix 16407 - LS in binding element of object binding pattern (#16534)
* wip-try get symbol of bindingelement in objectBindingPattern first

* Add fourslash tests

* Update .types baselines

* Update .symbols baselines

* Revert checker changes

* Actually lookup type for binding property name definition

* More succinct check, clarify yui's comment
2017-08-11 11:14:59 -07:00
Ryan Cavanaugh
c110ecb870 Merge pull request #17625 from RyanCavanaugh/extract-method-2
Extract Method
2017-08-11 10:54:48 -07:00
Andy
f64b8ad902 Add "preserveSymlinks" option (#16661)
* Add "preserveSymlinks" option

* Respond to PR comments
2017-08-11 10:03:21 -07:00
Ryan Cavanaugh
c27ee81341 Merge branch 'master' into extract-method-2 2017-08-10 17:02:14 -07:00
Ryan Cavanaugh
12403d9f70 Various fixes 2017-08-10 13:07:42 -07:00
Andy
fe3a05e89a A function should be context-sensitive if its return expression is (#17697)
* A function should be context-sensitive if its return expression is

* Remove outdated comment

* Fix typo
2017-08-10 07:08:24 -07:00
Wesley Wigham
8fde483393 Add test for #16144 (#17712) 2017-08-10 00:10:36 -07:00
Nathan Shively-Sanders
a59f77ffb4 Test:type predicate uses correct index to report errors 2017-08-09 15:45:28 -07:00
Andy
e1ba65ae64 Add simple version of chooseOverload for common case of single non-generic signature (#17589)
* Add simple version of `chooseOverload` for common case of single non-generic signature

* Use a single function
2017-08-09 14:41:38 -07:00
Andy
37b20ee670 For duplicate source files of the same package, make one redirect to the other (#16274)
* For duplicate source files of the same package, make one redirect to the other

* Add reuseProgramStructure tests

* Copy `sourceFileToPackageId` and `isSourceFileTargetOfRedirect` only if we completely reuse old structure

* Use fallthrough instead of early exit from loop

* Use a set to efficiently detect duplicate package names

* Move map setting outside of createRedirectSourceFile

* Correctly handle seenPackageNames set

* sourceFileToPackageId -> sourceFileToPackageName

* Renames

* Respond to PR comments

* Fix bug where `oldSourceFile !== newSourceFile` because oldSourceFile was a redirect

* Clean up redirectInfo

* Respond to PR comments
2017-08-09 14:39:06 -07:00
Wesley Wigham
6221d7089e Fix import addition location (#17327)
* Add test with bug

* Fix for import placement

* Consolidate comment recognition functions into utilities

* Add another test with all 3 kinds

* Recognize path directives as part of triple slash directives

* Also handle no-default-lib triple-slash comments

* Test for all the triple-slash kinds

* Keep import-placement logic in the quickfix, since its not really a node start; accept new baselines

* Work in not-ES6, use a real no-lib comment

* Remove no default lib triple slash comment, it disables checking and thereby quick fixes

* Copy regex rather than have a regex copy
2017-08-09 14:03:37 -07:00
Andy
e73d58e21c findAllReferences: Type parameter is not globally visible (#16419)
* findAllReferences: Type parameter is not globally visible

* Add test for merged interface

* Clean up comment
2017-08-09 13:53:54 -07:00
Yui
39e0cc61a7 Fix 16628: "undefined" exception when name of binding element in binding pattern is empty (#17132)
* Handle the case where binding pattern name element is empty

* Update tests and baselines

* Feedback from PR

* Handle empty binding patterns more generally in emitter

* Dont simply handling fo empty binding patterns and stay spec compliant

* PR feedback
2017-08-09 13:47:44 -07:00
Wesley Wigham
c399230767 Retain comments inside return statements (#17557)
* Retain comments inside return statements by including the return keyword in the parse tree

* Revert "Retain comments inside return statements by including the return keyword in the parse tree"

This reverts commit 5d2142edb1ffb9f6cb150b815aff6e627ae80449.

* Readd test

* Function for handling printing comments on a token
2017-08-08 19:53:53 -07:00
Wesley Wigham
43e758e1a9 Create synthetic default exports for dynamic imports (#17492)
* Create synthetic default exports for dynamic imports

* Slightly better solution

* Actually accept baselines

* Slightly adjust synthetic type

* Cache synthetic type

* Inline variables, remove non-required calls

* Rename function
2017-08-08 17:01:18 -07:00
Nathan Shively-Sanders
847d7fe3c8 Merge pull request #17404 from Microsoft/use-type-param-constraints-for-computed-prop-types
Use type parameter constraints for computed property types
2017-08-08 16:29:28 -07:00
Ron Buckton
75c8ecb2f1 Merge pull request #17517 from tinganho/IgnoredCatchParameter
Ignored catch parameter
2017-08-08 16:15:18 -07:00
Wesley Wigham
d2625678f9 Add test case from #14439 (#17627) 2017-08-08 14:44:41 -07:00
Nathan Shively-Sanders
e494d73b29 Merge branch 'master' into use-type-param-constraints-for-computed-prop-types 2017-08-08 13:26:24 -07:00
Wesley Wigham
af20adb137 Add tests for #15358 (#17664) 2017-08-08 13:06:12 -07:00
Ron Buckton
83ae8afef8 Merge pull request #17394 from vvakame/openParentFormatting
Add SpaceBetweenOpenParens formatting rule
2017-08-08 13:04:13 -07:00
Nathan Shively-Sanders
a2c66c3262 Merge pull request #17660 from Microsoft/weak-type-errors-on-signature-only-types
Weak type errors on signature-only types
2017-08-08 12:40:50 -07:00
Nathan Shively-Sanders
7ff1d8e797 Add specific weak type error for callable types
"Did you mean to call it?"
2017-08-08 11:25:32 -07:00
Andy
94518e8533 Don't count self-reference when setting isReferenced (#17495)
* Don't count self-reference when setting `isReferenced`

* Improve comment
2017-08-08 11:18:20 -07:00
Nathan Shively-Sanders
781da2332d Merge branch 'master' into weak-type-errors-on-signature-only-types 2017-08-08 10:45:52 -07:00
Ron Buckton
cacc3006c7 Merge branch 'master' into implicitlyExcludeNodeModules 2017-08-07 18:17:05 -07:00
Ron Buckton
31230b9176 Merge pull request #16953 from charlespierce/destructure_completion_nonpublic
Remove nonpublic members from destructuring completion lists
2017-08-07 14:24:47 -07:00
Anders Hejlsberg
aa0fc0b885 Merge pull request #17633 from Microsoft/indexSignatureMappedType
Mapped type and string index signature relations
2017-08-07 14:17:29 -07:00
Anders Hejlsberg
3118e81297 Merge pull request #17634 from Microsoft/fixSignatureStackOverflow
Fix stack overflow related to contextual signature instantiations
2017-08-07 14:00:14 -07:00
Anders Hejlsberg
3efeb1e27f Address CR feedback 2017-08-07 13:59:52 -07:00
Nathan Shively-Sanders
068cb8d5d0 Update weakType test + baselines 2017-08-07 10:58:07 -07:00
Wesley Wigham
a453eff575 Restrict parsing of literals and their expressions a _lot_ more (#17628) 2017-08-07 09:16:12 -07:00
Anders Hejlsberg
313c93c861 Merge pull request #17521 from Microsoft/deferLookupTypeResolution
Defer indexed access type resolution
2017-08-07 08:25:06 -07:00
Anders Hejlsberg
a4a37ea086 Add regression test 2017-08-05 12:40:40 -07:00
Anders Hejlsberg
c938a2acdc Add tests 2017-08-05 10:17:20 -07:00
Yui
d7fff8ebe9 [Master] fix 12985 emit leading and trailing comment around binary operator (#16584)
* Emit leading and trailing on binary operator

* Add tests and baselines

* Update baselines
2017-08-04 19:12:13 -07:00
Ryan Cavanaugh
c7f665faa1 Extract Method (squash) 2017-08-04 16:10:33 -07:00
Nathan Shively-Sanders
8f7a582fc5 Merge branch 'master' into inferFromRelatedTypesOnly 2017-08-04 15:21:17 -07:00
Ron Buckton
b747c2dd96 exclude node_modules unless explicitly included 2017-08-03 18:48:27 -07:00
Nathan Shively-Sanders
0d7f0e0e19 Test:infer from related types only 2017-08-03 09:14:59 -07:00
Daniel Rosenwasser
1552761982 Merge pull request #17425 from ikatyang/fix-17392
Retain literal type for prefix plus on number literal
2017-08-02 18:41:21 -07:00
Wesley Wigham
c06a30ae68 JSDoc Instantiation Fixes (#17553)
* Fix #17383 - issue an error when jsdoc attempts to instantiate a builtin as a generic

* Fix comment

* Fix #17377 - only get type parameters from reference target if the type is a reference

* Fix #17525 - Add SyntaxKind.AsteriskToken to isStartOfType
2017-08-02 13:55:14 -07:00
Anders Hejlsberg
467245780d Merge pull request #17455 from Microsoft/mappedTypeFixes
Mapped and indexed access type fixes
2017-08-02 13:36:37 -07:00
Anders Hejlsberg
98f6761590 Add tests 2017-08-02 12:07:09 -07:00
Tingan Ho
4f3e13ab8c Typo 2017-08-02 20:55:19 +02:00
Tingan Ho
f9e85ec091 Adds missing test cases 2017-08-02 20:48:31 +02:00