From c916e8d93027782bd9d6ff6c08c5d96e6f9c13d4 Mon Sep 17 00:00:00 2001 From: Colen Garoutte-Carson <49173979+Colengms@users.noreply.github.com> Date: Wed, 11 Aug 2021 14:54:43 -0700 Subject: [PATCH] Fix code folding bug (#7962) --- .../src/LanguageServer/Providers/foldingRangeProvider.ts | 7 ++----- Extension/src/LanguageServer/client.ts | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Extension/src/LanguageServer/Providers/foldingRangeProvider.ts b/Extension/src/LanguageServer/Providers/foldingRangeProvider.ts index 9e23eea482..17d7c0850a 100644 --- a/Extension/src/LanguageServer/Providers/foldingRangeProvider.ts +++ b/Extension/src/LanguageServer/Providers/foldingRangeProvider.ts @@ -29,11 +29,8 @@ export class FoldingRangeProvider implements vscode.FoldingRangeProvider { const result: vscode.FoldingRange[] = []; ranges.ranges.forEach((r: CppFoldingRange) => { const foldingRange: vscode.FoldingRange = { - start: r.range.start.line, - // Move the end range up one, so the end } line isn't folded, because - // VS Code doesn't support column-based folding: https://github.com/microsoft/vscode/issues/50840 - // The behavior matches TypeScript but not VS (which has column-based folding). - end: r.range.end.line - 1 + start: r.range.startLine, + end: r.range.endLine }; switch (r.kind) { case FoldingRangeKind.Comment: diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 9cf40e18a5..b5929284c5 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -373,7 +373,7 @@ export enum FoldingRangeKind { export interface CppFoldingRange { kind: FoldingRangeKind; - range: Range; + range: InputRegion; } export interface GetFoldingRangesResult {