33505 Commits

Author SHA1 Message Date
Will Nayes
501e442ffc
Elide import equals in transpileModule if referenced only by export type (#49664)
* Elide import equals in transpileModule if referenced only by export type.

* Revise approach to avoid marking alias in export type as referenced.

* Handle type only export specifier.
2022-07-05 09:08:43 -07:00
TypeScript Bot
3dbe62e3f0 Update package-lock.json 2022-07-05 06:06:24 +00:00
TypeScript Bot
2613158d75 Update package-lock.json 2022-07-04 06:07:53 +00:00
TypeScript Bot
5d65c4dc26 Update package-lock.json 2022-07-03 06:06:30 +00:00
TypeScript Bot
1b9c8a15ad Update package-lock.json 2022-07-02 06:07:25 +00:00
Ron Buckton
c6ff5f3b52
Fix for Awaited<T> inference (#49748) 2022-07-01 15:00:54 -07:00
TypeScript Bot
ad4ded80e1 Update package-lock.json 2022-07-01 06:06:20 +00:00
Andrew Branch
f8aa570b23
Get type arguments lazily for instantiating inferred type parameter constraint (#49744)
* Get type arguments lazily for instantiating inferred constraint

* Use new deferred type mapper
2022-06-30 16:23:07 -07:00
Wesley Wigham
4c34f2c792
Fix mapper used to instantiate distributive conditional manufactured in declaration emit (#49737) 2022-06-30 15:03:25 -07:00
Sheetal Nandi
c251d60095
Instead of storing timestamp of when last d.ts file was modified, store its name so buildinfo becomes portable again (#49717)
* Store dts change file path in buildinfo

* With composite, do not write d.ts files if they changed

* Determine dts change based on outputs

* Instead of storing time in buildinfo store filename which was last updated to get modified time stamp from

* Get declaration time change lazily

* Rename per feedback
2022-06-30 09:49:27 -07:00
Andrew Branch
93f2d2b9a1
Add variance results to tracing, capture variance verification on annotated type params (#49712)
* Add variance results to tracing

* Tweak format, prohibit `results` on `E` events
2022-06-29 16:30:57 -07:00
Mateusz Burzyński
bd11ce2aeb
Fixed an issue with self-referential awaited union (#49677) 2022-06-29 13:01:36 -07:00
Wesley Wigham
52f4055174
For missing constraint quickfix insert position, Use node name end rather than related span end (#49673) 2022-06-29 11:46:42 -07:00
Nathan Shively-Sanders
cba184f69b
Demote priority of JS completions (#49716)
* Demote priority of JS completions

Fixes #48498

Unchecked JS files gather identifier-based completions. Currently, this search
happens instead of `getCompletionEntriesFromSymbols` for TS/checked JS
files. However, identifier-based completions are much lower quality and
can be ignored by some editors.

Identifier-based completions should be gathered last, after gathering
other completions. That's what this PR does.

* Invert isUncheckedFile to avoid double negative

* dedupe calls to getCompletionEntriesFromSymbols

* Stop re-creating list of entry names

* more deduping + fix lint
2022-06-29 11:05:50 -07:00
TypeScript Bot
63d0574321 Update package-lock.json 2022-06-29 06:06:27 +00:00
Jake Bailey
b379e7fc79
Pass contextFlags when getting contextual type of JSX elements/attributes (#49707) 2022-06-28 14:40:26 -07:00
aghArdeshir
1eb276fabd
Add reference to TypeScript-Compiler-Notes in CONTRIBUTING.md (#49689)
I tried a lot in the past few weeks to find a documentation on TS Compiler, I couldn't find any. I opened an issue asking for the documentation: https://github.com/microsoft/TypeScript-Website/issues/2428 and then I got to know the TypeScript-Compiler-Notes repository. I believe it could help a lot if it was in CONTRIBUTING.md file.
2022-06-28 14:32:59 -07:00
Andrew Casey
2f86a83dff
Fix mis-completed variable name in tracepoint (#49715) 2022-06-28 14:32:44 -07:00
Sheetal Nandi
7e91485bec
Use value meaning for computed property name for visibility check (#49678)
* Test

* Use value meaning for computed property name
Fixes #49562
2022-06-27 15:16:33 -07:00
Sheetal Nandi
df21926976
To handle d.ts emit errors that could affect other files, in incremental mode use d.ts emit text + diagnostics as signature of the file (#49543)
* Add test when declaration emit has errors and d.ts emit doesnt change which results in incorrect incremental behaviour

* Refactor

* Use declaration diagnostics in the d.ts signature for the file so it can be more accurate for detecting changes to file that could affect other files
Fixes #49527

* Renames and clarifications

* Simplify serialize declaration diagnostics for signature purpose
Do not serialize file name if error is in same file we are emitting. this should avoid having to do file path computation in most cases.
Locations are start and length instead of line and character.
Do not use any indents

* Fix baselines
2022-06-27 15:02:11 -07:00
Andrew Casey
8ed846c73b
Reuse start position in binarySearchKey (#49641)
* Reuse start position in binarySearchKey

* Kick out early if end < position
2022-06-27 14:31:22 -07:00
Andrew Branch
2bc91a6b46
Fix parser TODO (#49679) 2022-06-27 09:05:41 -07:00
TypeScript Bot
4899116b9a Update package-lock.json 2022-06-26 06:07:53 +00:00
Jake Bailey
569cdf1b07
Disallow expression with type parameters as left side of property access (#49464) 2022-06-24 15:54:21 -07:00
Lawrence Craft
ad6d08675c
Add case to capture enum subtype reduction
* Add case to capture enum subtype reduction
Signed-off-by: Lawrence Craft <lcraft6@bloomberg.net>
2022-06-24 13:04:44 -07:00
Andrew Casey
020ef41543
Add a simple queue implementation with better performance than Array.shift (#49623)
* Add a simple queue implementation with better performance than `Array.shift`

This lets us clean up the hack introduced in #49581

* Correct typo

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
2022-06-24 10:07:28 -07:00
bentongxyz
b24b6a1125
fixes #49491 (#49493) 2022-06-22 13:25:01 -07:00
Oleksandr T
8636adbbb9
fix(49449): change error location when passing objects/arrays to an argument of type (#49593) 2022-06-22 10:06:01 -07:00
Jake Bailey
71b5bdf980
Ensure resolved signature is cached before processing call errors (#49598) 2022-06-21 13:15:03 -07:00
Gabriel Grubba
9f2ab7fc31
Fix(49473): Added docs for RegExpMatchArray (#49499)
* fix: added docs for RegExpMatchArray

* Accepted baselines.

* Accepted missing baselines.

* Accepted missing baselines pt2.
2022-06-21 12:30:07 -07:00
jordanmbell
db49c6c3ba
Add fractionalSecond part type to DateTimeFormat().formatToParts (#49569)
* Add fractionalSecond part type to DateTimeFormat().formatToParts

This change adds the `fractionalSecond` part type as a valid part
to be returned from Intl.DateTimeFormat().formatToParts().

Fixes microsoft#48882

* fixup
2022-06-21 07:52:24 -07:00
Anders Hejlsberg
529ba99e29
Use separate marker types for variance annotation validation (#49616)
* Use separate marker types for variance annotation validation

* Add regression test
2022-06-21 06:42:10 -07:00
TypeScript Bot
4c2770d769 Update package-lock.json 2022-06-21 06:06:24 +00:00
Oleksandr T
74d76e93b3
fix(49546): create computed property name for symbol props (#49554) 2022-06-20 13:46:47 -07:00
Oleksandr T
c01afb5ef3
fix(49548): show completions after keywords in block (#49600) 2022-06-20 12:52:28 -07:00
csigs
7eddb3a122
LEGO: Merge pull request 49612
LEGO: Merge pull request 49612
2022-06-20 02:59:46 -07:00
csigs
96d298c4bc
LEGO: Merge pull request 49602
LEGO: Merge pull request 49602
2022-06-19 03:01:39 -07:00
csigs
730e6117fd
LEGO: Merge pull request 49599
LEGO: Merge pull request 49599
2022-06-18 03:16:49 -07:00
Jake Bailey
d7e58c8ea9
Fix arrow expressions in conditional expressions, take N+1 (#49531) 2022-06-17 16:34:27 -07:00
Nathan Shively-Sanders
6004b35ce4
Update 4.8 DOM from Typescript-DOM-lib-generator (#49596) 2022-06-17 15:01:44 -07:00
Andrew Branch
7e7c53961a
Add TS Server option to exclude files from auto-imports (#49578)
* Basic functionality

* Add tests

* Add test for ambient modules

* Add to protocol
2022-06-17 14:39:51 -07:00
Andrew Branch
1213c35d57
Add error when importing/exporting types in JS files (#49580)
* Add error when importing/exporting types in JS files

* Ignore type-only imports, update other baselines

* Clean up
2022-06-17 14:39:24 -07:00
Jake Bailey
9f1983d8f4
Downgrade node-fetch back to v2 (#49592) 2022-06-17 11:19:42 -07:00
csigs
9534b2bd46
LEGO: Merge pull request 49590
LEGO: Merge pull request 49590
2022-06-17 03:21:55 -07:00
Wesley Wigham
5c4caafc2a
Allow nongeneric string mapping types to exist (#47050)
* Allow nongeneric string mapping types to exist

* Accept baseline

* Recusive membership testing function

* Fix lint

* Add @DanielRosenwasser's comment
2022-06-16 17:02:31 -07:00
Gabriela Araujo Britto
86d5040031
Fix renaming of node_modules (#49568)
* add bug repro test

* add test and start fix implementation

* adjust for useAlias preference

* fix existing renaming test

* refactor to get rid of options

* fix named bindings & other imports cases

* fix eslint error

* address cr comments

* hopefully actually fix eslint

* clean up stale baseline

* make API change non-breaking

* add/fix comments
2022-06-16 17:01:44 -07:00
Andrew Casey
01ba3a426b
Tune FAR aggregation (#49581)
* Tune FAR aggregation

In making the work queue management more intelligible, we centralized the redundancy check at dequeue time.  As a result, the queue tends to get very large (~1.6M items for `SyntaxKind` in this repo) and dequeuing via `shift` is too slow to do that many times.  This change makes a few tweaks:

1. Use `Project` identity for de-duping and only maintain a set of keys for `loadAncestorProjectTree`
2. Attempt to filter prior to insertion
3. Use `splice` if many consecutive work queue items will be discarded.

On my box, this cuts FAR for `SyntaxKind` in parser.ts from 38 minutes to 20 seconds (we could do better, but effectively decided not to optimize this worst case scenario).
2022-06-16 16:11:55 -07:00
Jake Bailey
734b9828a6
Update all depedencies, including ESLint 8, refresh lockfile (#49550) 2022-06-16 13:39:42 -07:00
Oleksandr T
f83ce9bd9c
fix(49566): Implicit this.property completions not returned while writing property (#49574)
* fix(49566): show this.prop completions in class scoped property declaration

* remove duplicate default value
2022-06-16 12:43:50 -07:00
TypeScript Bot
44d6b51281 Update package-lock.json 2022-06-16 06:06:33 +00:00