Commit Graph

19850 Commits

Author SHA1 Message Date
Andrew Casey
4de6b0dd2d Introduce and consume suppressLeadingAndTrailingTrivia
Fixes #18626
2017-10-12 11:34:34 -07:00
Andrew Casey
c2150f4d26 Merge pull request #19132 from amcasey/JumpInFinallyTest
Add missing test coverage for jumps in finally blocks
2017-10-12 11:25:11 -07:00
Andrew Casey
b12947a35b Merge pull request #18931 from amcasey/ExtractConstantThis
Allow Extract Constant into enclosing scope in spite of RangeFacts.UsesThis
2017-10-12 11:25:00 -07:00
Nathan Shively-Sanders
54ad9a6c82 Merge pull request #19112 from Microsoft/fill-missing-type-arguments-during-error-reporting
Fill missing type arguments during error reporting
2017-10-12 11:02:25 -07:00
Nathan Shively-Sanders
27b4417304 Assert:checkTypeArguments isn't passed too many type arguments 2017-10-12 10:38:02 -07:00
Mohamed Hegazy
4487917f89 Quick fix for no-implicit-any errors to add explicit type annotation (#14786)
* Infer from usage quick fix

* Change full function singature

* Add property/element access support

* Fix a few issues

* Some cleanup

* Expose getArrayType and getPromiseType

* Switch to collecting all usage before infering

* Infer array and promise type arguments

* Handel enums in binary operators

* consolidate usage of addCandidateTypes

* Handel rest paramters

* Properly handel `+=` and `+` inference for numbers and strings

* Add print quickfixes debug helper

* Add rest param tests

* Add optional paramter tests

* Handel set accessors

* Support getters

* Support no implicit any error for variable at use site

* Support properties

* Only offer quick fix if an infered type other than any is available

* Rename functions

* Move to a separate namespace

* Check cancellation token

* Cleanup

* Check for accesibile symbols where serializing types

* Remove JS support

* Reorganize functions

* Mark APIs as internal

* Fix lint errors

* Removed conflict markers.

* Update 'createSymbol' to use '__String'.

* Fixed most problems relating to '__String' and 'includeJsDocComments' in the fix itself.

* Addressed most API changes.

* Make all helpers internal

* Use a diffrent writer and not the built-in single line write

* Infer types for all parameters in a parameter list instead of one at a time

* Accept baselines

* Code review commments

* Respond to code review comments
2017-10-12 10:14:58 -07:00
Nathan Shively-Sanders
8ea13bef48 Fix lint 2017-10-12 10:11:09 -07:00
Nathan Shively-Sanders
da0c79f2a3 Simplify checkTypeArguments based on PR comments 2017-10-12 10:09:52 -07:00
Andrew Casey
e4313f62c6 Add missing test coverage for jumps in finally blocks 2017-10-12 09:45:10 -07:00
Andrew Casey
73826bdb7b Allow Extract Constant into enclosing scope in spite of RangeFacts.UsesThis 2017-10-12 09:32:05 -07:00
Andrew Casey
b5e6b890f1 Merge pull request #18997 from amcasey/ExtractDeclaration
Allow extraction of variable decls used outside the extracted range
2017-10-12 09:31:19 -07:00
Sheetal Nandi
6e5a4a9476 Merge pull request #18959 from Microsoft/configFileDiag
Do not report config file errors if the file opened isn't from configured project and that project doesn't have the config errors
2017-10-12 08:56:00 -07:00
Sheetal Nandi
5a776e28ba Merge pull request #19088 from Microsoft/resolutionCacheDefensiveChecks
Function to clear the per directory resolution
2017-10-12 08:55:17 -07:00
Andrew Casey
1b896c2f80 Fix lint error 2017-10-11 17:35:52 -07:00
Andrew Casey
c5f40a1b2b Add additional deep clone tests 2017-10-11 17:26:41 -07:00
Anders Hejlsberg
728d2a92ce Merge pull request #19091 from Microsoft/fixAnonymousTypeInstantiation
Fix anonymous type instantiation
2017-10-12 00:54:14 +01:00
Andrew Casey
568c8a3298 Allow extraction of variable decls used outside the extracted range
If there are only declarations, use the new function as the initializer
for a destructuring declaration.

If there are declarations and writes, changes all of the `const`
declarations to `let` and add `| undefined` onto any explicit types.
Use destructuring assignment to accomplish both "initialization" and
writes.

I don't believe there is a case where there are both declarations and a
return (since the declarations wouldn't be available after the return).

UNDONE: this could probably be generalized to handle binding patterns
but,
for now, only identifiers are supported.

Fixes #18242
Fixes #18855
2017-10-11 16:38:38 -07:00
Andrew Casey
bada0095ed Merge pull request #18979 from amcasey/DeepClone
Introduce getSynthesizedDeepClone
2017-10-11 16:36:25 -07:00
Anders Hejlsberg
6cf41ae882 Merge pull request #19107 from Microsoft/fixRecursiveCallbacks
Fix checking of recursive callback types
2017-10-12 00:28:16 +01:00
Anders Hejlsberg
7ee96293ca Accept new baselines 2017-10-11 16:03:23 -07:00
Anders Hejlsberg
19f70f6d3d Add additional test 2017-10-11 16:03:15 -07:00
Anders Hejlsberg
9ef417b846 Account for type queries in type literals 2017-10-11 16:02:58 -07:00
Nathan Shively-Sanders
d00ab417c6 checkTypeParameters now always calls fillMissingTypeArguments
And refactor checkTypeParameters to be easier to use and to read.
2017-10-11 15:58:54 -07:00
Andrew Casey
eb4f067ecb Don't clobber the position of cloned nodes 2017-10-11 15:52:48 -07:00
Sheetal Nandi
562a0463bc Merge pull request #19111 from Microsoft/useCaseSensitiveProjectRootToSearchConfigFile
Handle case sensitivity when looking up config file for Script info
2017-10-11 15:31:00 -07:00
Wesley Wigham
b949245336 Add ValueModule as a valid object literal type, as they are immutable (#19090)
* Add ValueModule as a valid object literal type, as they are immutable

* Rename method based on usage
2017-10-11 15:13:33 -07:00
Wesley Wigham
9f4130b204 Fix incorrect cast target (#19093)
Found while updating #18285 to latest master. Not sure what this fixes, but it was definitely incorrect - `node` must be a `Block` at this point, so this cast must have been intended for `node.parent`, which was checked against `TryStatement` right before it.
2017-10-11 14:52:23 -07:00
Andy
917ae32937 Always log output of execSync (#19110)
* Always log output of execSync

* Fix lint
2017-10-11 14:50:45 -07:00
Nathan Shively-Sanders
156e7e2069 Test:Incorrect number of type args during err reporting 2017-10-11 14:02:20 -07:00
Nathan Shively-Sanders
3fef16008d Fill missing type arguments during error reporting
Previously, only the success path did this; it was missing in the error
reporting path in resolveCall. This resulted in crashes for unsupplied
type arguments when the supplied type arguments were incorrect.
2017-10-11 14:01:25 -07:00
Mohamed Hegazy
7e1dd66c19 Update to use help wanted instead of Accepting PRs (#19105) 2017-10-11 13:44:07 -07:00
Sheetal Nandi
deed981715 Handle case sensitivity when looking up config file for Script info
Fixes #17726
2017-10-11 13:35:06 -07:00
Nathan Shively-Sanders
461e29bbd8 Merge pull request #18965 from Microsoft/set-symbol-on-union-of-spreads
Set symbol on union that is returned from `getSpreadType`
2017-10-11 13:25:45 -07:00
Ron Buckton
73d06f796d Merge pull request #19056 from Microsoft/fix16221
Fix recursive reference in type parameter default
2017-10-11 12:49:35 -07:00
Sheetal Nandi
bce77fdfd9 Merge pull request #18960 from Microsoft/builderHandlesChangeInResolution
Builder handles changes in resolution/references when file's contents dont change
2017-10-11 12:11:44 -07:00
Ron Buckton
26290a88ac Updated error baseline 2017-10-11 12:07:16 -07:00
Anders Hejlsberg
38cec12190 Accept new baselines 2017-10-11 12:02:01 -07:00
Anders Hejlsberg
07e4819b8b Add regression test 2017-10-11 12:01:38 -07:00
Anders Hejlsberg
81fc2a14d1 Don't check for callbacks in recursive call that resulted from callbacks 2017-10-11 12:01:26 -07:00
Ron Buckton
d08770bdff Merge pull request #19046 from Microsoft/fix15395
Fix emit for classes with both fields and 'extends null'
2017-10-11 11:49:22 -07:00
Sheetal Nandi
142a88a4ae Update the comment on emit handler method 2017-10-11 10:51:46 -07:00
Andy
e85c6330ba Add package-lock.json to repository (#19099) 2017-10-11 10:03:53 -07:00
Andy
0c4fe37a92 In issue template, recommend to use typescript@next (#19098) 2017-10-11 10:03:29 -07:00
Charles Pierce
576bd8c25f Ensure Async Modifier is maintained through ES6 Class Conversion (#19092) 2017-10-11 09:04:51 -07:00
Nathan Shively-Sanders
de68f067d5 Set flags on fresh object types from getSpreadType
Previously, getSpreadType didn't set any flags and relied on its callers
to do so. This was error-prone because getSpreadType often returns
non-fresh types.
2017-10-11 08:17:40 -07:00
Sheetal Nandi
cf9b83accc Instead of counting events with name, verify each event to not equal event name 2017-10-10 21:15:20 -07:00
Sheetal Nandi
993890f06c Verify errors more correctly in tsc-watch mode 2017-10-10 21:11:33 -07:00
Sheetal Nandi
9767d77143 Update comment on emit handler functions 2017-10-10 18:41:45 -07:00
Sheetal Nandi
a7fa187fb2 Merge pull request #19058 from Microsoft/whenWatchesFail
Swallow the directory watcher exceptions and ignore them
2017-10-10 18:32:22 -07:00
Sheetal Nandi
7f1ddaf7b8 Merge branch 'master' into configFileDiag 2017-10-10 18:30:59 -07:00