Add outlining spans for object destructuring elements

This commit is contained in:
Alexander T 2020-04-21 12:57:26 +03:00
parent 9684bb21e1
commit 52d32e5597
2 changed files with 40 additions and 0 deletions

View File

@ -199,6 +199,7 @@ namespace ts.OutliningElementsCollector {
case SyntaxKind.InterfaceDeclaration:
case SyntaxKind.EnumDeclaration:
case SyntaxKind.CaseBlock:
case SyntaxKind.ObjectBindingPattern:
return spanForNode(n);
case SyntaxKind.CaseClause:
case SyntaxKind.DefaultClause:

View File

@ -0,0 +1,39 @@
/// <reference path="fourslash.ts"/>
////const[| {
//// a,
//// b,
//// c
////}|] =[| {
//// a: 1,
//// b: 2,
//// c: 3
////}|]
////const[| {
//// a:[| {
//// a_1,
//// a_2,
//// a_3:[| {
//// a_3_1,
//// a_3_2,
//// a_3_3,
//// }|],
//// }|],
//// b,
//// c
////}|] =[| {
//// a:[| {
//// a_1: 1,
//// a_2: 2,
//// a_3:[| {
//// a_3_1: 1,
//// a_3_2: 1,
//// a_3_3: 1
//// }|],
//// }|],
//// b: 2,
//// c: 3
////}|]
verify.outliningSpansInCurrentFile(test.ranges(), "code");