29736 Commits

Author SHA1 Message Date
Andrew Branch
950b36192a
Fix renaming an ExportSpecifier name when propertyName is present (#36790)
* Fix renaming exportSpecifier name when propertyName is present

* Add baseline test for name without propertyName too
2020-02-13 16:55:52 -08:00
TypeScript Bot
888cd4db20
Update user baselines (#36765) 2020-02-13 15:10:01 -08:00
Daniel Rosenwasser
210090b483
No template refactor on plain strings (#36785)
* Add/convert to failing tests.

* Stop offering to convert single string literals to template expressions.

* Ensure we're actually testing for single quotes.
2020-02-13 12:22:53 -08:00
Orta
19c3bcb9a9
Adds puppeteer to test whether typescript.js runs in the browser (#35471)
* Adds puppeteer to test whether typescript.js runs in the browser

* Adds a check for the browser integration into the GitHub Actions CI

* Update to use playwright, and test in three browsers
2020-02-13 14:19:33 -05:00
Jack Bates
0a7d54d104
Fix npm test if os.cpus().length == 1 (#35753) 2020-02-13 11:08:39 -08:00
Jack Bates
98492d8daf
Add --git-dir and --work-tree to user tests (#35362) 2020-02-12 15:21:29 -08:00
Anders Hejlsberg
7a1c5b7a20
Avoid expensive relationship checking in mapped type member resolution (#36754)
* Avoid expensive relationship checking in mapped type member resolution

* Accept new baselines
2020-02-12 15:05:01 -08:00
Alexander T
e435054b3b
fix(36416): empty import path causes server crash (#36751) 2020-02-12 14:26:51 -08:00
Jack Bates
bf370659b3
Don't npm install the parent project with no args (#35359) 2020-02-12 14:19:46 -08:00
Wesley Wigham
2b64731a97
Fix getTypeAtLocation for as const to not issue a diagnostic (#36741)
* Fix getTypeAtLocation for `as const` to not issue a diagnostic

* use existing helpers for checks

* Fix lint
2020-02-12 13:43:02 -08:00
Ron Buckton
54102336f2 Merge branch 'Swatinem-separate-nodetypes' 2020-02-12 11:53:05 -08:00
Ron Buckton
195f6bb2ab Merge branch 'separate-nodetypes' of https://github.com/Swatinem/TypeScript into Swatinem-separate-nodetypes 2020-02-12 11:52:53 -08:00
Nathan Shively-Sanders
01c86c749d
Fix get candidate for overload failure checking (#36744)
* getCandidateForOverloadFailure:call resolveUntypedCall

This re-adds the missed errors and marks as used missed nodes from the
user and RWC baselines.

* Update baselines and remove new test

It was redundant with the old tests

* Defer resolveUntypedCall on resolution failure to give priority to parameter types fixed by overload signatures

Co-authored-by: Wesley Wigham <wwigham@gmail.com>
2020-02-12 11:42:56 -08:00
Ron Buckton
cf6b641709
Merge branch 'master' into separate-nodetypes 2020-02-12 11:23:51 -08:00
Wesley Wigham
6f079a4ebc Update versionMajorMinor to match package.json 2020-02-11 15:34:17 -08:00
Wesley Wigham
1fd0e8f9a6
Bump package.json version to reflect reality 2020-02-11 15:08:03 -08:00
Wesley Wigham
8481bc1d98
Do not report errors when we fail to find a module symbol at an import specifier when invoked via API (#36742) 2020-02-11 14:49:11 -08:00
Nathan Shively-Sanders
a772c26a71
Error when property is specified more than once via a spread (#36727)
* add tests but not baselines or fixes

* Update original change

Still probably wrong; probably doesn't even compile beacuse I'm just
typing on my laptop.

* fix error code ok

* notes to self

* Error: property is specified more than once via spread

* make jsx tests stricter

* update semicolon error message

* use ?. because it is great

* use maybeTypeOfKind in new code

* restore jsx error

* add tests
2020-02-11 10:23:15 -08:00
Brad Zacher
348c4dddc6
Throw syntax error for } and > in JSX text (#36636)
* Throw syntax error for `}` and `>` in JSX text

Fixes #36341

* Add codefix for error
2020-02-11 11:44:17 -05:00
Andrew Branch
ad8c209fc2
Use type-only imports in auto-imports when it would be an error not to, and use auto-imports in “implement interface” fix (#36615)
* Refactor fix-all-missing-imports to be reusable by other codefixes

* Migrate infer-from-usage to use ImportAdder

* Add infer from usage test importing more than one thing in a single fix

* Migrate implement interface / abstract members fixes to use ImportAdder

* Update old tests

* Use type-only imports when it would be an error not to

* Add another test

* Rename stuff
2020-02-10 17:13:35 -08:00
Wesley Wigham
aece8c06b0
Allow intersections (and substitutions) to be checks against discriminable unions (#36663) 2020-02-10 15:26:46 -08:00
Sheetal Nandi
70e6f5b8a0
Handle walkThroughSnippet:/ and untitled:/ as dynamic files (#36722)
Handle walkThroughSnippet:/ and untitled:/ as dynamic files
Fixes #36681
2020-02-10 13:55:43 -08:00
Jack Bates
fa3173f8f6
Either clone or pull, don't do both (#35230)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-02-07 10:17:44 -08:00
TypeScript Bot
909672450d
Update user baselines (#36669) 2020-02-07 10:08:08 -08:00
Nathan Shively-Sanders
71c1da020f
redo #28564 (#36665) 2020-02-07 09:55:29 -08:00
Nathan Shively-Sanders
1e48cbe2c9
Fix jsdoc comment parsing initial state (#36661)
* Fix jsdoc comment parsing initial state

Jsdoc comment parsing can be invoked in two modes:

1. top-level parsing, for comments not inside a tag.
2. tag parsing, for comment that occur after the semantic parts of a
tag.

Top-level parsing skips an initial * because it assumes that it is starting
at the very beginning of a JSDoc comment. Tag parsing does not.

The two modes are distinguished by an optional second parameter named
`margin`. When `margin` is provided, it provides an initial indent used
for comment alignment.

Previously, the check for `margin` was a truthy check `if (margin)`.
This check incorrectly treats `margin=""` the same as
`margin=undefined`.

This PR changes the check to `if (margin !== undefined)`, which
correctly treats `margin=""` the same as `margin="    "`.

* Fixes for broken tests

1. Use SawAsterisk start state.
2. @template needs to skip asterisk in addition to whitespace while
parsing type parameter names.

* undo code move
2020-02-07 08:35:40 -08:00
Nathan Shively-Sanders
2cc585668d
Support property declarations in jsdoc template generation (#36658)
* Support property declarations in jsdoc template generation

* fix lint and add test
2020-02-06 14:38:21 -08:00
Anders Hejlsberg
b8b59489e1
Cache results of isGenericObjectType and isGenericIndexType (#36622) 2020-02-05 16:04:05 -08:00
Anders Hejlsberg
de37c87252
Optimize deferred type references (#36607)
* Improve reasoning about when to create deferred type references

* Accept new baselines

* Fix minor issues

* Handle default type arguments case in isDeferredTypeReferenceNode
2020-02-05 16:03:42 -08:00
Anders Hejlsberg
0a160323df
Faster exit from isTypeRelatedTo with identityRelation (#36590)
* Faster exit from isTypeRelatedTo with identityRelation

* Reorganize a bit
2020-02-05 16:03:09 -08:00
TypeScript Bot
77b81edd82
Update user baselines (#36641) 2020-02-05 14:27:37 -08:00
Wesley Wigham
7ffaf2aeb0
Add vue-next to docker suite (#33865)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-02-05 12:48:06 -08:00
TypeScript Bot
741f513d53
Update user baselines (#36617) 2020-02-05 12:43:09 -08:00
Wesley Wigham
8ef498f69e
Also edit the cherry-pick script to handle non-master base branches while we are here 2020-02-05 11:01:02 -08:00
Wesley Wigham
a8f01dfff8
Patch cherry pick script for new octokit 2020-02-05 10:47:25 -08:00
Wenlu Wang
70399e146e
add support for Lift Template Literal Restriction (#23801)
* add support for Lift Template Literal Restriction

* rename file and improve comment and tests

* fix NoSubstitutionTemplateLiteral support

* extract tagged template and add more test

* avoid useless parameter

* fix incorrect return node if cannot transform

* accept baseline

* correctly baseline

* accept baseline

* fix merge break

* fix merge break

* inline rescan template head or no subsititution template

* update scan error

* add comment and fix lint

* refactor and fix lint

* avoid blank

* fix merge conflict

* fix again

* fix again

* use multiple target

* fix space lint

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-02-05 08:59:51 -08:00
Andrew Branch
20471182fc
Fix crash when trying to import a non-exported type (#36619)
* Fix crash when trying to import a non-exported type

* Add related info on each declaration
2020-02-05 08:27:49 -08:00
hafiz
09441107c1
Expose hasOnlyExpressionInitializer as a public type guard (#33229)
Exposes `hasOnlyExpressionInitializer` as a public function so users of
TypeScript compiler APIs do not have to roll their own
`HasExpressionInitializer` type guards.

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-02-04 16:01:20 -08:00
Wesley Wigham
044355ba5f
Add rxjs to the docker suite (#33500) 2020-02-04 16:00:08 -08:00
Andrew Casey
da8d3ef0a8
Drop support for defunct Chakra host (#33797) 2020-02-04 15:53:45 -08:00
Andrew Casey
2e97918d43
Make Response.performanceData public (#36595) 2020-02-04 15:07:48 -08:00
Alexander T
8c31700735
Enable @typescript-eslint/space-before-function-paren, @typescript-eslint/no-unused-expressions (#36569)
* use @typescript-eslint/no-unused-expressions instead of no-unused-expressions

* enable @typescript-eslint/space-before-function-paren
2020-02-04 14:43:25 -08:00
Orta
7726464abd
De-duplicate indentations in JSX Texts (#36552)
* WIP on making the JSX text node not include whitespace

* Scans to the last newline for JSX correctly

* Handle JSX closing element wrapping

* Offload all jsx text indentation handling to indentMultilineCommentOrJsxText

* Switch from find node -> find inde in formatting

Co-authored-by: Wesley Wigham <wwigham@gmail.com>
2020-02-03 17:09:50 -05:00
Alexander T
1c42fd4bdf
fix(33600): disallow convertFunctionToEs6Class Quick Fix for IIFE (#36580) 2020-02-03 16:52:08 -05:00
TypeScript Bot
ba4f59fc1a
Update user baselines (#36578) 2020-02-03 12:48:57 -08:00
Andrew Branch
ef8eb0c876
Fix contextually typed object literal completions where the object being edited affects its own inference (#36556)
* Conditionally elide a parameter from contextual type signature calculation

* Slightly different approach to forbid inference to specific expressions

* Handle nested literals and mapped types correctly

* Delete unused cache

* Rename ContextFlags.BaseConstraint and related usage

* Add tests from my PR

* Update ContextFlags comment

Co-Authored-By: Wesley Wigham <wwigham@gmail.com>

* Update comments and fourslash triple slash refs

Co-authored-by: Wesley Wigham <wwigham@gmail.com>
2020-01-31 15:37:18 -08:00
Nathan Shively-Sanders
ad249043da
resolvedJSDocType should cache on node, not symbol (#36561) 2020-01-31 15:19:45 -08:00
Andrew Branch
86556d6c03
Fix export * that resolves to something type-only (#36558)
* Fix `export *` that resolves to something type-only

* Add same tests but non-tsserver
2020-01-31 15:09:27 -08:00
Ron Buckton
8db1d7bc6d
Do not adjust location for import/export keywords with more than one possible binding (#36560) 2020-01-31 14:58:30 -08:00
Ron Buckton
9a357c19f3
Fix wrong script info used to resolve line/offset for call hierarchy items (#36559) 2020-01-31 14:41:25 -08:00