Commit Graph

10531 Commits

Author SHA1 Message Date
Michael
71cd5d522d Fix two issues with ConvertToTypeOnlyExport codefix (#40490)
* Modify test case to reproduce error

* Fix TypeOnlyExport codefix to work with 3 or more type exports in the same declaration

The check to ensure that a fixed export declaration wasn't fixed again
was reversed. This only surfaced when 3 or more type exports existed in
the same declaration.

* Add failing test cases for comments being duplicated

* Fix convertToTypeOnlyExport codefix from duplicating leading comments

* Simplify convertToTypeOnlyExport when change is just inserting `type` keyword

Co-authored-by: Andrew Branch <andrew@wheream.io>
2020-10-27 15:08:20 -07:00
Oleksandr T
9ed608b439 fix(41244): ignore synthesized imports (#41267) 2020-10-27 13:22:02 -07:00
Wesley Wigham
c923023494 Merge pull request #41191 from weswigham/control-flow-comma-exprs
Track control flow for comma expressions in call expressions
2020-10-27 12:37:02 -07:00
Anders Hejlsberg
f9dcd9ef98 Don't cache Ternary.Maybe results when recursion is encountered during variance measurement (#41218)
* Don't record Ternary.Maybe results in cache during recursive variance measurement

* Add regression test

* Accept new baselines

* Use Ternary.Unknown to signal variance recursion

* Add comments

* Fix comment
2020-10-27 10:53:13 -07:00
Oleksandr T
3754bb4455 fix(40994): change type for optional properties (#41011) 2020-10-27 10:05:40 -07:00
Daniel Rosenwasser
3517af8f80 Make 'getIndentString' just use a loop. (#41221)
* Make 'getIndentString' just use a loop.

* Added test.

* Accepted baselines.
2020-10-26 12:19:31 -07:00
Wesley Wigham
94b0e0e389 Merge pull request #41190 from weswigham/handle-binding-element-aliases
Handle the new js binding element alias symbols in JS declaration emit
2020-10-23 10:31:08 -07:00
Anders Hejlsberg
d1f87d18b1 Support partial reverse mapped inferences with tuple types (#41106)
* Support partial reverse mapped inferences with tuple types

* Add tests

* Accept new baselines
2020-10-22 11:27:41 -07:00
Wesley Wigham
6dde1621cb Track control flow for comma expressions in call expressions 2020-10-21 12:31:29 -07:00
Anders Hejlsberg
5d021b401a Don't reduce 'keyof M' for mapped types with non-distributive 'as' clauses (#41186)
* Don't reduce 'keyof M' for mapped types with non-distributive as clauses

* Add regression test

* Accept new baselines
2020-10-21 12:16:46 -07:00
Wesley Wigham
f4255dd237 Handle the new js binding element alias symbols in JS declaration emit 2020-10-21 11:24:19 -07:00
Andrew Branch
1f852ed747 Percent-encode source map URLs (#41102) 2020-10-20 13:11:52 -07:00
Wesley Wigham
0ad22de146 Merge branch 'master' into fix/create-element-new-jsx-transform 2020-10-19 15:21:52 -07:00
Wesley Wigham
aa9445bc15 Merge branch 'master' into empty-jsx-child 2020-10-19 14:54:20 -07:00
Wesley Wigham
b8dfa28ca8 Do not consider empty jsx expressions semantically important children 2020-10-19 13:34:16 -07:00
Anders Hejlsberg
4638c685b1 Properly reduce intersections of string literal and template literal types (#41162)
* Properly reduce single element intersections

* Add regression test

* Accept new baselines
2020-10-19 13:05:29 -07:00
Anders Hejlsberg
3918e6c535 Move anonymous type instantiation cache from AST node to root type (#41084)
* Move anonymous type instantiation cache from AST node to root type

* Use "root" type reference as cache location for deferred type references

* Add test

Co-authored-by: Andrew Branch <andrew@wheream.io>
2020-10-19 07:26:48 -07:00
Mateusz Burzyński
43433eb2f1 Add tests related to the key prop when using new JSX transform 2020-10-17 15:20:39 +02:00
Wesley Wigham
ce1947b0be Merge pull request #41070 from weswigham/use-minimal-endings-in-bundled-declaration-emit
Use minimal endings when generating declarations for js
2020-10-14 15:29:50 -07:00
Eli Barzilay
5b2fba3334 transformGenerators: handle CommaListExpression
Uses essentially the same code as `visitCommaExpression` (which was
moved, to keep both together and close to
`visit{Right,Left}AssociativeBinaryExpression`).

Fixes #40614.
2020-10-14 15:58:13 -04:00
Wesley Wigham
84726be01a Merge pull request #40597 from weswigham/allow-instanceof-array-to-narrow-readonly-array
Handle the mapping between Array and ReadonlyArray in isTypeDerivedFrom
2020-10-13 15:08:17 -07:00
Alex T
417b8a9481 fix(29881): infer quote preference for property access conversion in completions (#41041) 2020-10-13 10:06:27 -07:00
Wesley Wigham
1cdb621257 Use minimal endings when generating declarations for js 2020-10-12 16:01:32 -07:00
Andrew Branch
83d02a5f05 Fix auto imports for export default edge cases (#41068) 2020-10-12 15:42:58 -07:00
Andrew Branch
a09a7144e7 Fix crash resolving ImportTypeNode in JSDoc (#40838) 2020-10-12 09:33:39 -07:00
Alex T
05be3b421a fix: show deprecated error for alias (#40961) 2020-10-12 08:45:08 -07:00
Nathan Shively-Sanders
a109b5d5c8 Fix relative paths in commonjs decl emit w/property access (#40986)
```js
const x = require('./foo').y
```

was incorrectly using the unmangled require path as the temp name in
emit:

```
import ./foo_1 = require('./foo')
import x = ./foo_1.y
```

It now uses the imported identifier:

```
import x_1 = require('./foo')
import x = x_1.y
```

Discovered while fixing #37832
2020-10-09 16:32:57 -07:00
Wesley Wigham
aee18e0725 Merge pull request #41017 from weswigham/fix-unchecked-cast-crash
Fix crash due to unchecked cast in addImplementationSuccessElaboration
2020-10-09 15:58:08 -07:00
Andrew Branch
4766a2e5a3 Fix overlapping changes when un-qualifying import use site within transformed export (#40987)
* Fix overlapping changes when un-qualifying import use site within transformed export

* Break long line
2020-10-09 13:24:18 -07:00
Wesley Wigham
39c2a09b1f Fix crash due to unchecked cast in addImplementationSuccessElaboration 2020-10-09 10:53:59 -07:00
Wesley Wigham
a49099fd15 Add elaboration when call fails all overloads but succeeds against the implementation signature 2020-10-08 14:55:14 -07:00
Alex T
23c5f9260c fix(3758): show completion for object literals in an assignment pattern (#40976) 2020-10-08 12:27:53 -07:00
Nathan Shively-Sanders
cf3e28ea66 Revert "feat(40197): handle uncalled function checks in binary expressions (#40260)"
This reverts commit eaf4f46c17.
2020-10-07 14:14:49 -07:00
Alex T
eaf4f46c17 feat(40197): handle uncalled function checks in binary expressions (#40260) 2020-10-07 14:06:42 -07:00
Nathan Shively-Sanders
4283428906 Fix export binding of namespaced typedefs (#40980)
The binder incorrectly rejected implicit namespace declarations in
typedefs.
2020-10-07 13:21:02 -07:00
Wesley Wigham
4dc7e59248 Merge pull request #40953 from weswigham/improve-completions-large-literal-perf
Improve the performance of requesting completions within a massive array literal
2020-10-07 12:44:20 -07:00
Anders Hejlsberg
f34220980b Add isDeeplyNestedType logic to getResolvedBaseConstraint (#40971)
* Add isDeeplyNestedType logic to getResolvedBaseConstraint

* Accept new baselines

* Add regression test

* Accept new baselines

* Fix lint issue
2020-10-07 05:50:06 -07:00
Mauro Bringolf
48ad25d4b9 Add currency sign to NumberFormatOptions type (#40709) 2020-10-06 16:30:09 -07:00
Daniel Rosenwasser
3766be1bde Test indexed access to this on intersections (#40967)
* Added test.

* Accepted baselines.
2020-10-06 14:18:44 -07:00
Wesley Wigham
87c83306dd Use suggested command, add now-fixed log 2020-10-06 12:56:51 -07:00
Wesley Wigham
f8382d720f Add pyright user test 2020-10-06 12:37:05 -07:00
Alex T
5c55fc0a21 fix(40817): suggest import for default exported alias (#40845) 2020-10-06 09:52:35 -07:00
Simon Chan
fc0eed3795 lib: remove length field from SharedArrayBuffer (#40858)
* fix(lib): SharedArrayBuffer does not have a `length` field

* Revert formatting change.

* test: add tests for SharedArrayBuffer.length

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2020-10-06 08:27:56 -07:00
Alex T
1e49ad8370 fix(40685): fix generating docs for arrow functions (#40728) 2020-10-06 07:50:08 -07:00
Vincent Boivin
57661607e9 fix(40929) PromiseConstructor error message for newer versions of ECMAScript (#40931)
* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Fixes #40929

Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
2020-10-05 16:38:12 -07:00
Wesley Wigham
da57f9876e Improve the performance of requesting completions within a massive array literal 2020-10-05 14:42:10 -07:00
Tiago Tristao
1191e2e731 Fix class expression from being assignable if types don't match (#40660)
* Fix class expression from being assignable if types don't match

* Fix class expression from being assignable if types don't match
2020-10-05 13:21:38 -07:00
Wesley Wigham
77df9faabf Merge pull request #40886 from weswigham/error-on-anonymous-type-with-nonlocal-unique-symbol
Limit when we allow nested unique symbols to be serialized
2020-10-05 11:59:45 -07:00
Andrew Branch
6ee4a6b7f0 Skip past module.exports = { Foo } in go-to-defintion on 'Foo' (#40835)
* Add test

* Skip shorthand property assignments of module.exports in go-to-definition

* Skip past shorthand property assignments in module.exports in go-to-definition

* Revert WIP change

* Fix comment typo

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-10-05 11:47:19 -07:00
Andrew Branch
736363b427 Use other files when necessary to determine import style in JS (#40879)
* Use other files when necessary to determine import style in JS

* Fix existing tests
2020-10-05 11:39:20 -07:00