663 Commits

Author SHA1 Message Date
Mohamed Hegazy
d537b79c61 Merge release-2.1 into master (#12157)
* Update LKG

* Update version

* Update LKG

* Skip overloads with too-short function parameters

If the parameter of an overload is a function and the argument is also a
function, skip the overload if the parameter has fewer arguments than
the argument does. That overload cannot possibly apply, and should not
participate in, for example, contextual typing.

Example:

```ts
interface I {
  (a: number): void;
  (b: string, c): void;
}
declare function f(i: I): void;
f((x, y) => {});
```

This code now skips the first overload instead of considering.

This was a longstanding bug but was only uncovered now that more
functions expressions are context sensitive.

* Test skip overloads w/too-short function params

1. Update changed baseline.
2. Add a new test with baseline.

* Minor style improvements

* Ignore optionality when skipping overloads

* Do not use contextual signatures with too few parameters

* isAritySmaller runs later: getNonGenericSignature

* rewrite void-returning statements in constructors that capture result of super call (#11868)

* rewrite void-returning statements in constructors that capture result of super call

* linter

* Update LKG

* Fix emit inferred type which is a generic type-alias both fully and partially fill type parameters

* Add tests and baselines

* Skip trying to use alias if there is target type

* Update baselines

* Add diagnostics to remind adding tsconfig file for certain external project (#11932)

* Add diagnostics for certain external project

* Show tsconfig suggestion

* fix lint error

* Address pr

* fix comment

* Update error message

* Flag for not overwrite js files by default without generating errors (#11980)

* WIP

* Properly naming things

* refactor

* apply the option to all files and check out options

* Fix typo

* Update LKG

* lockLinter

* use local registry to check if typings package exist (#12014) (#12032)

use local registry to check if typings package exist

* Add test for https://github.com/Microsoft/TypeScript/pull/11980 (#12027)

* add test for the fix for overwrite emitting error

* cr feedback

* enable sending telemetry events to tsserver client (#12034) (#12051)

enable sending telemetry events

* Update LKG

* Reuse subtree transform flags for incrementally parsed nodes (#12088)

* Update LKG

* Update version

* Update LKG

* Do not emit "use strict" when targeting es6 or higher or module kind is es2015 and the file is external module

* Add tests and baselines

* [Release 2.1] fix11754 global augmentation (#12133)

* Exclude global augmentation from module resolution logic

* Address PR: check using string literal instead of NodeFlags.globalAugmentation

* Remove comment
2016-11-10 14:28:34 -08:00
Zhengbo Li
4dc58dde38 Exclude js files in non-configured projects compile-on-save emitting (#12118)
* Exclude js files in non-configured projects CoS emitting

* remove unnecessary method
2016-11-10 14:12:24 -08:00
Vladimir Matveev
9a9f45f0fb use createHash from ServerHost instead of explicit require (#12043)
* use createHash from ServerHost instead of explicit require

* added missing method in ServerHost stub
2016-11-08 15:32:53 -08:00
Vladimir Matveev
9e3d6efb19 reduce set of files being watched, increase polling interval (#12054) (#12092) 2016-11-07 21:13:11 -08:00
Vladimir Matveev
be2e8e85d6 property handle missing config files in external projects (#12094) 2016-11-07 15:49:19 -08:00
Vladimir Matveev
4ffdea838a Ports #12051 and #12032 into master (#12090)
* use local registry to check if typings package exist (#12014)

use local registry to check if typings package exist

* enable sending telemetry events to tsserver client (#12035)

enable sending telemetry events
2016-11-07 13:36:08 -08:00
Andy Hanson
d5c67312f6 Add realpath implementation for lshost 2016-11-07 12:42:12 -08:00
Zhengbo Li
1c004bf317 Port #12027, #11980 and #11932 to master (#12037)
* add test for the fix for overwrite emitting error

* cr feedback
2016-11-03 21:13:41 -07:00
Vladimir Matveev
fdb3b6857d enable non-ts extensions in inferred projects by default 2016-10-28 11:30:00 -07:00
Zhengbo Li
4513ae3034 disable CoS for inferred projects (#11909) 2016-10-27 18:00:21 -07:00
Andy Hanson
12f6dcefa1 Revert "Merge pull request #11354 from Microsoft/map4"
This reverts commit adfdae0dc47db5ad8248d26929a7b31cb895a539, reversing
changes made to aad663cebf6a89f7029af57d8cb6a0a011854978.
2016-10-27 15:50:21 -07:00
Andy Hanson
bcc0807198 Respond to PR comments 2016-10-27 13:14:56 -07:00
Andy Hanson
867093707b Merge branch 'master' into map4 2016-10-27 12:36:50 -07:00
Andy Hanson
dec5f4b39a Merge branch 'master' into map4 2016-10-27 12:21:06 -07:00
Andy Hanson
0f8003fb39 Make extension property of ResolvedModule optional; introduce ResolvedModuleFull interface for when the extension is provided. 2016-10-27 11:35:20 -07:00
Andy Hanson
c958c47ef5 Merge branch 'master' into map4 2016-10-26 11:05:51 -07:00
Andy Hanson
9130fbd731 Merge branch 'master' into refactor_module_resolution 2016-10-26 08:27:34 -07:00
Andy Hanson
07bb2582b6 Don't require resolvedTsFileName and resolvedJsFileName, just resolvedFileName and extension. Also, change search order to do all TS searching before searching for JS. 2016-10-26 08:13:58 -07:00
Vladimir Matveev
f6b82d5e9f add a fallback logic for older versions of node that don't support 'homedir' (#11845)
* add a fallback logic for older versions of node that don't support 'homedir'

* try os.homedir first
2016-10-25 16:36:02 -07:00
Vladimir Matveev
72f81e2fc4 Merge pull request #11841 from Microsoft/vladima/report-typings-installer-pid
report typings installer process id to parent process
2016-10-25 15:37:56 -07:00
Vladimir Matveev
7890f63250 use unresolved imports as a source of used typings (#11828) 2016-10-25 15:24:21 -07:00
Vladimir Matveev
f48728af74 report typings installer process id to parent process 2016-10-25 13:18:57 -07:00
Andy Hanson
dc99355b5d Move most of resolveModuleNameForLsHost to lsHost 2016-10-25 08:02:16 -07:00
Vladimir Matveev
a477d1f7bb Merge pull request #11764 from Microsoft/vladima/11744
watch configuration files if they exist even if they cannot be parsed
2016-10-20 21:31:38 -07:00
Andy Hanson
ca970063a3 Just use notImplemented 2016-10-20 07:15:25 -07:00
Andy Hanson
5e7e5421fa Add noop, notImplemented, and notYetImplemented helpers 2016-10-19 14:21:48 -07:00
Andy Hanson
a11838215c Merge branch 'master' into map4 2016-10-19 13:16:55 -07:00
Andy Hanson
1d201c1add Merge branch 'master' into refactor_module_resolution 2016-10-19 09:20:45 -07:00
Andy Hanson
6814c1d883 Forbid unused locals/parameters anywhere 2016-10-19 08:27:49 -07:00
Andy Hanson
f828bc3fae Merge branch 'master' into map4 2016-10-18 09:07:00 -07:00
Andy Hanson
de876bdfc9 Use an ES5 target 2016-10-18 07:34:48 -07:00
Andy Hanson
b557211a37 Return both ts and js results from module resolution, and don't have moduleNameResolver responsible for omitting files based on compiler options 2016-10-18 07:09:43 -07:00
Vladimir Matveev
121f51e552 Merge pull request #11694 from Microsoft/vladima/reload-tmp
allow reload from temp files
2016-10-17 23:20:39 -07:00
jramsay
68c485d9f9 Merge pull request #11686 from Microsoft/AddIsSemanticToGetDiagnosticsWorker
TSServer: Add isSemantic check to getDiagnosticsWorker
2016-10-17 22:10:59 -07:00
Jason Ramsay
deb3449077 Add getSyntacticDiagnostics unit test 2016-10-17 17:47:10 -07:00
Vladimir Matveev
05ebd1d5fb Merge pull request #11651 from Microsoft/vladima/literals-in-protocol
switch enums in protocol to unions of literal types
2016-10-17 15:46:55 -07:00
Jason Ramsay
b71e8a2167 Add isSemantic check to getDiagnosticsWorker 2016-10-17 13:11:13 -07:00
Andy Hanson
4c5a728314 Don't use ternary operator 2016-10-17 10:27:12 -07:00
Andy Hanson
7292f9f67e Merge branch 'master' into map4 2016-10-17 06:49:53 -07:00
Andy Hanson
8a2d16134d Remove unnecessary assert 2016-10-17 06:11:00 -07:00
Zhengbo Li
a1cbfcae4b Add missing trigger file (#11641)
* Add missing trigger file property for config file diags

* Add test
2016-10-14 20:50:12 -07:00
Yui
cd04aa9995 Merge pull request #11541 from Microsoft/master_11339
[Master] Fix 11339; using localeCompare cause exception in window 2012 dueto Intl
2016-10-14 09:36:41 -07:00
Vladimir Matveev
a09f00bb11 Merge pull request #11593 from Microsoft/vladima/port-11577
ports PR #11577 into master
2016-10-14 08:11:09 -07:00
Vladimir Matveev
dd26822cc0 Merge pull request #11594 from Microsoft/vladima/fix-11590
return result from SetCompilerOptionsForInferredProject request
2016-10-13 16:48:44 -07:00
Zhengbo Li
a6443e3e5a Avoid watching non-existing directories and fix null-exception (#11601)
* Avoid watching non-existing directories and fix null-exception

* Add test

* Move the fix to sys to cover tsc -w also
2016-10-13 15:39:09 -07:00
Vladimir Matveev
9c41e42d62 fix linter issues 2016-10-13 10:29:01 -07:00
Vladimir Matveev
224582c4f3 Merge pull request #11577 from Microsoft/vladima/configure-typing-acquisition
Disable automatic type acquisition with command line option, replace npm view with request to npm registry
2016-10-13 10:22:26 -07:00
Kanchalai Tanglertsampan
c03b04bd4f Only use localeCompare in CompareStrings 2016-10-12 14:26:30 -07:00
Vladimir Matveev
92b63fa725 Merge pull request #11550 from Microsoft/vladima/generate-protocol
Automatically generate protocol.d.ts by pulling in necessary dependencies
2016-10-12 14:18:19 -07:00
Andy Hanson
475125bbb9 Merge branch 'master' into map4 2016-10-12 09:13:36 -07:00