Commit Graph

17161 Commits

Author SHA1 Message Date
Mohamed Hegazy
7fb3123984 Merge pull request #24298 from Microsoft/noErrOnBackgroundUpdate
Add noGetErrOnBackgroundUpdate session option to not queue diagnostics check for open files
2018-05-22 10:56:18 -07:00
Anders Hejlsberg
a5029e3d4e Merge pull request #23794 from Microsoft/fixDiscriminatedContextualType
Fix discriminant checking in contextual types
2018-05-22 10:35:29 -07:00
Mohamed Hegazy
9d57903630 Merge pull request #24312 from Kingwl/multiline-type-literal-formatter
fix wrong formatting with multiline type literals with IntersectionTy…
2018-05-22 10:06:24 -07:00
Mine Starks
5e5c5a761a Merge pull request #24139 from minestarks/dynamicprojectassert
Normalize ProjectService.currentDirectory
2018-05-22 09:04:45 -07:00
Andy
982c8d0af9 Add suggestion diagnostics for unused label and unreachable code (#24261)
* Add suggestion diagnostics for unused label and unreachable code

* Always error on unused left hand side of comma
2018-05-22 07:56:29 -07:00
Anders Hejlsberg
f52c4af448 Merge pull request #24310 from Microsoft/nonWideningLiteralInferences
Non-widening literal type inferences
2018-05-22 06:56:34 -07:00
王文璐
4b47c0cb82 fix wrong formatting with multiline type literals with IntersectionType and UnionType 2018-05-22 14:01:04 +08:00
Mohamed Hegazy
a9e89ce3f1 Merge pull request #24180 from Microsoft/updateVersion
Update version
2018-05-21 17:18:39 -07:00
Anders Hejlsberg
8528dbee76 Handle union types in getRegularTypeOfLiteralType 2018-05-21 16:17:56 -07:00
Andy
802dc2bb9b fixUnusedIdentifier: If every VariableDeclaration is unused, remove the VariableStatement (#24231) 2018-05-21 15:54:33 -07:00
Anders Hejlsberg
c8ac085498 Infer non-widening literal types when type parameter constraint includes primitive types 2018-05-21 15:28:51 -07:00
Sheetal Nandi
f1acbc93ef Add noGetErrOnBackgroundUpdate session option to not queue diagnostics check for open files
This will ensure that the getErr will be queued in by host and hence would make sure that it is cancellable.
Handles one of the scenario delaying completions in #19458
2018-05-21 12:53:31 -07:00
Mohamed Hegazy
d2f6f6a0a4 Merge pull request #24296 from Microsoft/npmPackageSize
Remove unneeded files from npm package
2018-05-21 12:35:00 -07:00
Mohamed Hegazy
5abe4fead4 builf lib.es2018.full.d.ts 2018-05-21 11:01:56 -07:00
Andy
440291e316 Fix bug: Get merged module symbol in forEachExternalModule (#24295) 2018-05-21 10:48:50 -07:00
Andy
c09cc70ebe Fix bug: VariableDeclaration initializer may be undefined (#24256) 2018-05-21 07:58:33 -07:00
Mohamed Hegazy
153c1806d3 Merge pull request #24271 from Microsoft/portRegExpDotAllFix
Port changes in #24238 to source file
2018-05-19 11:44:58 -07:00
Mohamed Hegazy
8f6e6487f7 Merge pull request #24265 from Microsoft/quoteTypeof
Use single quotes around 'typeof' in message.
2018-05-19 11:31:41 -07:00
Mohamed Hegazy
c19408ba4d Port changes in #24238 to source file 2018-05-19 11:23:41 -07:00
csigs
956d82ae94 LEGO: check in for master to temporary branch. 2018-05-19 16:10:26 +00:00
Daniel Rosenwasser
3563a0576d Use single quotes around 'typeof' in message. 2018-05-18 23:44:38 -07:00
csigs
e6c62b9cc4 LEGO: check in for master to temporary branch. 2018-05-19 04:10:20 +00:00
Wesley Wigham
02fe840732 Get constraint with this argument of the type parameter for comparisons (#21210)
* Get constraint with this argument of the type parameter for comparisons

* Also instantiate indexed accesses

* Add much simpler test
2018-05-18 18:30:23 -07:00
Andy
4c22bf786e getEditsForFileRename: Do fresh module resolution instead of relying on cache (#24211)
* getEditsForFileRename: Do fresh module resolution instead of relying on cache

* Add host.resolveModuleNameWithFailedLookupLocations method

* Make host.resolveModuleNameWithFailedLookupLocations mandatory, and implement for Project

* Add test, and no need to check host.fileExists

* Change method name and always use cache

* Update name in string
2018-05-18 16:42:42 -07:00
Andy
3eb66da155 Add code fix to remove unused label (#24037)
* Add code fix to remove unused label

* Test with trivia and fix indentation with dedented label
2018-05-18 15:25:24 -07:00
Andy
1df7997014 getJSDocTypeParameterDeclarations: Avoid unnecessary array (#24257) 2018-05-18 13:53:27 -07:00
Andrew Casey
04a351224c Merge pull request #24237 from amcasey/GH23640
Sort exports when organizeImports is run
2018-05-18 13:39:24 -07:00
Sheetal Nandi
3bb9ccfa8e Merge pull request #24234 from Microsoft/unusedIdentifierCorrectFile
Unused variable error reporting needs to handle nodes that could not belong to current source file
2018-05-18 13:25:19 -07:00
Andy
7f0258bcb9 getJSDocHost always returns a defined result (#24255) 2018-05-18 13:20:13 -07:00
Andrew Casey
8f662a9131 Extract sorting helper 2018-05-18 12:53:28 -07:00
Mohamed Hegazy
d60866aada Merge pull request #24236 from Kingwl/quick-fix-for-import-type
simply quick fix for import type missing typeof
2018-05-18 11:34:54 -07:00
Andrew Casey
43e1edf10a Eliminate runtime type check 2018-05-18 10:54:40 -07:00
Andrew Casey
7fcf1fdeb6 Delete redundant tests 2018-05-18 10:49:10 -07:00
Andy
76573c6520 getEffectiveTypeParameterDeclarations: Always return a defined result (#24251) 2018-05-18 10:17:35 -07:00
Wesley Wigham
89059f0b85 Some RWC tests had dupes in their input/outher files list because paths werent both resolved (#24235) 2018-05-18 08:46:50 -07:00
Mohamed Hegazy
8c2ed976a5 Merge pull request #24187 from Kingwl/disallow-in-function-like-initializer
disallow acesssor generate in function like initializer
2018-05-17 19:41:01 -07:00
王文璐
45c06cfd11 only allow refactor if selected span overlaps name declaration 2018-05-18 10:07:45 +08:00
Andrew Casey
a327241655 Sort exports when organizeImports is run
Note that there's no attempt to remove unused exports.

Fixes #23640
2018-05-17 18:38:42 -07:00
王文璐
49989619db simply quick fix for import type missing typeof 2018-05-18 09:34:14 +08:00
Sheetal Nandi
52e8c2d663 Unused variable error reporting needs to handle nodes that could not belong to current source file
Eg. when resolving module, the another file gets checked and its locals are added to potentiallyUnused list
Fixes #24215
2018-05-17 16:27:08 -07:00
Wesley Wigham
66d6e5e6e0 Remove leveldown, stip absolute paths from test mk 2, accept reordered and new user baselines (#24227) 2018-05-17 15:32:10 -07:00
Wesley Wigham
d82d35c7f5 Set startPos at EOF in jsdoc token scanner so node end positions for nodes terminated at EoF are right (#24184)
* Set startPos at EOF in jsdoc token scanner to node end positions for nodes terminated at EoF are right

* More complete nonwhitespace token check, fix syntactica jsdoc classifier

* Use loop and no nested lookahead

* Do thigns unrelated to the bug in the test

* Fix typo move return

* Patch up typedef end pos

* Fix indentation, make end pos target more obvious
2018-05-17 15:16:18 -07:00
Andy
d579793d0a moveToNewFile: Fix bug for missing importClause (#24224) 2018-05-17 14:32:12 -07:00
Andy
75ab60f199 Improve ChangeTracker#deleteNodeInList (#24221) 2018-05-17 14:31:58 -07:00
Wesley Wigham
3800d7b246 More robust circularity detection in node builder (#24225) 2018-05-17 14:30:07 -07:00
Andy
08c364d258 fixUnusedIdentifier: Don't delete node whose ancestor was already deleted (#24207) 2018-05-17 14:08:58 -07:00
Anders Hejlsberg
3fc3df3c3a Merge pull request #24137 from Microsoft/fix23977
Optimize intersections of unions of unit types
2018-05-17 13:15:28 -07:00
Wesley Wigham
3fc727b256 Use import types to refer to declarations in declaration emit (#24071)
* Stand up a simple implementation using import types for exports of modules which are otherwise inaccessible

* Ensure references exist to link to modules containing utilized ambient modules

* Accept baselines with new import type usage

* Fix lint
2018-05-17 13:08:22 -07:00
Andy
09b9ec43e3 moveToNewFile: Fix bug for VariableDeclaration missing initializer (#24214) 2018-05-17 12:38:20 -07:00
Mohamed Hegazy
a9660f3c5e Merge pull request #24212 from Microsoft/Fix24199
Add undefined guard
2018-05-17 12:27:55 -07:00