Commit Graph

31028 Commits

Author SHA1 Message Date
Wesley Wigham
94123d5744 Issue a diagnostic when the node builder performs truncation despite the NoTruncation flag being set (#40477) 2020-09-14 12:20:57 -07:00
csigs
d6859c3480 LEGO: Merge pull request 40547
LEGO: Merge pull request 40547
2020-09-14 11:11:22 -07:00
csigs
a6ea950c1b LEGO: check in for master to temporary branch. 2020-09-14 18:10:53 +00:00
Ryan Cavanaugh
21d781fa54 Fix incorrect name of index signature flag in implementation (#40541) 2020-09-14 09:32:22 -07:00
csigs
8d6aecbdde LEGO: Merge pull request 40537
LEGO: Merge pull request 40537
2020-09-14 05:11:12 -07:00
csigs
ff5eef4ad4 LEGO: check in for master to temporary branch. 2020-09-14 12:10:34 +00:00
TypeScript Bot
e9d2aa1dd2 Update package-lock.json 2020-09-14 06:20:45 +00:00
csigs
5fa379c742 LEGO: Merge pull request 40535
LEGO: Merge pull request 40535
2020-09-13 23:11:11 -07:00
csigs
9be710bbea LEGO: check in for master to temporary branch. 2020-09-14 06:10:37 +00:00
Daniel Rosenwasser
bbf26a07eb Remove technically unnecessary 'module' option from 'harness' config. (#40526) 2020-09-12 23:19:02 -07:00
Anders Hejlsberg
57c8938d9e Consistent inferences when inferring to template literal type (#40518)
* Consistently make inferences when inferring to template literal type

* Add tests

* Accept new baselines
2020-09-12 16:33:33 -10:00
TypeScript Bot
c9422e6aa1 Update package-lock.json 2020-09-12 06:20:06 +00:00
Andrew Casey
46506b5872 Merge pull request #40095 from rhillefeld/master
Added zero-padding to timestamp output
2020-09-11 18:12:31 -07:00
Nathan Shively-Sanders
9c99870058 Support element access aliases: exports["x"] = x (#40514) 2020-09-11 18:05:47 -07:00
Anders Hejlsberg
eee799fe0c Properly check types in template literal placeholders (#40498)
* Properly check types in template literal placeholders

* Add regression test

* Update test

* Accept new baselines
2020-09-11 14:48:35 -10:00
Ryan Cavanaugh
ea51fabb7c Don't crash when observing invalid 'export' in object literal (#40295)
Fixes #32870
2020-09-11 17:18:23 -07:00
Reinhard Hillefeld
4c5e463e12 Simplifying padLeft() to only allow spaces or zeros for padding. Updated padRight() to mirror padLeft() but without the option to use zeros since that would be an unlikely use case. 2020-09-11 20:16:43 -04:00
Alex T
d7cd405bb2 feat(14751): show static members at the top of the list for a class like completion (#40428) 2020-09-11 14:48:24 -07:00
Ryan Cavanaugh
3d235b42a0 --noUncheckedIndexedAccess (#39560)
* Initial implementation + tests

* linty

* Support destructuring declarations and assignments

* lint

* Fix destructuring assignment and element access into known properties

* Update baselines

* Rename flag to unUncheckedIndexedAccess

* Add test for unique symbol indexing

* Fix flag order in baselines

Co-authored-by: Andrew Branch <andrew@wheream.io>
2020-09-11 14:43:10 -07:00
Andrew Branch
9c8d11b5ed Allow 'paths' without 'baseUrl' (#40101)
* Allow paths without baseUrl

* Remove exception for leading * paths

* Add comment, remove commented code

* Update baselines

* Remove unnecessary default

* Fix test harness

* Fix baseline

* Resolve relative to host.getCurrentDirectory() with createProgram API
2020-09-11 12:58:40 -07:00
Orta Therox
aa2756a5d7 Updates Dom lib with TSJS changes, adding a new library for webworker iterable (#40500)
* Updates Dom lib with TSJS changes, adding a new library for webworker iterable

Co-authored-by: Nathan Shively-Sanders <nathansa@microsoft.com>

* Fixes tests

Co-authored-by: Nathan Shively-Sanders <nathansa@microsoft.com>
2020-09-11 15:36:00 -04:00
Orta Therox
db5368dc1d Import the semantic highlighter from typescript-vscode-sh-plugin (#39119)
* Initial import of the vscode semantic highlight code

* Adds the ability to test modern semantic classification via strings instead of numbers

* Adds existing tests

* Port over the semantic classification tests

* Update baselines

* Update src/harness/fourslashImpl.ts

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

* Handle feedback from #39119

* Consistent formatting in the 2020 classifier

* Update baselines

* Apply suggestions from code review

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>

* Update src/harness/fourslashImpl.ts

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>

* Reafactor after comments

* Use 2020 everywhere

* Handle feedback

* WIP - don't provide a breaking change

* Fix all build errors

* Update baselines

* Update src/services/classifier2020.ts

Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>

* Addresses Ron's feedback

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
2020-09-11 15:10:55 -04:00
Wesley Wigham
a36f17c1f8 Add emit support for jsx/jsxs experimental jsx runtime api (#39199) 2020-09-11 10:44:52 -07:00
Andrew Branch
083129f005 A union including non-iterable types is not iterable (#40350)
* WIP

* If method type derives solely from the global iterator or generator type, use its type arguments

* Add test for problem fixed as side effect
2020-09-11 09:31:22 -07:00
Jack Moore
4a3b195772 Add lib es2020.sharedmemory (#39541) 2020-09-11 11:34:01 -04:00
Reinhard Hillefeld
ce1d76c7c9 Merge branch 'master' of https://github.com/microsoft/TypeScript 2020-09-11 10:34:44 -04:00
Reinhard Hillefeld
07c92e8fca Modified existing padLeft() and padRight() functions to support strings other than a single space as padding.
Used this new functionality to zero-pad the timestamp created by nowString().
2020-09-11 09:27:27 -04:00
Orta Therox
cdafb7157b Replaces the default module index resolver with '/index' instead of '' when handling internal routing for dts bundles (#39277)
* Adds support for declaring the bundled name of a dts module export

Co-authored-by: Wesley Wigham <wwigham@gmail.com>

* Adds baselines

* Update the tests

* Try to reduce the scope of the bundledPackageName error

* Use the flag in more baselines

* Get it green

* More tests

* Handle more feedback

* More test cleanup

* Set the moduleResolution for the tsconfigs

Co-authored-by: Wesley Wigham <wwigham@gmail.com>
2020-09-11 08:12:07 -04:00
TypeScript Bot
bbf2133fbe Update package-lock.json 2020-09-11 06:20:23 +00:00
Nathan Shively-Sanders
0eb0fb6d72 Change baseline name to avoid case-only conflict
Windows hates this one weird trick! (And humans are mightily confused by
it)
2020-09-10 13:17:40 -07:00
Nathan Shively-Sanders
b7c598ea39 Use ad-hoc code for nested destructuring in require (#40188)
* Use ad-hoc code for nested destructuring in require

Nested destructuring doesn't really map to ES imports:

```js
const { utils: { nub, intercalate } } = require('./monopackage')
```

Previously, isRequireVariableDeclaration walked up binding elements
until it reached a variable declaration. This change instead only walks
up one binding element and stops. Then it's not bound as an alias and
uses the checker-only code to produce types for the nested-imported
identifiers.

Fixes #40143

* revert binder formatting change
2020-09-10 13:07:58 -07:00
Andrew Casey
45dedd6b87 Merge pull request #40063 from amcasey/ChromeTracing
Trace key operations
2020-09-10 13:01:47 -07:00
Orta Therox
0a5f53301f Retains trailing cmments in a logical manner in extract type (#40245) 2020-09-10 14:59:46 -04:00
Nathan Shively-Sanders
e350c357d2 Alias for module.exports.x = x (#40228)
* Alias for `module.exports.x = x`

This fixes #40155 in a surprisingly small amount of code.

* Treat any aliasable expression as an alias

* test internal references to exported class
2020-09-10 11:23:48 -07:00
csigs
0636b9bfc1 LEGO: Merge pull request 40480
LEGO: Merge pull request 40480
2020-09-10 11:10:57 -07:00
csigs
5753b4be22 LEGO: check in for master to temporary branch. 2020-09-10 18:10:32 +00:00
Wesley Wigham
683979246f Fix JS declaration emit for acessors in a class/interface merge (#40456) 2020-09-10 10:39:41 -07:00
Nathan Shively-Sanders
156cb4c1f9 Fix see tag quickinfo (#40458)
* Add test

* Treat see tags same as param tags
2020-09-10 08:28:38 -07:00
csigs
6be21fe53e LEGO: Merge pull request 40475
LEGO: Merge pull request 40475
2020-09-10 05:11:07 -07:00
csigs
bb95c3566f LEGO: check in for master to temporary branch. 2020-09-10 12:10:26 +00:00
TypeScript Bot
0a1f1c864b Update package-lock.json 2020-09-10 06:20:09 +00:00
Anders Hejlsberg
6f0c91c4cb Template literal types and mapped type 'as' clauses (#40336)
* Initial implementation of string template types

* Accept new API baselines

* Accept new baselines

* Unified checking for large cross product union types

* Accept new baselines

* Ensure errors from union type resolution are reported

* Accept new baselines

* Compute constraints for string template types

* Support `as T` clause in mapped types

* Accept new API baselines

* Add missing semicolon

* Add checking of `as T` clauses

* Support casing modifiers in string template types

* Accept new baselines

* Bump keyword maximum length

* fix anders

* Revert "fix anders"

This reverts commit b3178d4618.

* Properly handle 'as T' clause with keyof for mapped type

* Fix lint error

* Single character inferences and anchored end span matching

* Fewer array copy operations in template literal type resolution

* Handle cases where 'as T' maps multiple properties onto one

* Fix lint error

* Store key type instead of type mapper in MappedSymbol

* No constraint on `in T` type when `as N` clause present

* Rename from TemplateType to TemplateLiteralType

* Accept new API baselines

* Add tests

* Accept new baselines

* Address CR feedback

* Accept new API baselines

Co-authored-by: Erich Gamma <egamma@microsoft.com>
2020-09-09 17:23:22 -10:00
Vincent Boivin
96b0832cf6 fix(40322): bad completions for string literal type as indexed access type object (#40424)
* Added fourslash tests to work on the bug

* fix(40322): bad completions for string literal type as indexed access type object

* Added regression tests

* Using nodes instead of text

* Add verification for parenthesized nodes

* Using range check

* Change test markers
2020-09-09 15:26:35 -07:00
Wenlu Wang
ee5f51bc0f Add see tag support (#39760)
* Add see tag parser

* add baseline

* fix symbol resolve

* add more case

* fix unittests

* improve tests and parser

* accept baseline

* Adopt package-lock.json and npm ci

* Add a workflow to update package-lock.json daily

* Git ignore package-lock.json and forcibly update in workflow

* Update bot email address

* Delete extra npm update

* Update package-lock.json

* Add compactDisplay and signDisplay to NumberFormatOptions (#40039)

* Fix typo in (Readonly)Set.keys comment (fixes #40164) (#40176)

* fix(26325): use a unique name for reserved words in 'constructor like' function name (#39684)

* fix(25770): add diagnostic message for the possible mapped type used as an index (#39973)

* fix(31046): add new diagnostic message for incompatible constructor signature (#40073)

* Update package-lock.json

* Update package-lock.json

* Add rename support

* Accpet baseline

* wip

* fix anders

* Revert "fix anders"

This reverts commit b3178d4618.

* Fix call hierarchy item serialization and server tests (#40348)

* Avoid error

* accept baseline

* Add more tests

* Add signature name resolve

Co-authored-by: Andrew Casey <andrew.casey@microsoft.com>
Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
Co-authored-by: Neil Kistner <neil.kistner@gmail.com>
Co-authored-by: cherryblossom000 <31467609+cherryblossom000@users.noreply.github.com>
Co-authored-by: Alexander T <alexander.tarasyuk@outlook.com>
Co-authored-by: Erich Gamma <egamma@microsoft.com>
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
2020-09-09 10:45:09 -07:00
Alex T
4584d6d470 fix(39676): skip removing unused parameters for functions used as callback references (#40299) 2020-09-09 08:23:53 -07:00
TypeScript Bot
2b0278a88f Update package-lock.json 2020-09-09 06:20:34 +00:00
Alex T
6aec7f4676 feat(25770): add Quick Fix to convert LiteralType to MappedType (#40226) 2020-09-08 14:18:53 -07:00
Alex T
6101fbca39 fix(40150): use parameter name for a Promise callback function (#40191) 2020-09-08 13:44:38 -07:00
Alex T
15084465b7 fix(40222): fix crash on using destructuring in a catch clause (#40240) 2020-09-08 11:49:45 -07:00
Orta Therox
fa89ce6158 Remove assignability cases in getNarrowedType + an isArray improvement for readonly arrays (#39258)
* Explore using a different isArray declaration

* Add tests and the new isArray definition

* Baseline updates

* Upda the isArray type
2020-09-08 14:43:48 -04:00