5363 Commits

Author SHA1 Message Date
Sheetal Nandi
992c211c22
Merge pull request #32028 from microsoft/referencesPrototypeSourceFile
For editing experience, use source instead of .d.ts files from project references
2019-09-24 13:16:53 -07:00
Nathan Shively-Sanders
f1104806d5
Merge pull request #33263 from microsoft/infer-from-usage/similarity-to-builtins
Infer from usage by similarity to builtin types
2019-09-24 07:44:34 -07:00
Nathan Shively-Sanders
84e857b6f3 use forEachEntry 2019-09-23 15:57:32 -07:00
Martin Probst
6bb7e5c086 Handle parentless nodes in isParameterPropertyDeclaration
Fixes #33295.

This follows a similar pattern as in #20314 by requiring an explicit
`parent` parameter. Where possible, it uses the appopriate variable at
the call sites.

In several locations there is no context available though (e.g.
inspecting `valueDeclarations`) and we access `.parent` as the code
previously did. From a cursory inspection this seems correct, these
callpaths originate in phases where there must be a `parent` (i.e. in
checker, binder, etc).

Change-Id: I28e4726777b57237bec776e4001e9e69ac591b11
2019-09-17 13:22:30 -07:00
Andrew Casey
2f8832cccc
Merge pull request #33469 from amcasey/gh33332
Make extractSymbol explicitly drop JSDoc nodes
2019-09-17 11:42:26 -07:00
Andrew Casey
f10e38fea7 Make extractSymbol explicitly drop JSDoc nodes
Fixes #33332
2019-09-17 10:35:11 -07:00
xiaofa
67aa2b22ac fix conflicts 2019-09-17 19:02:44 +08:00
xiaofa
58e0469252 fix typo 2019-09-17 18:56:19 +08:00
kingwl
93a250b9a6 fix duplicate async modifier codefix 2019-09-14 02:22:59 +08:00
Nathan Shively-Sanders
de7d68a6d8 Even more renaming 2019-09-12 11:30:51 -07:00
Nathan Shively-Sanders
b69f5af08e Merge branch 'master' into infer-from-usage/similarity-to-builtins 2019-09-12 10:50:13 -07:00
Jesse Trinity
fd6fbdf7fe
Show more items in the navbar (#33040)
* show more items in navbar

* fixed missing node kind for property assignments

* updated navBarNestedCommonJsExports test

* updated navigationBarMerging_grandchildren test

* updated navigationBarItemsFunctions test

* updated navigationBarAnonymousClassAndFunctionExpressions test

* updated navigationBarFunctionIndirectlyInVariableDeclaration test

* updated navigationBarInitializerSpans test

* updated navigationBarItemsPropertiesDefinedInConstructors test

* updated tests

* change nav icon for properties with function-like initializers

* add test case for binding element with function-like initializer

* add navigationBarNestedObjectLiterals test

* add navigationBarFunctionLikePropertyAssignments test

* made some silly names less silly (?)

* added SpreadAssignments and ShorthandPropertyAssignments

* new wording for primary menu items
2019-09-11 15:54:27 -07:00
Orta
e8fc62e1a2
Merge pull request #33300 from JoshuaKGoldberg/too-large-integer-bigint-codefix
Added codefix for numeric literals >= 2 ** 53
2019-09-11 22:53:19 +02:00
Sheetal Nandi
b26ca160f4 Merge branch 'master' into referencesPrototypeSourceFile 2019-09-11 12:27:58 -07:00
Orta
fb9b3fe17d
Merge pull request #32345 from dragomirtitian/GH-32325-improve-const-function-extraction
Improved const extraction for function expressions and arrow functions
2019-09-11 21:19:45 +02:00
Titian Cernicova-Dragomir
1d97ae62b6
Update src/services/refactors/extractSymbol.ts
Fixed typo in comment

Co-Authored-By: Orta <orta.therox+github@gmail.com>
2019-09-11 21:20:55 +03:00
Josh Goldberg
99f9719ab3 Added codefix for numeric literals >= 2 ** 53
`Number.MAX_SAFE_INTEGER` is `2 ** 53 - 1`, so anything greater than that is a 'dangerous' integer to store as a traditional number. This adds a codefix to suggest converting them to a `bigint` literal.
2019-09-07 18:43:32 -04:00
Nathan Shively-Sanders
330e51f098 Add test + reshuffle/rename new code 2019-09-06 15:15:19 -07:00
Nathan Shively-Sanders
1703ae0f46 Renames and more cleanup 2019-09-06 11:27:34 -07:00
Nathan Shively-Sanders
f394190572 Tonnes of cleanup 2019-09-06 11:18:50 -07:00
Nathan Shively-Sanders
d32c6b2df1 Fallback type is always any now
void is explicitly inferred now, never used as a fallback.
2019-09-05 16:21:08 -07:00
Nathan Shively-Sanders
052a3d9d73 Infer void from expr statement usage, not calls
This makes inferences a lot better.
2019-09-05 16:16:35 -07:00
Sheetal Nandi
54d9ce9247 Merge branch 'master' into referencesPrototypeSourceFile 2019-09-05 13:51:56 -07:00
Alexander
a381968f21 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-09-05 21:33:19 +03:00
Sheetal Nandi
c26c44d5fc
Merge pull request #32266 from fuafa/properties-priorities
Add properties priority for completion
2019-09-05 11:09:11 -07:00
Andrew Branch
b85134b00d
Fix smart selection bug with TemplateTails (#33108) 2019-09-05 09:01:41 -07:00
Nathan Shively-Sanders
ff38a1bc9b Merge branch 'master' into infer-from-usage/similarity-to-builtins 2019-09-04 10:23:02 -07:00
Alexander T
f0e8518010 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-09-04 11:35:45 +03:00
Sheetal Nandi
0589d2dd1e Value for transpile option in CommandLineOption 2019-09-03 14:24:41 -07:00
Sheetal Nandi
5de0303728 Fix transpiling when options specify incremental or tsbuildinfofile
Fixes #33184
2019-09-03 13:14:50 -07:00
Nathan Shively-Sanders
17d1a7e052 Merge branch 'master' into infer-from-usage/similarity-to-builtins 2019-09-03 12:59:43 -07:00
Alexander
b1d748b644 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-31 22:12:41 +03:00
Nathan Shively-Sanders
383286ff53 Add type parameter inference
It's a smeary copy of the checker's type parameter, so I feel bad about
duplicating that code. Not sure what the solution is, architecturally.
2019-08-30 13:44:06 -07:00
Mine Starks
ad02f47f08
Merge pull request #33148 from minestarks/formatting-object-literals
Fixes #32923
2019-08-30 08:00:00 -07:00
Alexander T
b31d5b37f8 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-30 15:57:05 +03:00
xiaofa
909bc61f01 Add convert const to let 2019-08-30 18:05:07 +08:00
Mine Starks
9781b95bdc Fixes #32923 2019-08-29 15:31:09 -07:00
Armando Aguirre
029f7a3801
Merge pull request #33124 from armanio123/FixGotoMultipleFile
Fixed goto when global declarations are on multiple files
2019-08-29 14:13:32 -07:00
Nathan Shively-Sanders
37150d9cb5 Turn on findBuiltinTypes
Type parameter inference is special-cased, just moved from its previous
place with no improvement.
2019-08-29 12:40:33 -07:00
Titian Cernicova-Dragomir
fa9e0fa8e8 Better outlining spans for prototype methods (#32782)
* Changed outlining to better outline ES5 classes (functions assigned to prototype)

* Changed outlining to better outline ES5 classes (properties assigned to functions)

* Fixed some small bugs when merging es5 class nodes. Added tests for new es5 class outline.

* Added support for interlaced ES5 classes (where an ES5 class's members are mixed with other declarations).

* Fixed crash in outline when assigning {} to the prototype.

* Added support for nested es5 declarations.

* Added support for prototype assignment for es5 classes.
2019-08-29 09:19:04 -07:00
Alexander T
49f1a79c1f Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-29 09:35:19 +03:00
Andrew Branch
cd371daf77
Fix writing multi-line text without semicolons (#32903)
* Fix semicolon-omitting writer

* Use writeTrailingSemicolon for do statements
2019-08-28 16:28:31 -07:00
Armando Aguirre
09a5b68a85 Fixed goto when declarations are on multiple files 2019-08-28 15:14:19 -07:00
Nathan Shively-Sanders
945d423ef5 Fix bugs in combineUsages/getSignatureFromCalls 2019-08-28 14:12:21 -07:00
Nathan Shively-Sanders
c93f9193ce Merge branch 'master' into infer-from-usage/similarity-to-builtins 2019-08-28 12:57:22 -07:00
Wenlu Wang
af9ca21643 add support for extract as interface (#31644)
* add support for extract as interface

* fix action assert

* Donot provide convert to interface if duplicate member
2019-08-28 11:34:40 -07:00
Alexander T
f8ab00b407 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-28 10:11:38 +03:00
Nathan Shively-Sanders
13e1ccdd01
goto-def should treat constructor functions as functions (#33109)
* goto-def:special handling for constructor functions

* Just treat constructor functions like functions

* Even simpler fallback
2019-08-27 16:22:22 -07:00
Nathan Shively-Sanders
d347b08a42 Copied from old branch
1. Everything explodes! Out of stack space!
2. Results aren't used yet.
3. But call and construct use the new getSignatureFromCalls, so I expect
some baseline changes after I get the infinite recursion fixed.
2019-08-27 13:13:58 -07:00
Nathan Shively-Sanders
4fc12d7b03
Close over common variables in inferTypeFromReferences (#33095)
Also lots of renaming
2019-08-27 09:02:58 -07:00