Commit graph

19863 commits

Author SHA1 Message Date
Armando Aguirre
8004fec2ce Addressed PR comments: added simplified/full version, changed design 2017-10-18 14:48:06 -07:00
Armando Aguirre
b86153da88 Changed command designed based on review input 2017-10-16 17:50:35 -07:00
Armando Aguirre
c6a8a32b71 Fixed api reference tests 2017-10-13 16:36:25 -07:00
Armando Aguirre
1cb2d24c5d Added DefinitionAndBoundSpan command 2017-10-12 17:18:38 -07:00
Andrew Casey
d940cdadfe Merge pull request #19141 from amcasey/MissingNewlineAtEOF
Insert a line break before a function at EOF if needed
2017-10-12 15:28:37 -07:00
Wesley Wigham
de0e475c64 Recreate old decorator metadata behavior (#19089)
* Emulate pre 2.4 metadata behavior of eliding null and undefined from unions without strictNullChecks

* Accept baseline

* Update comment

* Update for second old baseline

* Respect strict
2017-10-12 15:05:04 -07:00
Andrew Casey
2ea4cfe23b Insert a line break before a function at EOF if needed
This is a pre-existing issue that became more obvious after refining
trivia handling.
2017-10-12 14:19:36 -07:00
Andrew Casey
98f04e6cfd Merge pull request #19135 from amcasey/GH18626
Introduce and consume suppressLeadingAndTrailingTrivia
2017-10-12 14:10:28 -07:00
Andrew Casey
6bfad52225 Update missed baseline 2017-10-12 13:23:08 -07:00
Wesley Wigham
9af21eb00e Transform nested dynamic imports (#18998)
* Fix nested dynamic imports when targeting es6

* Fixup nested dynamic imports when targeting downlevel

* Remove duplicated expressions in UMD emit

* Code review feedback, clone arg if need be

* More CR feedback, apply user quotemark styles

* Remove blank lines

* Use behavior of visitEachChild instead of enw codepath, add new test, use createLiteral to retain quotemarks

* Set lib flag for test
2017-10-12 12:53:12 -07:00
Sheetal Nandi
29ed92e20d Merge pull request #19118 from Microsoft/caseSensitivityInferredProjectRoot
Handles case sensitivity of project root with respect to inferred projects
2017-10-12 11:49:29 -07:00
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
625486455d Update public api baseline 2017-10-12 09:02:22 -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
4d7c112ef7 Make sure project root paths of inferred projects are canonical when comparing 2017-10-11 15:33:17 -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