Commit Graph
21714 Commits
Author SHA1 Message Date
Anders Hejlsberg 0b194a2b34 Define Rest<T, K> as Pick<T, Exclude<keyof T, K>> to ensure it is homomorphic 2018-11-01 16:48:12 -07:00
Sheetal Nandi 77ef9cedab Report error summary in pretty mode during normal compilation 2018-11-01 16:11:22 -07:00
Andy eabbaa415f Fix symbolCanBeReferencedAtTypeLocation for namespace that exports itself (#28295) 2018-11-01 15:10:21 -07:00
Sheetal Nandi 901476fae3 Merge pull request #28271 from Microsoft/containerOnlyProgramFiles
Do not add source files to container only project
2018-11-01 14:54:00 -07:00
Anders Hejlsberg b0a5337604 Merge branch 'master' into genericRest
# Conflicts:
#	tests/baselines/reference/objectRest.errors.txt
#	tests/baselines/reference/objectRest.types
2018-11-01 14:23:25 -07:00
Wesley Wigham deeee77f18 Check destructuring validity the same way element accesses and indexed accesses are checked (#24700)
* Check destructuring validity the same way element accesses and indexed accesses are checked

* Accept updated test baseline

* Use raw apparent type instead of passing in flag to sometimes make one

* Use `checkComputedPropertyName`
2018-11-01 13:46:41 -07:00
Anders Hejlsberg 6f8959b86b Use Rest<T, K> for rest properties in object destructuring 2018-11-01 12:41:39 -07:00
Anders Hejlsberg f555261d7a Add Rest<T, K> type to lib.d.ts 2018-11-01 12:33:18 -07:00
Klaus Meinhardt a0767437f6 remove some useless internal comments 2018-11-01 17:48:52 +01:00
Ryan Clarke 2dc3c8e49f Refactor convert to unknown codefix 2018-11-01 07:46:15 -04:00
Ryan Clarke 4598943ed3 Add codefix for 'convert to unknown' diagnostic
Codefix for diagnostic error 2352: "Conversion of type '{0}' to type '{1}' may be
a mistake because neither type sufficiently overlaps with the other. If this was
intentional, convert the expression to 'unknown' first."

Add codefix for both AsExpressions and TypeAssertions
2018-11-01 06:13:25 -04:00
Sheetal Nandi 121a350c5d Instead of adding lib files, avoid creating diagnostics producing checker for container projects 2018-10-31 19:55:58 -07:00
Sheetal Nandi c780186a92 Merge pull request #28266 from Microsoft/fixProjectLoadingFinishEvent
Fix incorrectly passed event name for ProjectLoadingFinish event
2018-10-31 18:13:56 -07:00
Sheetal Nandi 0544b7745d Merge pull request #28273 from Microsoft/buildSourceMapNavigation
Fix source map decoding to handle case sensitivity and --out option
2018-10-31 18:13:05 -07:00
Sheetal Nandi 72aec56fe8 Use mapDefined and combine event name inputs 2018-10-31 15:57:32 -07:00
Wesley Wigham a4a1bed88b Add showConfig tsc flag for debugging configs (#27353)
* Add showConfig tsc flag for debugging configs

* Merge showConfig implementation with init implementation, add basic unit tests

* Fix lint

* Add missing semicolon

* showConfig when theres no config file
2018-10-31 15:57:09 -07:00
Sheetal Nandi 851f739c82 Dont ignore libs since that could result in unexpected error 2018-10-31 15:50:22 -07:00
Sheetal Nandi 9f844c4b08 Test to verify that file with --out and case mismatch works with source map 2018-10-31 15:39:31 -07:00
Sheetal Nandi efe5dd6b6d Handle case sensitivity correctly in source map decoder 2018-10-31 15:14:08 -07:00
Sheetal Nandi a373029f54 Public API 2018-10-31 15:11:54 -07:00
Sheetal Nandi 78174657e7 Do not add source files to container only project 2018-10-31 15:03:42 -07:00
Wesley Wigham 3a2f7c0df1 Allow intersections of readonlys to be assignable to a readonly intersection (#28218)
* Allow intersections of readonlys to be assignable to a readonly intersection

* Add real motivating react example to test suite
2018-10-31 14:09:12 -07:00
AnyhowStep 01e71820fc Fixes Microsoft/TypeScript#6955 2018-10-31 17:00:24 -04:00
Sheetal Nandi 677f04b165 Test to verify project loading events with default event handler 2018-10-31 13:37:00 -07:00
Wesley Wigham 0ef844ff2b Avoid this-instantiation if not necessary for relationship (#28263) 2018-10-31 13:21:35 -07:00
Sheetal Nandi f7189e17f4 Some reorg in creating sessions for testing 2018-10-31 13:05:12 -07:00
Sheetal Nandi 878b7a21ce Fix incorrect event 2018-10-31 13:05:00 -07:00
Anders Hejlsberg 8e4b90da00 Merge pull request #28234 from Microsoft/genericSpread
Generic spread expressions in object literals
2018-10-31 12:52:16 -07:00
Andy dce6668070 Change pathCompletions to stringCompletions, move more code there (#28245) 2018-10-30 22:01:31 -07:00
Sheetal Nandi dcdda87258 Merge pull request #28243 from Microsoft/containerOnlyRef
Report error requiring references to have composite only if the program is not container only
2018-10-30 21:20:52 -07:00
Sheetal Nandi 305303cc0d Fix test case for project reference with composite not true 2018-10-30 18:59:25 -07:00
Sheetal Nandi 4606a4b700 Merge pull request #28209 from Microsoft/ignorePathsStartingWithDotInNodeModules
Ignore any changes to file or folder that are in node_modules and start with "."
2018-10-30 18:06:00 -07:00
Andy 903e68164e Redo resolution on ATA when previous resolution was to '.js' file (#28236)
* Redo resolution on ATA when previous resolution was to '.js' file

* Use a separate test case
2018-10-30 16:39:40 -07:00
Andy 3458360322 Prefer getValidSourceFile over Debug.assertDefined(program.getSourceFile(*)) (#28242) 2018-10-30 16:38:52 -07:00
Anders Hejlsberg 9d5e8fe89f Continue to error on rest from generic source type 2018-10-30 16:00:05 -07:00
Sheetal Nandi 60801a261c Report error requiring references to have composite only if the program is not container only 2018-10-30 15:22:00 -07:00
Wesley Wigham e2436f331a Use constraint for default default value if possible (#28222) 2018-10-30 14:55:30 -07:00
Wesley Wigham 4cfff8962c Fix declaration emit for cross-file enums (#28237) 2018-10-30 14:55:01 -07:00
Klaus Meinhardt 1397fed2ad Only suggest adding to types if present in compilerOptions
Fixes: https://github.com/Microsoft/TypeScript/pull/28211#issuecomment-434438407
2018-10-30 21:31:22 +01:00
Nathan Shively-Sanders 0481d44501 Bad callsite inferences fall back to body usage (#28235)
For parameters, the infer-from-usage codefix uses a substantially
different codepath that previously only looked at call site uses. When
this resulted in no inferences, or bad inferences, for a single
parameter, the codefix would just use any. Only if no usages of a
function were found would the codefix use the body-inference
code.

This commit makes parameter inference fall back to body-inference code
for individual parameters when there is no inference or inference to
any.
2018-10-30 13:25:24 -07:00
Andy 437bc41e99 For path completions, include extension as a kindModifier (#28148) 2018-10-30 11:56:34 -07:00
Klaus Meinhardt 33568795e0 Suggest adding to tsconfig after installing @types (#28211)
Ref: https://github.com/Microsoft/TypeScript/pull/28168#issuecomment-433554228
2018-10-30 11:33:05 -07:00
Andy 176627c818 Support augmenting module with export as namespace (#27281)
* Support augmenting module with `export as namespace`

* Warn on use of merged symbol containing 'export as namespace'
2018-10-30 11:16:26 -07:00
Sheetal Nandi c9fadf1f46 Ignore wild card directory watchers with node_modules file or folder starting with . 2018-10-30 11:06:13 -07:00
Andy acc34bd95d Miscellaneous code cleanup relating to module resolution (#28092)
* Miscellaneous code cleanup relating to module resolution

* Revert if condition
2018-10-30 10:15:01 -07:00
Andy 7c515bf6e8 Remove toSortedArray and toDeduplicatedSortedArray, use sort and sortAndDeduplicate (#28214) 2018-10-30 08:41:31 -07:00
Andy 1c4590341f Avoid reformatting body of arrow function with single unused parameter (#28217) 2018-10-29 16:40:30 -07:00
Anders Hejlsberg 7a47248f30 Produce intersection types for spreads with generic types 2018-10-29 16:02:34 -07:00
Mine Starks 0879e163c9 Merge pull request #28212 from minestarks/configure-plugins-master
Merge pull request #28106 from minestarks/configure-plugins
2018-10-29 16:00:51 -07:00
csigs 5c42c5a5a2 LEGO: check in for master to temporary branch. 2018-10-29 22:10:53 +00:00