Skip to content

Commit 0ee3150

Browse files
committed
WIP debugoutput time
1 parent 318cec9 commit 0ee3150

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/PowerShellEditorServices/Language/TokenOperations.cs

+8
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ namespace Microsoft.PowerShell.EditorServices
2424
internal static class TokenOperations
2525
{
2626
static public FoldingReference[] FoldableRegions(Token[] tokens) {
27+
28+
foreach (Token token in tokens)
29+
{
30+
string s = token.Extent.ToString() + "\n" + token.HasError.ToString() + "\n" + token.Kind.ToString() +
31+
"\n" + token.Text + "\n" + token.TokenFlags.ToString();
32+
System.Console.WriteLine("---\n" + s);
33+
}
34+
2735
FoldingReference[] result = new FoldingReference[] {};
2836
return result;
2937
}

test/PowerShellEditorServices.Test/Language/TokenOperationsTests.cs

+13-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,19 @@ private FoldingReference[] GetRegions(string text) {
5050

5151
[Fact]
5252
public void LaguageServiceFindsFoldablRegions() {
53-
FoldingReference[] result = GetRegions("abc");
53+
string text = @"#RegIon This should fold
54+
<#
55+
Nested different comment types. This should fold
56+
#>
57+
#EnDReGion
58+
59+
# region This should not fold due to whitespace
60+
$shouldFold = $false
61+
# endRegion
62+
function short-func-not-fold {};
63+
";
64+
65+
FoldingReference[] result = GetRegions(text);
5466
// var result = this.languageService
5567
Assert.Equal(result.Length, 0);
5668
}

0 commit comments

Comments
 (0)