Commit graph

20763 commits

Author SHA1 Message Date
Titian Cernicova-Dragomir d2c9d6cc1b Improved parameter names for call signatures resulting from unions when only one parameter name is available. (#32056) 2019-07-11 10:06:49 -07:00
csigs 6b89c72b5e LEGO: check in for master to temporary branch. 2019-07-11 10:10:20 +00:00
Andrew Branch 8eb3822ae0
Merge pull request #28290 from rflorian/add-codefix-cannot-find-name-in-for-loop
Add codefix for 'Cannot find name' diagnostic
2019-07-10 21:47:36 -07:00
Wesley Wigham 6839973bf7
Generate a unique type parameter name for each nested type parameter (#31544)
* Generate a unique type parameter name for each nested type parameter

* Add testcase from 31605

* Fix typo

* Liiiiiine eeeendingggggss
2019-07-10 17:12:20 -07:00
Wesley Wigham daf0a73346
Fix lookup of optional methods in declaration emit (#32094) 2019-07-10 16:39:07 -07:00
Nathan Shively-Sanders 5289f2ede9
Update DOM from TSJS-lib-generator (#32335)
* Update DOM from TSJS-lib-generator

1. Update Navigator and other small updates.
2. Make ProgressEvent generic.
3. Make `window: Window & typeof globalThis`.
4. Add types:
  * CSS Overflow
  * CSS Masking
  * Web Authentication
  * WebGL 2

The big change is that `window` now includes globals in its type via
`typeof globalThis`. This helps some codebases a lot, such as
chrome-devtools-frontend.

* Update baselines
2019-07-10 16:36:50 -07:00
Andrew Branch f41c9b2c20
Rename parameter 2019-07-10 13:34:58 -07:00
Andrew Branch ab9e583e45
Remove "Did you forget to use await" for unary arithmetic expressions 2019-07-10 13:18:37 -07:00
Florian Regensburger 196db5bbcb Fixed lint error 2019-07-10 02:35:40 +02:00
Florian Regensburger f273448925 Added addMissingConst codefix for comma separated initializers 2019-07-10 02:11:02 +02:00
Andrew Branch a4cddd4647
Merge pull request #32239 from andrewbranch/enhancement/missing-await-errors
Improve error messages for potentially missing 'await'
2019-07-09 16:28:54 -07:00
Nathan Shively-Sanders 949956b586
Improve multiple overloads error span (#32315)
* Improve multiple overloads error span

When all errors for a multiple-overload error refer to the same span,
use that span instead of the one for the entire call.

This situation is quite common for 2-overload sets in React.

* Update baselines

* Fix lint
2019-07-09 15:39:42 -07:00
Anders Hejlsberg b0f050f4ee
Merge pull request #32260 from microsoft/fix32169
Include conditional types in top-level type parameter check
2019-07-09 10:30:44 -07:00
Florian Regensburger 384669a1ce Finish addMissingConst codefix for single variable and array literal assignments 2019-07-09 01:56:50 +02:00
Andrew Branch bdd8a3e878
Only add "Did you forget await" for function args when the parameter type is not promise-like 2019-07-08 16:32:53 -07:00
Andrew Branch 64501996cc
Update error code 2019-07-08 14:52:23 -07:00
Andrew Branch 6626a99f11
Fix bad rebase 2019-07-08 14:44:57 -07:00
Andrew Branch eb6b87aa26
Refactor to use related info everywhere 2019-07-08 14:37:45 -07:00
Andrew Branch 094a001982
Did you forget to use await? on arguments of function calls 2019-07-08 14:33:25 -07:00
Andrew Branch e89a2c4571
Update baselines 2019-07-08 14:03:59 -07:00
Andrew Branch a3a076d79f
Did you forget to use await? for call and construct signatures 2019-07-08 14:01:25 -07:00
Andrew Branch 48fc6b8b17
Did you forget to use await? on iterables 2019-07-08 13:59:59 -07:00
Andrew Branch c48e34ef91
Did you forget to use await? for operators 2019-07-08 13:50:56 -07:00
Nathan Shively-Sanders 834a476a96 Merge branch 'master' into report-multiple-overload-errors 2019-07-08 09:33:24 -07:00
Florian Regensburger 7d08f172d8 Added fourslash tests for standalone and array initialization cases and started implementing them 2019-07-07 13:56:34 +02:00
Anders Hejlsberg d7f8f0072e Include conditional types in top-level type parameter check 2019-07-04 16:26:54 -10:00
Ron Buckton e8bf9584aa
Improve type checking and inference for Generators and Async Generators (#30790)
* Improve typing for Generators and Async Generators

* Add TReturn and TNext to Iterator, IterableIterator, etc.

* Update ts internal Iterator to be assignable from global Iterator

* Make 'done' optional in IteratorYieldResult

* Revert Iterable and IterableIterator to simpler versions plus other fixes

* Add additional inference tests

* Added additional tests

* PR cleanup and minor async iteration type fix

* Updated diagnostics message and added non-strict tests

* Fix expected arity of Iterator/AsyncIterator
2019-07-03 21:55:59 -07:00
Wesley Wigham 0bea4bd3c9
Widen object literal this types (#32240) 2019-07-03 15:58:21 -07:00
Orta Therox 6e9d098d41 Adds support for completions after ASI inserted expressions
Signed-off-by: Andrew Branch <andrew.branch@microsoft.com>
2019-07-03 18:02:44 -04:00
Nathan Shively-Sanders 19b593ee4e Merge branch 'master' into report-multiple-overload-errors 2019-07-03 14:55:06 -07:00
Nathan Shively-Sanders 6f0baa3ae1
Merge pull request #29717 from petersandor/jsdoc-tag-author-email-support
Support email in author JSDoc tag
2019-07-03 10:42:02 -07:00
Andrew Branch 16bbb4d002
Merge pull request #32077 from andrewbranch/bug/31114
Fix incorrect noImplicitAny error on contextual union function signature
2019-07-03 10:10:10 -07:00
Nathan Shively-Sanders 722917f04e Remove TODO 2019-07-03 09:50:03 -07:00
Nathan Shively-Sanders e62d84cd88 Merge branch 'master' into report-multiple-overload-errors 2019-07-03 09:28:44 -07:00
Anders Hejlsberg 340f81035f
Merge pull request #32178 from microsoft/improveTupleDestructuring
Simplify tuple destructuring logic
2019-07-02 17:25:12 -07:00
Anders Hejlsberg 440ed83f29
Merge pull request #32079 from microsoft/instantiationCountLimiter
Add type instantiation count limiter
2019-07-02 17:19:39 -07:00
Anders Hejlsberg 5b24ea80a7 Restore union-like behavior for inference to conditional types 2019-07-01 17:46:50 -10:00
Florian Regensburger bd9f39dbcc Merge branch 'master' into add-codefix-cannot-find-name-in-for-loop 2019-07-02 00:41:27 +02:00
Nathan Shively-Sanders f139455229 Address PR comments 2019-07-01 15:06:16 -07:00
Wesley Wigham 3e6856137a
Add support for sharding tests across multiple workers (#32173)
* Add support for sharding tests across multiple workers

* Disable unittests when runners are expressly provided (unless they contain the unittest runner)
2019-07-01 14:56:57 -07:00
Wesley Wigham 055a07ea4a
Check for parse errors in emitted JS (#32009) 2019-07-01 14:15:30 -07:00
Wesley Wigham 3765651d82
Fix not emitted statement in then clauses producing syntactically invalid output (#32010)
* Fix not emitted statement in then clauses producing syntactically invalid output

* Refactor to common code, apply to all embedded statements
2019-07-01 13:39:18 -07:00
Andrew Branch 11a62cb0ab
Merge pull request #31801 from andrewbranch/semicolons
Detect semicolons before writing from TextChanges
2019-07-01 13:23:31 -07:00
Andrew Branch 327bc3cb67
Merge pull request #32071 from andrewbranch/bug/31070
Allow assignability of non-empty object to generic mapped type
2019-07-01 13:18:44 -07:00
Wesley Wigham ff81d5261e
Elide the exact node version rush complains about from the docker output (#32204) 2019-07-01 13:13:44 -07:00
Andrew Branch a890275463
Merge pull request #31912 from andrewbranch/bug/31657
Fix smartSelection returning extra span inside string quotes when cursor is outside them
2019-07-01 11:53:24 -07:00
Sheetal Nandi af20e791fd
Merge pull request #32167 from microsoft/tryReuseProgram
When checking sourceFile is from external library, use sourceFile.resolvedPath since thats how the source files are queried and thats the real path
2019-07-01 11:16:17 -07:00
Andrew Branch 23f1d5ccb7
Merge pull request #32117 from andrewbranch/bug/31460
Fix declaration emit for negative number properties, allow negative numbers as computed type property names
2019-07-01 10:56:56 -07:00
Sheetal Nandi f6d7261288
Merge pull request #32147 from microsoft/noDtsWhenNotUsingProjectReferences
Watch generated file if it doesnt exist when trying to translate it to to source generated position
2019-07-01 10:22:16 -07:00
Nathan Shively-Sanders cce2b9316e Merge branch 'master' into report-multiple-overload-errors 2019-07-01 10:17:03 -07:00
Nathan Shively-Sanders b46c44d70d
Merge pull request #32181 from microsoft/use-only-immediately-preceding-jsdoc
Use only immediately preceding JSDoc
2019-07-01 10:12:05 -07:00
Sheetal Nandi ebf323ea19
Merge pull request #32124 from austincummings/affectsEmitToModuleAndEsModuleInterop
Add affectsEmit to module and esModuleInterop options
2019-07-01 09:59:41 -07:00
Sheetal Nandi 1bd631e593
Merge pull request #32076 from stristr/master
Make close() in interface Watch<T> public
2019-07-01 09:46:09 -07:00
Anders Hejlsberg f89165d072
Merge pull request #32049 from microsoft/noDuplicateIntersectionSignatures
Remove duplicate signatures in intersections
2019-06-30 19:38:37 -07:00
Anders Hejlsberg 17153a6e5f Fix linting error 2019-06-30 08:54:48 -10:00
Austin Cummings c30054de63 Fix esModuleInterop affectsEmit change test 2019-06-30 11:06:00 -07:00
Anders Hejlsberg eb1b2251b8 Pad tuple type initializers of parameter array binding elements 2019-06-30 08:02:18 -10:00
Nathan Shively-Sanders fefb857847 Use only immediately preceding JSDoc
Now only the immediately preceding jsdoc of a node is retrieved by
getJSDoc, although it still does the correct non-local lookup for nodes
like ParameterDeclaration.

This doesn't change parsing or binding, which use the per-node Node.jsdoc
property directly. But it does change everything that relies on getJSDoc,
which includes the checker and language service.

Fixes #32062, which contains the analysis that justifies the change.
2019-06-29 08:05:10 -07:00
Anders Hejlsberg 2e5249835d Remove logic that pads array literals contextually typed by tuple types 2019-06-28 16:54:42 -10:00
Austin Cummings 5b694f8302 Add tests for module and esModuleInterop affectsEmit change 2019-06-28 18:34:59 -07:00
Austin Cummings 4195f1a409 Add affectsEmit to module and esModuleInterop options 2019-06-28 17:51:05 -07:00
Nathan Shively-Sanders 71276a21af Merge branch 'master' into report-multiple-overload-errors 2019-06-28 16:24:38 -07:00
Nathan Shively-Sanders 97784749b5 Fix lint 2019-06-28 16:09:54 -07:00
Daniel Rosenwasser 410b71751e
Merge pull request #32034 from dragomirtitian/GH-32013-improve-error-messages-for-calling-types
Improved error message for calling/constructing types
2019-06-28 16:08:18 -07:00
Nathan Shively-Sanders c48018f95e Merge branch 'master' into report-multiple-overload-errors 2019-06-28 16:02:35 -07:00
Nathan Shively-Sanders 47bbc9546e Convert related spans to message chains 2019-06-28 15:42:27 -07:00
Titian Cernicova-Dragomir e4bca9649a Improved error spans for call errors:
1. When calling a non-callable expression the error span is on the call target not on the whole call
2. When calling a method, the error for overload resolution now includes the arguments (this was previously regressed by #31414)
2019-06-28 23:53:47 +03:00
Titian Cernicova-Dragomir bc07eec015 Added tests for new error messages on calls to unions. 2019-06-28 23:23:17 +03:00
Titian Cernicova-Dragomir 768318b30c Improved error message for calling/constructing types 2019-06-28 23:23:16 +03:00
Wesley Wigham b4a1a5996f
Rework declaration emit visibility calculation for namespaces (#32156)
* Rework declaration visibility for namespaces

* Accept skipped baselines
2019-06-28 13:23:15 -07:00
Wesley Wigham 6760a03cec
Add vscode docker test (#32152)
* Add vscode docker test

* Remove PID-log line

* Update user baselines (#18)
2019-06-28 13:22:25 -07:00
Sheetal Nandi 4ae091fa9e
Update src/server/project.ts
Co-Authored-By: Orta <orta.therox+github@gmail.com>
2019-06-28 10:17:58 -07:00
Sheetal Nandi 4f802e7205 When checking sourceFile is from external library, use sourceFile.resolvedPath since thats how the source files are queried and thats the real path
Fixes #32086
2019-06-28 10:14:33 -07:00
Nathan Shively-Sanders ba9d8e2e81 Switch DiagnosticMessageChain to be a tree 2019-06-27 16:30:35 -07:00
Wesley Wigham 2af8ac73ff
Add xterm test to docker suite (#32149) 2019-06-27 15:29:22 -07:00
Sheetal Nandi b32afb55d1
Merge pull request #31985 from microsoft/buildInfoData
Make paths in tsbuildinfo file to be relative to the file
2019-06-27 12:49:52 -07:00
Andrew Casey f1c781fa13
Merge pull request #31988 from amcasey/SyntacticClassifications
Trivially expose getEncodedSyntacticClassifications
2019-06-27 10:16:57 -07:00
Nathan Shively-Sanders 35dda10865 Fix lint, remove overloads 2019-06-27 09:09:59 -07:00
Anders Hejlsberg ea0a6de82f Compare type parameters, constraints, and defaults in signature identity 2019-06-26 18:09:30 -10:00
Andrew Branch 79c604836a
Use intersectTypes instead of filterType 2019-06-26 16:56:54 -07:00
Nathan Shively-Sanders 8454ef114d JSDoc:Treat tokens between backticks as comments
even `@`, which would otherwise start a new tag.
2019-06-26 16:04:46 -07:00
Andrew Casey 2d785c8c91 Make args types internal 2019-06-26 15:09:30 -07:00
Klaus Meinhardt 392d775095 allow const-assertion on aliased enum symbol (#32110)
Fixes: #32087
2019-06-26 14:42:06 -07:00
Orta a50a5d309c
Merge pull request #32088 from orta/fix-32068
Handle making sure that two less thans are never converted into >>
2019-06-26 14:10:02 -07:00
Andrew Branch aaf818b4eb
Treat negative numbers as non-dynamic names 2019-06-26 13:57:34 -07:00
Nathan Shively-Sanders 0436cfca16 Do not report multiple diagnostics per signature.
If there are multiple diagnostics per signature, choose the signature
with the fewer diagnostics to report. If there are more than one with
the minimum, choose the latest in the overload set.
2019-06-26 12:56:14 -07:00
Andrew Branch 17f6f77de5
Fix declaration emit for negative number property declarations 2019-06-26 11:49:45 -07:00
Andrew Branch 871bdeeec4
Merge pull request #31480 from andrewbranch/bug/25487
Fix invalid JSXExpressions having identifier-ish things in their trivia, improve error messages for comma expressions in JSX
2019-06-26 10:13:42 -07:00
Nathan Shively-Sanders c0ff286b34 Merge branch 'master' into report-multiple-overload-errors 2019-06-26 10:06:29 -07:00
Nathan Shively-Sanders 68968fd396 Improve error messages and related spans 2019-06-26 10:05:44 -07:00
Wesley Wigham 34eb5ddf75
Fix tuple and array comparisons during identity checking (#32089) 2019-06-25 20:56:41 -07:00
Nathan Shively-Sanders 261952247a
Merge pull request #31945 from microsoft/skip-costly-tests
Skip costly tests
2019-06-25 15:47:49 -07:00
Orta Therox 897fb3a2a6 Handle making sure that two less thans are never converted into >> 2019-06-25 15:16:15 -07:00
Sheetal Nandi 3e49556a88 Watch generated file if it doesnt exist when trying to translate it to to source generated position 2019-06-25 15:11:44 -07:00
Nathan Shively-Sanders b58932e638 Fix lint and remove done TODOs 2019-06-25 14:54:43 -07:00
Nathan Shively-Sanders 67b8ca77d9 Merge branch 'master' into report-multiple-overload-errors 2019-06-25 14:07:56 -07:00
Nathan Shively-Sanders 66244f7937 Don't double-check JSX calls
The JSX code path stands on its own
2019-06-25 13:57:30 -07:00
Nathan Shively-Sanders f20f700025 Update baselines, except JSX
JSX is still broken
2019-06-25 13:16:34 -07:00
Orta Therox 444c3059f6 Handle feeedback 2019-06-25 09:41:26 -07:00
Anders Hejlsberg 49e3f17886 Add instantiation count limiter 2019-06-24 17:11:16 -10:00
Andrew Branch 252840ad40
Fix incorrect noImplicitAny error on contextual union function signature 2019-06-24 17:37:14 -07:00
Orta 0a272e04ef
Update src/services/formatting/README.md
Co-Authored-By: Andrew Branch <andrewbranch@users.noreply.github.com>
2019-06-24 17:08:34 -07:00
Orta 3f9395be39
Update src/services/formatting/README.md
Co-Authored-By: Andrew Branch <andrewbranch@users.noreply.github.com>
2019-06-24 17:08:28 -07:00
Sasha Joseph 314f2e68b7 Make close() in interface Watch<T> public
Closes #31526
2019-06-24 17:05:19 -07:00
Orta Therox ba4aad79dc Adds some docs for how a formatter works 2019-06-24 15:42:56 -07:00
Nathan Shively-Sanders ecfa902ba1 Use existing reporting mechanism 2019-06-24 15:32:58 -07:00
Wesley Wigham a150d55592
Explicitly error when an exclude is provided by a test as it will be unused (#32014) 2019-06-24 15:29:02 -07:00
Andrew Branch 7bbd299226
Look at properties of constraint-instantiated optional mapped types when deciding assignability 2019-06-24 15:19:43 -07:00
Andrew Branch 6717d8d928
Merge pull request #31942 from andrewbranch/bug/30882
Improve error message on indexed access to private members of type parameters
2019-06-24 09:22:21 -07:00
Anders Hejlsberg 762fff1f65 Remove duplicate call/construct signatures in intersections 2019-06-23 09:00:42 -10:00
Anders Hejlsberg 7cdc65b2a5 Out of bounds tuple elements have type 'undefined' 2019-06-21 18:00:26 -10:00
Daniel Rosenwasser 2c458c0d1c
Merge pull request #31414 from dhruvrajvanshi/master
Report error on method name for chained method calls
2019-06-21 17:51:04 -07:00
Wesley Wigham 9d23ce3d06
Sanitize rush progress numbers in docker test output (#32029) 2019-06-21 14:49:43 -07:00
Andrew Casey 2953574eba Use getEncodedSyntacticClassifications 2019-06-21 14:48:22 -07:00
Wesley Wigham 1cbace6eee
Remove secondary reference lookup implementation (#32016)
* Remove secondary reference lookup implementation

* Remove TODO
2019-06-21 13:26:29 -07:00
Nathan Shively-Sanders 720ad5bf22 Improve error message and update baselines 2019-06-21 13:15:32 -07:00
Sheetal Nandi 179e0a606a
Merge pull request #32027 from microsoft/containerReference
Container only ref needs to be ignored from uptodate status
2019-06-21 11:28:45 -07:00
Wesley Wigham fe2b9e9e17
Assert ranges exist when looped over in fourslash (#32012) 2019-06-21 10:38:31 -07:00
Wesley Wigham 37b20f6afd
Eliminate references to defunct LSHost in comments (#32018) 2019-06-20 19:11:46 -07:00
Wesley Wigham a97c18f227
Ignore identifier declarations when calculating symbol visibility (#31974) 2019-06-20 17:20:12 -07:00
Nathan Shively-Sanders b85796cba0 Retain related info for 1-overloads 2019-06-20 16:13:08 -07:00
Sheetal Nandi 0e5d95feef Container only ref needs to be ignored from uptodate status
Fixes #31288
2019-06-20 16:09:35 -07:00
Nathan Shively-Sanders ef0a8759bd Share code a bit better 2019-06-20 15:40:29 -07:00
Wesley Wigham f2735b5a06
Fake up a namespace enclosing declaration when generating expando namespace members (#31971)
* Fake up a namespace enclosing declaration when generating expando namespace members

* Fix #31676
2019-06-20 12:58:16 -07:00
Sheetal Nandi d36099c98d Use absolute paths for buildInfoDirectory 2019-06-20 12:55:02 -07:00
Wesley Wigham c39a877a92
Add dockerfile based tests for azure-sdk-for-js and office-ui-fabric-react (#31948)
* Add dockerfile based tests

* Update tests/cases/docker/README.md

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

* Combine sanitize functions

* Add some debugging instructions to README

* Fix listed command order
2019-06-20 12:47:57 -07:00
Sheetal Nandi 36df28d800
Merge pull request #31986 from microsoft/buildLocale
Support --locale with --build
2019-06-20 12:25:37 -07:00
Sheetal Nandi 796d5bb660
Merge pull request #31954 from suhasdeshpande/patch-1
fix tsserver picking hidden files created by emacs
2019-06-20 12:23:18 -07:00
Anders Hejlsberg 6def72b3a4
Merge pull request #31950 from microsoft/unionObjectAndArrayLiterals
Union inferences from object and array literals
2019-06-20 09:36:20 -07:00
Nathan Shively-Sanders afecb87d3f Use related spans to form a tree of errors.
Formatting is wrong, and I might want to format it as non-related spans,
but the structure is exactly a tree.
2019-06-20 08:54:31 -07:00
Andrew Casey 6e50853143 Trivially expose getEncodedSyntacticClassifications 2019-06-19 15:48:23 -07:00
Sheetal Nandi 06d188a255 Support --locale with --build
Fixes #31960
2019-06-19 15:38:05 -07:00
Nathan Shively-Sanders 1f6ef0504b Re-add multiple errors
In the worst possible way. Now it's sort of ready for creating a
DiagnosticMessageTree.
2019-06-19 14:54:38 -07:00
Sheetal Nandi b9fc44ece7 Bundle info paths as relative to tsbuildinfo file 2019-06-19 14:49:13 -07:00
Sheetal Nandi 9446fc0c0c Convert options to relative paths 2019-06-19 12:54:22 -07:00
Sheetal Nandi d760cbb74b Make any paths in buildInfoFile to be relative to it. 2019-06-19 12:54:21 -07:00
Nathan Shively-Sanders e5fd8766fa Merge branch 'master' into report-multiple-overload-errors 2019-06-19 10:46:51 -07:00
Nathan Shively-Sanders fce7f9f87b Move .test-cost.json
Also include parameter name in test output so that people will know what
to do to change the percent chance of failure.
2019-06-19 08:40:06 -07:00
sisisin 6b33dda121 chore(tsserver): fix typo 2019-06-19 19:08:01 +09:00
Suhas Deshpande f8004a33dd semi-colon 2019-06-18 23:17:58 -07:00
Suhas Deshpande 8a11f15569 Add unit test 2019-06-18 22:50:48 -07:00
Suhas 13b7af6ea0 fix tsserver picking hidden files created by emacs
Saw this good for first timers. I followed what @sheetalkamat suggested. 
#31916
2019-06-18 22:50:48 -07:00
Sheetal Nandi 7ed3896a0a
Merge pull request #31587 from microsoft/definitionSpan
Include declarationSpan as relevant declaration span when defintion or other places are declaration name
2019-06-18 14:07:15 -07:00
Nathan Shively-Sanders caff266f5e Notes on how to return errors from checkTypeRelatedTo 2019-06-18 10:52:03 -07:00
Nathan Shively-Sanders beddf9c02d Working, just not the way I would like
There are still separate errors instead of one + related spans for each
sub-error.
2019-06-18 10:12:32 -07:00
Nathan Shively-Sanders 1e6a6e9989
Update DOM and baselines (#31806) 2019-06-18 08:41:40 -07:00
Nathan Shively-Sanders c65d9f261a Initial attempt. Totally doesn't work. 2019-06-18 08:30:18 -07:00
Josh Goldberg ca00b3248b Added --noImplicitThis code fix for functions used as object properties (#31138)
* Added --noImplicitThis code fix for functions used as object properties

Before trying out all the various possibilities for where these functions could be used, I figured I'd start out with a relatively simple use case to verify this is the right approach. Is it? 😄

Starts on #28964.

* Fixed function expression names; included new baselines

* Got JSDocs to work, hooray!

* Added test for 'any' case of no function uses

* Refactored for inferFunctionReferencesFromUsage

* Fixed inference bug: undefined references cause parameters to default

* Removed dead code comments
2019-06-17 19:00:15 -07:00
Andrew Branch 04fbd93bf8
Revert previous fix and improve error message instead 2019-06-17 15:21:21 -07:00
Ron Buckton 179381301e
Move class property transform (#31848)
* Revert "Revert "Move class property transformation into new transformer. (#30467)""

This reverts commit 53467ae4a4.

* Fix emit issues
2019-06-17 14:26:42 -07:00
Orta Therox f1a0a7f863 Don't let the additional property setting on an object show up as a definition for the lanmguage server 2019-06-17 13:30:39 -07:00
Anders Hejlsberg 32584249b2 Union array literals in inference similar to object literals 2019-06-17 08:37:33 -10:00
Andrew Branch 48f74fdf80
Consider non-public literal members in index type of constrained type parameters 2019-06-14 17:29:39 -07:00
Nathan Shively-Sanders b4b5bf04a1 Fix lint 2019-06-14 16:07:41 -07:00
Nathan Shively-Sanders 3ef953a819 Allow passing skipPercent
Currently, the default is 5%.

0 gives you 0% time savings
2.5 gives you 29%
5 gives you 38%
10 gives you 50%
20 gives you 65%
2019-06-14 15:59:39 -07:00
Andrew Branch 54f5f2baf2
Fix smartSelection returning extra span inside string quotes when cursor is outside them 2019-06-14 15:50:09 -07:00
Nathan Shively-Sanders a852f2feea Skip costly tests
1. Add a script to generate a sorted list of most costly tests. A tests'
cost is roughly `runtime% / number of edits`. A slow test that's only
been updated once is much less valuable than a slow test that has
been updated 20 times: the latter test is catching more changes in the
type system.

2. Check in the results of running this script. I want to make the
skipping behaviour deterministic and the same for everybody, even though
you may get slightly better performance by examining only *your* test
changes.

3. Add code to skip tests until it reaches a 5% chance of missing an
edit. Right now this provides a 38% speedup.

Still not done:
4. Make this value configurable.
5. Make the CI configuration specify a 0% chance of missing an edit.
2019-06-14 13:35:41 -07:00
ExE Boss 81f71530c4 fix(lib): Fix RegExp constructor with string|RegExp and flags (#30586) 2019-06-13 15:38:11 -07:00
Sheetal Nandi 73bf2684ac Rename to use contextSpan 2019-06-13 12:41:21 -07:00
Wesley Wigham 74c6bc1f85
Filter primitives from union when checking for mismatched excess props if nonprimitive type is present (#31708)
* Filter primitives from union when checking for mismatched excess props if nonprimitive type is present

* Use maybeTypeOfKind
2019-06-12 17:31:57 -07:00
Sheetal Nandi da2aa9781e Revert to using spread instead of mutating value later 2019-06-12 15:25:16 -07:00
Sheetal Nandi a0d164f142
Merge pull request #31820 from microsoft/nodeModules
When resolving from typings cache, handle node code modules
2019-06-12 10:55:26 -07:00
Sheetal Nandi 520f7e8067
Merge pull request #31818 from microsoft/sharepointIssue
Do not watch tsconfig files from folders that we canot watch (because they are at roots we want to ignore)
2019-06-12 10:47:17 -07:00
Benjamin Lichtman 0628adc056
Merge pull request #31865 from amcasey/FunctionHintSpan
Correct outline hint spans for functions
2019-06-12 10:13:21 -07:00
Andrew Casey 1bf28f21de Add regression test 2019-06-11 17:50:36 -07:00
Andrew Casey 65881602b6 Correct outline hint spans for functions 2019-06-11 16:58:08 -07:00
Ron Buckton 375487ec60
Add __spreadArrays helper (#31166) 2019-06-11 14:15:57 -07:00
Anders Hejlsberg ad322a561a
Merge pull request #31838 from microsoft/emptyIntersectionReduction
Empty intersection reduction
2019-06-11 12:25:51 -07:00
Anders Hejlsberg 3a1fb1bea6 Properly preserve CheckFlags.Readonly when widening properties 2019-06-11 09:25:00 -07:00
Daniel Rosenwasser d023427226
Merge pull request #31831 from shibukawa/patch-1
Fix es2019.string.d.ts
2019-06-10 16:13:38 -07:00
Daniel Rosenwasser a7a0c3300d
Improve ts6307 error (#31706)
Improve ts6307 error
2019-06-10 15:17:49 -07:00
Daniel Rosenwasser 79aff027f3
Merge pull request #31290 from a-tarasyuk/bug/29880
29880 - No completions for computed string properties
2019-06-10 13:45:58 -07:00
Anders Hejlsberg d2397e0380 Fix minor issue 2019-06-09 10:05:55 -07:00
Anders Hejlsberg d4c9f24577 Intersections of disjoint types become never upon construction 2019-06-09 07:46:13 -07:00
Yoshiki Shibukawa 24a2ed7d83
Fix es2019.string.d.ts
trimLeft and trimRight's comments are swapped.
2019-06-09 08:43:38 +09:00
Sheetal Nandi 2fd80b3142 When resolving from typings cache, handle node code modules
Fixes #29865
2019-06-07 16:21:39 -07:00
Sheetal Nandi 6ed8aae683 Test when node typings dont get added on subsequent update graph because of invalid typing
Test for #29865
2019-06-07 16:19:56 -07:00
Sheetal Nandi a6c72a0cf3 Do not watch tsconfig files from folders that we canot watch
Fixes #30818
2019-06-07 12:10:21 -07:00
Anders Hejlsberg 4856768212 Merge branch 'master' into wideningInAccessExpressions 2019-06-07 11:52:24 -07:00
Anders Hejlsberg 69706bd064 Merge branch 'master' into wideningInAccessExpressions 2019-06-07 10:54:39 -07:00
gb714us 7acca501b6 create outlining span for JsxFragment 2019-06-07 03:48:19 -07:00
Andrew Branch 53467ae4a4 Revert "Move class property transformation into new transformer. (#30467)"
This reverts commit 3139cf2f85.
2019-06-06 17:40:02 -07:00
Nathan Shively-Sanders bdf8d5c8cb Update DOM and baselines 2019-06-06 15:13:16 -07:00
Anders Hejlsberg 4ae3a54ba6
Merge pull request #31784 from microsoft/numericEnumMappedType
Numeric enums as key types in mapped types
2019-06-06 15:00:19 -07:00
Sheetal Nandi a84ed93f72 Merge branch 'master' into definitionSpan 2019-06-06 14:13:09 -07:00
Sheetal Nandi a67b375d0e Handle module specifiers 2019-06-06 13:39:04 -07:00
Anders Hejlsberg ddc742c40c Minor fix 2019-06-06 13:33:18 -07:00
Anders Hejlsberg 13557299e9 Consistent widening in property and element access expressions 2019-06-06 12:45:56 -07:00
Sheetal Nandi a120c59015 Handle Lable 2019-06-06 12:04:48 -07:00
Sheetal Nandi 768c9ed8d7 Handle jsx Opening, Closing and Self closing tags 2019-06-06 11:48:45 -07:00
Andrew Branch b37875ff7a
Detect semicolons in file before writing quick fixes 2019-06-06 10:49:09 -07:00
Sheetal Nandi edad317395 Fourslash server tests 2019-06-06 10:41:33 -07:00
Sheetal Nandi e4a2dd510f Handle export keyword of export assignment 2019-06-06 09:09:39 -07:00
Joey Watts 3139cf2f85 Move class property transformation into new transformer. (#30467)
Signed-off-by: Joseph Watts <jwatts43@bloomberg.net>
2019-06-05 22:24:25 -07:00
Anders Hejlsberg 5ad46b180b Fix minor issue 2019-06-05 16:53:42 -07:00
Sheetal Nandi 1163a93ed6 Handle default keyword of default export 2019-06-05 16:35:29 -07:00
Anders Hejlsberg 2e99438edc Handle numeric enums in mapped types + fix obscure crash 2019-06-05 14:57:18 -07:00
Sheetal Nandi d1dc837353 Cache ranges by text 2019-06-05 14:44:19 -07:00
Sheetal Nandi 6dc2ba7939 Take optional string of range text for singleReferenceGroup 2019-06-05 14:43:22 -07:00
Wesley Wigham 38da682de7
Unify contextual signature type parameter assignment (#31574)
* Unify conditional signature type assignment

* Moonomorphism
2019-06-05 14:35:00 -07:00
Sheetal Nandi edffcce785 Take optional texts to verify parameter for rangesWithSameTextAreRenameLocations 2019-06-05 13:52:41 -07:00
Sheetal Nandi 5c21fad12f
Merge pull request #31432 from microsoft/builderAPI
Api for tsc --build and --incremental
2019-06-05 12:31:00 -07:00
Paul van Brenk c5578a2b43 Update error message as requested by @danielrosenwasser 2019-06-04 19:08:34 -04:00
Sheetal Nandi 004488c0c9 Set declaration span only if its not same as own span 2019-06-04 15:37:43 -07:00
Sheetal Nandi eaeeb06f9a Handle when declarationSpan from declarationNode is undefined 2019-06-04 13:48:13 -07:00
Sheetal Nandi 424f2c9e00 More tests 2019-06-04 13:06:34 -07:00
Sheetal Nandi e41533acc7 Handle computed property names 2019-06-03 14:06:30 -07:00
Sheetal Nandi 0fee3b023d Handle destructuring assignments 2019-06-03 13:42:55 -07:00
csigs 30333e19e2 LEGO: check in for master to temporary branch. 2019-06-03 16:10:14 +00:00
Paul van Brenk a658f728a9 Include the project filepath in the error message for files not being
listed in the 'include' pattern. TS6307
2019-06-02 11:54:48 -04:00
Anders Hejlsberg a5281ada54
Merge pull request #31687 from microsoft/enumImplicitIndexSignatures
Implicit index signatures for enum object types
2019-06-02 07:42:58 -07:00
Anders Hejlsberg d6c323a21b
Merge pull request #31711 from microsoft/fixDestructuringWithFallback
Fix destructuring with fallback
2019-06-01 17:30:07 -07:00
Anders Hejlsberg d548f6af70 Consider object literals in unions to have properties of type 'undefined' 2019-06-01 09:45:58 -07:00
Benjamin Lichtman eb81feaf04
Merge pull request #31685 from uniqueiniquity/stopInvalidatingOnOpenFileSave
Stop invalidating module resolution cache when saving an open file
2019-05-31 20:36:33 -04:00
Anders Hejlsberg 4fc5f6a5ff When binding pattern contextually types x || y, x contextually types y 2019-05-31 16:40:22 -07:00
Wesley Wigham 41ce98b440
Propagate saved variance flags from cached comparisons (#31688)
* Propegate saved variance flags from cached comparisons

* Propegate variance a bit more selectively

* Add test

* Remove now-redundant code

* Fix misspelling and remove unneeded branch
2019-05-31 16:11:08 -07:00
Sheetal Nandi dfb613c6d6 Use for-of declaration list + expression as span for preview 2019-05-31 16:02:31 -07:00
Benjamin Lichtman d3b6ba557a Change test instead of behavior 2019-05-31 14:46:15 -07:00
Sheetal Nandi 9703b3d6c1 Show property assignment for special property assignments in js files 2019-05-31 14:05:15 -07:00
Sheetal Nandi 6c04a0d14e For property name of binding element use binding element as preview node 2019-05-31 11:33:36 -07:00
Benjamin Lichtman 7ac5fa783b Refactor and add wildcard scenario 2019-05-31 11:24:54 -07:00
Sheetal Nandi 15ce996cf5 Export assignment identifier use ExportAssigment as declaration 2019-05-31 11:09:22 -07:00
Anders Hejlsberg aaa55923e8 Permit assignment this.xxx when class has index signature 2019-05-31 11:03:49 -07:00
Anders Hejlsberg bb15df3e43 Fix lint error 2019-05-30 21:06:51 -07:00
Benjamin Lichtman 6b92ccaffa Respond to CR 2019-05-30 17:22:12 -07:00
Benjamin Lichtman a30cacb562 Add test 2019-05-30 16:56:27 -07:00
Anders Hejlsberg 0b53b8e7f8 Merge branch 'master' into enumImplicitIndexSignatures 2019-05-30 16:38:25 -07:00
Anders Hejlsberg 7dc1f40dc1
Merge pull request #31680 from microsoft/fixGenericReturnTypeInference
Fix generic return type inference
2019-05-30 16:33:22 -07:00
Anders Hejlsberg 08d8f97bb4 Add comment 2019-05-30 16:06:49 -07:00
Benjamin Lichtman 8c443b1481 Stop invalidating resolution when file stays open 2019-05-30 15:05:53 -07:00
Sheetal Nandi bbfbf8fa95 Use import export sepcifier as declaration for the property name of import export as well 2019-05-30 14:55:25 -07:00
Anders Hejlsberg 82ea88569e
Merge pull request #31662 from microsoft/fixTypeAliasInference
Fix contravariant type alias inference
2019-05-30 14:09:35 -07:00
Andrew Branch b8dcf27c3e
Merge pull request #31482 from andrewbranch/bug/31338
Organize imports: don’t delete import declarations used for module augmentation
2019-05-30 14:01:55 -07:00
Sheetal Nandi 8948fe415f Rename declarationRange to declarationRangeIndex 2019-05-30 12:45:11 -07:00
Anders Hejlsberg 08cd0b3700 Use proper variances when inferring between type alias instantiations 2019-05-29 12:42:43 -07:00
Daniel Rosenwasser 94f19c7edd Update version to 3.6.0. 2019-05-29 08:59:44 -07:00
Anders Hejlsberg b75a90e95a Return type inference should not include parameter inferences 2019-05-28 16:32:10 -07:00
Sheetal Nandi 6a961b5bc5 More tests 2019-05-28 16:14:44 -07:00
Wesley Wigham cd09cbbd5e
Cache widened types (#31586)
* Cache widened types

* Fix lint
2019-05-28 13:13:46 -07:00
Wesley Wigham e70f2af25d
Defer union or intersection property type normalization (#31486)
* Defer union or intersection property type normalization

* Accept moved span
2019-05-28 10:51:47 -07:00
Dhruv Rajvanshi 9ca8045baa Fix linter errors 2019-05-28 22:23:33 +05:30
Dhruv Rajvanshi 273617cc88 Use node.expression as error node for call diagnostics 2019-05-27 17:16:05 +05:30
Sheetal Nandi 1d830ffe7a Start fixing fourslash tests 2019-05-24 16:29:27 -07:00
Daniel Rosenwasser 38f3b05cb1
31304 - Autocomplete for enum values fails when typing "/" (#31362)
31304 - Autocomplete for enum values fails when typing "/"
2019-05-24 16:17:25 -07:00
Sheetal Nandi fd86f40d05 Include declarationSpan as relevant declaration span when defintion or other places are declaration name
Fixes #30849
2019-05-24 15:44:32 -07:00
Sheetal Nandi 57d9ecc39f Do not log errors when ts server plugin is not found in one folder but is eventually resolved.
Fixes #30106
2019-05-24 15:15:04 -07:00
Andrew Branch a06ab8532c
Merge pull request #31560 from andrewbranch/bug/31485
Fix crash when creating a union signature from signatures that do and don’t have `this` types
2019-05-24 10:30:47 -07:00
Andrew Branch 9380b9f920
Merge pull request #31568 from andrewbranch/bug/31347
Fix containsPrecedingToken for tokens whose preceding token is a missing node
2019-05-24 10:29:21 -07:00
Alexander T 8dba4d6467 Merge branch 'master' of https://github.com/Microsoft/TypeScript into bug/29880 2019-05-24 18:39:03 +03:00
Anders Hejlsberg 7ff97d1393
Merge pull request #31572 from microsoft/normalizedIntersectionLimiter
Limit size of union types resulting from intersection type normalization
2019-05-23 17:57:33 -07:00