Commit Graph

3728 Commits

Author SHA1 Message Date
Nathan Shively-Sanders
c2c18a8d06 Merge branch 'master' into refactor-jsdoc-types-to-typescript 2017-10-12 14:18:28 -07:00
Nathan Shively-Sanders
123347d5c4 Convert @template tag to type parameters in refactor 2017-10-12 11:40:07 -07:00
Andrew Casey
4de6b0dd2d Introduce and consume suppressLeadingAndTrailingTrivia
Fixes #18626
2017-10-12 11:34:34 -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
Mohamed Hegazy
260d37e8ea Merge branch 'master' into refactor-jsdoc-types-to-typescript 2017-10-12 10:23:21 -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
Andrew Casey
73826bdb7b Allow Extract Constant into enclosing scope in spite of RangeFacts.UsesThis 2017-10-12 09:32:05 -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
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
Andrew Casey
eb4f067ecb Don't clobber the position of cloned nodes 2017-10-11 15:52:48 -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
Nathan Shively-Sanders
d7424b00b2 Merge branch 'master' into refactor-jsdoc-types-to-typescript 2017-10-11 13:41:45 -07:00
Nathan Shively-Sanders
4930cad653 Convert all JSDoc parameters and return types of functions 2017-10-11 13:33:31 -07:00
Charles Pierce
576bd8c25f Ensure Async Modifier is maintained through ES6 Class Conversion (#19092) 2017-10-11 09:04:51 -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
e30a66d22f Add utitlity for stringContains 2017-10-10 17:16:39 -07:00
Sheetal Nandi
61dd815ebc Merge pull request #19072 from Microsoft/completionInClassMember
Handle the case of completion of class member when member name is being edited
2017-10-10 15:45:11 -07:00
Charles Pierce
249c2cbaf7 Maintain Export Modifier when Refactoring to ES6 Class #18435 (#19070) 2017-10-10 15:39:59 -07:00
Andrew Casey
d33a9acbcc Merge pull request #18950 from amcasey/MissingMemberFormatting
Improve AddMissingMember formatting
2017-10-10 13:12:05 -07:00
Andrew Casey
18afd8a50d Optimize getSynthesizedDeepClone 2017-10-10 13:08:57 -07:00
Andrew Casey
9ece0cc956 Move getSynthesizedDeepClone to services/utilities.ts 2017-10-10 13:01:11 -07:00
Sheetal Nandi
3171d082a6 Handle the case of completion of class member when member name is being edited
Fixes #17977
2017-10-10 10:58:21 -07:00
Andy
9ccc1b4887 Remove unnecessary uses of any in shims.ts (#19038) 2017-10-10 10:54:29 -07:00
Andy
8b60736b61 importFixes: Remove unnecessary undefined check (#19045) 2017-10-09 13:39:15 -07:00
Andy
71f8852124 Have getNameOfDeclaration return x for export default x. (#18616) 2017-10-06 14:29:45 -07:00
Andrew Casey
ad148dbc88 Use deep cloning, rather than thunking for repeated substitution
Replaces b244cd4fb4
2017-10-05 15:46:14 -07:00
Daniel Rosenwasser
ea2021dd3e Create fix for uninvoked decorators. 2017-10-05 11:43:14 -07:00
Benjamin Lichtman
43084829bc Increase maximum depth of outlining span search (#18704)
* Increase max depth of outlining spans to 120

* Update tests

* Update tests to demonstrate limit

* Set limit to 40 and update tests
2017-10-04 13:48:08 -07:00
Andrew Casey
530e107d51 Merge pull request #18936 from amcasey/GH18899
Localize more Extract Function/Constant strings
2017-10-04 13:33:06 -07:00
Andrew Casey
02f2a29ca2 Stop combining already-translated strings 2017-10-04 12:39:32 -07:00
Andy
de9c459d5e Clean up code in getModifierOccurrences (#18948) 2017-10-04 12:20:58 -07:00
Andrew Casey
4cf289e1a5 Fix whitespace around inserted property initializer
Fixes #18741
2017-10-04 11:26:41 -07:00
Andrew Casey
686fd1e62d Fix whitespace around inserted static property
Fixes #18743
2017-10-04 11:23:58 -07:00
Andrew Casey
d03d237b3b Merge pull request #18929 from amcasey/ExtractVoidNever
Stop extracting void and never constants
2017-10-04 10:33:05 -07:00
Andy
6617819bf3 In getModifierOccurrences, support additional container kinds (#18947) 2017-10-04 09:52:51 -07:00
Andrew Casey
bcdfdd276f Call getLocaleSpecificMessage 2017-10-03 18:10:58 -07:00
Andrew Casey
559689f66f Localize more Extract Function/Constant strings
Fixes #18899
2017-10-03 17:18:12 -07:00
Andrew Casey
443812a045 Stop extracting void and never constants 2017-10-03 15:07:39 -07:00
Andrew Casey
d1015bff06 Merge pull request #18926 from amcasey/ExtractConstantArrow
Disallow constant extraction into expression-bodied arrow functions
2017-10-03 14:29:01 -07:00
Andrew Casey
2cb965c268 Disallow constant extraction into expression-bodied arrow functions
...until https://github.com/Microsoft/TypeScript/issues/18924 is fixed.
2017-10-03 13:34:20 -07:00
Andrew Casey
b9fb1733ef Merge pull request #18919 from amcasey/ExtractLocalRefinements
Improve Extract Constant's handling of expression statements
2017-10-03 13:19:39 -07:00
Andrew Casey
7b1147fbce Stop inadvertently exempting expression statements from check 2017-10-03 12:23:32 -07:00
Andrew Casey
2a4ab08655 Refine extraction of expression statements
1) Replace range, rather than node, to leave trivia intact.
2) Only replace node in the innermost scope - otherwise insert as usual
and delete the original statement.
2017-10-03 11:18:40 -07:00
Andy
b111493276 Remove unnecessary *OrUndefined calls (#18889)
* Remove unnecessary *OrUndefined calls

* Add 'first'
2017-10-03 10:24:39 -07:00
Andrew Casey
b21d8a4742 Merge pull request #18900 from amcasey/ReduceDup
Refactor to reduce property duplication
2017-10-03 10:04:03 -07:00
Mohamed Hegazy
ae3f29ade6 Accept baselines (#18903) 2017-10-02 19:08:13 -07:00
Sheetal Nandi
6997e9b731 Merge pull request #17269 from Microsoft/watchImprovements
Watch improvements in tsserver
2017-10-02 17:38:22 -07:00
Andrew Casey
b244cd4fb4 Merge pull request #18864 from amcasey/GH18857
Handle repeated substitution of the same symbol during extraction
2017-10-02 17:03:03 -07:00