Skip to content

Commit c916e8d

Browse files
authored
Fix code folding bug (#7962)
1 parent 7230cf3 commit c916e8d

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

Extension/src/LanguageServer/Providers/foldingRangeProvider.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,8 @@ export class FoldingRangeProvider implements vscode.FoldingRangeProvider {
2929
const result: vscode.FoldingRange[] = [];
3030
ranges.ranges.forEach((r: CppFoldingRange) => {
3131
const foldingRange: vscode.FoldingRange = {
32-
start: r.range.start.line,
33-
// Move the end range up one, so the end } line isn't folded, because
34-
// VS Code doesn't support column-based folding: https://github.com/microsoft/vscode/issues/50840
35-
// The behavior matches TypeScript but not VS (which has column-based folding).
36-
end: r.range.end.line - 1
32+
start: r.range.startLine,
33+
end: r.range.endLine
3734
};
3835
switch (r.kind) {
3936
case FoldingRangeKind.Comment:

Extension/src/LanguageServer/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ export enum FoldingRangeKind {
373373

374374
export interface CppFoldingRange {
375375
kind: FoldingRangeKind;
376-
range: Range;
376+
range: InputRegion;
377377
}
378378

379379
export interface GetFoldingRangesResult {

0 commit comments

Comments
 (0)