Commit Graph

32734 Commits

Author SHA1 Message Date
Anders Hejlsberg 2ed627aaf1 Update tests 2018-10-30 16:33:14 -07:00
Anders Hejlsberg 3c36339955 Accept new baselines 2018-10-30 16:00:14 -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 65ba8d9fce Accept baseline with correct additional span location (#28238) 2018-10-30 14:55:52 -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
Anders Hejlsberg 0f308f5074 Accept new baselines 2018-10-30 08:18:25 -07:00
Anders Hejlsberg e0d210d027 Add tests 2018-10-30 08:18:18 -07:00
TypeScript Bot 513c6af4e0 Update user baselines (#28228) 2018-10-30 07:29:18 -07:00
Alexander T e98d8c3679 remove unused 'debug' option. change 'jake runtests' description (#28226) 2018-10-30 07:25:42 -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 00c30156c6 Accept new baselines 2018-10-29 16:07:42 -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 364d4bd7d5 LEGO: Merge pull request 28216
LEGO: Merge pull request 28216
2018-10-29 15:11:13 -07:00
csigs 5c42c5a5a2 LEGO: check in for master to temporary branch. 2018-10-29 22:10:53 +00:00
Nathan Shively-Sanders 64ff195426 Set-only accessors spread to undefined (#28213)
* Set-only accessors spread to undefined

Previously they were skipped. The runtime behaviour is to create a
property of type undefined, unlike (for example) spreading numbers or
other primitives. So now spreading a set-only accessor creates a
property of type undefined:

```ts
const o: { foo: undefined } = { ...{ set foo(v: number) { } } }
```

Notably, `o.foo: undefined` not `number`.

Fixes #26337

* Fix isSpreadableProperty oversimplification
2018-10-29 14:51:12 -07:00
Mine Starks 1fbabd5534 Merge pull request #28106 from minestarks/configure-plugins
configurePlugins command for tsserver
2018-10-29 14:06:40 -07:00
Nathan Shively-Sanders 60efb65931 infer-from-usage suggestions can't be ignored, and always do something when invoked. (#28206)
* Do not ts-ignore noImplicitAny suggestions

Still need to write tests.

* Add tests

* More tests

* Update baselines
2018-10-29 13:23:33 -07:00
Sheetal Nandi d32c1b091a Ignore any changes to file or folder that are in node_modules and start with "."
Fixes #27673
2018-10-29 12:00:46 -07:00
Andy 24febc2445 Allow to combine --resolveJsonModule with --isolatedModules (#28207) 2018-10-29 11:56:49 -07:00
Andy 672b0e3e16 Have flatMap return a ReadonlyArray by default (#28205) 2018-10-29 11:12:51 -07:00
Andy c97fc64972 Always use verify.completions when testing completions (#28137) 2018-10-29 10:03:25 -07:00
Wesley Wigham a6952887e9 Use same condition in isReferencedAliasDeclaration as isAliasResolvedToValue (#28171) 2018-10-29 09:38:10 -07:00
iliashkolyar 21feb204f6 Merge branch 'master' into codefix_add_missing_new_operator 2018-10-28 23:27:16 +02:00
iliashkolyar 583dbc571e Add missing apostrophe to codefix suggestion 2018-10-28 23:18:19 +02:00
ispedals 57546393ff Support synthesized SourceFile parent in getOrCreateEmitNode (#24709)
getOrCreateEmitNode() assumes that the SourceFile of node that is
part of a parse tree will also be a parse tree node. This assumption is
not valid for a transformed SourceFile. disposeEmitNodes() already handles
this case by getting the original SourceFile node if the provided node
is synthesized, so do the same in getOrCreateEmitNode().

This results in the test case in #24709 to run without error.
2018-10-28 13:12:08 -04:00
superkd37 1ec54f3b7f Update .mailmap 2018-10-27 20:39:23 +05:30
Wesley Wigham e2100cd2cc Measure variance of aliased conditional types using variance markers (#27804)
* Measure variance of aliased conditional types using variance markers

* Just do variance probing for all type aliases

* Small limiter for predictability

* Inline property set, remove unused functions
2018-10-26 16:26:20 -07:00
Anders Hejlsberg ccc16136b2 Merge pull request #28170 from Microsoft/fixGenericMappedTypeConstraint
No constraint for { [P in K]: XXX } where K is type variable
2018-10-26 16:02:17 -07:00
Wesley Wigham 972c403cd8 JSX uses mixed signatures and union sigs use subtype on partial match (#28141)
* JSX uses mixed signatures and union sigs use subtype on partial match

* Small improvement
2018-10-26 16:01:32 -07:00
Anders Hejlsberg 00fbdedbcc Accept new baselines 2018-10-26 15:32:18 -07:00
Anders Hejlsberg 24e3745296 Add regression test 2018-10-26 15:32:10 -07:00
Andy 36dfd775b3 Parse an object literal property as shorthand unless followed by '(' or ':' (#28121) 2018-10-26 15:00:31 -07:00
Jack W abce9ae0be Bring typeof switch inline with if (#27680)
- Narrow unknown
- Narrow union members (in addition to filtering)
2018-10-26 14:56:26 -07:00
Andy 77d8e15905 Remove unused property ParameterInference#typeNode (#28115) 2018-10-26 14:44:49 -07:00
Anders Hejlsberg 30d1ecd1bd Constraint for { [P in K]: XXX } should be empty type 2018-10-26 14:14:53 -07:00
Nathan Shively-Sanders 372c7d9b0c infer from usage JSDoc:Don't emit nested comments (#28161)
* infer from usage JSDoc:Don't emit nested comments

Previously, the trivia on a parameter name would show up inside the
emitted JSDoc comment. If the trivia contained a C-style comment, the
emitted JSDoc comment would be invalid. For example:

```js
function call(callback /*oh no*/) {
  return callback(this)
}
```

Emitted this comment:

```js
/**
 * @param {(arg0: any) => void} callback /*oh no*/
 */
```

* Remove misleading comment used for debugging.
2018-10-26 14:09:42 -07:00
TypeScript Bot 14c328e706 Update user baselines (#28157) 2018-10-26 09:55:05 -07:00
Klaus Meinhardt 3fb8873bc2 don't resolve import types in JSDoc of TS files (#28158) 2018-10-26 09:50:12 -07:00
Prateek Goel 15e7fa727f Merge branch 'error-messages' of https://github.com/prateekgoel/TypeScript into error-messages 2018-10-26 10:17:07 +05:30