-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17954 from uniqueiniquity/regions
Add support for custom outlining regions
- Loading branch information
Showing
4 changed files
with
110 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/// <reference path="fourslash.ts"/> | ||
|
||
////// region without label | ||
////[|// #region | ||
//// | ||
////// #endregion|] | ||
//// | ||
////// region without label with trailing spaces | ||
////[|// #region | ||
//// | ||
////// #endregion|] | ||
//// | ||
////// region with label | ||
////[|// #region label1 | ||
//// | ||
////// #endregion|] | ||
//// | ||
////// region with extra whitespace in all valid locations | ||
//// [|// #region label2 label3 | ||
//// | ||
//// // #endregion|] | ||
//// | ||
////// No space before directive | ||
////[|//#region label4 | ||
//// | ||
//////#endregion|] | ||
//// | ||
////// Nested regions | ||
////[|// #region outer | ||
//// | ||
////[|// #region inner | ||
//// | ||
////// #endregion inner|] | ||
//// | ||
////// #endregion outer|] | ||
//// | ||
////// region delimiters not valid when there is preceding text on line | ||
//// test // #region invalid1 | ||
//// | ||
////test // #endregion | ||
//// | ||
////// region delimiters not valid when in multiline comment | ||
/////* | ||
////// #region invalid2 | ||
////*/ | ||
//// | ||
/////* | ||
////// #endregion | ||
////*/ | ||
|
||
verify.outliningSpansInCurrentFile(test.ranges()); |
10 changes: 10 additions & 0 deletions
10
tests/cases/fourslash/getOutliningSpansForUnbalancedEndRegion.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/// <reference path="fourslash.ts"/> | ||
|
||
////// bottom-heavy region balance | ||
////[|// #region matched | ||
//// | ||
////// #endregion matched|] | ||
//// | ||
////// #endregion unmatched | ||
|
||
verify.outliningSpansInCurrentFile(test.ranges()); |
11 changes: 11 additions & 0 deletions
11
tests/cases/fourslash/getOutliningSpansForUnbalancedRegion.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/// <reference path="fourslash.ts"/> | ||
|
||
////// top-heavy region balance | ||
////// #region unmatched | ||
//// | ||
////[|// #region matched | ||
//// | ||
////// #endregion matched|] | ||
|
||
debugger; | ||
verify.outliningSpansInCurrentFile(test.ranges()); |