Commit graph

17136 commits

Author SHA1 Message Date
Andy 424dba1d69
codeFixInferFromUsage: Avoid duplicate fix for variable declaration (#24169)
* codeFixInferFromUsage: Avoid duplicate fix for variable declaration

* Include VariableDeclaration initializer as a candidate type
2018-05-16 12:28:27 -07:00
Mohamed Hegazy 13ac88647f
Merge pull request #24162 from Kingwl/fix-generate-accessor-starting-underscore
fix generate accessor if starting with underscore
2018-05-16 12:06:15 -07:00
Mohamed Hegazy 7f8ddc8343
Merge pull request #24158 from Kingwl/fix-trailing-comma-in-accessor-generator
fix trailing comma in accessor generator
2018-05-16 10:36:31 -07:00
Wesley Wigham 60df4671d0
Fix jsx element parsing within ternary (#24149) 2018-05-16 09:28:22 -07:00
csigs 06eabf7498 LEGO: check in for master to temporary branch. 2018-05-16 16:10:34 +00:00
csigs da3724e793 LEGO: check in for master to temporary branch. 2018-05-16 10:10:29 +00:00
王文璐 b7f725d1b8 fix generate accessor if starting with underscore 2018-05-16 15:34:11 +08:00
王文璐 0fde07f1c5 fix trailing comma in accessor generator 2018-05-16 14:47:44 +08:00
csigs c52b069922 LEGO: check in for master to temporary branch. 2018-05-16 06:38:51 +00:00
Mohamed Hegazy 6f4ed3afa6 Handel synthetic rest parameter declarations 2018-05-15 22:08:01 -07:00
Andy b4ca23d8f9
Fix bug: Converting 'module.exports = {...}' to ES6 doesn't introduce a default export (#24141) 2018-05-15 16:22:58 -07:00
Andy 2200c94a43
Fix unused diagnostic for rename-destructuring { a: b } (#24145) 2018-05-15 16:22:13 -07:00
Andy d4a3c9c61a
Fix placement of indent for @ts-ignore comment (#24143) 2018-05-15 16:21:15 -07:00
Nathan Shively-Sanders 339a56fbf0
Avoid duplicates when finding jsdoc (#24086)
* Avoid duplicates when finding jsdoc

1. Add a cheap assert for detecting duplicates. getJSDocTags must find
either [1] 0 or 1 comments or [2] the first two comments must not be
identical. This does not always find duplicates for nodes with 3 or more
comments, but these nodes are exceptionally rare.

This assert fired for over 20 of the around 250 tests we have that
retrieve JSDoc at all. So I fixed the asserts in [2] and [3].

2. There were overlapping cases from calls to getSourceOfAssignment and
getSpecialPropertyAssignment. getSpecialPropertyAssignment is too
restrictive, but was in the correct location (parent vs parent.parent),
so I removed the getSourceOfAssignment call and replaced the
getSpecialPropertyAssignment calls with a less restrictive check.

3. When a node's parent is a PropertyDeclaration,
getJSDocCOmmentsAndTags would check the parent for jsdoc. But when the
*node* is a PropertyDeclaration, getJSDocCommentsAndTags would use the
jsdoc from the initializer. This second case is useful to make sure that
property declarations get all their jsdoc, but results in duplicates for
their initializers. I couldn't think of a better fix than tracking the
previous node in the recursive lookup of getJSDocCommentsAndTags, which
is a little clunky.

* Fix lint; remove new context parameter

* Update importJsNodeModule3 with fix
2018-05-15 15:12:29 -07:00
Sheetal Nandi 77168e5d50
Merge pull request #24112 from Microsoft/packageJsonWithMainInSubDirectory
Resolve using package json's "main" field when resolving typescript extensions
2018-05-15 14:18:27 -07:00
Andy cbbe34b35e
Fix conversion of TextChanges to FileCodeEdits for new file (#24126) 2018-05-15 13:55:26 -07:00
Wesley Wigham 86dce41ec0
Move synthetic comments from arrow body expressions to return statement (#24135) 2018-05-15 13:11:38 -07:00
Mohamed Hegazy 9484653657
Merge pull request #24114 from Microsoft/inspectorToModules
Inspector to modules
2018-05-15 12:59:42 -07:00
Nathan Shively-Sanders 0ba8998c82
Fix stack overflow in merge symbol (#24134)
* JS initializers use original valueDecl, not mutated

target's valueDeclaration is set to the source's if it is not present.
This makes it incorrect to use getJSInitializerSymbol because it relies
on the symbol's valueDeclaration.

This fix just saves the original valueDeclaration before mutating and
uses that.

* Compare merged targetInitializer to target

Instead of the unmerged one

* Add test of stack overflow
2018-05-15 12:49:54 -07:00
Andy 7e515af240
Copy allowTextChangesInNewFiles property to protocol.ts (#24127) 2018-05-15 12:35:08 -07:00
Andy e1f22ac568
Combine signatureHelp testing methods (#24132) 2018-05-15 12:34:53 -07:00
Anders Hejlsberg 426a63e8b6 Optimize intersections of unions of unit types 2018-05-15 12:24:40 -07:00
Wesley Wigham 5756ae1fd8
External runner fixes (#24115)
* Add missing @types/node dep to so many projects, rename parent node_modules dirs so they dont participate in tests, sort errors

* Accept new baselines

* Satisfy linter
2018-05-15 11:15:08 -07:00
Ryan Cavanaugh 2ca0792976
Merge pull request #24074 from RyanCavanaugh/splitTransparentGoToDef
Return mapped locations in alternate fields
2018-05-16 05:39:51 +12:00
Mohamed Hegazy 0bda862cca Remove assert 2018-05-14 22:49:50 -07:00
Ryan Cavanaugh f01338fa33 Comments/naming 2018-05-14 18:27:21 -07:00
Mohamed Hegazy b8c2eca8b3 Reorder, add "http2", "async-hooks" and "perf_hooks" 2018-05-14 15:37:11 -07:00
Mohamed Hegazy 6baaddc4f0 Add 'inspector' to known node modules 2018-05-14 15:22:24 -07:00
Sheetal Nandi dc50fe5e40 Apart from typing, use main field in package json to resolve typescript files
Fixes #23502
2018-05-14 14:52:11 -07:00
Sheetal Nandi 22d5b0e19f Do not remove extension js or jsx from the subModuleName if the subModule doesnt have js or jsx extension 2018-05-14 14:21:08 -07:00
Wesley Wigham ba4bf21ead
Cache simplified indexed accesses to better handle circularly constrained indexed acceses (#24072) 2018-05-14 12:54:26 -07:00
Andy 7e3af08a09
Don't add a suggestion to convert to an es6 module if no commonjs import/export appears at top-level. (#24101) 2018-05-14 12:00:40 -07:00
Andy 9b6378b938
Use SHA256 hash for project info telemetry (#24099)
* Use SHA256 hash for project info telemetry

* Update API baselines
2018-05-14 11:32:16 -07:00
Wesley Wigham b58e4e1fa1
Reduce aggression of parenthesis removal in ts transform (#24073) 2018-05-14 11:20:04 -07:00
Ryan Cavanaugh 64b1c23a9b Push through original mapping location 2018-05-14 10:54:40 -07:00
Ron Buckton 672d8e5e9d
Merge pull request #24076 from Microsoft/fix24006
Cut back on more 'caught exceptions' from vfs
2018-05-14 09:24:26 -07:00
Ron Buckton dd520f9a16
Merge pull request #24078 from Microsoft/fix24014
Fix async generator rejection handling
2018-05-14 09:23:43 -07:00
csigs d470b0228a LEGO: check in for master to temporary branch. 2018-05-14 16:10:27 +00:00
Ron Buckton f5281d62cc Fix async generator rejection handling 2018-05-12 02:07:31 -07:00
csigs 8a63a8caa4 LEGO: check in for master to temporary branch. 2018-05-12 04:10:28 +00:00
Ron Buckton 70b6bd95c3 Cut back on more 'caught exceptions' from vfs 2018-05-11 20:44:21 -07:00
Ryan Cavanaugh 69f73eba16 Return mapped locations in alternate fields 2018-05-11 17:22:10 -07:00
Armando Aguirre 5cc833a5f5
Merge pull request #24049 from armanio123/AddDeferredToProjectTelemetry
Add deferred to project telemetry
2018-05-11 13:07:32 -07:00
Mohamed Hegazy b0c67fd023
Merge pull request #24056 from a-tarasyuk/bug/23891-declarationDir-needs-to-be-handled-in-excludeSpecs
Add declarationDir to excludeSpec
2018-05-11 12:56:15 -07:00
Alexader 60d39d7f18 add tests 2018-05-11 21:27:40 +03:00
Mohamed Hegazy cc36cfc834
Merge pull request #24050 from Microsoft/fix-js-initializer-merging
Fix js initializer merging
2018-05-11 10:45:20 -07:00
Nathan Shively-Sanders de9ff1b004 Assert:only merge into transient symbols 2018-05-11 09:12:25 -07:00
csigs d75d6426d0 LEGO: check in for master to temporary branch. 2018-05-11 16:10:55 +00:00
Alexander T bb615ac3f9 Add declarationDir to excludeSpec 2018-05-11 13:47:44 +03:00
csigs 82fd6b6cfa LEGO: check in for master to temporary branch. 2018-05-11 10:10:42 +00:00
csigs 3a0504ebc5 LEGO: check in for master to temporary branch. 2018-05-11 04:10:27 +00:00
Nathan Shively-Sanders 904f8df9c1 Fix repeated merging of js initializers 2018-05-10 20:58:59 -07:00
Andrew Casey 020d6c7ba3
Merge pull request #24048 from amcasey/GH23366
Ignore case when sorting imports
2018-05-10 19:11:44 -07:00
Armando Aguirre bb178d38bf Small test fixes 2018-05-10 18:18:43 -07:00
Andrew Casey 543c5daf9c Ignore case when sorting imports 2018-05-10 18:10:05 -07:00
Armando Aguirre fdd078064d Added deferred to FileStats telemetry 2018-05-10 18:08:36 -07:00
Andrew Casey 7281bb7510 Stop deleting empty named import lists
Fixes #23892
2018-05-10 18:01:55 -07:00
Nathan Shively-Sanders c49ef36964 First half of fix
Still doesn't work correctly for multiple merges
2018-05-10 16:51:46 -07:00
Andy 2be6aaf813
Support '/' as a trigger character in path completions (#24042) 2018-05-10 16:50:26 -07:00
Andy 6ae4d3a516
Add code fix to remove unreachable code (#24028)
* Add code fix to remove unreachable code

* Code review

* Preserve more kinds of statements
2018-05-10 16:44:48 -07:00
Andy e33e229a52
Extract 'moduleSpecifiers' namespace out of importFixes (#24010) 2018-05-10 16:30:24 -07:00
Andy fd17f77cc9
Improvements to find-all-references for import types (#23998)
* Improvements to find-all-references for import types

* Add JS test
2018-05-10 15:31:06 -07:00
csigs 632fe1ccd1 LEGO: check in for master to temporary branch. 2018-05-10 22:10:45 +00:00
Wesley Wigham 7580903959
Dump XML test results (#24034) 2018-05-10 14:59:51 -07:00
Andy 61a2949051
Don't count '/' in division as a completions trigger (#24038) 2018-05-10 14:59:33 -07:00
Andy 5cf491715a
Fix comment (#24035) 2018-05-10 14:59:15 -07:00
Wesley Wigham fb49fbbd30
Update user baselines (#24032)
* Strip absolute paths from import types in captured baseline

* Accept updated user baselines
2018-05-10 13:08:45 -07:00
Ron Buckton f7311ef84a
Merge pull request #23956 from Kingwl/emit-var-at-top
emit temporary vars at the top of the scope
2018-05-10 12:20:13 -07:00
Andy 7271ec1240
Add 'move to new file' refactor (#23726)
* Add 'move to new file' refactor

* Code review, and support commonjs

* Compute movedSymbols completely before using, and support `export import`

* Fix assertion error: sort empty change before non-empty change

* Remove extra newline

* Add allowTextChangesInNewFiles preference

* Add the new file to 'files' in tsconfig

* Avoid parameter initializer

* Update API baselines

* Use path relative to tsconfig.json

* Code review

* Fix error where node in tsconfig file was missing a source file
2018-05-10 11:17:04 -07:00
Wesley Wigham 6149b41469
Generate names for type parameter declarations in inferred types (#23902)
* Generate names for type parameter declarations in inferred types

* Fix lint

* Merge functions, make overload private

* Handle some edge cases better (nodes in differing files than current emit)

* Account for transformed nodes
2018-05-10 11:16:27 -07:00
Mohamed Hegazy 1b796ed04d
Merge pull request #23954 from Kingwl/readonly-getter-support
add support for readonly modifier
2018-05-10 11:10:03 -07:00
kingwl 44d10dcf59 fix incorrect find reference pos 2018-05-11 01:49:40 +08:00
Mohamed Hegazy 3e08c4174e
Merge pull request #24000 from ajafff/regex-factory
Add createRegularExpressionLiteral and expose createStringLiteral
2018-05-10 09:56:46 -07:00
csigs 07be6cf327 LEGO: check in for master to temporary branch. 2018-05-10 16:10:32 +00:00
csigs 6fe71d4247 LEGO: check in for master to temporary branch. 2018-05-10 10:10:34 +00:00
王文璐 ad5a4c7097 add prependRange and move more variable declaration 2018-05-10 15:54:51 +08:00
王文璐 340e8cd56a find reference at begin of constructor 2018-05-10 11:20:07 +08:00
Wesley Wigham 20f9493f04
Allow all private declarations to be emitted in declaration output (#23351)
* Mostly functional WIP

* Fix accessors, symbol stringification

* Accept/update changed baselines

* Move type definition so file build order doesnt matter

* Accept post-merge test update

* Rename function, add doc
2018-05-09 19:53:44 -07:00
Wesley Wigham 58c7d7c236
Fix RWC test case sensitivity (#24012)
* Fix RWC test case sensitivity

* Fix lint
2018-05-09 18:08:58 -07:00
Andy da413d6fef
Remove unnecessary filtering of tsx completions (#24004) 2018-05-09 15:18:45 -07:00
csigs 3166278ef9 LEGO: check in for master to temporary branch. 2018-05-09 22:10:50 +00:00
Ron Buckton 5af7e06f72
Merge pull request #23972 from Microsoft/batchTestConfigurationsForBrowser
Batch enumerateFiles into a single web request
2018-05-09 14:15:42 -07:00
Klaus Meinhardt fc3ba76ab7 Add createRegularExpressionLiteral and expose createStringLiteral
Fixes: #23992
2018-05-09 22:22:46 +02:00
Ron Buckton 9b04dc3897 PR Feedback 2018-05-09 12:57:48 -07:00
Mohamed Hegazy 6f9dc2f976
Merge pull request #23923 from Zzzen/master
Document highlights on async/await keywords should highlight other oc…
2018-05-09 09:51:04 -07:00
Mohamed Hegazy 9ea4d93823
Merge pull request #23957 from paulkoerbitz/16675-better-error-message-for-dynamic-import
Fix #16675: Better error message for dynamic import with ES2015 modules
2018-05-09 09:42:58 -07:00
Nathan Shively-Sanders e27fb0651b
Fix crash in recursive declared type resolution (#23950)
When one type has a type parameter with a default
2018-05-09 09:25:00 -07:00
Ron Buckton b31968a598
Merge pull request #23982 from Microsoft/reduceVfsCaughtExceptions
Reduce number of 'caught exceptions' raised by vfs
2018-05-09 09:23:23 -07:00
Andy 7fb7eecf2c
Add telemetry for open JS files (#23833)
* Add telemetry for open JS files

* Send event every time

* Keep stats even for closed files

* Remove tsCheckCountForOpenFilesTelemetry

* Use 'info.path'

* Update API
2018-05-09 07:51:46 -07:00
Zen 91a15dc609 improve performance 2018-05-09 22:42:44 +08:00
王文璐 8414a962ba update all reference in constructor 2018-05-09 18:41:46 +08:00
csigs 7bcbe7c193 LEGO: check in for master to temporary branch. 2018-05-09 10:10:29 +00:00
Paul Koerbitz 89d2baede7 Adress review comments 2018-05-09 10:53:27 +02:00
Ron Buckton f17bf54bfe
Merge pull request #23887 from agentcooper/async-generator-resolve-promise
Resolve promise inside async generator
2018-05-09 00:23:47 -07:00
Artem Tyurin d88210b270 Do not check for await expression and always output yield await 2018-05-09 09:09:49 +02:00
Mohamed Hegazy 030b8fc8a6
Merge pull request #23976 from ialexryan/patch-3
Fix comment typo in program.ts
2018-05-08 22:08:56 -07:00
csigs 67ebb6c751 LEGO: check in for master to temporary branch. 2018-05-09 04:10:24 +00:00
Wesley Wigham cb42086bab
Fix RWC tsconfig and lib paths (#23979)
* Fix RWC tsconfig paths

* Fix lints

* move helper from utils into vpath
2018-05-08 17:07:54 -07:00
Ron Buckton ea953b5dd0 Reduce number of 'caught exceptions' raised by vfs 2018-05-08 15:05:11 -07:00
Mohamed Hegazy 80d168dde6
Merge pull request #23980 from ialexryan/patch-2
Fix comment typo in types.ts
2018-05-08 15:00:38 -07:00