34031 Commits

Author SHA1 Message Date
Andrew Branch
695b24d187
Move DebugTypeMapper to debug.ts (#49864)
* Move DebugTypeMapper to debug.ts

* export `DebugType`
2022-07-11 13:25:33 -07:00
TypeScript Bot
1622247636 Update package-lock.json 2022-07-09 06:07:13 +00:00
TypeScript Bot
28dc248e5c Update package-lock.json 2022-07-08 06:07:03 +00:00
Anders Hejlsberg
c2897189cb
Defer types like keyof (T & {}) (#49696)
* 'keyof undefined' and 'keyof null same as 'keyof never'

* Update tests

* Defer types like `keyof (T & {})`

* Restore test

* Update test

* Accept new baselines

* Add tests
2022-07-07 11:54:22 -10:00
Anders Hejlsberg
2eaf49f56e
Handle pseudo-references in getFlowCacheKey (#49828)
* Handle pseudo-references in getFlowCacheKey

* Add tests

* Accept new baselines
2022-07-07 11:53:30 -10:00
Andrew Branch
9dde56c6fc
Add path completions for package.json exports with wildcards (#49644)
* Support path completions for exports wildcards

* Break up results by directory

* Share code between typesVersions and exports processing

* Revert completion kind change

* Add kinds to tests

* Update existing test

* Support nested conditions, improve recursive globbing
2022-07-07 12:26:18 -07:00
Mateusz Burzyński
fefe2208f4
Fixed outdated expectation comments (#49691) 2022-07-07 11:45:52 -07:00
AlCalzone
f6684be95e
fix: correct name length criterion for spelling fixes (#49575)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
2022-07-07 09:08:37 -07:00
Jake Bailey
59238dbf90
Make contextFlags an explicitly required parameter (#49720) 2022-07-06 16:11:39 -07:00
Oleksandr T
8ae1e9e7c7
fix(49685): omit incorrect visibility error when setter precedes getter (#49697) 2022-07-06 15:59:05 -07:00
Oleksandr T
7584e6aad6
fix(49642): resolve JsDoc comments/tags if accessors exist in symbol declarations (#49654) 2022-07-06 15:41:50 -07:00
Jake Bailey
94a65769d4
Add debug format helpers for more enums (#49732) 2022-07-06 15:35:57 -07:00
Wesley Wigham
9872184483
Remove dependence on module compiler option to consider mts/cts files always modules (#49815) 2022-07-06 13:26:36 -07:00
Wesley Wigham
eb430f27ea
More documentation on the impliedNodeFormat SourceFile field (#49816) 2022-07-06 13:25:58 -07:00
Jake Bailey
af70f240a1
Always resetErrorInfo if structuredTypeRelatedTo succeeds (#49718) 2022-07-06 12:57:01 -07:00
Andrew Branch
8002369871
Protect against a language service host mutating its underlying source for getScriptFileNames (#49813)
* Protect against a language service host mutating its underlying source for `getScriptFileNames`

* Add comment
2022-07-06 10:49:01 -07:00
Mateusz Burzyński
8687940398
Add visible alias statements for non-visible binding patterns when emitting declaration (#48869) 2022-07-06 10:08:17 -07:00
Wesley Wigham
0f868035af
Constrain infer type parameters made to preserver distributivity for inlined homomorphic mapped types (#49793) 2022-07-06 09:32:37 -07:00
Oleksandr T
e2e3c1285f
fix(49544): allow comma token after accessors (#49545) 2022-07-06 08:54:54 -07:00
Jack Bates
0bc2b658a4
Retire $ExpectError awareness from DefinitelyTypedRunner (#49756) 2022-07-06 08:43:39 -07:00
Jake Bailey
641ab8eb97
Infer rest type without using assignContextualParameterTypes (#49740) 2022-07-06 08:27:56 -07:00
TypeScript Bot
e75b25a444 Update package-lock.json 2022-07-06 06:08:31 +00:00
iamharbie
1f0d0f7c66
Set Error.prototype.cause type to unknown (#70) (#49639)
Signed-off-by: Abdul-Azeez Lawal <abdul-azeez.lawal@outlook.com>
2022-07-05 15:43:43 -07:00
Andrew Casey
2876f3ae85
Minor fixes (#49791)
* Fix operator precedence

* Tidy up some conditions with statically knowable values
2022-07-05 15:02:14 -07:00
Oleksandr T
cdc1996e87
fix(49426): Object method snippet completions incorrectly add this parameters (#49757)
* fix(49426): omit this parameter

* add OmitThisParameter to TypeFormatFlags

* change flag value
2022-07-05 11:46:19 -07:00
Anders Hejlsberg
2f260885cc
Cache results of expensive repetitive type operations (#49760) 2022-07-05 07:02:32 -10:00
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