Commit Graph
24924 Commits
Author SHA1 Message Date
Nathan Shively-SandersandGitHub 170a17fad5 Dom update 2022-10-25 (#51300)
* Update DOM

Looks like the changes are:

- AbortSignal.abort finally has the right type.
- Add OffscreenCanvas support
- Some new properties scattered around, some properties now allow `null`.
- rename VideoFrameMetadata -> VideoFrameCallbackMetadata
- Add CSSContainerRule, EXT_texture_norm16, OES_draw_buffers_indexed
- Some type aliases include more types in their union.

* Update baselines
2022-10-25 17:04:55 -07:00
Andrew BranchandGitHub 9c4e14d751 Remove "No type information for this code" from baseline (#51311)
* Fix "No type information for this code" in baseline

* Just remove the message
2022-10-25 15:11:27 -07:00
Oleksandr TandGitHub 88d25b4f23 fix(50068): Refactors trigger debug failure when JSX text has a ' and a tag on the same line. (#51299)
* fix(50068): rescan JsxText on JsxElement context

* fix lint errors

* add tests
2022-10-25 13:10:31 -07:00
Ron BucktonandGitHub 702de1eeaa Fix early call to return/throw on generator (#51294) 2022-10-24 22:37:42 -04:00
Jake BaileyandGitHub 60934915d9 Fix apparent typo in getStringMappingType (#51248) 2022-10-22 08:23:41 -07:00
Andrew BranchandGitHub ef69116c41 Generate shortest rootDirs module specifier instead of first possible (#51244)
* Generate shortest rootDirs module specifier instead of first possible

* Simplify `min`
2022-10-21 16:05:58 -07:00
Jake BaileyandGitHub bbb42f453d Fix typo in canWatchDirectoryOrFile found by CodeQL (#51262) 2022-10-21 10:04:40 -07:00
Ron BucktonandGitHub a56b254ad3 Include 'this' type parameter in isRelatedTo fast path (#51230) 2022-10-21 08:00:24 -04:00
Ron BucktonandGitHub 3abd351c0e Fix super property transform in async arrow in method (#51240) 2022-10-21 08:00:00 -04:00
Sheetal NandiandGitHub 2625c1feae Make the init config category order predictable (#51247) 2022-10-20 13:23:18 -07:00
Oleksandr TandGitHub 1ca99b3402 fix(50551): Destructuring assignment with var bypasses "variable is used before being assigned" check (2454) (#50560)
* fix(50551): handle destructuring variables used before assignment

* skip the error in binding elements that refer to the same destructuring

* fix binding element type
2022-10-20 10:57:43 -07:00
Anders HejlsbergandGitHub 906ebe4933 Revert structuredTypeRelatedTo change and fix isUnitLikeType (#51076)
* Revert structuredTypeRelatedTo change, fix isUnitLikeType

* Accept new baselines

* Add regression tests

* Fix formatting in test
2022-10-19 15:46:00 -07:00
Oleksandr TandGitHub 8ac465239f change type (#51231) 2022-10-19 12:38:37 -07:00
Oleksandr TandGitHub 245a02cbed fix(51222): Go-to-definition on return statements should jump to the containing function declaration (#51227)
* fix(51222): add go-to-definition return statement to containing function

* add additional tests
2022-10-19 11:32:39 -07:00
Ron BucktonandGitHub 2dff34e8c4 markAliasReferenced should include ExportValue as well (#51219) 2022-10-19 13:24:01 -04:00
Jake BaileyandGitHub d0f0e35c88 Remove old tslint comments (#51220) 2022-10-18 17:30:42 -07:00
Mateusz BurzyńskiandGitHub 85d405a1d7 Fixed a false positive "await has no effect on the type" diagnostic with mixed generic union (#50833) 2022-10-18 14:10:03 -07:00
1f8959f5dc fix: avoid downleveled dynamic import closing over specifier expression (#49663)
* fix: evaluate dynamic import specifier expressions synchronously

* refactor

* Update src/compiler/transformers/module/module.ts

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>

* [Experiment]

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
2022-10-18 16:46:51 -04:00
Mateusz BurzyńskiandGitHub 11066b264f Rename internal functions to narrowTypeBySwitchOnTypeOf and narrowTypeByInKeyword (#51215) 2022-10-18 12:58:39 -07:00
Oleksandr TandGitHub f25bcb7c27 fix(49196): add jsdoc snippet for interface member functions (#51135) 2022-10-17 17:35:08 -07:00
Oleksandr TandGitHub 7406ee9c14 fix(51170): Completing an unimplemented property overwrites rest of line (#51175)
* fix(51170): skip insertText for class members with existing initializer

* skip insertText for class members with existing tokens
2022-10-17 13:14:23 -07:00
Jake BaileyandGitHub a1d82fc9dc Remove some unnecessary code discovered by rollup (#51204) 2022-10-17 10:49:56 -07:00
Alex HsuandGitHub 0481773a27 LEGO: Merge pull request 51200
LEGO: Merge pull request 51200
2022-10-17 03:24:51 -07:00
Alex HsuandGitHub 98c19cbbbe LEGO: Merge pull request 51190
LEGO: Merge pull request 51190
2022-10-16 05:55:49 -07:00
Andrew BranchandGitHub f6cf51053e Add more tracing to node16/nodenext resolution (#51168)
* Add more tracing to node16/nodenext resolution

* Update baselines after diagnostic change

* Trace non-matching conditions
2022-10-14 09:42:06 -07:00
Isabel DuanandGitHub 2cb7e779d7 fix(50416): correctly names disabled export refactors (#50663)
* added test case to try to retrieve duplicate refactor as in #50416. 'verify.refactorAvailable' correctly retrieves nonduplicate refactors...

* optional arguments in refactorAvailable return `true` even if there is no single refactor that satisfies both

* it still passes :C

* Delete fixExtractToInnerFunctionDuplicaton.ts

* deleted extra test code

* fix 'verify.refactorAvailable' so that tests correctly check for multiple arguments

* fixes #50416

* refactor
2022-10-13 16:44:30 -07:00
Oleksandr TandGitHub 2bcfed01f3 feat(37440): Provide a quick-fix for non-exported types (#51038)
* feat(37440): add QF to handle missing exports

* change diagnostic message

* add type modifier only if isolatedModules is set or if the export declaration already uses type modifiers
2022-10-13 15:43:49 -07:00
Oleksandr TandGitHub 2da62a784b fix(51112): omit parameter names that precede the type (#51142) 2022-10-13 13:37:23 -07:00
Oleksandr TandGitHub cf1b6b7333 feat(51163): show QF to fill in the missing properties for the mapped type. (#51165) 2022-10-13 11:29:18 -07:00
Wesley WighamandGitHub bdcc240d68 Remove bug-causing carve-out in conditional type instantiation that hopefully is no longer required (#51151) 2022-10-13 10:58:42 -07:00
Anders HejlsbergandGitHub 37317a208f Check nested weak types in intersections on target side of relation (#51140)
* Check nested weak types in intersections on target side of relation

* Add regression tests

* Move logic from isRelatedTo to structuredTypeRelatedTo

* Fix lint error

* Add additional test
2022-10-13 08:20:07 -07:00
Anders HejlsbergandGitHub 4f54e7e947 Fix isExhaustiveSwitchStatement to better handle circularities (#51095)
* Fix isExhaustiveSwitchStatement to better handle circularities

* Add regression test
2022-10-12 07:22:06 -07:00
Valerian ClercandGitHub 503604c884 Overloads shouldn't gain @deprecated tags of other overloads in quick info (#50904)
* Add test case to check for the propogation of @deprecation tag to multiple overloads

* Implement filter to only include @deprecated tag in first signature after JSDoc comment
2022-10-11 16:58:03 -07:00
Jake BaileyandGitHub 67256e50c4 Remove unused declarations array in extractSymbol's TargetRange (#51091) 2022-10-10 13:57:10 -07:00
Rafał ChłodnickiandGitHub 9c87ded2b3 fix(51100): ensure tsserver shuts down when parent process is killed (#51107)
* fix(51100): ensure tsserver shuts down when parent process is killed

When using IPC channel (`--useNodeIpc`) for communicating with tsserver,
the child tsserver process did not shut down on parent process disconnecting
(for example due to it being killed).

Call exit() on IPC disconnect, same as stdio-based communication did
when pipe to parent process was destroyed.

* don't duplicate inherited method
2022-10-10 12:03:15 -07:00
Oleksandr TandGitHub d0bfd8caed fix(51072): ts.preProcessFile finds import in template string after conditional expression with template strings (#51082) 2022-10-07 10:33:20 -07:00
Jake BaileyandGitHub ad56b5ca56 Convert scripts/Gulpfile to checked mjs/cjs so they can run without compilation (#50988) 2022-10-07 09:50:46 -07:00
Oleksandr TandGitHub dbeae5d943 fix(51017): Make lineText in the references response opt-out (#51081)
* add option to exclude lineText from the response

* add comments

* update baseline
2022-10-07 09:13:22 -07:00
Anders HejlsbergandGitHub d06a592d02 Properly defer resolution of mapped types with generic as clauses (#51050)
* Fix isGenericMappedType, getTemplateLiteralType, getStringMappingType

* Accept new baselines

* Add regression tests

* Fix comment
2022-10-07 07:25:57 -07:00
Sheetal NandiandGitHub 5f3e6cc498 Plugin probe location is higher priority than peer node_modules (#51079)
Fixes #34616
2022-10-06 13:45:22 -07:00
Sheetal NandiandGitHub 2648f6ab09 Plugins in project were adding up after every config file reload (#51087)
* Add test where current plugins dont get reset when reloading config file

* Reset loaded plugins when reloading configured project and closing project
2022-10-06 13:40:21 -07:00
Sheetal NandiandGitHub c18791ccf1 Fix incorrect options type to WatchOptions (#51064) 2022-10-05 11:54:59 -07:00
Sheetal NandiandGitHub 43c6fd4c09 Covert some of the config testing to baselines for easy validation (#51063)
* Baseline config tests for easy validation

* Refactor

* Fix incorrect pick

* Dont print unnecessary plugin host not implemented msg in logs
2022-10-04 18:14:14 -07:00
Sheetal NandiandGitHub fc5e72b92c Remove unused defaultWatchFileKind method since useFsEvents is default for tsserver and tsc (#51044) 2022-10-04 15:06:41 -07:00
Jake BaileyandGitHub 8af9a936b5 Use typescript.d.ts in APISample tests (#51061) 2022-10-04 15:00:35 -07:00
Jake BaileyandGitHub 49533168db Remove configureLanguageServiceBuild, instrumenter (#51048) 2022-10-04 10:36:57 -07:00
33a34e5b96 Adding a JSDoc comment to the es5 type declarations to describe the functionality of Date.now() (#50630)
* Adding a JSDoc comment to the es5 type declarations to describe the functionality of Date.now() & updating baselines (50565)

* Update the Date.now() type declaration description

Updating the Date.now() type declaration description to make it clearer and more accurate.

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-10-03 16:31:24 -07:00
Nathan Shively-SandersandGitHub 299745cb21 Fix crash in goto-def on @override (#51016)
* Fix crash in goto-def on `@override`

When the base type is not defined, getDefinitionFromOverriddenMember
will have its type as errorType, which has no symbol. The error handling
previously only handled the case of no baseType at all -- which I'm not
sure ever actually happens.

* Improve checking

1. getTypeAtLocation never returns undefined, only errorType, so check for that.
2. Return directly after missing baseTypeNode instead of continuing to return later.

* Experiment with making goto-def on `override` more consistent

* Unify static/instance node->symbol->type path

* Make getSymbolAtLocation support class expressions

and parenthesized expressions

* Revert "Make getSymbolAtLocation support class expressions"

This reverts commit 4c1b031355.

* fix semicolon lint
2022-10-03 16:07:57 -07:00
Oleksandr TandGitHub 7dcf11f139 fix(50750): Object type literal with string literal property in contextual typing position causes language service error on all literal type references (#50757)
* fix(50750): skip unbound symbols from JSDoc tags in typescript

* skip contextual type checking in JsDoc for TypeScript files
2022-10-03 15:57:32 -07:00
96894db6cb Include type parameter defaults in contextual typing (#50994)
* Include type parameter defaults in contextual typing

* Add tests

* Add additional an test for instantiating contextual signature using default type param (#51002)

* Update comment

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
2022-09-30 07:02:22 -07:00