Commit graph

21549 commits

Author SHA1 Message Date
Nathan Shively-Sanders 0bbeab6e61
Revert "Skip costly tests" (#35197)
* Revert "Skip costly tests"

* fix package.json format
2019-11-19 12:59:09 -08:00
Orta af0d5d33b6
Improve positioning of the implement interface codefix (#34928) 2019-11-19 12:13:50 -05:00
Ron Buckton 6c59dc34ac
More tests for super.method call chain, improve vary-by (#35013) 2019-11-18 18:03:37 -08:00
Klaus Meinhardt fce728e07f fix emit for delete on optional chain (#35090)
* fix emit for delete on optional chain

* Apply suggestions from code review

Co-Authored-By: Ron Buckton <ron.buckton@microsoft.com>
2019-11-18 16:34:47 -08:00
Anders Hejlsberg 8b83703632
Properly strip readonly from rest argument types (#35169)
* Properly strip readonlyness from rest argument types

* Add tests

* Accept new baselines
2019-11-18 13:11:36 -08:00
Anders Hejlsberg 196c0aa078
Fix excess property checking for unions with index signatures (#34927)
* Fix excess property checking for union targets with index signatures

* Accept new baselines

* Remove unused code

* Add tests

* Accept new baselines
2019-11-15 10:59:58 -08:00
Jack Williams 3bcea0dbba Fix #35060 (#35065)
* Fix 35060

* Refactor and check ro-array to tuple case

* Lint
2019-11-15 10:13:10 -08:00
Klaus Meinhardt 5321dcb09f disallow 'await' and 'yield' in property and enum member initializer (#34892)
* disallow 'await' and 'yield' in property and enum member initializer

* accept baseline changes

* Add a test for #34887

Ensures that this fixes #34887
2019-11-14 17:44:48 -08:00
Klaus Meinhardt 8f40ac06cc optimize transform of optional chaining and nullish coalescing (#34951)
* optimize transform of optional chaining and nullish coalescing

* remove unnecessary condition

* typo

* fix lint

* prevent capturing of super

* swap branches again

* accept new baselines

* avoid temporary objects
2019-11-14 17:34:13 -08:00
Sheetal Nandi aa0cb889da
Support dynamic file names with project root path (#35111)
* Support dynamic file names with project root path
Fixes #35094

* Remove unexpected change
2019-11-14 15:37:00 -08:00
Orta ef0cca7d12
Adds 'did you mean' to the CLI args parser (#35063)
* Adds did you mean to the CLI args parser

* Adds test coverage for the did you mean on CLI args

* Adds did you mean to convertOptionsFromJson

* Ensure tsconfig compiler flags also get 'did you mean?'
2019-11-13 20:16:48 -05:00
Anders Hejlsberg 38db7ae59e
Properly analyze switch statement bypass control flow (#35087)
* Properly analyze switch statement bypass control flow

* Add regression test

* Accept new baselines
2019-11-13 09:22:18 -08:00
Wesley Wigham aa39080ac7
Do not allow freshness to move errors out of the current file, ensure json documents are deeply unfreshened and fully widened (#35048) 2019-11-12 13:30:27 -08:00
Nathan Shively-Sanders f3344767dd
Fix import type resolution in jsdoc, mark 2 (#35057)
Fake alias resolution only applies when the import type is followed by a
qualified name. Otherwise the alias is sufficiently resolved already.
2019-11-12 12:44:30 -08:00
Klaus Meinhardt 94f85901d7 strip QuestionToken from MethodDeclaration and PropertyDeclaration emit (#34954)
* strip QuestionToken from MethodDeclartion emit

Fixes: #34953

* test property emit
2019-11-12 10:30:46 -08:00
Anders Hejlsberg 3a5230ab3d
Defer switch exhaustiveness checks (#35000)
* Defer switch exhaustiveness checks until they're actually needed

* Add regression test

* Accept new baselines
2019-11-09 07:52:39 -08:00
Wesley Wigham 165b4bc100
More version sanitization 2019-11-07 17:14:16 -08:00
Andrew Branch 53d2b7ed60
Don’t assume importing some JSON means you want everything imported with .js extensions (#34961) 2019-11-07 14:55:54 -08:00
Andrew Branch 4cbace7110
Add "auto" to importModuleSpecifierPreference (#34981)
* Add "auto" to importModuleSpecifierPreference

* Update APIs
2019-11-07 14:55:13 -08:00
Wesley Wigham db43be130d
Fix missing semicolon 2019-11-07 14:53:12 -08:00
Wesley Wigham 07d80edb3f
Strip more timestamps and versions from docker logs to better handle the more verbose logging from office-ui-fabric 2019-11-07 14:11:33 -08:00
Andrew Branch f2146a627c
Fix isInJsxText after JSXOpeningElement with type arguments (#34958)
* Fix `isInJsxText` after JSXOpeningElement with type arguments

* Do the same thing a different way
2019-11-06 15:02:45 -08:00
Anders Hejlsberg 1c42c1aaa8
Fix control flow analysis in try-catch-finally (#34880)
* Revise creation of control flow graph for try-catch-finally statements

* Add tests

* Accept new baselines
2019-11-05 12:06:25 -08:00
Anders Hejlsberg 95be956320
Fix switch statement exhaustiveness checking (#34840)
* Don't optimize away CFA nodes representing missing default clauses

* Add regression test

* Accept new baselines
2019-11-05 12:05:41 -08:00
Anders Hejlsberg 966d9864d0
Properly instantiate object types created from rest parameters (#34826)
* Anonymous types of rest variable declarations need instantiation

* Add regression test

* Accept new baselines

* Accept new API baselines
2019-11-05 12:04:45 -08:00
Alexander T 56cad36678 (34894): Wrong information in error message for overridden acc… (#34901) 2019-11-05 00:07:03 -05:00
Ozair Patel be960fa356 Add related diagnostic to "used before defined" if type is a function that returns a union with undefined (#33171)
* Add "use before defined" diagnostic

* Make "use before defined" diagnostic as related information to TS2454

* Add baseline tests for "use before defined"

* Add test for type alias union with undefined for "use before defined" diagnostic

* Update baselines
2019-11-04 17:53:31 -05:00
Sheetal Nandi 47ec514cf4
Use empty object for invalid package json contents instead of undefined (#34906)
* Use empty object for invalid package json contents instead of undefined
Fixes #34726

* Behave as if package json doesnt exist in case of invalid json in package json
2019-11-04 14:31:45 -08:00
Luka Hartwig 9a3ec5f229 Improve error message when compiling a .js file (#34861)
* Improve error message when compiling a .js file

* Add dedicated error message for .json and .js files

* Update missing baseline tests

* Remove error hint for .json files
2019-11-04 14:59:06 -05:00
Ron Buckton ba5e86f140
Propagate 'undefined' instead of the optional type marker at an optional chain boundary (#34588)
* Propagate 'undefined' instead of the optional type marker at an optional chain boundary

* Update src/compiler/types.ts

Co-Authored-By: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2019-11-01 11:36:22 -07:00
Anders Hejlsberg 9ff378aab3
Exclude types originating in literals from recursion depth limiter check (#34742)
* Exclude types originating in literals from recursion depth limiter check

* Add tests

* Accept new baselines

* Remove superfluous test
2019-10-31 06:14:43 -07:00
Wenlu Wang 234680851b add template literal spans (#34699) 2019-10-30 23:54:00 -07:00
Wesley Wigham 7b02c635b6
Report generic rest parameters as unreliable variance positions (#33020)
* Report generic rest parameters as unreliable variance positions

* Add example from discussion on #30301
2019-10-30 13:54:39 -07:00
Wesley Wigham 5e0fbc677a
Add circularity checking during deferred type argument creation (#34791) 2019-10-30 13:36:43 -07:00
Wesley Wigham 8b7664ae15
Generate more correct property name nodes in declaration emit (#34741)
* Generate more correct property name nodes in declaration emit

* Silly only-on-CI lint rule T.T
2019-10-30 12:40:59 -07:00
Wesley Wigham d28672d97f
Fix alias naming and structure bugs in js declarations (#34786)
* Fix alias naming and structure bugs in js declarations

* Add another test case and change condition for ns merge to require signature or export content

* Fix typo in comment
2019-10-30 12:40:06 -07:00
Ron Buckton 87cc8c4af8
Evaluate RHS of binding/assignment pattern first (#34806) 2019-10-29 17:42:30 -07:00
Nathan Shively-Sanders 00dd1f0609
Add isIntersectionConstituent to relation key (#34789)
* Add isIntersectionConstituent to relation key

isIntersectionConstituent controls whether relation checking performs
excess property and common property checks. It is possible to fail a
relation check with excess property checks turned on, cache the result,
and then skip a relation check with excess property checks that would
have succeeded. #33133 provides an example of such a program.

Fixes #33133 the right way, so I reverted the fix at #33213
Fixes #34762 (by reverting #33213)
Fixes #33944 -- I added the test from #34646

* Update comments in test
2019-10-29 15:08:59 -07:00
Nathan Shively-Sanders 7635884224
JSDoc type reference understands require with entity name (#34804)
* resolve require with entity name postfix

For example, `require("x").c`. This is the value equivalent of
`import("x").a.b.c`, but the syntax tree is not as nicely designed for
this purpose.

Fixes #34802

* Add bug number to test

* Add optional chain test
2019-10-29 14:56:33 -07:00
Sheetal Nandi dbef230eb8
This handles when packages are symbol links in mono repo like scenarios to use source files instead of output d.ts from project reference (#34743)
* Fix incorrect outDir usage instead of out

* Handle symlinks of packages in mono repo like packages
Fixes #34723

* Added clarified comment
2019-10-29 10:49:14 -07:00
Ron Buckton 554bd24734
Fix checker handling for empty type argument lists (#34790) 2019-10-29 08:56:11 -07:00
Martin Probst ff590b622e Fix a crash when transforming functions in modules. (#34513)
When transforming a module declaration and block, parse tree nodes
contained in the module block have their parent pointers reset due to
`shouldEmitModuleDeclaration` calling into `isInstantiatedModule`, which
needs to set parent pointers to operate.

That causes a crash when later transforming any nodes within the module,
as retrieving their source file in `getSourceFileOfNode` (via
`getOrCreateEmitNode`) fails, due to their new synthesized parent nodes
not being in a source file.

This change avoids the issue by using the parse tree node in `ts.ts` to
decide whether a module declaration should be emitted (i.e. whether the
module contains values).

This means transformers cannot add values to modules that previously did
not contain any.

Fixes #34644.
2019-10-29 08:40:49 -07:00
Sheetal Nandi cbbbcfa4c5
Fix incorrectly looking for position in call/new expression arguments when looking for indentation of type arguments (#34779)
* Fix incorrectly looking for position in call/new expression arguments when looking for indentation of type arguments
Fixes #32487

* Update src/services/formatting/smartIndenter.ts

Co-Authored-By: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2019-10-28 14:02:09 -07:00
Andrew Branch 634e0ad52b
Fix extract type on JS function params (#34745) 2019-10-28 10:30:59 -07:00
Nathan Shively-Sanders 080e41dc90
Fix type reference to merged prototype property assignment (#34764)
The constructor function code path in the return type checking of
signatures needs to pass the *merged* symbol of the declaration to
getDeclaredTypeOfClassOrInterface. Other callers of
getDeclaredTypeOfClassOrInterface do this, or used an already-merged
symbol.

Fixes #33993
2019-10-28 10:14:04 -07:00
Eli Barzilay eb0208c589
make globalThis have an empty declarations (#34561)
Fixes #33860 by making it an error.  This is an improvement, but sounds
like it would be better to make it work later.
2019-10-25 22:49:31 -04:00
Andrew Branch d8840f8a18
Show all matching enum flags in debug flag formatter (#34689)
* Show all matching enum flags in debug formatter

* Revert "Show all matching enum flags in debug formatter"

This reverts commit 073099722a.

* Same thing but simpler

* Lint
2019-10-25 16:27:24 -07:00
Evan Cahill 88f3593742 Fix error when exporting const enums (#33060) (#34721)
* Allow export declaration to reference const enums

* Update baselines

* Add test to verify reexported const enums are elided
2019-10-25 16:04:44 -07:00
Sheetal Nandi f12eee2e4b
Include *.json in the root files if they are specified as root (#34676)
Fixes #33827
2019-10-25 13:48:38 -07:00
Sangmin Lee a01c8ef764 Fix typo in watchMode.ts (#34701) 2019-10-25 13:13:00 -07:00
Gorka Hernández Estomba 8e1d228a44 Update inconsistent use of the word multiline/multi-line in test cases (#34733)
The word multi-line and multiline are used interchangeably within the file. Multiline seems to be the most used spelling of the word across the TypeScript repository codebase so a few strings have been updated to keep consistency within a single file. Additionally, corrected a minor capitalization mistake.
2019-10-25 11:28:50 -07:00
Anders Hejlsberg c404c08fde
Fix reachability analysis for ?? operator (#34702)
* Exclude ?? operator from true/false literal check in createFlowCondition

* Accept new API baselines

* Add tests

* Accept new baselines

* Address CR feedback

* Accept new API baselines
2019-10-24 15:57:14 -07:00
Martin Probst a03227d60e Avoid a crash with @typedef in a script file. (#33847)
* Avoid a crash with `@typedef` in a script file.

Scripts (as opposed to modules) do not have a symbol object. If a script
contains a `@typdef` defined on a namespace called `exports`, TypeScript
crashes because it attempts to create an exported symbol on the
(non-existent) symbol of the SourceFile.

This change avoids the crash by explicitly checking if the source file
has a symbol object, i.e. whether it is a module.

* Add usage of exports.SomeName typedef.

* Fix bug at bind site rather than in declare func
2019-10-24 14:04:42 -07:00
Wesley Wigham 7cfa1dfb8a
Fix regression in mixin emit by removing unneeded line of code (#34715)
* Fix regression in mixin emit by removing unneeded line of code

* Double the test, double the fun
2019-10-24 14:02:37 -07:00
Nathan Shively-Sanders d892fd408f
Fix expando handling in getTypeReferenceType (#34712)
* Fix expando handling in getTypeReferenceType

getExpandoSymbol looks for the initialiser of a symbol when it is an
expando value (IIFEs, function exprs, class exprs and empty object
literals) and returns the symbol.

Previously, however, it returned the symbol of the initialiser without
merging with the declaration symbol itself. This missed, in particular,
the prototype assignment in the following pattern:

```js
var x = function x() {
  this.y = 1
}
x.prototype = {
  z() { }
}

/** @type {x} */
var xx;
xx.z // missed!
```

getJSDocValueReference had weird try-again code that relied on calling
getTypeOfSymbol, which *does* correctly merge the symbols. This PR
re-removes that code and instead makes getExpandoSymbol call
mergeJSSymbols itself.

* Remove extra newline
2019-10-24 13:12:44 -07:00
Nathan Shively-Sanders 969634b97c
Restore delayed merge check to getTypeFromJSDocValueReference (#34706)
* Restore delayed merge check to getTypeFromJSDocValueReference

This is needed when a function merges with a prototype assignment. The
resulting *merged* symbol is a constructor function marked with
SymbolFlags.Class. However, the merge doesn't happen until
getTypeOfFuncClassEnumModule is called, which, in the
getTypeReferenceType code path, doesn't happen until
getTypeFromJSDocValueReference. That means the check for
SymbolFlags.Class is missed.

Previously, getTypeFromJSDocValueReference had a weird check
`symbol !== getTypeOfSymbol(symbol).symbol`, which, if true, ran
getTypeReferenceType again on `getTypeOfSymbol(symbol).symbol`. For
JS "aliases", this had the effect of dereferencing the alias, and for
function-prototype merges, this had the effect of ... just trying again
after the merge had happened.

This is a confusing way to run things. getTypeReferenceType should
instead detect a function-prototype merge, cause it to happen, and
*then* run the rest of its code instead of relying on try-again logic at
the very end. However, for the RC, I want to fix this code by restoring
the old check, with an additional check to make sure that #33106 doesn't
break again:

```ts
const valueType = getTypeOfSymbol(symbol)
symbol !== valueType.symbol && getMergedSymbol(symbol) === valueType.symbol
```

I'll work on the real fix afterwards and put it into 3.8.

* Add bug number
2019-10-24 09:24:58 -07:00
Wesley Wigham 07d3a2ec7e
Do not consider element accesses which are neither statically bindable nor late bound as special assignments (#34679) 2019-10-23 16:01:25 -07:00
Nathan Shively-Sanders 8223c07527
getTypeFromJSDocValueReference: handle import types (#34683)
Previously it only handled types whose declaration was from `require`,
but now it handles types whose reference is an import type as well.
2019-10-23 15:53:38 -07:00
Keen Yee Liau f689982c9f Prioritize loading plugin from probeLocations over peer node_modules
This commit reoroders the loading sequence of a tsserver plugin. It
should first check `pluginProbeLocations` before checking peer
node_modules.

PR closes https://github.com/microsoft/TypeScript/issues/34616
2019-10-23 11:28:44 -07:00
Andrew Casey 6f04f526d4
Merge pull request #34659 from amcasey/FARGlobalThis
Don't assume that all symbols have declarations
2019-10-22 16:26:19 -07:00
Andrew Casey 590fd3f2a2 Don't assume that all symbols have declarations
...in Find All References.  For example, global `this` doesn't in
modules.

Part of #34404
2019-10-22 15:00:30 -07:00
Kārlis Gaņģis 479d30646f Fix crash in assigning function with this ref to alias (#34650) 2019-10-22 14:33:45 -07:00
Nathan Shively-Sanders 1cbbe288ac
Treat any mix of element/prop access as declaration in JS (#34649)
Fixes #34642 but, notably, doesn't actually make the assignment into a
working declaration. It just fixes the crash.
2019-10-22 11:28:28 -07:00
Andrew Casey 159b6262ea
Merge pull request #34631 from amcasey/ComputedPropName
Handle undefined from getPropertyNameForPropertyNameNode
2019-10-22 10:17:05 -07:00
Andrew Casey 8cf13249ea
Merge pull request #34521 from amcasey/LazyDirectoryCreation
Stop pre-emptively creating directories
2019-10-21 17:41:54 -07:00
Andrew Casey 7862e58354 Handle undefined from getPropertyNameForPropertyNameNode
...which can be returned when the property name is computed.

Part of #34404
2019-10-21 17:41:06 -07:00
Andrew Casey af2f46e899 Use longer lambda parameter names 2019-10-21 16:22:10 -07:00
Daniel Rosenwasser 1b0fca5df5 Update version to 3.8. 2019-10-21 14:51:21 -07:00
Andrew Casey ca31f008a8 Address more potential this issues 2019-10-21 14:01:12 -07:00
Andrew Casey 6429e4cd36 Fix undefined this 2019-10-21 13:32:42 -07:00
Anders Hejlsberg f84fd300b8
Merge pull request #34607 from microsoft/fix33490
Fix type inference regression
2019-10-21 12:50:38 -07:00
Anders Hejlsberg ff6626f869
Merge pull request #34597 from microsoft/optionalChainControlFlow
More optional chaining control flow analysis
2019-10-21 12:36:07 -07:00
Daniel Rosenwasser b167012561 Extend the correct tsconfig.json. 2019-10-21 10:46:41 -07:00
Andrew Branch 1d3ecc0610
Ensure export= symbol from JavaScript always has a valueDeclaration (#34553) 2019-10-21 09:56:02 -07:00
Anders Hejlsberg 8f15a2e639 Fix type inference regression 2019-10-20 17:59:21 -07:00
Anders Hejlsberg 60b391507e And a few more 2019-10-19 07:04:24 -07:00
Daniel Rosenwasser b845800bdf
Add option to configure automatic optional chain completions (#34552)
Add option to configure automatic optional chain completions
2019-10-18 17:35:59 -07:00
Daniel Rosenwasser f33465416f
Ensure original files are included in tsconfig.release.json (#34584)
Ensure original files are included in tsconfig.release.json
2019-10-18 17:35:37 -07:00
Ron Buckton 556da72ffd
[WIP] Improve optional chaining checker performance (#33794)
* Improve optional chaining checker performance

* Improve optional chaining checker performance

* Add flags to Signature

* Inline getOptionalExpression

* split checks for optional chains

* Cache optional call signatures
2019-10-18 17:27:47 -07:00
Anders Hejlsberg 98fe34225c Handle more cases 2019-10-18 16:33:55 -07:00
Andrew Branch 91196fc53f
Ensure functions that have prototype properties assigned by Object.defineProperty get marked as classes (#34577)
* Ensure functions that have prototype properties assigned by Object.defineProperty get marked as classes

* Revert unneeded change
2019-10-18 16:31:43 -07:00
Daniel Rosenwasser fbc070f328 Extend tsconfig.release.json from the sibling tsconfig.json to ensure files aren't forgotten. 2019-10-18 16:12:31 -07:00
Daniel Rosenwasser 218bbcd669 Don't immediately return in getMemberSymbols. 2019-10-18 15:23:56 -07:00
Nathan Shively-Sanders cdf1ab2dec
Bind @class in the right place -- bindWorker not bindChildrenWorker (#34575)
Also add an assert to make future mismatches fail in an obvious place
instead of in a while loop.
2019-10-18 14:13:14 -07:00
Nathan Shively-Sanders fa1884ed1b
Fix crash in expando assignment to alias (#34566)
* Fix crash in expando assignment to alias

This PR disallows expando assignments

Fixes #34493, but disallows the prototype assignment nonetheless.

* Revert mistaken changes
2019-10-18 13:31:44 -07:00
Nathan Shively-Sanders 1d5add528d
Emit computed property temps even w/o init w/useDefineForClassFields (#34406)
Fixes #33857
2019-10-18 13:23:38 -07:00
Daniel Rosenwasser 9b6a027167 Perform checks prior to calling addTypeProperties. 2019-10-18 13:03:25 -07:00
Anders Hejlsberg 241de73556
Merge pull request #34496 from microsoft/fix34272
Properly attach alias symbol to `readonly T[]` types
2019-10-18 12:07:03 -07:00
Anders Hejlsberg d3df927c7a Optional chain control flow analysis fixes 2019-10-18 10:50:03 -07:00
Ben Lichtman 1bfc47252f
Merge pull request #33938 from uniqueiniquity/classifcationAssertion
Add assertion when classification has unexpected length
2019-10-18 09:44:51 -07:00
Ben Lichtman 65561a89dd fix assertion condition 2019-10-18 09:18:16 -07:00
Michael Crane 0fc388893e Remove redundant and misplaced perfLogger startup statement (#34551) 2019-10-18 09:13:40 -07:00
Nathan Shively-Sanders 82f927f8dd
Fix stack overflow in circular assignment declaration (#34543)
* Fix stack overflow in circular assignment declaration

It also needs to have multiple assignments so that it has a ValueModule
flag.

Fixes #33006

* remove errant comment

* Remove other possible circularity

* Restore fallback with additional condition
2019-10-18 09:01:21 -07:00
Daniel Rosenwasser 85e09134be Update comment. 2019-10-17 17:45:13 -07:00
Daniel Rosenwasser 15445e156a Add user preference to the protocol. 2019-10-17 17:41:49 -07:00
Daniel Rosenwasser 73e9715da5 Added option 'includeAutomaticOptionalChainCompletions' to disable '?.' completions. 2019-10-17 17:41:49 -07:00
Andrew Casey 7275e9ca93 Delete redundant test 2019-10-17 17:22:47 -07:00
Daniel Rosenwasser d2fab65df6 Added test. 2019-10-17 17:04:45 -07:00
Andrew Casey 526e413abc Dropping assert for 3.7 2019-10-17 16:51:30 -07:00
Andrew Casey 8927aaabb5 Rewrite tests 2019-10-17 16:50:22 -07:00
Andrew Casey 9dd8391244 Add additional properties to switch declaration 2019-10-17 16:36:54 -07:00
Andrew Casey d18130d36b Consolidate checks in emitFilesAndReportErrors 2019-10-17 16:36:54 -07:00
Andrew Casey caf0041f8a Add listFilesOnly command-line option
Msbuild currently uses a combination of `--listFiles` and `--noEmit` to
obtain a list of files to be consumed by tsc.  However, these two flags
don't suppress type checking, the results of which msbuild will never
consume.  This new switch gives msbuild a faster way to obtain the file
list.

Note: like `--noEmit`, doesn't make sense in build mode.
2019-10-17 16:36:50 -07:00
Andrew Casey 205b3dae3b Extract shared helper 2019-10-17 16:26:43 -07:00
csigs 80cb807663 LEGO: check in for master to temporary branch. 2019-10-17 22:10:36 +00:00
Sheetal Nandi 580e3f56aa
Merge pull request #34527 from microsoft/rootDir
Use getNormalizedAbsolutePath to combine basePath and config value for file names
2019-10-17 14:19:49 -07:00
Andrew Branch 454a3a0b0f
Fix auto-imports from auto type acquisition definitions (#33766)
* Fix auto-imports from ATA typings

* Compare canonical filenames in isImportablePath
2019-10-17 13:59:09 -07:00
Sheetal Nandi fde10a2494 Merge branch 'master' into rootDir 2019-10-17 12:54:26 -07:00
Sheetal Nandi 575339c2e1 Merge branch 'master' into testChanges 2019-10-17 12:26:16 -07:00
Sheetal Nandi 4055689579
Merge pull request #34487 from microsoft/skipTsBuildinfoEmit
Do not write build info if there are no files to emit
2019-10-17 12:22:25 -07:00
Sheetal Nandi 4530d3ed80 Fixed scenario names 2019-10-17 12:04:24 -07:00
Sheetal Nandi 6caa92800f Fix scenario name 2019-10-17 12:00:41 -07:00
Sheetal Nandi afee423a84 Feedback on formatting 2019-10-17 11:54:26 -07:00
Sheetal Nandi 5b5f88ead0 Add test with incremental program with only d.ts files 2019-10-17 11:52:22 -07:00
Sheetal Nandi f32c2eac65 Some changes to incremental tests 2019-10-17 11:46:54 -07:00
Andrew Casey f39b49d756 Update another writeFile call-site 2019-10-17 11:36:45 -07:00
Nathan Shively-Sanders f5dbcb78af
Resolve more jsdoc value references as types (#34515)
* Resolve more jsdoc value references as types

* add test
2019-10-17 11:21:34 -07:00
Nathan Shively-Sanders 262ec6171d
Make ImageData(Uint8ClampedArray)'s 3rd param optional (#34519)
It can be inferred from the first two.

Fixes #33266

Baseline update from microsoft/TSJS-lib-generator#790
2019-10-17 11:14:07 -07:00
Andrew Branch f41b7b59ce
Fix quick info for methods whose contextual type is a mapped type property (#33930) 2019-10-17 10:54:01 -07:00
Andrew Branch a95a25b9a7
Fix completions of optional properties in generic positions (#33937)
* fixes #30507

* Add test case for generic Partial type

* Fixes #28470

* Simplify contextFlags binary check

* Add string literal completion test

* Fix ContextFlags typings

* Speed up inference expression for completion

* Fix baseline merge

* Make contextFlags internal

* Reapply readonly array changes

* accept baselines

* Fix generic completion tests

* Re-merge ContextFlags

* Don’t change type during inference

* Fix typos and superfluous undefined arguments

* Add test for completions in unconstrained generic object literal
2019-10-17 10:45:40 -07:00
Klaus Meinhardt 45d0ef9441 factory: parenthesize for-of expression when necessary (#34229)
Fixes: #33856
2019-10-17 10:17:33 -07:00
Orta 5d20c573a6
Merge pull request #34524 from orta/fix_32675
Does not add a duplicate completion when offering an export which was re-declared as a global
2019-10-17 13:08:32 -04:00
Orta Therox 85010fa6fe Make sure that global module re-exports are short-cutted to be added to completions 2019-10-17 12:33:01 -04:00
Nathan Shively-Sanders f3a234caac
Dedupe inherited jsdoc comments (#34522)
JSDoc on own properties was already deduped, but inherited jsdoc was
incorrectly not deduped.

Fixes #32708
2019-10-16 15:56:01 -07:00
Sheetal Nandi 1531c9ec21 Fix lint rules 2019-10-16 15:42:53 -07:00
Sheetal Nandi 9fa7d8b3b9 Use getNormalizedAbsolutePath to combine basePath and config value for file names
Fixes #34502 by being consistent in path normalization
2019-10-16 15:38:29 -07:00
csigs 0709bde718 LEGO: check in for master to temporary branch. 2019-10-16 22:10:29 +00:00
Sheetal Nandi a4044ca684 Add test for #34502 2019-10-16 14:32:18 -07:00
Sheetal Nandi 66ea16a23a Sample to baseline output 2019-10-16 14:05:07 -07:00
Orta Therox c40ddb183e Does not add a duplicate completion when offering an export which was re-declared as a global - fixes #32675 2019-10-16 17:02:35 -04:00
Sheetal Nandi e54d5cae60 outFile to baseline 2019-10-16 12:51:41 -07:00
Sheetal Nandi 5390c644c9 rootDir tests are baselined 2019-10-16 12:19:26 -07:00
Sheetal Nandi 928a4e799c resolveJsonModule as baseline test 2019-10-16 12:12:12 -07:00
Sheetal Nandi 4b13406baf transitiveReferences as baseline 2019-10-16 11:52:46 -07:00
Sheetal Nandi 25db0b0bf0 Merge baselining and tsc logic into one 2019-10-16 11:39:40 -07:00
Sheetal Nandi e3cc4f4730 missingExtendedConfig to baseline test 2019-10-16 11:39:04 -07:00
Sheetal Nandi 7c0cc4a3b9 empty files to baseline test 2019-10-16 11:37:43 -07:00
Sheetal Nandi c2eabddf5c Write ExitStatus as enumng-rootDir-is-in-the-tsconfig.js 2019-10-16 11:37:35 -07:00
Andrew Casey b6659e5d6e Inline function to tidy up control flow 2019-10-16 11:34:38 -07:00
Andrew Casey 4ed80b62df Stop pre-emptively creating directories
Checking for directory existence is expensive and frequently indicates
success.  Instead of pre-emptively creating the directory containing a
file to be written, attempt to create the file and only do the directory
scaffolding if the write fails.

Appears to reduce file write time by 10-20% for a file-I/O heavy partner
build.

Thanks to @rbuckton for the suggestion!
2019-10-16 11:24:24 -07:00
Klaus Meinhardt 178417f431 factory: correctly parenthesize conditional head (#34227)
Fixes: #34109
2019-10-16 10:41:52 -07:00
Sheetal Nandi 348735a755 Demo as baseline test instead 2019-10-16 09:10:33 -07:00
Sheetal Nandi c8e6f1c2eb Convert some more tests into baselines 2019-10-16 09:10:30 -07:00
Sheetal Nandi 333436b9a8 Some changes to incremental tests 2019-10-16 09:10:22 -07:00
csigs 510639218a LEGO: check in for master to temporary branch. 2019-10-16 16:10:11 +00:00
Martin Johns 408b17649a doc(lib/es5): Fix grammar in DateConstructor.UTC documentation (#34509)
This fixes #34507.
2019-10-16 08:33:22 -07:00
Sheetal Nandi 2c4cf0d1d5 Do not write build info if there are no files to emit 2019-10-16 08:28:23 -07:00
Sheetal Nandi aaadb17afe
Merge pull request #34495 from microsoft/forceDts
Add forceDtsEmit flag to getEmitOutput
2019-10-16 08:14:47 -07:00
Sheetal Nandi f24db4ccf4
Merge pull request #33921 from sQVe/refactor/correct-misspelled-response
refactor(spelling): correct misspelled response
2019-10-16 08:07:25 -07:00
Oskar Grunning 2f48ff37fd
refactor(spelling): correct misspelled response 2019-10-16 08:44:14 +02:00