24026 Commits

Author SHA1 Message Date
Andrew Branch
be618b1446
Stop looking at binding patterns for type argument inference (#45719)
* Ignore empty binding patterns for contextual typing

* Stop looking at binding patterns for type argument inference entirely
2021-09-07 17:14:06 -07:00
Sang
bac841ef18
Fix missing abstract keyword in completion (#45710)
* first commit

* tests
2021-09-07 13:20:58 -07:00
Anders Hejlsberg
7032f6bcee
Include index signatures for tagged primitives in keyof (#45773)
* Properly include tagged primitive types in keyof

* Add regression test
2021-09-07 10:46:13 -07:00
csigs
8894262bac
LEGO: Merge pull request 45725
LEGO: Merge pull request 45725
2021-09-04 10:13:34 -07:00
csigs
0246f2611a
LEGO: Merge pull request 45720
LEGO: Merge pull request 45720
2021-09-03 16:13:40 -07:00
Zzzen
1d51dfa550
improve error message for using property of type as type (#45354)
* improve error message for using property of type as type

* suggest typeof when possible

* fix naming and error location
2021-09-03 12:17:50 -07:00
csigs
d514a69409
LEGO: Merge pull request 45709
LEGO: Merge pull request 45709
2021-09-03 04:15:22 -07:00
csigs
66441e2f12
LEGO: Merge pull request 45706
LEGO: Merge pull request 45706
2021-09-02 22:13:54 -07:00
Chris Manghane
a53ab0935d
Don't suppress comments when adding or removing braces to/from arrow function. (#45597)
Fixes microsoft/typescript#44228, microsoft/typescript#44229.
2021-09-02 18:05:16 -07:00
csigs
b1df3fec16
LEGO: Merge pull request 45699
LEGO: Merge pull request 45699
2021-09-02 16:13:45 -07:00
Oleksandr T
ba3a068614
fix(45687): allow selection to next token (#45695) 2021-09-02 11:57:37 -07:00
csigs
35ada354a3
LEGO: Merge pull request 45694
LEGO: Merge pull request 45694
2021-09-02 10:13:45 -07:00
Andrew Branch
5daa6f45a3
Revert "fix(45501): don't remove spaces between empty object literals with enabled insertSpaceAfterOpeningAndBeforeClosingEmptyBraces (#45514)" (#45682)
This reverts commit 076f22b2c993a0acb17a234066409439d5541d6d.
2021-09-01 17:47:27 -07:00
Ron Buckton
6f7f3b1775
Minor fixes to "Convert To Async" refactor (#45536)
* Minor fixes to convertToAsync

* Back out on nested return in inner continuation

* Baseline update

* Verify type argument for call can be used, add a few more early exit shortcuts
2021-09-01 13:13:12 -07:00
Orta Therox
f9a3d85b00
Fix the default text for --useDefineForClassFields (#45513)
* Fix the default text for --useDefineForClassFields

* Update with feedback
2021-09-01 15:10:47 +01:00
Wesley Wigham
f598076e68
Close package json watches in watch mode on close (#45642) 2021-08-30 12:53:26 -07:00
Kenta Moriuchi
d699bcdaae
Update lib types to mark Annex B as deprecated (#43710)
* Mark properties defined in Annex B as deprecated

* Tweak

* Update baselines

* Update fourslash tests

* Add completionsStringMethods.ts test

* Fix sortText value in fourslash test for deprecated tags

* Update package-lock.json

* Update package-lock.json

* Mark Non-standard RegExp Constructor properties as deprecated

* Update baselines

Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
2021-08-30 10:38:07 -07:00
Kenta Moriuchi
9d815361fe
Fix verify.baselineCompletions (#45615) 2021-08-29 21:53:42 -07:00
Ron Buckton
107c556fe4
Fix 'as const'-like behavior in JSDoc type cast (#45464) 2021-08-27 18:22:02 -07:00
Tim
1dc1efbc4f
Update es5.d.ts (#45454)
* Update es5.d.ts

Fix grammar error.

* Update src/lib/es5.d.ts

* Update src/lib/es5.d.ts

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2021-08-26 23:10:25 -07:00
Gabriela Araujo Britto
9f025b90a4
Don't include literals from enum members in completions (#45588)
* don't include literals from enum members in completions

* add enum symbol to completions test

* use symbol flags for detecting enum member

* use type flags to check for enum member

* fix test
2021-08-26 16:33:06 -07:00
Andrew Casey
7fc1cb4b36
Use realpathSync.native on case-insensitive file systems (#44966)
* Make getSourceOfProjectReferenceRedirect take a Path

* Add useCaseSensitiveFileNames to ModuleResolutionHost

...so that path comparisons can use it during module resolution.

* Re-enable realpathSync.native for case-insensitive file systems
2021-08-26 15:35:04 -07:00
Stef Busking
2a2962a916
Properties on intersections should be readonly only if all declarations are (#45263)
Fixes #45122
2021-08-25 16:55:14 -07:00
Andrew Branch
30103de1dd
Let AutoImportProviderProject resolve JS when allowJs and maxNodeModulesJsDepth allows (#45524)
* Let AutoImportProviderProject resolve JS when allowJs and maxNodeModulesJsDepth allows

* Simplify function
2021-08-25 15:06:14 -07:00
csigs
db0576c251
LEGO: Merge pull request 45568
LEGO: Merge pull request 45568
2021-08-24 17:00:47 -07:00
Armando Aguirre
ead9dfbdbd
Fixed JS completions type spread (#45484)
* Fix and updated tests

* Added test

* Revert "Fix and updated tests"

This reverts commit 33829fa4a4a4cc0b54d3793ced9a31fa42930e3a.

* Filter out empty access expression

* PR feedback
2021-08-24 14:54:19 -07:00
Oleksandr T
076f22b2c9
fix(45501): don't remove spaces between empty object literals with enabled insertSpaceAfterOpeningAndBeforeClosingEmptyBraces (#45514) 2021-08-24 11:28:58 -07:00
Orta Therox
41dcad056a
Adds a script for removing unused diagnostics (#44324)
* Adds a script for removing unused diagnostics

* Accidentally deleted the wrong one
2021-08-24 13:03:18 +01:00
Daniel Rosenwasser
59b8bef3e7
Only provide hints for simple literals when 'literals' is specified. (#45557)
* Only provide hints for simple literals when 'literals' is specified.

* Update fourslash tests.
2021-08-23 16:38:26 -07:00
Daniel Rosenwasser
af54990055
Some cleanup around inlay hints types to get more-precise checking. (#45391)
* Some cleanup around inlay hints types to get more-precise checking.

* Update Baselines and/or Applied Lint Fixes

Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
2021-08-23 16:15:54 -07:00
Nathan Shively-Sanders
b8ace9d312
Restore HTMLDocument constructable value in DOM (#45554)
Don't touch anything else in the DOM.
2021-08-23 15:56:11 -07:00
David Rogers
d18e82b380
fix for 45006 (#45020)
* fix for 45006

* treat setters like getters in preceding commit; move test accordingly

* fix test baselines

* changes per code review

in `getContainerFlags`, move cases for get/set accessors
to fallthrough into the block that currently handles MethodDeclaration;
so get/set accessors and method declarations all get the same container flags,
such that during `bindContainer`, `startFlow.node` is assigned to
getters/accessors
(this changes a public api in tsserverlibrary.d.ts and typescript.d.ts
by adding `GetAccessorDeclaration` and `SetAccessorDeclaration` to the type
of `FlowStart.node`)

consolidate predicates checking whether a node is either a get or set
accessor, into `isObjectLiteralOrClassExpressionMethodOrAccessor`
(formerly `isObjectLiteralOrClassExpressionMethod`)

annotate updated test with `@target: es2020`

* fix `isObjectLiteralOrClassExpressionMethodOrAccessor`

require that Getter/Setters are parented by an ObjectLiteralExpression or ClassExpression
2021-08-20 17:05:19 -07:00
Oleksandr T
65ed4124ee
feat(44888): omit completions in an object expression with an instantiated class type (#45044) 2021-08-20 13:51:37 -07:00
Oleksandr T
69b5b2b2f3
feat(16755): show QF to declare missing properties in a call expression with an object literal argument (#44781) 2021-08-20 13:49:46 -07:00
Gabriela Araujo Britto
84b057828e
Fix incorrect suggestion for package that bundles types (#45507)
* Fix incorrect suggestion for package that bundles types

* determine if a package ships types from its files

* update new error message
2021-08-20 11:12:34 -07:00
Oleksandr T
e00722f262
feat(44720): allow renaming string literal in switch/case (#45084) 2021-08-19 17:09:35 -07:00
Zzzen
693c2d08c1
support contextual return type of iife (#45007) 2021-08-19 16:37:50 -07:00
Gabriela Araujo Britto
945179fb64
Reuse checker's property accessibility check for completions (#45388)
* add test for completions crash

* WIP: experiment

* remove comments

* add call to getParseTreeNode

* Revert "add call to getParseTreeNode"

This reverts commit 8dd1cf67cfa869efefd99fc7bdad5697e6418ac2.

* Fix comments

* minor fixes

* fix formatting

* rename type to containingType
2021-08-19 13:02:20 -07:00
Eli Barzilay
7a19c22063 getReferencesAtLocation: fix handling of destructoring imports
Fixes #45423.
2021-08-18 14:39:54 -04:00
Anders Hejlsberg
79474fdfd2
Increase type instantiation depth limit (#45025)
* Bump instantiation depth limit to 500

* Accept new baselines

* Update tests

* Accept new baselines
2021-08-17 07:00:19 -07:00
Oleksandr T
dc80e6a28b
feat(18147): skip uncessary parenthesis (#44769) 2021-08-16 17:20:40 -07:00
Oleksandr T
424464d46b
feat(43963): change var to a parameter in destructured function parameters (#44767) 2021-08-16 17:19:44 -07:00
Gerrit Birkeland
e263fcebf8
Expose getTypePredicateOfSignature (#44863) 2021-08-16 17:17:42 -07:00
Oleksandr T
55ed742574
fix(45294): show parameter inlay hints for template strings (#45305) 2021-08-16 14:11:02 -07:00
Ryan Cavanaugh
e00b5ecd40
Enable max-statements-per-line lint rule (#45475)
* Enable the rule

* Fix all the violations
2021-08-16 13:53:51 -07:00
csigs
d50c91da17
LEGO: Merge pull request 45456
LEGO: Merge pull request 45456
2021-08-14 10:13:55 -07:00
csigs
3c957efd4a
LEGO: Merge pull request 45453
LEGO: Merge pull request 45453
2021-08-14 04:24:59 -07:00
Oleksandr T
5b3072f687
fix(45233): allow type assertion in ExportAssignment with JSDoc type definition (#45342) 2021-08-13 16:32:23 -07:00
Oleksandr T
dfd84ec0b2
fix(45417): show inlay hints for null and literal-like identifiers (#45426) 2021-08-13 11:31:47 -07:00
csigs
fe7962af3d
LEGO: Merge pull request 45444
LEGO: Merge pull request 45444
2021-08-13 10:13:50 -07:00