24194 Commits

Author SHA1 Message Date
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
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
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
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
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
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
csigs
09b84d56f3
LEGO: Merge pull request 47647
LEGO: Merge pull request 47647
2022-01-27 22:18:31 -08:00
Andrew Branch
3de032fd0d
Allow usage of local value symbol merged with type-only import (#47642) 2022-01-27 16:18:14 -08:00
Gabriela Araujo Britto
90280518ae
Add assert keyword in completions (#47644)
* add contextual keyword assert in completions

* clean up
2022-01-27 16:17:43 -08:00
csigs
f2c51c10f5
LEGO: Merge pull request 47645
LEGO: Merge pull request 47645
2022-01-27 16:15:37 -08:00
Andrew Branch
4d298591db
Fix duplicate completions from two different copies of a node_modules package (#47584)
* Fix duplicate completions from two different copies of a node_modules package

* Fix logic for scoped packages

* Fix errors from merge

* Less gross way to reconcile these two conflicting PRs
2022-01-27 14:35:36 -08:00
Nathan Shively-Sanders
61b7bbb026
Revert to temporary AbortSignal fix (#47643)
I forgot to keep the temporary fix when I updated the DOM yesterday.
2022-01-27 13:28:17 -08:00
Andrew Branch
e9092f3723
Proposal: simplify auto import descriptions (#47631)
* Simplify import fix descriptions

* Update tests

* Fix new test
2022-01-27 10:21:08 -08:00
csigs
208cb2d57c
LEGO: Merge pull request 47641
LEGO: Merge pull request 47641
2022-01-27 10:14:34 -08:00
csigs
b7b648306f
LEGO: Merge pull request 47640
LEGO: Merge pull request 47640
2022-01-27 04:15:07 -08:00
csigs
52e785ff6c
LEGO: Merge pull request 47635
LEGO: Merge pull request 47635
2022-01-26 22:15:11 -08:00
Andrew Branch
5813a3541c
Allow moduleSymbolToValidIdentifier to be uppercase for JSX tags (#47625)
* Allow moduleSymbolToValidIdentifier to be uppercase for JSX tags

* Cleaner way of getting the uppercase name when needed

* Fix build errors, get rid of basically unnecessary ScriptTarget

* More accurate name for parameter

* Rename other parameter too

* Fix failing test
2022-01-26 16:12:40 -08:00
Andrew Branch
0d3ff0cce8
Add codefix and completions for promoting existing type-only imports to non-type-only (#47552)
* Import fix

* Wire up completions, add sorting to fix

* Fix overlapping changes when there’s only one import specifier

* Update API baseline

* Add sorting and filtering back to UMD fix
2022-01-26 15:07:41 -08:00
Jake Bailey
3718182a13
Don't block completion after end of type parameters in JSX elements (#47501) 2022-01-26 14:45:21 -08:00
magic-akari
0f3809eff1
fix: enum self reference (#47287)
* fix: enum self reference

* fix: add test case

* chore: clean code

* fix: check `errorType` directly

* chore: revert refactor of `isConstantMemberAccess`
2022-01-26 14:13:34 -08:00
Nathan Shively-Sanders
53b96d9ddf
Update DOM 2022-01-26 (#47623)
Improves types for FileSystemHandle.kind in subtypes, plus other bcd
updates.
2022-01-26 12:29:25 -08:00
Andrew Branch
c191e7c942
Fix diagnostic serialization crash (#47604)
* Add crashing test

* Fix unsafe cast to DiagnosticMessageChain
2022-01-26 10:41:47 -08:00
Oleksandr T
3206df8e6d
fix(47561): use parameter name from enclosing declaration (#47609) 2022-01-26 04:00:14 -08:00
Oleksandr T
20b5523830
feat(42684): allow deprecated JSDoc tag to be used on aliased nodes (#47293) 2022-01-25 15:49:33 -08:00
Song Gao
0673f0288c
Fix JsDocTags inheritage and setter/getter quickInfo (#46801)
* tmp

* fix jsdoc inheritage for property and setter/getter

* fix test

* fix test

* fix mirrors

* add more tests

* add tests of jsdoc for intance of class
2022-01-25 15:43:12 -08:00
Andrew Casey
f84a67f29c
Don't trace bindSourceFile cache hits (#47602)
Writing the trace entry takes longer than returning the cached value.

Fixes #47565
2022-01-25 14:57:17 -08:00
Joost Koehoorn
ba402e6b86
Allow structure reuse if a declaration file within a package is updated (#47472)
* Allow structure reuse if a declaration file within a package is updated

Closes #47471

* Use correct program to obtain source file in structure reuse test
2022-01-25 11:04:53 -08:00
Eli Barzilay
69277306c9 Fix detecting an existing Map/Set
This didn't affect compilation to CJS since that sets `exports.Map`
instead of creating a global.
2022-01-24 15:47:10 -05:00
Gabriela Araujo Britto
3cbc8d2231
Fix narrowing of intersection with function type (#47483)
* add and and or mask to typefacts

* add comment
2022-01-21 12:05:34 -08:00
Jake Bailey
9b6c179089
Fix parser test cases missing 'it' calls (#47545) 2022-01-21 11:32:23 -08:00
Oleksandr T
5e38082a9e
fix(47165): ignore spaces in goToDefinition imports (#47541) 2022-01-21 10:09:10 -08:00
Or Ouziel
5e09e86612
return early from fixUnreachableCode if syntactic errors exists (#47463) 2022-01-20 15:45:42 -08:00
Oleksandr T
e9453f411a
fix(47524): skip assertion on checking this in fixImplicitThis QF (#47527) 2022-01-20 14:58:28 -08:00
Armando Aguirre
ab4d3198ed
Fixed Go To Definition using jsconfig (#47434)
* Fixed Go To Definition using jsconfig

* Fixed formatting
2022-01-20 14:45:29 -08:00
Andrew Casey
7e3eccedd7
Associate paths with nodes when tracing (#47530)
Walking up the tree to find the enclosing SourceFile would distort the
timing too much so, instead, we attach a Path in the binder.

At present, the path is determined retroactively by walking up the call
stack in the trace visualizer, but this is both inconvenient and
routinely inaccurate (checking an expression in one file may require
checking an expression in another file and there's no way to determine
from the trace where this transition occurred).
2022-01-20 14:38:36 -08:00