Commit Graph

10136 Commits

Author SHA1 Message Date
Daniel Rosenwasser
62675a58d6 Merge pull request #38481 from a-tarasyuk/bug/38463
fix(38463): No indexed access completions after Record<...>
2020-05-21 13:44:44 -07:00
Alexander T
c00aeb5486 fix(33286): add outlining for arrow function with one parameter (#38631) 2020-05-21 08:07:47 -07:00
Alexander T
e40a2bca57 Merge branch 'master' of https://github.com/microsoft/TypeScript into bug/38463 2020-05-21 16:33:35 +03:00
Nathan Shively-Sanders
fc83d10388 Merge branch 'master' into diagnose-accidental-accessor-call 2020-05-20 16:46:34 -07:00
Nathan Shively-Sanders
3340142dda Merge pull request #38607 from a-tarasyuk/bug/38295
fix(38295): Duplicated object key in const not detected when the key is a number preceded by `-` or `+`
2020-05-20 14:52:09 -07:00
Alexander T
4e945fbc98 fix(38299): use string literals as keys to creating rest result (#38600) 2020-05-20 13:52:52 -07:00
Anders Hejlsberg
a56960303d Intersection check for empty object type shouldn't cause circularities (#38673)
* isEmptyAnonymousObjectType shouldn't require full member resolution

* Add regression test
2020-05-20 10:56:14 -07:00
Alexander T
bbf56b044b Merge branch 'master' of https://github.com/microsoft/TypeScript into bug/38295 2020-05-20 20:13:50 +03:00
Alexander T
e04ab6938a fix(38295): handle duplicate object literal keys which contain '+' and '-' tokens 2020-05-20 14:32:41 +03:00
Alexander T
528d82afd1 Merge branch 'master' of https://github.com/microsoft/TypeScript into bug/38463 2020-05-20 11:04:55 +03:00
Alexander T
1c72da6e49 fix(38463): show completions for index access properties 2020-05-20 10:17:20 +03:00
Wesley Wigham
5f597e69b2 Support naming tuple members (#38234)
* Initial draft of named tuple members

* Show tuple labels and documentation in completions

* Swap allowed syntax to parameter-like

* Add quickfix for labeled tuple syntax mistakes

* Add refactoring to convert list of signatures to single overload

* Fix small bug in visitor verification

* Signature help for rest parameters which are unions of tuples are displayed as seperate entries now

* Expand sanity check test cases in conformance suite

* Add tests and code for preserving tuple names through spreads where possible

* More refactoring tests, some comment preservation and some fixed formatting of multiline tuples

* Handle missing parameter named in isValidDeclarationForTupleLabel

* Minor text fixes
2020-05-19 15:54:02 -07:00
Jack Works
7ec467e270 fix: extract const in jsx (#37912)
* fix: extract const in jsx

* Update src/services/refactors/extractSymbol.ts

Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>

* Update src/services/refactors/extractSymbol.ts

Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>

Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
2020-05-19 14:29:49 -07:00
Nathan Shively-Sanders
415b2e7969 Merge pull request #38656 from a-tarasyuk/bug/33233
fix(33233): Code Folding on es5 object functions does not work (getOutliningSpans)
2020-05-19 14:18:42 -07:00
Anders Hejlsberg
7ba0a6592d No contextual types from circular mapped type properties (#38653)
* No contextual types from circular mapped type properties

* Add regression test
2020-05-19 13:42:30 -07:00
Andrew Branch
707e977056 Ensure formatter can always get a newline character (#38579)
* Ensure formatter can always get a newline character

* Make FormatContext.host optional since it’s not necessary if format options are all applied

* Make FormattingHost required again
2020-05-19 13:14:32 -07:00
Alexander T
2b703d254a fix(33233): add outlining for comments before property access expression 2020-05-18 15:26:46 +03:00
Anders Hejlsberg
3c1f37e913 Use control flow analysis to check 'super(...)' call before 'this' access (#38612)
* Use CFA graph to check this/super accesses are preceded by super() call

* Accept cleaned-up API baselines

* Accept new baselines

* Add tests
2020-05-16 19:58:17 -07:00
Eli Barzilay
33c3e9e2c6 Make processTaggedTemplateExpression visit a returned node
This problem was introduced in 70399e146e (from PR #23801), which added
a `visitTaggedTemplateExpression` case for `TaggedTemplateExpression`,
before that, it would fallback to the default of `visitNode`.  So re-add
that happen in `processTaggedTemplateExpression`.

Since it doesn't hurt, I left a `Debug.checkDefined(property.name)`
instead of `!`-ing it.

Fixes #38558.
2020-05-15 19:46:45 -04:00
Eli Barzilay
d7dd06e36d goToDefinition: find only the value if it's the RHS of an assignment 2020-05-15 18:55:57 -04:00
Ron Buckton
1cbe7ef000 Fix crash in JS declaration emit (#38508)
* Fix crash in JS decl emit

* Emit as class with private ctor
2020-05-15 14:00:59 -07:00
Wesley Wigham
7fc456f2d7 Include unknown in spread prop override check (#38577) 2020-05-14 14:36:38 -07:00
Anders Hejlsberg
c1f676dd3f Perform intersection reduction before and after getApparentType (#38565)
* Perform intersection reduction before and after getApparentType

* Add regression tests
2020-05-13 20:57:17 -07:00
Alexander T
71711257ea fix(33836): allow readonly modifier for a field with only get accessor (#36543) 2020-05-13 13:28:32 -07:00
Daniel Rosenwasser
b682ee1a8a Merge pull request #38489 from microsoft/removeDuplicateInfo
Remove duplicate JSDoc comments
2020-05-12 12:52:15 -07:00
Nathan Shively-Sanders
3f06adf662 Merge pull request #38240 from a-tarasyuk/feat/add-outlining-spans-for-object-destructuring-elements
feat: Add outlining spans for object destructuring elements
2020-05-12 07:35:03 -07:00
Nathan Shively-Sanders
cbf15bb6ed feat(38225): change diagnostic message for remove braces from arrow function body (#38226) 2020-05-12 07:27:09 -07:00
Alexander T
5895493815 fix(37877): include in NavigationBar default exported child items (#38255) 2020-05-12 07:26:31 -07:00
Ron Buckton
d07e866a28 Fix for jsdoc modifiers on constructor params (#38403)
* Fix for jsdoc modifiers on constructor params

* Update Public API baseline and fix unique symbol grammar check for js
2020-05-11 15:07:43 -07:00
Daniel
1450908e5c Added tests for union types with identical doc comments. 2020-05-11 21:36:43 +00:00
Wenqi
1b7b3eb0f7 report error for duplicate @type declaration (#38340) 2020-05-11 12:47:49 -07:00
Alexander T
738b6b5b68 fix(38073): hide 'Extract to function in global scope' action for arrow functions which use 'this' (#38107) 2020-05-11 12:25:25 -07:00
Wesley Wigham
7b03835b77 Fix js missing type arguments on existing nodes and jsdoc object literal declaration emit (#38368)
* Fix js missing type arguments on existing nodes and jsdoc object literal declaration emit

* Add special lookups test case, rename helper

* Accept slightly modified baselines
2020-05-08 10:46:28 -07:00
Anders Hejlsberg
0091fd6c64 Exclude arrays and tuples from full intersection property check (#38395)
* Exclude arrays and tuples from full intersection property check

* Add regression test
2020-05-07 15:03:51 -07:00
Anders Hejlsberg
7798f532df Fix crash caused by assertion with evolving array type (#38398)
* Properly finalize evolving array type in getTypeAtFlowCall

* Add regression test
2020-05-07 14:05:57 -07:00
Eli Barzilay
29cf049e61 moveToNewFile: handle namespace imports too
Fixes #35591
2020-05-07 11:46:36 -04:00
Jack Williams
05d59a1f1a Unify logic in typeof narrowing (#33434) 2020-05-06 15:15:24 -07:00
Alexander T
683b3ec058 feat(37782): 'declare method' quick fix for adding a private method (#37806)
* feat(37782): add quick-fix action to declare a private method for names that start from underscore

* better merge order in messages json

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-05-06 15:10:02 -07:00
Wenlu Wang
8d78984558 Add support of contextual quick info (#37451)
* Add support of contextual quick info

* Avoid document comment map

* Make lint happy

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-05-06 15:05:31 -07:00
Josh Goldberg
be2eb8a2e1 Allowed comment directives to be multiline (#38228)
* Allowed comment directives to be multiline

* Added tests, and perhaps fixed a test runner bug?

* I think it's going to need a consistent variable to loop over

* Used dynamically computed indexes in verifies

* Added multiline tests

* Increased flexibility for multiline comment parsing

* Undid a couple of formatting changes; removed backslashes from multiline regexp

* Added baseline tests for multiline comment skipping

Co-authored-by: Orta Therox <orta.therox@gmail.com>
2020-05-06 13:09:29 -07:00
Ron Buckton
4b08c0582d Fix regression in name resolution in parameter (#38351) 2020-05-06 12:04:28 -07:00
Alexander T
ec93a7cf7b fix(36055): forbid union type with invalid types in the 'in' operator (#37786) 2020-05-06 11:41:50 -07:00
Anders Hejlsberg
2524fb164a Consistent narrowing by discriminant (#38311)
* Consistent requirements for narrowing by discriminant

* Add tests
2020-05-05 20:06:07 -07:00
Alexander T
c219fdae08 fix(37703): forbid required parameter after optional (#38155) 2020-05-05 10:29:17 -07:00
Alexander T
d86bdf4e5c add outlining spans for the tuple type (#38179) 2020-05-05 09:48:33 -07:00
Alexander T
2bdc8fdc94 add outlining spans for array destructuring elements (#38191) 2020-05-05 09:29:24 -07:00
Daniel Rosenwasser
94c5c3ff47 Add missing arguments to typeToTypeNode. (#38336)
* Add missing arguments to typeToTypeNode.

* Use returnTypeNode as the enclosingDeclaration.

* Add a test.
2020-05-04 19:32:27 -07:00
Anders Hejlsberg
e6390efb01 Properly handle private/protected members in unions of object types (#38277)
* Property handle private/protected properties in unions of object types

* Add regression test
2020-05-04 15:28:00 -07:00
Wesley Wigham
d9c9c9d9e4 Harden node builder APIs to no longer return undefined for a node when NodeBuilderFlags.IgnoreErrors is provided (#38273) 2020-05-04 14:47:39 -07:00
Sheetal Nandi
aa37b28246 Fix incorrect line text computation to stop comment directive searching (#38296)
Fixes #38289
2020-05-04 13:02:54 -07:00