Commit Graph

15303 Commits

Author SHA1 Message Date
Wesley Wigham
aa9445bc15 Merge branch 'master' into empty-jsx-child 2020-10-19 14:54:20 -07:00
Wesley Wigham
de93173f53 Revert "Add extensions to jsx automatically added import, per babel change (#40871)"
This reverts commit 798b18be6e.
2020-10-19 14:27:28 -07:00
Wesley Wigham
b8dfa28ca8 Do not consider empty jsx expressions semantically important children 2020-10-19 13:34:16 -07:00
Anders Hejlsberg
4638c685b1 Properly reduce intersections of string literal and template literal types (#41162)
* Properly reduce single element intersections

* Add regression test

* Accept new baselines
2020-10-19 13:05:29 -07:00
Sheetal Nandi
15cec9d1f7 Optimizes project loading in few scenarios (#41126)
* Some refactoring of forEachResolvedProjectReference

* More refactoring

* Test before the change

* When loading project tree, load projects that directly or indirectly reference the projects we are looking for

* Optimize finding project in solution scenario by directly finding possible default project through projectReferenceRedirect
This helps in avoiding loading indirect projects when solution indirectly referenced default project
2020-10-19 12:59:59 -07:00
Jesse Trinity
08e4f369fb Add editor configurable filename-based ATA (#40952)
* add typeAcquisition:inferTypings

* remove unused property

* handle inferred and external projects separately

* update missed rename

* fix tests

* pass as external compilerOption

* update test

* remove hostConfig reference

* change option name

* remove extraneous property

* add inferredProjectCompilerOptions
2020-10-19 09:53:58 -07:00
Anders Hejlsberg
3918e6c535 Move anonymous type instantiation cache from AST node to root type (#41084)
* Move anonymous type instantiation cache from AST node to root type

* Use "root" type reference as cache location for deferred type references

* Add test

Co-authored-by: Andrew Branch <andrew@wheream.io>
2020-10-19 07:26:48 -07:00
Eli Barzilay
868638ae04 performanceTimestamp: use performance.now on node
On node, `performance` is found in `require("perf_hooks")`.
2020-10-15 19:01:50 -04:00
Wesley Wigham
ce1947b0be Merge pull request #41070 from weswigham/use-minimal-endings-in-bundled-declaration-emit
Use minimal endings when generating declarations for js
2020-10-14 15:29:50 -07:00
Eli Barzilay
5b2fba3334 transformGenerators: handle CommaListExpression
Uses essentially the same code as `visitCommaExpression` (which was
moved, to keep both together and close to
`visit{Right,Left}AssociativeBinaryExpression`).

Fixes #40614.
2020-10-14 15:58:13 -04:00
Wesley Wigham
84726be01a Merge pull request #40597 from weswigham/allow-instanceof-array-to-narrow-readonly-array
Handle the mapping between Array and ReadonlyArray in isTypeDerivedFrom
2020-10-13 15:08:17 -07:00
Wesley Wigham
1cdb621257 Use minimal endings when generating declarations for js 2020-10-12 16:01:32 -07:00
Wesley Wigham
34fb470087 Merge branch 'master' into spread-compact-literals 2020-10-12 14:10:51 -07:00
Andrew Branch
a09a7144e7 Fix crash resolving ImportTypeNode in JSDoc (#40838) 2020-10-12 09:33:39 -07:00
Alex T
05be3b421a fix: show deprecated error for alias (#40961) 2020-10-12 08:45:08 -07:00
Sheetal Nandi
a4b9bbae90 Handle noEmit and noEmitOnError with SemanticDiagnosticsBuilder (#40880)
* Add test that fails

* Handle noEmit on semantic builder's emit as well

* Add test for tsbuildinfo text verification

* Fix noEmit handling for tsbuildinfo emit with SemanticDiagnosticBuilder

* Add test for noEmitOnError with SemanticDiagnosticsBuilder

* Fix tsbuildinfo emit with SemanticDiagnosticsBuilder on noEmitOnError

* Update src/compiler/builder.ts

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

* Update src/compiler/builder.ts

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-10-09 17:25:04 -07:00
Nathan Shively-Sanders
a109b5d5c8 Fix relative paths in commonjs decl emit w/property access (#40986)
```js
const x = require('./foo').y
```

was incorrectly using the unmangled require path as the temp name in
emit:

```
import ./foo_1 = require('./foo')
import x = ./foo_1.y
```

It now uses the imported identifier:

```
import x_1 = require('./foo')
import x = x_1.y
```

Discovered while fixing #37832
2020-10-09 16:32:57 -07:00
Wesley Wigham
aee18e0725 Merge pull request #41017 from weswigham/fix-unchecked-cast-crash
Fix crash due to unchecked cast in addImplementationSuccessElaboration
2020-10-09 15:58:08 -07:00
Sheetal Nandi
e6d525c5cb Structure is reused should be on new program instead of old program (#41005) 2020-10-09 15:56:51 -07:00
Sheetal Nandi
876e44bbc6 Handle extra file extensions when wild card directory watch is invoked (#41018)
Fixes #40495
2020-10-09 14:07:55 -07:00
Wesley Wigham
39c2a09b1f Fix crash due to unchecked cast in addImplementationSuccessElaboration 2020-10-09 10:53:59 -07:00
Wesley Wigham
f324fde873 Fix lint 2020-10-08 17:34:06 -07:00
Wesley Wigham
de204430ec PR feedback 2020-10-08 17:17:06 -07:00
Wesley Wigham
6b29f36674 Rename variable 2020-10-08 16:14:47 -07:00
Wesley Wigham
a49099fd15 Add elaboration when call fails all overloads but succeeds against the implementation signature 2020-10-08 14:55:14 -07:00
Nathan Shively-Sanders
cf3e28ea66 Revert "feat(40197): handle uncalled function checks in binary expressions (#40260)"
This reverts commit eaf4f46c17.
2020-10-07 14:14:49 -07:00
Alex T
eaf4f46c17 feat(40197): handle uncalled function checks in binary expressions (#40260) 2020-10-07 14:06:42 -07:00
Nathan Shively-Sanders
4283428906 Fix export binding of namespaced typedefs (#40980)
The binder incorrectly rejected implicit namespace declarations in
typedefs.
2020-10-07 13:21:02 -07:00
Wesley Wigham
4dc7e59248 Merge pull request #40953 from weswigham/improve-completions-large-literal-perf
Improve the performance of requesting completions within a massive array literal
2020-10-07 12:44:20 -07:00
Nathan Shively-Sanders
fc783a9000 Fix missed tasks to add esnext.weakref (#40981)
Follow up to #38232, based on #33844
2020-10-07 11:06:04 -07:00
Anders Hejlsberg
f34220980b Add isDeeplyNestedType logic to getResolvedBaseConstraint (#40971)
* Add isDeeplyNestedType logic to getResolvedBaseConstraint

* Accept new baselines

* Add regression test

* Accept new baselines

* Fix lint issue
2020-10-07 05:50:06 -07:00
Wesley Wigham
3df8bc6a03 Rephrase to use binarySearchKey 2020-10-06 12:29:58 -07:00
Sheetal Nandi
d94b8e42a6 Fixes calculating resolved project reference to redirect for module resolution (#40954)
* Add test for #38711

* Fixes calculating resolved project reference to redirect for module resolution
Fixes #38711

* Update src/compiler/program.ts
2020-10-06 11:23:05 -07:00
Alex T
0c7d45a9ed fix: change deprecated FunctionLike type to SignatureDeclaration (#40795) 2020-10-06 07:51:01 -07:00
Vincent Boivin
57661607e9 fix(40929) PromiseConstructor error message for newer versions of ECMAScript (#40931)
* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Fixes #40929

Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
2020-10-05 16:38:12 -07:00
Tiago Tristao
1191e2e731 Fix class expression from being assignable if types don't match (#40660)
* Fix class expression from being assignable if types don't match

* Fix class expression from being assignable if types don't match
2020-10-05 13:21:38 -07:00
Wesley Wigham
77df9faabf Merge pull request #40886 from weswigham/error-on-anonymous-type-with-nonlocal-unique-symbol
Limit when we allow nested unique symbols to be serialized
2020-10-05 11:59:45 -07:00
Orta Therox
dd84bc1dc9 Handles creating a reasonable AST when destructuring into a parens'd expresssion (#40115)
* Handles creating a lgical AST when destructuring  into a parens

* Adds an async example
2020-10-05 14:12:47 -04:00
Vincent Boivin
61aadc4ce2 fix(40320): Better errors when using properties/methods from newer versions of ECMAScript (#40650)
* Update package-lock.json

* Suggesting a library for a missing property/method

* Added more types and added tests

* Added more tests to cover all the latest features

* Added bigintarrays and dataview methods

* Fixed typo in template

* Transform old error message to use 2nd template slot

* Removed test that has been split up between es2015 and es2016+

* Use empty arrays and remove unnecessary function call

* merge

* Added early bail-out and updated baselines

* Implemented early bail-out (misread)

Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
2020-10-02 16:47:37 -07:00
Richa Deshmukh
b748484031 #40763 Fixed: Bad error message when forgetting a comma in an array of templ… (#40907)
* #40763 Bad error message when forgetting a comma in an array of template strings

* Code review fixes
2020-10-02 15:37:59 -07:00
Sheetal Nandi
5ecdcef4ce Remove unnecessary requirement for createHash since we already handle absence of it (#40891) 2020-10-02 10:56:33 -07:00
Wesley Wigham
6a5527e0c6 Properly compare path prefixes when generating module paths (#40885) 2020-10-02 10:50:30 -07:00
Nathan Shively-Sanders
477e4b1a9d Fix function merged with export as namespace sourcefile (#40908)
Previously it crashed because the function-checking code didn't expect
a node with no parent.
2020-10-02 10:50:12 -07:00
Nathan Shively-Sanders
b8ebad48d7 Fix recursive types in @typedef (#40861)
* Fix reference types in @typedef

Previously this code path was broken and untested. Fortunately the fix
is simple.

* add test case from #40234

* update baselines
2020-10-02 08:46:42 -07:00
Sai Geetha Kandepalli Cherukuru
0ba250dc3b Updated error message for TS1031 (#40889)
Co-authored-by: Sai Geetha <sai.geetha@ssi.samsung.com>
2020-10-01 16:37:14 -07:00
Wesley Wigham
b86dc34386 Limit when we allow nested unique symbols to be serialized to when their declaration is within the same file as the context 2020-10-01 15:20:01 -07:00
Wesley Wigham
e9465c5de5 Properly compare path prefixes when generating module paths 2020-10-01 14:56:32 -07:00
Wesley Wigham
da86332120 Limit export= js declaration emit to only json source files (#40882) 2020-10-01 14:55:24 -07:00
Wesley Wigham
3ea81e652a Ensure whitespace jsx elements are not counted when determining if a jsx child is the only child (#40839)
* Ensure whitespace jsx elements are not counted when determining if a jsx child is the only child

* Use filtered children count for deciding constructor used

* Accept updated baselines post-merge
2020-10-01 14:36:44 -07:00
Andrew Branch
5fbe9806db Fix noUncheckedIndexedAccess with tuple rest types and generic index types (#40681)
* Fix noUncheckedIndexedAccess for tuple rest elements

* Defer inclusion of undefined for generic indexed access types

* Create separate IndexedAccessTypes depending on whether --noUncheckedIndexedAccess applies

* Undo accidental export

* Parenthesize for clearer precedence
2020-10-01 13:56:13 -07:00