Skip to content

Commit a2a91b0

Browse files
Copilotmeta-codesync[bot]
authored andcommitted
Actually expose the commentFoldingRanges setting (#2205)
Summary: The `commentFoldingRanges` setting was implemented in the LSP server in f71dbd1 and documented in e7295fb but *not exposed* in VSCode's settings UI, making it undiscoverable. **Changes:** - Added `pyrefly.commentFoldingRanges` boolean configuration to `lsp/package.json` (default: false) - Updated `website/docs/IDE.mdx` to specify exact setting name Users can now enable comment section folding (comments matching `# Section Name ----`) via VSCode settings UI. Pull Request resolved: #2205 Reviewed By: grievejia Differential Revision: D91360705 Pulled By: yangdanny97 fbshipit-source-id: d23607387ccbe3f734c0caaf4c5f724cd923f501
1 parent 800c40a commit a2a91b0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lsp/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,11 @@
216216
"type": "boolean",
217217
"default": true,
218218
"description": "If true (default), Pyrefly will stream diagnostics as they become available during recheck, providing incremental feedback. Set to false to only publish diagnostics after the full recheck completes. This is a global setting that applies to all workspaces."
219+
},
220+
"pyrefly.commentFoldingRanges": {
221+
"type": "boolean",
222+
"default": false,
223+
"description": "Controls whether comment section folding ranges are included in the editor. When true, comments following the pattern '# Section Name ----' (with 4+ trailing dashes) create collapsible regions, similar to R's code section convention."
219224
}
220225
}
221226
}

website/docs/IDE.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The following configuration options are IDE-specific and exposed as VSCode setti
4848
- Control hover tooltip links
4949
- `python.analysis.showHoverGoToLinks` [boolean: true]: Controls whether hover tooltips include "Go to definition" and "Go to type definition" navigation links. Set to `false` for cleaner tooltips with only type information.
5050
- Control comment section folding
51-
- `commentFoldingRanges` [boolean: false]: Controls whether comment section folding ranges are included in the editor. When `true`, comments following the pattern `# Section Name ----` (with 4+ trailing dashes) create collapsible regions, similar to R's code section convention. Set to `true` to enable this feature.
51+
- `pyrefly.commentFoldingRanges` [boolean: false]: Controls whether comment section folding ranges are included in the editor. When `true`, comments following the pattern `# Section Name ----` (with 4+ trailing dashes) create collapsible regions, similar to R's code section convention. Set to `true` to enable this feature.
5252

5353
When used with non-VSCode editors, these options can also be configured by sending them via `initializationOptions` in the LSP [initialization](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initialize) request.
5454

0 commit comments

Comments
 (0)