Implement access specifier folding range collection and add unit tests - #14675
Conversation
|
@microsoft-github-policy-service agree |
There was a problem hiding this comment.
Pull request overview
Adds collapsible folding ranges for C++ class access-specifier sections while retaining server-provided ranges.
Changes:
- Implements client-side access-section detection.
- Integrates detected ranges with server results.
- Adds a basic unit test.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
foldingRangeUtils.ts |
Detects access-specifier folding ranges. |
foldingRangeProvider.ts |
Appends client-computed ranges. |
foldingRangeProvider.test.ts |
Tests basic access-section folding. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Hi Sean McManus (@sean-mcmanus), I’ve addressed the comments from the previous review and made the requested changes in the latest commit. Could you please revalidate the CI and Copilot validation when you get a chance? Thanks! |
|
Hi Prashant Kumar Rai (@8prashant) . Thanks again for another great contribution. (We do appreciate it! I've wanted this feature myself, for a while now.) Though, in this case, the right place for this logic is actually in a native/closed-source component, shared with Visual Studio. I've gone ahead and composed an alternative implementation (which would also add the feature to VS), which is now in PR internally. I don't believe we'll want to adopt this TypeScript-based approach. |
Adds folding ranges for class access specifier sections (
public:,private:,protected:) so users can collapse each section independently.Related to #14645.
What changed
Why
When classes contain multiple access blocks, collapsing by section helps reduce noise and improves readability, especially in large third-party headers.
Testing
yarn compilemocha dist/test/unit/foldingRangeProvider.test.js --timeout 300001 passing,0 failing