mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
add outlining spans for the tuple type (#38179)
This commit is contained in:
@@ -201,6 +201,8 @@ namespace ts.OutliningElementsCollector {
|
||||
case SyntaxKind.CaseBlock:
|
||||
case SyntaxKind.TypeLiteral:
|
||||
return spanForNode(n);
|
||||
case SyntaxKind.TupleType:
|
||||
return spanForNode(n, /*autoCollapse*/ false, /*useFullStart*/ !isTupleTypeNode(n.parent), SyntaxKind.OpenBracketToken);
|
||||
case SyntaxKind.CaseClause:
|
||||
case SyntaxKind.DefaultClause:
|
||||
return spanForNodeArray((n as CaseClause | DefaultClause).statements);
|
||||
|
||||
19
tests/cases/fourslash/getOutliningForTupleType.ts
Normal file
19
tests/cases/fourslash/getOutliningForTupleType.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/// <reference path="fourslash.ts"/>
|
||||
|
||||
////type A =[| [
|
||||
//// number,
|
||||
//// number,
|
||||
//// number
|
||||
////]|]
|
||||
////
|
||||
////type B =[| [
|
||||
//// [|[
|
||||
//// [|[
|
||||
//// number,
|
||||
//// number,
|
||||
//// number
|
||||
//// ]|]
|
||||
//// ]|]
|
||||
////]|]
|
||||
|
||||
verify.outliningSpansInCurrentFile(test.ranges(), "code");
|
||||
Reference in New Issue
Block a user