diff --git a/src/Features/CSharp/Portable/CSharpFeatures.csproj b/src/Features/CSharp/Portable/CSharpFeatures.csproj index 5764374fc4d52972da424bd367fadf0bd404cb2c..1e78a0b55b5cbf14be40edcc9974be920bf4eee7 100644 --- a/src/Features/CSharp/Portable/CSharpFeatures.csproj +++ b/src/Features/CSharp/Portable/CSharpFeatures.csproj @@ -55,6 +55,7 @@ InternalUtilities\LambdaUtilities.cs + diff --git a/src/Features/CSharp/Portable/Structure/CSharpBlockStructureProvider.cs b/src/Features/CSharp/Portable/Structure/CSharpBlockStructureProvider.cs index 1d25c2baf49f7b2d07388095e486d911e936c94f..81eab6c1b3dfe2775c0e9c1aee428e1a89263f51 100644 --- a/src/Features/CSharp/Portable/Structure/CSharpBlockStructureProvider.cs +++ b/src/Features/CSharp/Portable/Structure/CSharpBlockStructureProvider.cs @@ -7,7 +7,6 @@ namespace Microsoft.CodeAnalysis.CSharp.Structure { - internal class CSharpBlockStructureProvider : AbstractBlockStructureProvider { private static ImmutableDictionary> CreateDefaultNodeProviderMap() @@ -16,6 +15,7 @@ internal class CSharpBlockStructureProvider : AbstractBlockStructureProvider builder.Add(); builder.Add(); + builder.Add(); builder.Add(); builder.Add(); builder.Add(); diff --git a/src/Features/CSharp/Portable/Structure/Providers/ArrowExpressionClauseStructureProvider.cs b/src/Features/CSharp/Portable/Structure/Providers/ArrowExpressionClauseStructureProvider.cs new file mode 100644 index 0000000000000000000000000000000000000000..29f46e6f40c2c14781d812f77fe0f4d8dc6b4360 --- /dev/null +++ b/src/Features/CSharp/Portable/Structure/Providers/ArrowExpressionClauseStructureProvider.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Threading; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.Options; +using Microsoft.CodeAnalysis.Structure; +using Microsoft.CodeAnalysis.Text; + +namespace Microsoft.CodeAnalysis.CSharp.Structure +{ + internal class ArrowExpressionClauseStructureProvider : AbstractSyntaxNodeStructureProvider + { + protected override void CollectBlockSpans( + ArrowExpressionClauseSyntax node, + ArrayBuilder spans, + OptionSet options, + CancellationToken cancellationToken) + { + var previousToken = node.ArrowToken.GetPreviousToken(); + spans.Add(new BlockSpan( + isCollapsible: true, + textSpan: TextSpan.FromBounds(previousToken.Span.End, node.Span.End), + hintSpan: node.Parent.Span, + type: BlockTypes.Member)); + } + } +} \ No newline at end of file