Commit Graph

34031 Commits

Author SHA1 Message Date
Nathan Shively-Sanders d5c3015516 Constructor function methods:Add two missing tag lookups (#47742)
1. During name resolution, `@param` and `@return` tags should walk up
through the jsdoc comment and then jump to the host function. Previously they
did not, which would cause them to not resolve type parameters bound in
the scope of a host that was not a sibling of the comment. The example
from #46618 is a prototype method:

```js
/**
 * @template {T}
 * @param {T} t
 */
C.prototype.m = function (t) {
}
```

2. During name resolution, prototype methods are supposed to resolve
types both from the host function's location and from the containing
class' location. The containing class lookup happens in a separate call
to `resolveName`. Previously, the code that finds the containing class
only worked for the above style of comment, which is on the outer
ExpressionStatement, but not for the below style, which is on the
function expression itself:

```js
C.prototype.m =
  /**
   * @template {T}
   * @param {T} t
   */
  function (t) {
}
```
2022-02-09 11:22:33 -08:00
Andrew Branch 2cf5afd49e Avoid pulling on setter type when only getter type is needed to break circularity (#47818) 2022-02-09 10:56:29 -08:00
Oleksandr T c06849ad16 fix(47787): show QF to delete parameter in getter (#47797) 2022-02-08 13:39:54 -08:00
Andrew Branch c5b1011e94 Compute writeType from set accessors for union and intersection properties (#47674)
* Compute write type from set accessors for union and intersection properties

* Add test for deferred writeType

* Always check for writeType of symbol
2022-02-08 12:57:34 -08:00
Oleksandr T 17b97ccc43 fix(47788): forbid convertToMappedObjectType QF in invalid index signatures (#47798) 2022-02-08 11:36:45 -08:00
csigs 460908a478 LEGO: Merge pull request 47801
LEGO: Merge pull request 47801
2022-02-08 03:23:26 -08:00
TypeScript Bot 5b53e4ec28 Update package-lock.json 2022-02-08 06:08:53 +00:00
Andrew Casey c216b2db5b Trace document registry operations (#47785)
...to help detect misconfigurations like #47687.
2022-02-07 16:10:38 -08:00
Andrew Casey 1b6fb99efe Log per-project FAR and update baselines (#47781) 2022-02-07 16:10:01 -08:00
Andrew Branch d8ac54bfb1 Fix substitution types of indexed access types of substitution types (#47791)
* Fix substitution types of indexed access types of substitution types

* Add tests

* Fix accidental unindentation
2022-02-07 15:53:13 -08:00
Oleksandr T 867470ca26 fix(47783): show globals completion in case keyword outside of switch statement (#47786) 2022-02-07 14:08:35 -08:00
Oleksandr T afeacf41bd fix(47782): forbid super() extraction outside this container (#47784) 2022-02-07 13:26:39 -08:00
csigs 14feed97a0 LEGO: Merge pull request 47761
LEGO: Merge pull request 47761
2022-02-07 02:50:24 -08:00
TypeScript Bot 163fef9f5d Update package-lock.json 2022-02-06 06:06:05 +00:00
TypeScript Bot e1532a18ac Update package-lock.json 2022-02-05 06:07:35 +00:00
Andrew Branch 9c3b41d3cc Refactor named imports to default instead of namespace when esModuleInterop is on and module is an export= (#47744) 2022-02-04 17:11:25 -08:00
Oleksandr T 8ddead50eb fix(32941): include Template tag constraint to QuickInfo response (#47567) 2022-02-04 16:12:23 -08:00
Ron Buckton 3328feb799 Use 'static {}' for static fields when available and useDefineForClassFields is false (#47707) 2022-02-04 12:34:29 -08:00
Oleksandr T ceee975052 fix(45917): show completions in string literal followed by a comma (#46970) 2022-02-04 12:15:02 -08:00
Andrew Branch 300a53c333 Auto-import perf: Do symbol name/flags filtering before cache rehydration (#47678)
* Do symbol name filtering before cache rehydration

* Fix typo

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

* Update test

* Fix variable clobbered in merge conflict

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-02-04 09:17:55 -08:00
TypeScript Bot 69d06cb359 Update package-lock.json 2022-02-04 06:07:01 +00:00
Oleksandr T 0d5abd8a15 feat(27601): include JSDoc comments for destructuring arguments (#46886) 2022-02-03 11:27:40 -08:00
木易什么来着 46d1cb11e2 i18n:Inappropriate localization (#46924)
The previous version of the file incorrectly translated the keywords of some document comments into Chinese, which would be misleading
2022-02-03 11:23:36 -08:00
dependabot[bot] 8d47ea0064 Bump node-fetch from 2.6.1 to 2.6.7 (#47564)
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.1 to 2.6.7.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/node-fetch/node-fetch/compare/v2.6.1...v2.6.7)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-03 11:22:54 -08:00
Oliver Joseph Ash b7d011777e "Convert parameters to destructured object": enable for functions with just one parameter (#46945)
* "Convert parameters to destructured object": enable for functions with just one parameter

Fixes https://github.com/microsoft/TypeScript/issues/41753

* Add test
2022-02-03 10:13:05 -08:00
TypeScript Bot 9b0f01a13f Update package-lock.json 2022-02-03 06:06:30 +00:00
Nathan Shively-Sanders c4fd0028f5 Fix @link https:// formatting (#47705)
* Fix @link https:// formatting

Also improve .d.ts formatting of `@link`,`@linkcode`,`@linkplain`.

Fixes #46734

1. Previously, `@link` incorrectly put a space between "https" and "://"
when formatting jsdoc for editors. Now it does not.
2. When fixing the same output for .d.ts, I discovered that all `@link` tags
were formatted as `@link`, even if they were `@linkcode` or
`@linkplain`. I fixed that too.

* semicolon lint
2022-02-02 14:00:08 -08:00
Oleksandr T 854cec7387 fix(47670): remove import alias that uses the same name (#47676) 2022-02-02 10:45:18 -08:00
TypeScript Bot afee8bf968 Update package-lock.json 2022-02-02 06:06:01 +00:00
Zzzen 880e2c0783 support quickinfo and go-to-definition on typeof this (#47085)
* support quickinfo and go-to-definition on `typeof this`

* update baseline

* move code to checkIdentifier
2022-02-01 16:16:01 -08:00
Andrew Casey 7cc0f755ce Use node moduleResolution everywhere (#47687)
TestRunner was already using it, but upstream projects (e.g. Compiler) were not, causing TestRunner to re-parse and re-bind all upstream files in (at least) editor scenarios), slowing down initial project load.

In local testing, this cut a find-all-refs call in checker.ts from 5s to 2.5s.
2022-02-01 15:59:59 -08:00
Ryan Cavanaugh 2172e1964f Correctly check computed property names in type-space get/set accessors (#47156)
* Add test that should fail

* Make it fail

Fixes #47146

* Baselines
2022-02-01 12:49:05 -08:00
Gabriela Araujo Britto 46e7ab4dbf fix typefacts of intersection (#47583) 2022-02-01 12:10:43 -08:00
Ron Buckton 21bbb576ad Fix captured const in downlevel for-await (#47680) 2022-02-01 11:47:29 -08:00
Ron Buckton 63d9d4c8bf Transform param patterns/initializers after object rest (#47095) 2022-02-01 11:46:29 -08:00
Nathan Shively-Sanders 1ebdcc6fb8 Fix inlay hint crash for jsdoc function type syntax (#47684)
* Fix inlay hint crash for jsdoc function type syntax

Parameters in JSDoc function types do not have names. The type does not
reflect this. This PR fixes the crash; I'll see how much churn it causes
to fix the type as well.

Fixes #47606

* make inlay hints test smaller
2022-02-01 10:11:39 -08:00
Ron Buckton 7183b14831 Fix captured let/const in 'for' condition or incrementer (#47681) 2022-02-01 09:48:15 -08:00
csigs 9d5f62af44 LEGO: Merge pull request 47677
LEGO: Merge pull request 47677
2022-01-31 16:15:22 -08:00
dependabot[bot] a17c3675e0 Bump copy-props from 2.0.4 to 2.0.5 (#47342)
Bumps [copy-props](https://github.com/gulpjs/copy-props) from 2.0.4 to 2.0.5.
- [Release notes](https://github.com/gulpjs/copy-props/releases)
- [Changelog](https://github.com/gulpjs/copy-props/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gulpjs/copy-props/compare/2.0.4...2.0.5)

---
updated-dependencies:
- dependency-name: copy-props
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-31 15:36:08 -08:00
Nathan Shively-Sanders 3f55d68761 Manual revert of AbortSignal.abort in webworker.generated.d.ts (#47675)
Same as #47643, I just missed it until looking at remaining DT failures.

I need to update the DOM-lib-generator automation, but for now I want to
get TS types corrected.
2022-01-31 11:30:57 -08:00
csigs 92f54d6bd6 LEGO: Merge pull request 47666
LEGO: Merge pull request 47666
2022-01-30 10:22:05 -08:00
csigs 0388218914 LEGO: Merge pull request 47664
LEGO: Merge pull request 47664
2022-01-30 04:14:24 -08:00
csigs e5d7d70471 LEGO: Merge pull request 47661
LEGO: Merge pull request 47661
2022-01-29 22:14:39 -08:00
csigs 3d2ac9d06d LEGO: Merge pull request 47659
LEGO: Merge pull request 47659
2022-01-29 10:15:39 -08:00
Mohsen Azimi 17aec75ace Update terminal.integrated.shell.linux config in devcontainer.json (#47192)
The previous `"terminal.integrated.shell.linux"` configuration is deprecated. 

This is the new way of setting this configuration
2022-01-29 00:42:56 -08:00
Roman F 3e19cc8711 remove unused errors in checkGrammarModifiers (#47198) 2022-01-28 17:23:13 -08:00
csigs 38ed8eb505 LEGO: Merge pull request 47655
LEGO: Merge pull request 47655
2022-01-28 16:14:38 -08:00
Alvin Ramskogler 0b9f8b4aa2 Fix confusing file name in generated diagnostics file (#46821)
* Fix confusing file name in generated diagnostics file

* Change "by" to "in"
2022-01-28 15:08:19 -08:00
Oleksandr T 2d501b1d98 fix(47582): skip extraction if the type node is in the range of the type parameter declaration (#47596) 2022-01-28 12:19:48 -08:00
csigs eb3e7bd9d9 LEGO: Merge pull request 47649
LEGO: Merge pull request 47649
2022-01-28 04:14:33 -08:00