Commit Graph
24628 Commits
Author SHA1 Message Date
Nathan Shively-Sanders 8be58eb472 Remove VirtualServerBastHost
Instead, pass in additional configuration from TestServerHost
2022-06-08 14:00:18 -07:00
Nathan Shively-Sanders 2ba27a58fb Create composite host/fshost.
This removes fshost usage in most places except for construction of
objects.
2022-06-08 10:03:19 -07:00
Nathan Shively-Sanders a29c27ce47 remove newline from FileServerHost, undo RuntimeServerHost addition 2022-06-07 16:12:53 -07:00
Nathan Shively-Sanders 13745894ae add RuntimeServerHost as Omit<ServerHost, FileServerHost> 2022-06-07 13:09:56 -07:00
Nathan Shively-Sanders 209807843b Address first PR comments
Also improve test with a file update
2022-06-07 10:52:39 -07:00
Nathan Shively-Sanders 8c32914237 Merge branch 'main' into server-vfs-support 2022-06-07 08:50:24 -07:00
4c5060181f Fix(49198): Added missing definition for Atomics.waitAsync and es2022 sharedmemory file (#49204)
* feat(sharedmemory): Added file waitAsync function

* fix: Adjusted promise return type

* Fix(sharedmemory): Addressed PR comments

* Fix: Removed unused @see at sharedmemory

* Feat: Added tests to shared memory

* Fix: fixed ordering in libs.json

* Feat: Added shared memory to line parser

* Update tests es2022SharedMemory.ts as sugested

Co-authored-by: Eyal Halpern Shalev <eyalsh@gmail.com>

* Update es2022SharedMemory.ts

* feat: Accepted baselines

* fix: Adjusted grammar changes in jsdoc

* fix(47821): skip nodes with export modifiers (#47829)

* Use symbolic GitHub Actions Node.js versions (#49403)

* update baselines

Co-authored-by: Eyal Halpern Shalev <eyalsh@gmail.com>
Co-authored-by: Oleksandr T <oleksandr.tarasiuk@outlook.com>
Co-authored-by: Jack Bates <jack@nottheoilrig.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-06-07 08:46:23 -07:00
Jake Bailey f72b1badff Replace ts.hasOwnProperty.call(...) with hasProperty(...) (#49410) 2022-06-06 20:10:40 -07:00
Oleksandr T 2f13eba42c fix(47821): skip nodes with export modifiers (#47829) 2022-06-06 10:49:55 -07:00
Anders Hejlsberg 565249fbbe Fix definite assignment analysis issue caused by x !== null checks (#49387)
* Check for non-intersected `undefined` type in definite assignment analysis

* Add regression test
2022-06-06 09:51:13 -07:00
Oleksandr T 62668c6c1d feat(47558): check JSDoc link tags in TypeScript/JavaScript files (#47822) 2022-06-06 09:04:18 -07:00
Andrew Branch f483ab5c2f Explicit types should prevent ATA from doing package.json discovery (#49380) 2022-06-03 15:21:21 -07:00
Ron Buckton cb1bc6169b Move legacy decorators into separate transform (#48669) 2022-06-03 09:36:29 -07:00
Nathan Shively-Sanders 8f0741da8e Merge branch 'main' into server-vfs-support 2022-06-03 08:51:42 -07:00
Nathan Shively-Sanders 27b0e82c1b fix lint 2022-06-03 08:51:36 -07:00
Wesley WighamandDaniel Rosenwasser 3ccbe804f8 Expose import mode calculation functions (#49360)
* Expose import mode calculation functions

* Make `SourceFileImportsList` internal again.

* Accepted API baselines.

* Fix lints.

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2022-06-02 18:06:50 -07:00
Oleksandr TandDaniel Rosenwasser 9c8e6b53b8 fix(49223): checker.getTypeAtLocation for ExpressionWithTypeArguments returns an error any type (#49284)
* fix(49223): handle ExpressionWithTypeArguments nodes in isExpressionNode

* Update src/compiler/utilities.ts

* Just use `!isHeritageClause(node.parent)`.

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2022-06-02 17:28:36 -07:00
Andrew Branch 34fe835f33 Add nightly-only error on ImportType resolution mode assertion (#49356)
* Add nightly-only error on ImportType resolution mode assertion

* Temporarily change version to demonstrate errors

* Revert "Temporarily change version to demonstrate errors"

This reverts commit 40c2469647.

* "Resolution mode" -> "resolution-mode"
2022-06-02 15:50:44 -07:00
Wesley Wigham 19b22844d8 Use node's algorithm for calculating the longest matching export/import pattern (#49361) 2022-06-02 15:43:26 -07:00
Oleksandr T 2cb8ee27f0 fix(48653): throw an error on an invalid optional chain from new expression (#48656) 2022-06-02 14:21:36 -07:00
Oleksandr T c6447f9454 fix(49306): add isImportTypeAssertionContainer helper (#49313) 2022-06-02 14:07:03 -07:00
uhyo f3d57ccea8 Remove undefined from source type of renaming destructuring assignment with default (#41042)
* Remove undefined from source type of destructuring assignment with renaming

* add a test

* add test case from original issue

* add test with undefined default value

* add more test cases with const declaration
2022-06-01 15:34:37 -07:00
Anders Hejlsberg 1beb1037c0 Fix check in isMappedTypeGenericIndexedAccess (#49341)
* Fix check in isMappedTypeGenericIndexedAccess

* Add regression tests
2022-06-01 10:01:56 -07:00
Anders Hejlsberg 3cdb8081f7 Use NonNullable<T> in more scenarios (#49330)
* Remove getFalsyFlags and improve getNonNullableType

* Apply getNonNullableType to left operand of || operator

* Accept new baselines

* Add tests
2022-05-31 17:05:33 -07:00
75f4e95e85 Fix46246 (#46357)
* changed error message for interface extending primitive type

* moved interface check to different function

* changed part of interface declaration to is extended by interface

Co-authored-by: harsheetkakar <harsheetkakar@bitbucket.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-05-31 16:47:07 -07:00
TRCYX 44b9745942 fix(49151): format type parameters/arguments (#49165)
Before, the formatter did not consider these constructs as comma
separated lists in general, leading to wrong indentation of '>' after
the list.
2022-05-31 16:03:17 -07:00
Wesley Wigham bf5acb5c4d Issue serialization error when attempting to serialize a late-bound name from a mapped type (#49221) 2022-05-31 15:36:13 -07:00
Oleksandr T 3da165e3df fix(49178): check expression with type arguments in inlay hints (#49179) 2022-05-31 15:22:16 -07:00
Nathan Shively-Sanders a5b1f95c23 Allow accessors to override non-class or abstract properties (#41994)
* remove too-late fix

* Allow any property from a mapped type

* turn off error for any non-class base

* Also handle synthetic properties more laxly

Originally from #42635, but this version is simpler.

* update baselines

* Update baselines

* createUnionProperty of accessors creates an accessor

Seems simple and doesn't break much. I need to double-check the few test
failures, however.

* Fix computation of write type of accessors

* Calculate property-vs-accessor in existing loop

Instead of looping over the props list 3 more times.

* Undo synthetic accessor change

* Minimise diff
2022-05-31 14:51:08 -07:00
Andrew Branch 39f5dbff43 Fix index fallback of CJS package from ESM-mode import when main is present but does not resolve (#49327) 2022-05-31 14:10:17 -07:00
Nathan Shively-Sanders 0e0526774a Merge branch 'main' into server-vfs-support 2022-05-31 12:04:13 -07:00
Nathan Shively-Sanders 4bd683b7c7 Add tests 2022-05-31 11:59:25 -07:00
bentongxyzandAndrew Branch 3939b38aa1 fixes #48630 array binding pattern with only OmittedExpressions does not check RHS of for-of loop (#49008)
* fix RHS of for..of loop not evaluated when LHS is array binding element with OmittedExpression

* expand widened type check

* add more test cases

* update code with suggestions

* Make test target es2015

Co-authored-by: Andrew Branch <andrew@wheream.io>
2022-05-31 11:06:19 -07:00
csigs fa364b85d0 LEGO: Merge pull request 49300
LEGO: Merge pull request 49300
2022-05-29 04:17:15 -07:00
Anders Hejlsberg 51b346d65a Improve intersection reduction and CFA for truthy, equality, and typeof checks (#49119)
* Improve reduction of intersection types

* Accept new baselines

* Improve CFA for truthy, equality, and typeof checks

* Accept new baselines

* Remove special case for Function type

* Don't reduce intersections of form {...} & object

* Accept new baselines

* Anything is assignable to unknown-like union

* Accept new baselines

* Tweak subtype check

* Recombine unknown type from unknown-like union in more cases

* Display union origin only if it is shorter than union itself

* Accept new baselines

* Add tests

* Only attach origin type when it is shorter than union itself

* Specially preserve string & {}, number & {}, bigint & {}

* Accept new baselines

* Add additional tests

* Fix getNormalizedType and getNarrowableTypeForReference for intersections

* Switch NonNullable<T> to use T & {}

* Accept new baselines

* Use NonNullable<T> in place of anonymous T & {}

* Accept new baselines

* Add fourslash test

* More fourslash tests

* Fix getFalsyFlags handling of intersections

* Accept new baselines

* Add constraint to compareProperties type parameter

* Unconstrained type parameter not assignable to {} with strictNullChecks

* Accept new baselines
2022-05-27 14:02:54 -07:00
Ron Buckton ba4525202e More specific inference for constrained 'infer' types in template literal types (#48094)
* More specific inference for constrained 'infer' types in template literal types

* PR feedback

* Add inference priority for template type placeholders

* Infer to a preferred constraint instead of a union

* Add reduceType

* Switch tests to use infer..extends

* Add missing primitive constraint cases

* Update .types tests

* Remove TemplateTypePlaceholderPriority

* Remove reduceType
2022-05-27 11:05:24 -07:00
TRCYXandTRCYX 38631e6412 fix(30003): formatter deletes comment after trailing comma (#49168)
Co-authored-by: TRCYX <trcyxs@gmail.com>
2022-05-27 10:09:52 -07:00
Nathan Shively-Sanders 917ff003e2 Mechanical changes from PR 2022-05-27 09:59:41 -07:00
Andrew Casey 757a3acbde Port #48978 forward to the revised FAR code (#49267)
* Port #48978 forward to the revised FAR code

The old regression test didn't catch the corresponding bug in the new code because it hit the fast path where there's only a single project.

* Drop spurious non-null assertion
2022-05-27 09:52:20 -07:00
Wesley Wigham 67673f324d moduleDetection: auto makes cjs files parse as modules, module: node sets moduleDetection: force (#49268) 2022-05-26 16:49:55 -07:00
Andrew Branch 5b86612f68 Fix crash from inaccurate type guard implementation (#49252)
* Fix `isVariableDeclarationInitializedToBareOrAccessedRequire` returning true on binding elements

* Undo auto format change
2022-05-26 16:43:22 -07:00
Nathan Shively-Sanders 4643bc11fe Merge branch 'main' into server-vfs-support 2022-05-26 11:03:39 -07:00
Andrew CaseyandSheetal Nandi 84974838c7 Handle the case where the FAR results map is empty (#49254)
* Handle the case where the FAR results map is empty

Searching exactly one project does not imply the presence of exactly one references list.

Fixes #49217

* Use emptyArray

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

Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
2022-05-26 11:00:28 -07:00
Andrew Branch 77ffb96b1a Fix extensions for noDtsResolution in node16/nodenext (#49233) 2022-05-25 15:27:27 -07:00
Sheetal Nandi 0ad5f82d62 Fix the implicit glob key so that recursive keys are not differing just directory separator for wildcard directory (#49246)
* Add failing test

* Fix the implicit glob key so that recursive keys are not differing just by directory seperator
Fixes #49078

* Reset the reload level once program is loaded
2022-05-25 12:30:40 -07:00
Huy 1fb2b2d70f fix(47562): Add option to suppress type hint if variable name matches type name (#48529)
* fix(47562): Add option to suppress type hint if variable name matches type

* Remove the unnecessary debug code

* Re-run gulp runtests

* Use equateStringsCaseInsensitive to compare strings
2022-05-25 12:07:38 -07:00
Nathan Shively-Sanders ab673e8349 Little more diff cleanup 2022-05-25 10:44:24 -07:00
Nathan Shively-Sanders fdd44be514 Try to improve diff further 2022-05-25 10:39:24 -07:00
Nathan Shively-Sanders c927b48dbf Improve diff of virtualFileSystemWithWatch.ts
Undo mistaken move of changeToHostTrackingWrittenFiles and
getTsBuildProjectFile, which might still not be enough.
2022-05-25 10:28:09 -07:00
Nathan Shively-Sanders c2d45f9ad4 Get rid of separate init call for VirtualServerHost
Also move vfs -> Semantic mode parsing.
2022-05-25 10:18:12 -07:00