Commit graph

25566 commits

Author SHA1 Message Date
Andy 070218f828
Remove DirectoryOfFailedLookupWatch#ignore, use DirectoryOfFailedLookupWatch | undefined (#28091) 2018-10-25 15:03:46 -07:00
Andy efc831e0ba
At '.' in array literal, don't close the array (#28120) 2018-10-25 12:25:33 -07:00
Sheetal Nandi 539b9a6d50
Merge pull request #28028 from ajafff/optimize-resolve-reusing-old-state
Fix performance regression when reusing old state
2018-10-25 11:12:53 -07:00
Wesley Wigham 05716a74a5
Add support for configuration inheritance via packages (#27348)
* Add support for configuration inheritance via packages

* Fix lint

* Propagate trace into config parse hosts
2018-10-25 10:19:57 -07:00
TypeScript Bot 0aac87fd60 Update user baselines (#28129) 2018-10-25 09:28:04 -07:00
Anders Hejlsberg 6e8e5c10dd
Merge pull request #28112 from Microsoft/fixInstanceofControlFlow
Fix instanceof control flow analysis
2018-10-25 06:16:39 -07:00
Andy 42740d66c2
Improve performance of suggestionDiagnostics for convertToAsyncFunction (#28089) 2018-10-24 21:23:47 -07:00
Nathan Shively-Sanders fe2a33fcbc
Merge existing JSDoc comments (#27978)
* Correct indentation, using correct (I hope) indentation code

Note that part of the code, in formatting.ts, is cloned but should be
extracted to a function instead.

* Remove some possibly-superfluous code

But I see 4 failures with whitespace, so perhaps not.

* Restrict indentation change to avoid breaking baselines

The indentation code is very complex so I'm just going to avoid breaking
our single-line tests for now, plus add a simple jsdoc test to show that
multiline jsdoc indentation isn't destroyed in the common case.

* Switched over to construction for @return/@type

Still doesn't merge correctly though

* Add @return tags to emitter

* Merge multiple jsdocs

(not for @param yet)

* Merge multiple jsdoc for parameters too

* Emit more jsdoc tags

Not all of them; I got cold feet since I'll have to write tests for
them. I'll do that tomorrow.

* Many fixes to JSDoc emit

And single tests (at least) for all tags

* Cleanup in textChanges.ts

* Cleanup in formatting.ts

(Plus a little more in textChanges.ts)

* Cleanup in inferFromUsage.ts

* Fix minor omissions

* Separate merged top-level JSDoc comments with \n

instead of space.

* Don't delete intrusive non-jsdoc comments

* Cleanup from PR comments

1. Refactor emit code into smaller functions.
2. Preceding-whitespace utility is slightly easier to use.
3. Better casts and types in inferFromUsage make it easier to read.

* Fix bogus newline

* Use @andy-ms' cleanup annotateJSDocParameters
2018-10-24 16:14:52 -07:00
Andy e46c846ee6
Remove getBucketForCompilationSettings (#28088) 2018-10-24 15:37:46 -07:00
Andy 854f20e90f
Remove 'verify.fileAfterCodeFix', use 'verify.codeFix' (#28110) 2018-10-24 15:34:15 -07:00
Anders Hejlsberg cc9f45d517 Accept new baselines 2018-10-24 13:51:35 -07:00
Anders Hejlsberg ba8310ab8d Add regression test 2018-10-24 13:51:24 -07:00
Anders Hejlsberg 6fbd2a5f59 Reset narrowing of 'x.y' only when 'x' has a narrowable type 2018-10-24 13:51:11 -07:00
Noel Yoo 6409195054 Update CI (#28082)
* Use 'node' instead of 'stable'

* Add node 10

* Drop node 8
2018-10-24 13:21:58 -07:00
Nathan Shively-Sanders 0db3038b57
Fix tests for node 11 (#28108)
1. Sort is now stable in node 11, which exposed a lack in the sorting of
nested ranges. Ranges now sort based on last ending if the start
positions are the same. This means nested ranges sort the
containing range first, even if a range contains another range that
starts at the same position.
2. Symbol has a new member description which can't be accessed through
the prototype. In addition, Array now has flat and flatMap, which I
excluded to keep baselines the same between Node 6-11.
2018-10-24 13:03:29 -07:00
Nathan Shively-Sanders ff6f94791f
Use regex+getTokenAtPosition to find dynamic import (#28104)
Instead of walking the entire tree. This stack overflows for large
trees.

Still need to adapt a test.
2018-10-24 11:27:39 -07:00
Andy eadf44d073
Add generateTypesForModule to public API (#28069)
* Add generateTypesForModule to public API

* Avoid parameter initializer and update baselines
2018-10-23 16:10:26 -07:00
Nathan Shively-Sanders 996fb78445
Test update of DOM. (#28050)
Based on the few changes that have been accepted since Mohamed left.
2018-10-23 15:24:56 -07:00
TypeScript Bot 3c5f1a6819 Update user baselines (#28076) 2018-10-23 12:51:59 -07:00
Wesley Wigham 0a7c92864d
Fix Object.defineProperty declaration expando-ness and renames (#28061)
* Allow object.defineProperty calls to be expando properties

* Fix rename locations for object.defineProperty assignments
2018-10-23 09:33:53 -07:00
Wesley Wigham fbd6cad437
Like #27964 but for JSX (#28068) 2018-10-22 19:18:20 -07:00
Andy 5becc3b170
Rename of non-intrinsic JSX element should rename the declaration (#28066) 2018-10-22 18:17:32 -07:00
Andy 82773b8550
Fix bug: only getCompletionEntriesFromTypings if completions are for top-level directory (#27226)
* Fix bug: only getCompletionEntriesFromTypings if completions are for top-level directory

* Support subdirectories of a nonrelative import
2018-10-22 18:17:09 -07:00
Sheetal Nandi 7ed9e44055
Merge pull request #28059 from ajafff/lsh-resolve-return-type
fix return type of resolveModuleNames and resolveTypeReferenceDirectives
2018-10-22 18:09:15 -07:00
Wesley Wigham 76addd75d1
Add JSXText check into isValidLocationToAddComment (#27653)
* Add JSXText check into isValidLocationToAddComment

* Small simplification
2018-10-22 16:45:39 -07:00
Wesley Wigham 6e5e09cef8
Reject return type inferences to the autoType or autoArrayType (#27169)
* Reject return type inferences to the autoType or autoArrayType

* Accept new error positions
2018-10-22 16:44:32 -07:00
Wesley Wigham 0c36266706
Obey the excludeArgument parameter when checking JSX signature validity (#28002)
* Obey the excludeArgument parameter when checking JSX signature validity

* Fix conditional type extending any contextual types and accept baselines

* use flag check to also drop unknown from comparison for the same reason

* Slight refinement - make an intersection to ensure parameter constraints flow through contextual types when instantiated

* Format ternary more nicely
2018-10-22 16:36:11 -07:00
Wesley Wigham f701daf4e0
Infer over each mapped type constraint member if it is a union (#28006) 2018-10-22 16:33:43 -07:00
Daniel Rosenwasser 68ce68da79
Merge pull request #27964 from Igorbek/issue27854
Fix bug in reduceEachChild for tagged template expressions
2018-10-22 15:49:54 -07:00
Wesley Wigham 34256145b8
Fix lint 2018-10-22 14:37:27 -07:00
Klaus Meinhardt 5b3fe6e68b update other interfaces and implementations
and accept baseline
2018-10-22 21:23:04 +02:00
Klaus Meinhardt 3b058a4de4 fix compile errors, accept baselines 2018-10-22 21:12:12 +02:00
Klaus Meinhardt 96480b5ba9 fix return type of LangageServiceHost.resolve*
Fixes: #28058
2018-10-22 20:59:42 +02:00
Andy 1930f8a790
fourslash: Add 'goToMarkerOrRange' helper (#28057) 2018-10-22 11:44:39 -07:00
Andy d3d4f83f89
Remove hack to get target of GetAccessor symbol (#27868)
* Remove hack to get target of GetAccessor symbol

* Add tests and get moveToNewFile to work with binding patterns
2018-10-22 11:44:06 -07:00
Sam Drugan 02c74987b7 added await keyword to completions and added test (#27912) 2018-10-22 11:32:49 -07:00
Andy afa94c527c
Un-consolidate overloads for Map and WeakMap (#28052) 2018-10-22 11:18:56 -07:00
Andy 8e0142d709
Support import completions for a re-export with a different name from the original (#28055) 2018-10-22 11:16:39 -07:00
TypeScript Bot 778f438a7f Update user baselines (#28047) 2018-10-22 10:15:46 -07:00
Anders Hejlsberg dc04b97f2f
Merge pull request #28027 from Microsoft/simplifyAddTypeToUnion
Simplify addTypeToUnion function
2018-10-21 12:32:01 -07:00
Klaus Meinhardt 63a8cb6933 use Map instead of Array 2018-10-21 19:57:23 +02:00
Klaus Meinhardt ea0c7eb3ce Fix performance regression when reusing old state
Fixes: #28025
2018-10-21 18:15:01 +02:00
Anders Hejlsberg 033ea4c232 Simplify addTypeToUnion function 2018-10-21 09:12:52 -07:00
Andy 72244c5b03
Support 'isSourceFileFromExternalLibrary' for source files from '/// <reference types="" />'' (#28004)
* Support 'isSourceFileFromExternalLibrary' for source files from '/// <reference types="" />''

* Calculate `isExternalLibraryImport` at the end

* Calculate isExternalLibraryImport with symlink path
2018-10-19 18:00:45 -07:00
Sheetal Nandi 424fcdde37
Merge pull request #28005 from Microsoft/noReductionUnion
Do not do any reduction (even if it contains any) to the union type when getting contextual type
2018-10-19 17:33:16 -07:00
Sheetal Nandi ad5599434e
Merge pull request #27974 from Microsoft/errorUpdateWithChangeInTransitiveDeclarationFile
Use reference map from declaration file as exported map to handle deep import semantic diagnostics invalidation
2018-10-19 17:32:32 -07:00
Nathan Shively-Sanders bf393ae1cd
Check EOF token to get errors for JSDoc (#28000)
* Check EOF token to get errors for JSDoc

* outputFile instead of noEmit for test
2018-10-19 16:23:34 -07:00
Sheetal Nandi 71d8961ba0 Do not do any reduction (even if it contains any) to the union type when getting contextual type
Fixes #27975
2018-10-19 16:10:08 -07:00
Wesley Wigham 69b1cb5bac
Add new special assignment kinds for recognizing Object.defineProperty calls (#27208)
* Add new special assignment kinds for recognizing Object.defineProperty calls

* Add support for prototype assignments, fix nits

* Fix code review comments

* Add test documenting behavior in a few more odd scenarios
2018-10-19 14:31:55 -07:00
Nathan Shively-Sanders e379aeb151
Fix alias of module.exports->exports->IIFE (#27992)
In JS, when you assign `module.exports = exports` and the entire module is
wrapped in an IIFE, the resulting `export=` symbol, after following
aliases, is the module itself. This results in trying to merge the
file's exports with itself inside `getCommonJsExportEquals`, since it
thinks that it has found new exports, possibly in an object literal,
that need to be merged with the file's exports.

For example:

```js
(function() {
exports.a = 1
module.exports = exports
})()
```
2018-10-19 13:50:38 -07:00