Commit graph

17120 commits

Author SHA1 Message Date
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
Alex Ryan 4cc345e4e0
Fix comment typos in utilities.ts 2018-05-08 14:58:18 -07:00
Alex Ryan f9bd3afb8f
Fix comment typo in types.ts 2018-05-08 14:51:49 -07:00
Alex Ryan 01351d43e4
Fix comment typo in program.ts 2018-05-08 14:36:32 -07:00
Alex Ryan 4fb2add9a1
Fix comment typo in resolutionCache.ts
Another comment-only fix.
2018-05-08 14:27:40 -07:00
Alex Ryan 211b09b46c
Fix typo in parser.ts 2018-05-08 14:20:26 -07:00
Andy 5725428f2d
fixUnusedIdentifier: Handle destructure with all bindings unused (#23805)
* fixUnusedIdentifier: Handle destructure with all bindings unused

* Add parameters test

* Add test for 'for' loop
2018-05-08 13:33:55 -07:00
Ron Buckton f09c350471 Batch enumerateFiles for multiple configurations into a single web request 2018-05-08 13:18:38 -07:00
Wesley Wigham 556c316fed
Make new harness fake host more performant in large complications (#23951)
* Make new harness fake host more performant in large complications

* Use sortedmap
2018-05-08 12:46:33 -07:00
Sheetal Nandi 12790e8d83
Merge pull request #23910 from Microsoft/moduleUpdates
Support invalidating resolutions that are path mapped into sibling folder of root
2018-05-08 12:41:11 -07:00
Anders Hejlsberg 40e0ab72d2
Merge pull request #23966 from Microsoft/fixIndexedAccessAnyConstraint
Fix indexed access with 'any' constraint
2018-05-08 12:21:00 -07:00
Mohamed Hegazy 27550d3013
Merge pull request #23925 from rhysd/fix-npm-default-location-detection
Check detected default npm path is really existing
2018-05-08 11:33:30 -07:00
Andy ccfd3bf603
Handle BindingElement in fixUnusedIdentifier (#23819)
* Handle BindingElement in fixUnusedIdentifier

* Add array destructure tests
2018-05-08 11:23:01 -07:00
Wesley Wigham 8ab5be9a86
Add hook for adding transforms into the declaration emit pipeline after the main one (#23946)
* Add hook for adding transforms into the declaration emit pipeline after the main one

* Fix lint
2018-05-08 11:20:48 -07:00
Andy ddf20ecd6d
Support '.' as a trigger character (#23890)
* Support '.' as a trigger character

* Add a CompletionsTriggerCharacter type

* Add more trigger characters

* Add another type CompletionsTriggerCharacter

* Update API baselines
2018-05-08 09:52:46 -07:00
Ryan Cavanaugh f35a20e29e
Merge pull request #23944 from RyanCavanaugh/projRefs
Project References Core Support
2018-05-09 04:45:38 +12:00
Anders Hejlsberg ce6fd5eeaa Exception for 'any' constraint only applies to type parameters 2018-05-08 09:42:03 -07:00
csigs a930b571f9 LEGO: check in for master to temporary branch. 2018-05-08 16:10:28 +00:00
csigs ec974a599a LEGO: check in for master to temporary branch. 2018-05-08 10:10:40 +00:00
Artem Tyurin 4d37c44b92 Apply transformation to await expression 2018-05-08 08:21:08 +02:00
Paul Koerbitz ba360cfc4f Make error message for dynamic imports when module is ES2015 more helpful 2018-05-08 07:45:48 +02:00
王文璐 88bf9277ff add support for readonly modifier 2018-05-08 12:26:34 +08:00
csigs 7b888906f7 LEGO: check in for master to temporary branch. 2018-05-08 04:10:32 +00:00
Andy 123ae530a7
convertToEs6Module: Replace 'module.exports =' with 'export default' without replacing nodes (#23948) 2018-05-07 15:45:43 -07:00
Andy a50001c9da
Treat 'import("")' as a module reference (#23949) 2018-05-07 15:42:36 -07:00
Ryan Cavanaugh 10f2eb5ff1 Pass setParentNodes through to parseJsonText 2018-05-07 15:39:00 -07:00
Ryan Cavanaugh ffa0ccba2a Project References Core support 2018-05-07 15:12:50 -07:00
Sheetal Nandi 8fc4242097
Merge pull request #23915 from Microsoft/jsonCompletions
Suggest json files in completion when resolveJsonModule is set and module resolution is node
2018-05-07 12:53:09 -07:00
Andy 004a558125
Avoid unnecessary newline when inserting node at start of class (#23935) 2018-05-07 12:40:33 -07:00
Andy 2604bb4dd3
Add 'string' ScriptElementKind (#23821) 2018-05-07 12:39:00 -07:00
Andy 05b250691f
Expose ProjectService to plugins (#23824)
Add refreshDiagnostics() method to Project
2018-05-07 12:38:38 -07:00
Sheetal Nandi 92296b34dd Rename 2018-05-07 12:14:53 -07:00
Mohamed Hegazy e39e6fc780
Merge pull request #23894 from Microsoft/importOutlining
Add outlining spans for Import declarations
2018-05-07 12:08:11 -07:00
Andy a05feed839
generateGetAccessorAndSetAccessor: Preserve a parameter property declaration (#23318) 2018-05-07 11:33:00 -07:00
Andy 7fa5f70b9a
Remove verify.referencesAre, verify.referencesOf, verify.rangesReferenceEachOther (#23900) 2018-05-07 10:08:38 -07:00
rhysd 1fda3a4165 Check detected npm path is existing 2018-05-07 13:22:42 +09:00
Zzzen 34323b69fb Document highlights on async/await keywords should highlight other occurrences in the same body fix #22944 2018-05-06 12:27:10 +08:00
csigs f3e4f596a9 LEGO: check in for master to temporary branch. 2018-05-05 22:10:26 +00:00
Mohamed Hegazy 64d6b24c87 Code review comments 2018-05-05 13:22:48 -07:00
Mohamed Hegazy 3bc3f2d404 Add comments to kinds 2018-05-05 12:38:59 -07:00
Mohamed Hegazy 12ed49bada Revert adding named import binding list outlining spans 2018-05-05 12:04:12 -07:00
Mohamed Hegazy 8072dae16b Change kind name to imports 2018-05-05 12:02:40 -07:00
Paul Koerbitz a2d42a6421 Add WSH as an alias for WScript in scripthost.d.ts 2018-05-05 17:03:05 +02:00
csigs 4c48e2ca05 LEGO: check in for master to temporary branch. 2018-05-05 04:10:17 +00:00
Artem Tyurin 4318d97531 Revert "Resolve promise inside async generator"
This reverts commit 3e4279195f.
2018-05-05 02:45:33 +02:00
Artem Tyurin fa94fb079c Always yield await in async generator 2018-05-05 02:45:14 +02:00
Sheetal Nandi e8cd6b1111 Suggest json files in completion when resolveJsonModule is set and module resolution is node
Fixes #23899
2018-05-04 17:10:48 -07:00
Andy cecad27662
findAllReferences: Treat a nested property in a jsdoc type literal as a definition (#23901)
* findAllReferences: Treat a nested property in a jsdoc type literal as a definition

* Fix lint
2018-05-04 16:58:07 -07:00
Mohamed Hegazy ea96638701 Fix indentation 2018-05-04 15:59:55 -07:00
Mohamed Hegazy 82381280cf Merge branch 'master' into importOutlining 2018-05-04 15:58:56 -07:00
Andy 21a6a9afcc
Remove unused interface (#23905) 2018-05-04 15:51:46 -07:00
Sheetal Nandi 1a2fda0f56 Add support to update module resolutions on watches from mono repo like setup with path mapping
Fixes #22349
2018-05-04 15:39:06 -07:00
Sheetal Nandi 528bf84a7a Create a test case for module resolution when symlinked folder contents change and resolve modules
Test case for #22349
2018-05-04 15:14:28 -07:00
Sheetal Nandi 5ecfa782fc Few renames to distinguish between fs File and File in the test case to load in the VFS with watch 2018-05-04 15:10:23 -07:00
Wesley Wigham 618da24d6a
Look at simplified types when checking distributive conditional constraints (#23884) 2018-05-04 14:35:39 -07:00
Andy df9e2621d2
Fix find-all-refs for import("mod").Foo where Foo is a typedef (#23881)
* Fix find-all-refs for import("mod").Foo where Foo is a typedef

* Add Debug.assertNever message

* Ensure SemanticMeaning is matched
2018-05-04 13:32:40 -07:00
Sheetal Nandi 5133c70e7e
Merge pull request #22167 from Microsoft/requireJson
Resolve the modue names with "modulename.json" to json files when doing node module resolution
2018-05-04 12:42:10 -07:00
Sheetal Nandi ec19733f61
Merge pull request #22072 from Microsoft/configFileWithIncorrectProjectRoot
Search till root just like tsc when the projectRootPath specified doesnt contain the info.path
2018-05-04 12:23:56 -07:00
Mohamed Hegazy 2d725feb51 Add outlining span for named bindings in import declarations 2018-05-04 11:26:03 -07:00
Sheetal Nandi c4143ae0c1 Update the message for resolveJsonModule as per PR feedback 2018-05-04 11:14:39 -07:00
Sheetal Nandi 4e6586deb8 PR feedback 2018-05-04 10:45:46 -07:00
Mohamed Hegazy de13cc4692 Merge remote-tracking branch 'origin/master' into importOutlining 2018-05-04 10:40:58 -07:00
Mohamed Hegazy f1713c92d3 Add outlining spans for import declarations 2018-05-04 10:39:47 -07:00
Mohamed Hegazy 1a320fcd5e
Merge pull request #23883 from Microsoft/outliningSpanKind
Fix #22419: Add `kind` field to `OutliningSpan`
2018-05-04 09:16:01 -07:00
Artem Tyurin 3e4279195f Resolve promise inside async generator 2018-05-04 12:15:58 +02:00
Ron Buckton b172311778
Merge pull request #23882 from Microsoft/reduceStackDepthPart1
Minor changes to reduce stack depth during emit
2018-05-03 16:46:11 -07:00
Ron Buckton 4c6e93b166
Merge pull request #23878 from Microsoft/vfsBaselines
New vfs baselines follow-up
2018-05-03 16:35:48 -07:00
Mohamed Hegazy e52efb04f3 Fix #22419: Add kind field to OutliningSpan 2018-05-03 16:28:55 -07:00
Ron Buckton de10e82e8a Add assertion message 2018-05-03 16:27:15 -07:00
Ron Buckton a7074e2054 Minor changes to reduce stack depth during emit 2018-05-03 16:04:52 -07:00
Sheetal Nandi 92d08738d5 Merge branch 'master' into configFileWithIncorrectProjectRoot 2018-05-03 15:56:00 -07:00
Sheetal Nandi 15f9ea3d14 Merge branch 'master' into requireJson 2018-05-03 15:35:54 -07:00
Wesley Wigham 0d7d75ec64
Add formatting rule for import type import keyword and open paren (#23872) 2018-05-03 14:57:01 -07:00
Andy 406ca06e8e
Fix bug: JSDocPropertyTag is a declaration (#23876) 2018-05-03 14:19:15 -07:00
Ron Buckton f67afa098f Unpatch vfs resolver and default lib rename 2018-05-03 14:18:50 -07:00
Ron Buckton 9891b699a7 Unpatch project tests 2018-05-03 14:05:06 -07:00
Andy 38016f9300
Implement feedback on "Improve completions testing" (#23842) 2018-05-03 13:04:08 -07:00
Andy bad3a44bb2
In insertNodeAfter, handle file with no trailing newline (#23814) 2018-05-03 12:58:42 -07:00
Wesley Wigham eb80e9a51c
node builder should strive to preserve mapped type keyofness (#23815) 2018-05-03 12:38:31 -07:00
Wesley Wigham 23b9a23455
Ensure properties with computed names are visited (#23787) 2018-05-03 11:21:29 -07:00
Wesley Wigham 19a985eb24
Dont consider global augmentation top-level members as having the export modifier (#23846)
* Dont consider global argumentation top-level members as having the export modifier

* Remove unneeded test parts from repro
2018-05-03 11:21:11 -07:00
Wesley Wigham b467cd8a99
Move property errors to the name for the error span (#23865) 2018-05-03 10:55:44 -07:00
Wesley Wigham 616e6e6ca3
Move symbol instance type to es5 to follow PropertyKey (#23864)
* Move symbol instance type to es5

* Accept baseline changes from moving Symbol
2018-05-03 10:50:10 -07:00
Wesley Wigham 41182c2f0b
Stop using circularity-unchecked-caching (#23808)
* Stop using circularity-unchecked-caching

* Add comment
2018-05-03 10:44:17 -07:00
Ron Buckton 56648ad0f1
Merge pull request #20763 from Microsoft/vfs
Update harness to use single robust virtual file system for tests.
2018-05-03 10:25:20 -07:00
Sheetal Nandi a196f163a7 Merge branch 'master' into sourceFileChangeAssert 2018-05-03 09:45:11 -07:00
Andy 724e656acb
Don't show a definition at a 'require' call (#23822) 2018-05-03 08:02:56 -07:00
csigs 3387be886f LEGO: check in for master to temporary branch. 2018-05-03 10:10:31 +00:00
csigs e06c12e2a9 LEGO: check in for master to temporary branch. 2018-05-03 04:10:20 +00:00
Armando Aguirre 1d593fd81e
Merge pull request #23191 from armanio123/AddVueSupport
Added deferred ScriptKind and renamed JsFileExtensionInfo to FileExte…
2018-05-02 18:13:34 -07:00
Ron Buckton 5b7bec898b
Merge pull request #23839 from Microsoft/libsJson
Centralize lib management for build
2018-05-02 18:10:34 -07:00
Ron Buckton 88d5d6fccc
Merge pull request #23834 from Microsoft/generateNamesEarlier
Pre-generate names ahead of time
2018-05-02 17:51:37 -07:00
Armando Aguirre b8ddc0dabb Rollback fileExtensionIs 2018-05-02 17:17:55 -07:00
Wesley Wigham 9c40d276ab
Downlevel destructuring in module transformer if destructured variable has multiple names (#23832)
* Downlevel destructuring in module transformer if destructured variable has multiple names

* Alter indentation
2018-05-02 16:20:47 -07:00
Wesley Wigham b5b7fc4f1d
Flag default imports with named imports as needing importStar (#23795)
* Flag default imports with named imports as needing importStar

* Restructure helpers a bit, add double-default testcase
2018-05-02 16:20:34 -07:00
Ron Buckton 147aeaba9d Centralize lib management for build 2018-05-02 15:49:52 -07:00
Andy 306418e171
fixAddMissingMember: Add a new PropertyDeclaration at the end of the first set (#23837) 2018-05-02 15:42:05 -07:00
Andy 5aa0a79dac
Use 'firstDefined' in 'enablePlugin' (#23825) 2018-05-02 15:37:22 -07:00
Sheetal Nandi 55c5e8cb47 Fix the assert for orphan script info source change event 2018-05-02 15:11:39 -07:00
csigs e3fc4446b5 LEGO: check in for master to temporary branch. 2018-05-02 22:10:30 +00:00
Ron Buckton ab8c3fa3ac Pre-generate names ahead of time 2018-05-02 13:34:14 -07:00
Ron Buckton 66c11c527a Update completion order in test 2018-05-02 10:51:09 -07:00
csigs ac3ee5356c LEGO: check in for master to temporary branch. 2018-05-02 16:10:20 +00:00
Ron Buckton 860f9f88f6 Update documentation comments 2018-05-01 19:02:35 -07:00
Ron Buckton d62a11ffc0 Merge branch 'master' into vfs 2018-05-01 18:58:31 -07:00
Ron Buckton 1dff0af646 More path cleanup 2018-05-01 18:53:54 -07:00
Wesley Wigham c663645c91
Inform getDeclarationSpaces about how an imported exportAssignment may merge (#23816) 2018-05-01 17:24:30 -07:00
csigs 11ef342b92 LEGO: check in for master to temporary branch. 2018-05-01 22:10:44 +00:00
Andy 333b8ff028
Fix typo: || should be parenthesized (#23811) 2018-05-01 14:59:58 -07:00
Andy a1f9a4fb24
fixCannotFindModule: Special handling for node core modules like "fs" (#23807)
* fixCannotFindModule: Special handling for node core modules like "fs"

* Hardcode @types/node
2018-05-01 14:33:42 -07:00
Anders Hejlsberg 3bfbe68b5a
Merge pull request #23806 from Microsoft/objectAndUnconstrainedTypeParameter
Unconstrained type variable not assignable to 'object'
2018-05-01 13:24:16 -07:00
Andy 9f4abe2d79
Improve completions testing (#23591) 2018-05-01 13:00:13 -07:00
Anders Hejlsberg 1de8c65678 Unconstrained type parameter not assignable to 'object' 2018-05-01 12:38:29 -07:00
Andy cee4289f58
Add code fix to convert 'require' in a '.ts' file to an 'import' (#23711)
* Add code fix to convert 'require' in a '.ts' file to an 'import'

* Only add suggestion for modules

* Revert "Only add suggestion for modules"

This reverts commit b1a728fdac.
2018-05-01 09:24:02 -07:00
Sheetal Nandi 97df079feb PR feedback 2018-04-30 17:05:22 -07:00
Nathan Shively-Sanders 5ea4d3b2bb
No error for require, module.exports or exports in Javascript (#23743)
* No error for require

Still errors for module and exports, and require's type is now
incorreclty 'any'; I broke module resolution somehow. Needs
investigation.

* module/exports symbols+update isCommonJsRequire

Everything passes the tests but the code can be improved

* Update baselines

* Cleanup

* Update baselines of new tests

* Get rid of exports symbol

It wasn't doing anything anyway.
2018-04-30 15:47:59 -07:00
csigs 7eb6a8f803 LEGO: check in for master to temporary branch. 2018-04-30 22:10:57 +00:00