Commit Graph

33138 Commits

Author SHA1 Message Date
TypeScript Bot
2b7bd85935 Update package-lock.json 2022-03-24 06:06:26 +00:00
Wesley Wigham
8cd4b7a5da Make the unconstrained type parameter and {} assignability rule not apply under strictNullChecks (#48366)
* Make the unconstrained type parameter and {} assignability rule not apply under strictNullChecks

* Fix lint, PR feedback
2022-03-23 16:22:40 -07:00
Wesley Wigham
b5a3a058f5 Merge diagnosticsProducing and nonDiagnosticsProducing checkers into a single checker supporting lazy diagnostics (#36747)
* Merge diagnosticsProducing and nonDiagnosticsProducing checkers into a single checker supporting lazy diagnostics

* Fix lint
2022-03-23 16:21:06 -07:00
Wesley Wigham
26c701c351 Fix document registry cache key calculation for paths compiler option (#48389)
* Fix document registry cache key calculation for `paths` compiler option

* PR feedback
2022-03-23 15:57:39 -07:00
Zzzen
20c01cdd3f align ClassStaticBlockDeclaration with IIFE in CFA (#44969)
* align ClassStaticBlockDeclaration with IIFE in CFA

* isIIFELike => isImmediatelyInvoked

* fix unexpected used-before-assignment errors

* update baseline
2022-03-23 15:47:29 -07:00
Minh Quy
4ec16b2a6b Fix#48281 - Indentation not respected when executing various refactorings (TypeScript/JavaScript) (#48340)
* fix(48281) - Preserve indentation when adding missing properties

* fix(48281) - Fix object literal indentation like block

* fix(48281) - Indentation for object literal started with curly brace similar to block
2022-03-23 10:40:50 -07:00
gfyoung
ba3645e034 fix(48218): Split Intl.DisplayNames options (#48262)
Closes https://github.com/microsoft/TypeScript/issues/48218
2022-03-22 17:22:30 -07:00
islandryu
bf0eef4353 fix(48034): Get a literal string of type intersection in a template literal type (#48044) 2022-03-22 13:38:24 -07:00
Anders Hejlsberg
6cb58d382f Optional variance annotations (#48240)
* Simplify getVariancesWorker and associated logic

* Accept new API baselines

* Add 'in' and 'out' modififers / add modifiers to type parameters

* Check variance annotations

* Update test runner

* Accept new API baselines

* Allow variance annotations only on certain type parameters

* Add deprecated implementation of createTypeParameterDeclaration

* Accept new API baselines

* Report variance markers as 'sub-XXX' and 'super-XXX'

* Add tests

* Accept new baselines
2022-03-22 11:31:08 -07:00
Jm
fdb1c2fc35 fix: export default anonymous function works with prefixText and suffixText when disabled (#48259) 2022-03-22 10:43:41 -07:00
Pablo Sabater Jiménez
50a4b92bca fix(48053) Description of tsBuildInfoFile is misleading in generated tsconfig.json (#48072)
* add check for path default value

* fix wrong tsBuildInfoFile description

* updated files to file
2022-03-22 10:35:47 -07:00
csigs
45c1e58809 LEGO: Merge pull request 48371
LEGO: Merge pull request 48371
2022-03-22 02:50:20 -07:00
TypeScript Bot
7f1ec30b8e Update package-lock.json 2022-03-22 06:06:20 +00:00
Andrew Branch
5bc8179b73 Make AutoImportProvider look in ATA cache (#48329)
* Make AutoImportProvider consider ATA cache

* Delete unnecessary test
2022-03-21 17:02:44 -07:00
csigs
f9e6ba38f1 LEGO: Merge pull request 48346
LEGO: Merge pull request 48346
2022-03-21 02:49:39 -07:00
csigs
92af654a83 LEGO: Merge pull request 48342
LEGO: Merge pull request 48342
2022-03-20 02:50:17 -07:00
Andrew Casey
073ac920ad Add server tracepoints (#48282)
* Trace project creation, loading, and updateGraph

* Drop generic event tracing

* Make argument names more consistent

* Trace diagnostics to make steps easier to interpret

* Fill an unexplained gap in updateGraph

* Move updateGraph tracing into base type

* Fill the gaps in updateGraph
2022-03-17 14:56:42 -07:00
Oleksandr T
c1cf901997 fix(48291): omit jsdoc modifiers (#48304) 2022-03-17 13:44:42 -07:00
Thai Pangsakulyanont
9a2868bf98 Infer extracted local variable name from property name (#37902) 2022-03-17 13:39:13 -07:00
Andrew Branch
df1faa09b8 Add isolatedModules error for ambiguous imports referenced in decorator metadata (#42915)
* Add isolatedModules error for ambiguous imports referenced in decorator metadata

* Improve test and accept baselines

* Error only for es2015+

* Add namespace import to error message as workaround

* Add codefix

* Fix merge fallout
2022-03-17 12:00:23 -07:00
Minh Quy
b996287e00 fix(48191): Duplicates comments on "Add definite assignment assertion to property" (#48299)
* Suppress leading and trailing comments for adding missing definite assignment assertion action

* Suppress leading and trailing comments for adding missing initalizer action

* Test for initializer property action
2022-03-17 09:57:10 -07:00
Oleksandr T
546a87fa31 feat(48231): allow unique symbol for constant variables (#48270) 2022-03-16 17:00:27 -07:00
Gabriela Araujo Britto
cf8ed8fec1 Change sortText for class member completions (#48196)
* change sortText for class member completions

* update test

* create new sort text member for class snippets

* change values of sort text enum
2022-03-16 16:04:08 -07:00
Oleksandr T
f12922c8f7 fix(48277): show parameter type inlay hints after ? operator (#48283) 2022-03-16 11:38:40 -07:00
Wesley Wigham
7f652509b6 Handle JS synthetic rest args in contextual parameter assignment (#48263)
* Handle JS synthetic rest args in contextual parameter assignment

* Limit fixing to only unannotated js rest parameters

* Minimize test

* Add annotated version

* Remove explicit CheckFlags.RestParameter check since apparently not all rest parameters are CheckFlags.RestParameter
2022-03-16 11:04:07 -07:00
Wesley Wigham
92bc2ddc3c Consistently avoid pulling on the source return type when the target return type is any (#47306) 2022-03-15 18:16:05 -07:00
Anders Hejlsberg
8e5a84a696 Exclude mapped types with optionality modifiers and 'as' clauses from constraint logic (#48273)
* Exclude mapped types with optionality modifiers and 'as' clauses

* Add regression tests
2022-03-15 17:37:46 -07:00
Jesse Trinity
111ca92646 Fix parser regression for bad related diagnostic on missing matching brackets (#44158)
* Revert "Revert #43460 and #40884 (#44175)"

This reverts commit 5770434891.

* fix missing opening brace match error

* refactor parseExpectedMatchingBrackets

* use getNodePos

* accept baselines

* delete mistakenly added files

* Revert getNodePos addition

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-03-15 17:29:41 -07:00
Anders Hejlsberg
8c060eecaa Exclude mapped types with 'as' clauses from certain checks (#47889)
* Exclude mapped types with 'as' clauses from certain checks

* Add tests
2022-03-15 17:01:33 -07:00
Oleksandr T
c981c9ba5a fix(47597): ignore commented imports following template expression (#47657) 2022-03-15 15:28:49 -07:00
Ryan Cavanaugh
7addca63ae Update issue templates (#48261) 2022-03-15 14:43:46 -07:00
Wenlu Wang
5f017df609 Fix top level logical assignment leak (#40536)
* Fix leaking top level logical assignment

* Fix leaking top level logical assignment
2022-03-14 10:48:31 -07:00
Oleksandr T
4a58fbce17 fix(48081): omit error on importing variables defined with require() (#48115) 2022-03-14 09:55:12 -07:00
Mateusz Burzyński
ca65a1a05b Add boolean to supported literals within Object.freeze (#48117) 2022-03-14 09:07:31 -07:00
TypeScript Bot
995e0a0601 Update package-lock.json 2022-03-14 06:06:27 +00:00
TypeScript Bot
6f0dd47a88 Update package-lock.json 2022-03-12 06:06:33 +00:00
Andrew Casey
ce9657d5e2 Introduce set with custom equals and getHashCode (#48169)
* Implement set with custom equals and getHashCode

* Adopt custom set in session

* Add doc comment

* Initially store buckets as non-arrays
2022-03-11 16:17:54 -08:00
Wesley Wigham
93c3a30edc Add assertion on invalid cache set (#43845) 2022-03-11 10:57:22 -08:00
Wesley Wigham
d1fa945261 Add moduleDetection compiler flag to allow for changing how modules are parsed (#47495)
* Add moduleDetection compiler flag to allow for changing how modules are parsed

The default setting is 'auto', where JSX containing files under react-jsx and react-jsxdev are
always parsed as modules, and esm-format files under module: node12+ are always parsed as modules,
in addition to the 'legacy' detection mode's conditions for other files. (Declaration files are exempt from
these new conditions)

The 'legacy' mode preserves TS's behavior prior to the introduction of this flag - a file is
parsed as a module if it contains an import, export, or import.meta expression.

In addition, there is a 'force' mode that forces all non-declaration files to be parsed as modules.
(Declaration files are still only modules if they contain a top-level import or export.)

This technically breaks the parser API, but it's kinda-sorta backwards compatible so long
as you don't need the functionality associated with more recent compiler flags.

* Fix post-merge lint

* Rename function

* Update default value documentation

* PR feedback

* Fix lint and typo
2022-03-11 10:36:00 -08:00
Anders Hejlsberg
0271738047 Properly reduce intersections to never in identity relation (#48111)
* Exclude types that may simplify to other forms

* Add regression test
2022-03-11 10:18:04 -08:00
Mateusz Burzyński
04238e6f52 Fix/dependent parameters obj methods (#48110)
* Add failing test for dependent destructured variables within obj methods

* Fixed an issue with dependent parameters within obj methods
2022-03-11 09:46:30 -08:00
Jake Bailey
5fd0b6432e Clean up a load of unused dependencies, broken jake script (#48214) 2022-03-11 09:36:03 -08:00
Ryan Cavanaugh
a4f5555e09 Move hasOwn from Object instance to Object constructor (#48207)
Fixes #48206
2022-03-10 15:28:47 -08:00
Wesley Wigham
3f63804878 Make direct assignments to cjs exports considered literal contexts (#39816)
* Make direct assignments to cjs exports considered literal contexts

* Style feedback from PR

* Trailing whitespaaaaace
2022-03-09 13:27:39 -08:00
Wesley Wigham
f76452cb27 Fix conditional type type parameter leak (#31455)
* Fix conditional type type parameter leak

* Monkey with comment text per code review

* Conditionally clone type param

* Reuse input array and avoid making mapper where possible
2022-03-09 13:25:14 -08:00
Wesley Wigham
fc82c67357 Don't eagerly simplify reducible generic union index types (#46812) 2022-03-09 12:02:11 -08:00
Wesley Wigham
ea4791d4d7 Preserve the homomorphism of inlined mapped types in declaration emit (#48091) 2022-03-09 10:31:54 -08:00
Wesley Wigham
c70be8b501 Handle nonmaster branches in user suite tests (#48128)
* Handle nonmaster branches in user suite tests

* Fix remaining changed default branches, vscode & vue-next docker install scripts

* NPM reformats these on install now, comitting so it doesnt need to be ignored

* Accept current user suite baselines

* Fix many trivially fixable user suite tests
2022-03-09 10:31:16 -08:00
Nathan Shively-Sanders
918f0ef404 Rename SyntaxKind.JSDocComment -> JSDoc (#44416)
* Rename SyntaxKind.JSDocComment -> JSDoc

Early on, I made the mistake of using the syntax kind JSDocComment for
the type JSDoc. This arose because
I hadn't decided on the terminology of "jsdoc" for the C-style comment
that is attached to a declaration. "comment"
for the text that follows a tag. By the time I settled on those terms
consistently, a version had already shipped with `interface JSDoc`
having `SyntaxKind.JSDocComment`.

However, there is now a `type JSDocComment` that represents the possible
contents of the comment text (strings and various kinds of `@link`), so
it's doubly confusing that this type has a union of four kinds instead
of SyntaxKind.JSDocComment.

Although this is a public API break, I don't think it's hard to recover
from, and the JSDoc API has accessors for individual tag types, so I
suspect few people refer directly to SyntaxKind.JSDocComment.

* Add deprecate JSDocComment alias to JSDoc

For backward compatibility

* Make JSDoc an alias of JSDocComment

Improves output of JSDocParsing tests without having to make its code
smarter.

* update API baselines
2022-03-09 09:51:29 -08:00
Jack Bates
94a7ec17e0 🤖 Sync option descriptions <- website (#46465)
* 🤖 Sync option descriptions <- jablko/TypeScript-Website@a9df5139f2

https://github.com/jablko/TypeScript-Website/actions/runs/1953829438

* Update Baselines and/or Applied Lint Fixes

Co-authored-by: jablko/TypeScript-Website:.github/workflows/sync-option-descriptions.yml <bot@typescriptlang.org>
Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
2022-03-08 15:55:13 -08:00