Commit Graph

21791 Commits

Author SHA1 Message Date
Sheetal Nandi
05c9ec3f12 Remove unnecessary assert (since we allow already open file to be opened again even through openFile command - partially) from updateOpen command (#37059)
Fixes #35034
2020-02-26 15:25:51 -08:00
Ryan Cavanaugh
c4e96856ac Detect circularities when removing 'undefined' from defaulted params (#37023)
Fixes #37008

Note that referencing a variable in its initializer is a TDZ error;
the OP report had OOB logic that prevented this in practice (?)
2020-02-26 14:59:04 -08:00
csigs
42058a89ab LEGO: check in for master to temporary branch. 2020-02-26 22:10:40 +00:00
Andrew Casey
b424f36e9a Expose call count for instantiateType in extendedDiagnostics (#36797)
* Expose call count for instantiateType in extendedDiagnostics

* Update API baselines
2020-02-26 12:55:28 -08:00
Nathan Shively-Sanders
af901ba911 No error on this exprs in static property inits (#36781)
No error on `this` expressions in static property declaration
initialisers when targetting ESNext and with useDefineForClassFields. In
this case the emit is correct and the types are correct, so the error
should not be issued.
2020-02-26 09:07:45 -08:00
Wesley Wigham
454cdb8279 Retain undefined initializations (#36806)
* Emit an export assignment even when the initializer is elided

* User a void 0; and elide assignments for enum/namespace-sourced exported variables

* HAHA, SIMPLIFY GREATLY
2020-02-26 08:48:18 -08:00
Wesley Wigham
15dd0002ef Unwrap substitutions both before _and_ after potential simplification (#32116)
* Unwrap substitutions both before _and_ after potential simplification

* Repeatedly unwrap/simplify until no more can be performed

* Use seperate loops for source and target to reduce redundant calls

* Move loop into function

* Inline worker
2020-02-25 17:36:56 -08:00
Wesley Wigham
4d5464e1f9 Revert "Support declaration emit for late bound element accesses assigned to functions in both TS and JS (#36593)" (#37034)
This reverts commit 3e4ce4777d.
2020-02-25 16:40:38 -08:00
Anders Hejlsberg
9ed73ebbbf Properly handle control flows from returns in try/catch within IIFE (#36901)
* Properly handle control flows from returns in try/catch within IIFE

* Accept new baselines

* Add tests

* Accept new baselines

* When end of finally is unreachable, end of try statement is too

* Add additional test case
2020-02-25 16:14:00 -08:00
Sheetal Nandi
e89df5ce6f Handle getScriptVersion correctly to ensure program structure is checked correctly (#36808)
* Fix tests when there are project references but has disableSourceOfProjectReferenceRedirect

* Handle getScriptVersion correctly to ensure program structure is checked correctly
Fixes #36748

* Harness's language service host doesnt have getProjectVersion.
This means earlier we were creating fresh program everytime we did LS operation
Now we reuse same program, so quick info depends on order of quickinfo demands

* Because same program is used, it unvails a bug that if `export=` is evaluated before finding references, it cant find all definitions from the merge

* Update src/server/project.ts

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

* Make clearSourceMapperCache required

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-02-25 16:11:21 -08:00
Wesley Wigham
e99173a6f9 Ignore data- props when excess property checking (#36952) 2020-02-25 15:52:24 -08:00
Orta
8a797cad2b Adds floating block comments to the outlining spans response (#36880)
* Adds floating block comments to the outlining spans response

* Only use one route for grabbing outline nodes, which now includes special casing the EOF token
2020-02-25 17:09:16 -05:00
Ryan Cavanaugh
43863cafe2 Check for undefined source.symbol (#37021)
Fixes #37014
2020-02-25 13:46:24 -08:00
Wesley Wigham
3e4ce4777d Support declaration emit for late bound element accesses assigned to functions in both TS and JS (#36593) 2020-02-25 13:45:27 -08:00
Wesley Wigham
7d8dc730b7 Baseline arity checks for jsx sfc tags (#36643)
Finish comment

PR feedback
2020-02-25 13:44:22 -08:00
Wesley Wigham
e536c89872 Add js-equivalent test for the binary expression stress and introduce trampoline into getJSSyntacticDiagnosticsForFile (#36724)
* Add js-equivalent test for the binary expression stress and introduce trampiline into getJSSyntacticDiagnosticsForFile

* Update src/compiler/parser.ts

Comment text update

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

* Fix lint

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-02-25 13:29:34 -08:00
Wesley Wigham
01f81dfc00 Add helpers to helper list, per comment on #36806 2020-02-25 11:46:05 -08:00
Ryan Cavanaugh
c22cdb446a Harden telemetryOnOpenFile (#36993) 2020-02-25 11:32:32 -08:00
Wesley Wigham
e54b796301 Declare dependencies between helpers in the declaritive fashion introduced by #35967 (#37001) 2020-02-25 11:29:59 -08:00
Wesley Wigham
e120762390 Remove unneeded branch from getHelperName (#36998) 2020-02-25 11:29:45 -08:00
csigs
5af94fa0ca LEGO: check in for master to temporary branch. 2020-02-25 16:10:24 +00:00
Ron Buckton
177713ef45 Switch Debug.assertX functions to use asserts conditions (#36995)
* Switch Debug.assertX functions to use asserts conditions

* Replace assert functions with ts.noop when assertion level too low
2020-02-24 18:20:58 -08:00
Andrew Casey
b5bd38bcdc Convert UnionOrIntersectionType.couldContainTypeVariables to ObjectFlags (#36947)
...to save space (and possibly to reduce de-opts, since it appears to be
lazily set).
2020-02-24 18:18:39 -08:00
Andrew Casey
865c1209de Use couldContainTypeVariables to short-circuit instantiateType (#36951)
This is particularly impactful for large unions of string literals.
2020-02-24 17:50:44 -08:00
Nathan Shively-Sanders
3e3df8702c Fix crash on aliased,exported @enum tag in jsdoc (#36996)
THe code to bind `@enum` and `@typedef` didn't handle the case that the
`@enum` was on a property assignment to an alias of module.exports.
Specifically, `x` needs to be correctly aliased to the file's symbol in
the example below:

```
var x = module.exports = {};
/** @enum {string} */
x.E = {
  A: "A"
};
```
2020-02-24 16:13:18 -08:00
Wesley Wigham
65e7acce58 Use getters to define live export bindings refresh (#35967)
* use getters to define live export bindings

* fix scoping in export* helper

* Object.defineProperty cannot be used in ES3 target

* Accept changed baselines

* Use function expression, not arrow function

* Update importStarHelper to match export helper in binding-making

* Fix whitespace

* Adjust whitespace in edited helpers

* Use new helper for setting bindings, use unscoped __exportStar helper for exports so helpers get reused more

* Accept updated baselines

* Use __createBinding for individual reexports when target is es3

* Remove unneeded type assertion

* Singeline the helpers

* Add check for createBinding helper, accept updated baselines with shortened helper

Co-authored-by: Michael Rawlings <mirawlings@ebay.com>
2020-02-24 15:36:14 -08:00
csigs
9ec9d94548 LEGO: check in for master to temporary branch. 2020-02-24 22:10:34 +00:00
Ryan Cavanaugh
2b69b2281a Properly handle both special export forms when renaming (#36914)
* Properly handle both special export forms when renaming

Fixes #36713

* Lint
2020-02-24 13:17:02 -08:00
Ron Buckton
fd8000dd59 Fix class emit in converted loop body (#36795) 2020-02-24 10:55:13 -08:00
csigs
a2bb27cb2c LEGO: check in for master to temporary branch. 2020-02-24 16:10:23 +00:00
Wesley Wigham
c6cdc63b9c sanitize yarn-node path in output (#36953)
* sanitize yarn-node path in output

* Update user baselines (#58)

Co-authored-by: Wesley Wigham <wwigham@gmail.com>

Co-authored-by: TypeScript Bot <ts_bot@rcavanaugh.com>
2020-02-21 16:38:00 -08:00
Wesley Wigham
ebca423a6e Add elaboration & quickfix for async-able arrow function (#36342) 2020-02-21 15:51:02 -08:00
Nathan Shively-Sanders
6b645f582b Fix find-refs crash on JSDocNamepath (#36941)
JSDocNamepaths span a lot of identifiers that we don't actually care
about, so it's incorrect for createChildren to add its children as
synthetic nodes.
2020-02-21 15:37:11 -08:00
Klaus Meinhardt
24dd93fc2b Fix access of protected members on generic this-type (#36928)
Fixes: #36926
2020-02-21 09:33:21 -08:00
csigs
4bf28cb133 LEGO: check in for master to temporary branch. 2020-02-21 16:10:25 +00:00
csigs
219f6d7d28 LEGO: check in for master to temporary branch. 2020-02-21 10:10:25 +00:00
Andrew Casey
cf24c4fdc0 Fix copy-paste error in navigateToItemIsEqualTo (#36912)
* Fix copy-paste error in navigateToItemIsEqualTo

It was preventing de-duping of items found in multiple projects.

* Add de-duping test
2020-02-20 17:30:50 -08:00
Andrew Branch
4d1a1b850a Expose importModuleSpecifierEnding to protocol (#36725)
* Expose importModuleSpecifierEnding to protocol

* Update API baselines

* Add explicit auto setting
2020-02-20 13:59:56 -08:00
Wesley Wigham
7f02927b78 use const instead of let for new class iife assignments (#36907) 2020-02-20 12:48:02 -08:00
Alexander T
bf6be75131 feat(36048): handle uncalled function checks in ternaries (#36402) 2020-02-20 09:29:41 -08:00
Alexander T
c8147cb601 fix(33377): use quoteStyle option for string literals completions (#36720) 2020-02-20 08:45:07 -08:00
Nathan Shively-Sanders
d76380419d Fix typo in getChangesSinceVersion (#36885) 2020-02-20 08:30:22 -08:00
Wesley Wigham
4a34294908 Unify padding impls and consistently use them 2020-02-19 17:21:51 -08:00
Wesley Wigham
77d3a69039 Fix lint 2020-02-19 17:03:10 -08:00
Wesley Wigham
283bf999df Cast sys.bufferFrom results in cases where global buffer and sys copy of buffer mismatch 2020-02-19 17:02:30 -08:00
Wesley Wigham
5144330c98 Fix implicit dependencies on es6 lib exposed by node changes 2020-02-19 16:43:40 -08:00
Andrew Branch
1236a1006c Fix initialization error when destructuring from object literal that includes a spread assignment (#36865)
* Add test

* Fix superfluous error when destructuring from object that includes spread assignment

* Update baseline to include error case

* Remove redundant check
2020-02-19 08:28:12 -08:00
Jack Bates
e50f0aabd2 Include stdout in test worker error messages (#35921) 2020-02-19 06:50:31 -08:00
Alexander T
bab0c99584 fix(29565): Add missing super() quickFix errors for constructo… (#36601) 2020-02-18 13:00:31 -08:00
Alexander T
bc12123115 fix(29908): Declare static method/property quickfix can add st… (#36854) 2020-02-18 11:27:35 -08:00