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
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
Anders Hejlsberg
a09470f013
Fix index signatures on unions of intersections ( #38278 )
...
* Add missing getApparentType call
* Add regression tests
2020-05-04 12:46:14 -07:00
Alexander T
5e0e254ef7
fix(38177): add auto-import for missing argument type in new functions/methods ( #38213 )
2020-05-04 12:37:04 -07:00
Alexander T
0503da225d
feat(36266): add a quick fix for incorrect return types in async functions
2020-05-04 13:18:52 -04:00
Leko
275ed548df
disallows exponentials with BigInts for targets lower than ES2016
2020-05-04 13:14:48 -04:00
Andrew Branch
53320f59a4
Fix crash on duplicate default exports ( #38272 )
2020-04-30 12:21:02 -07:00
Jack Works
6f7faa7636
Fix: convertFunctionToEs6Class cannot recognize x.prototype = {} pattern ( #35219 )
...
* fix: convertFunctionToEs6Class cannot recognize `x.prototype = {}` pattern
* test: add test for convert fn to es6
* chore: add more tests
* chore: move tests around
* chore: make code more clear
2020-04-30 11:06:46 -07:00
Orta
0258db2210
Adds support for looking up past Blocks in expando objects ( #38031 )
...
* Adds support for looking up past Blocks in expando objects
* Adds JS tests to validate the JS parsing also works
* Get the top level block expando tests green
2020-04-29 10:35:33 -04:00
Anders Hejlsberg
a0ebd2c26e
Guard against recursion in inferTypeForHomomorphicMappedType ( #38224 )
...
* Guard against recursion in inferTypeForHomomorphicMappedType
* Add regression test
2020-04-28 16:56:35 -07:00
Anders Hejlsberg
16d2eb7075
Error on this.xxx access of previously declared but uninitialized property ( #38030 )
...
* Error on this.xxx access of previously declared but uninitialized property
* Add tests
* Accept new baselines
2020-04-28 12:52:14 -07:00
Daniel Rosenwasser
6a6c83cf9a
Revert "Revert "Add check for delete expression must be optional ( #37921 )" ( #38154 )" ( #38173 )
...
This reverts commit 1b8c68d7463e22903978bcb4a8c7dc8e3f7b3beb.
2020-04-27 13:23:45 -07:00
Wesley Wigham
4a5eeb0bb2
Skip comparing optional property flag when comparing against discriminant properties ( #38101 )
2020-04-24 18:33:30 -07:00
Daniel Rosenwasser
1b8c68d746
Revert "Add check for delete expression must be optional ( #37921 )" ( #38154 )
...
This reverts commit 39beb1d011a6bc412a67e1dfa2ec1cb1de438b4f.
2020-04-24 16:05:18 -07:00
Ron Buckton
968943f355
Reset error variable in downlevel for-await-of loop ( #38170 )
...
* Rename forAwait tests
* Reset error var in for-await loop
2020-04-24 14:59:41 -07:00
Daniel Rosenwasser
d28e38f573
Revert "make splice deleteCount required in es5.d.ts ( #32643 )" ( #38169 )
...
This reverts commit ddcf139668c3a0aeda1da6a0d44887735ad37cdf.
2020-04-24 14:30:28 -07:00
Alexander T
31b81bafe7
fix(38138): show suggestions for identifier in class property initializer ( #38157 )
2020-04-24 13:50:34 -07:00
Andrew Branch
ce95d9ca6b
Fix values and types merging in JS module exports ( #37896 )
...
* Fix values and types merging in JS module exports
* Fix everything
* Share `setValueDeclaration` between binder (local merge) and checker (cross-file merge)
* Revert accidental changes to baselines
* Update baseline from master merge
2020-04-24 13:49:48 -07:00
Wesley Wigham
1785d6c707
Special-case export assigned namespaces in getSpecifierForModuleSymbol so they behave like their containing module symbol ( #38151 )
2020-04-24 13:10:34 -07:00
Andrew Branch
fe140acc09
Fix truthiness call check for this-property access ( #38163 )
2020-04-24 13:02:17 -07:00
Ron Buckton
38ff7762ec
Fix temp variable scoping in async generators ( #38121 )
2020-04-24 12:10:29 -07:00
Ron Buckton
a7d6825e25
Fix temp vars referenced in parameter ( #38130 )
...
* Fix temp vars referenced in parameter
* Update error message
2020-04-23 20:45:39 -07:00
Wesley Wigham
815dc90dc5
Issue an error on cross-file merges we cant emit ( #38148 )
2020-04-23 19:01:16 -07:00
Andrew Branch
9569e8aaa4
Fix newline issues when adding multiple imports ( #38119 )
...
* Add new import declarations in a single TextChanges call
* Refactor
2020-04-23 11:59:38 -07:00
Nathan Shively-Sanders
032aa90289
Filter undefined from binding elements with initialisers without undefined in the type ( #38122 )
...
* Filter undefined from binding elts w/o undefined-containing inits
* use getTypeOfInitializer instead
* improve comment based on Wesleys suggestion
2020-04-22 15:45:15 -07:00
Josh Goldberg
ef83109dbf
Prefer a likely literal over anonymous type in --noImplicitAny codefixes ( #36015 )
...
* Prefer a likely literal over anonymous type in --noImplicitAny codefixes
Before trying to make an anonymous type for a type's usage, we'll first check if there is exactly one builtin primitive the usage is assignable to, and use it if so. Right now that's only `number` and `string` because `boolean` has no distinguishable members.
A couple of implementation details:
* `tryInsertTypeAnnotation` needed to know to insert a type _after_ a node's `exclamationToken` if it exists
* This code area was written before `??` 😉
* Used unknown/any instead of void when applicable
* Fix little whitespace change in tests/cases/fourslash/codeFixInferFromUsagePropertyAccessJS.ts
* Undid some now-unnecessary unknown additions
* Took advice on restricting void to just call expressions
2020-04-22 11:28:11 -07:00
Nathan Shively-Sanders
f248567dab
Filter undefined only in binding patterns in params ( #38116 )
...
initialiser. But this is only correct when the initialiser is for a
parameter. For example:
```ts
declare let x: { s: string } | undefined;
const { s } = x;
```
This PR removes undefined from the type of a binding pattern only when
the binding pattern's parent is a parameter. This fixes the regression
from 3.8. However, it's still not the ideal fix; we should be able to
use control flow to solve this problem. Consider:
```ts
const { s }: { s: string } | undefined = { s: 'hi' }
declare function f({ s }: { s: string } | undefined = { s: 'hi' }): void
```
Neither line should have an error, but the first does in 3.8 and after
this change.
2020-04-22 09:56:32 -07:00
Alexander T
d2016912b5
fix(37825): exclude private fields from completions in subclasses ( #37906 )
2020-04-22 12:07:36 -04:00
Alexander T
92a63741a2
fix(38080): add outlining spans for TypeLiteral ( #38089 )
2020-04-22 11:51:36 -04:00
Wenlu Wang
39beb1d011
Add check for delete expression must be optional ( #37921 )
...
* Add check for delete expression must be optional
* Add more tests
2020-04-22 03:12:01 -07:00