diff --git a/src/Features/LanguageServer/Protocol/Handler/FoldingRanges/FoldingRangesHandler.cs b/src/Features/LanguageServer/Protocol/Handler/FoldingRanges/FoldingRangesHandler.cs index e211bc1ad7b54..50b7dc2b0c304 100644 --- a/src/Features/LanguageServer/Protocol/Handler/FoldingRanges/FoldingRangesHandler.cs +++ b/src/Features/LanguageServer/Protocol/Handler/FoldingRanges/FoldingRangesHandler.cs @@ -41,7 +41,15 @@ public FoldingRangesHandler(IGlobalOptionService globalOptions) if (document is null) return null; - var options = _globalOptions.GetBlockStructureOptions(document.Project); + var options = _globalOptions.GetBlockStructureOptions(document.Project) with + { + // Need to set the block structure guide options to true since the concept does not exist in vscode + // but we still want to categorize them as the correct BlockType. + ShowBlockStructureGuidesForCommentsAndPreprocessorRegions = true, + ShowBlockStructureGuidesForDeclarationLevelConstructs = true, + ShowBlockStructureGuidesForCodeLevelConstructs = true + }; + return await GetFoldingRangesAsync(document, options, cancellationToken).ConfigureAwait(false); } diff --git a/src/Features/LanguageServer/ProtocolUnitTests/FoldingRanges/FoldingRangesTests.cs b/src/Features/LanguageServer/ProtocolUnitTests/FoldingRanges/FoldingRangesTests.cs index 1e2cfcc2651ca..d994b0aabdf56 100644 --- a/src/Features/LanguageServer/ProtocolUnitTests/FoldingRanges/FoldingRangesTests.cs +++ b/src/Features/LanguageServer/ProtocolUnitTests/FoldingRanges/FoldingRangesTests.cs @@ -52,7 +52,7 @@ public async Task TestGetFoldingRangeAsync_Comments(bool mutatingLspWorkspace) AssertJsonEquals(expected, results); } - [Theory(Skip = "GetFoldingRangeAsync does not yet support regions."), CombinatorialData] + [Theory, CombinatorialData] public async Task TestGetFoldingRangeAsync_Regions(bool mutatingLspWorkspace) { var markup =