Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collapse first comment #11603

Closed
mrx23dot opened this issue Nov 1, 2023 · 5 comments
Closed

Collapse first comment #11603

mrx23dot opened this issue Nov 1, 2023 · 5 comments

Comments

@mrx23dot
Copy link

mrx23dot commented Nov 1, 2023

Type: Feature Request

Eclipse has this neat feature where it collapses the first comment in C/C++ files.

Comments can be

/*  */  multiline
/**  */ multiline
// many lines like this
///  many lines like this

Usually they are a mile long version/disclaimer comments.
It would be silly to create a new addon just for this, so this would be a nice little addition to this addon.

Extension version: 1.17.5
VS Code version: Code 1.73.1 (6261075646f055b99068d3688932416f2346dd3b, 2022-11-09T04:27:29.066Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Sandboxed: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz (8 x 2304)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) undefined
Memory (System) 15.81GB (8.07GB free)
Process Argv
Screen Reader no
VM 0%
@sean-mcmanus
Copy link
Contributor

You can manually collapse the comment.

I assume it would be a setting that is settable per workspace folder, since only a subset of code bases have unimportant comments at the start of files, and other code bases might have important comments at the top.

@sean-mcmanus
Copy link
Contributor

Unfortunately, our extension isn't able to implement this until the VS Code issue microsoft/vscode#40338 is addressed, so you can upvote that issue.

@sean-mcmanus sean-mcmanus closed this as not planned Won't fix, can't repro, duplicate, stale Nov 1, 2023
@mrx23dot
Copy link
Author

mrx23dot commented Nov 2, 2023

Thank for linking this,

they say it's already done:

and you need to set "editor.foldingImportsByDefault": true
although it's about folding imports but the logic could be same.

Or there is a logic for this binding
ctrl + K ctrl + 1 - editor.foldLevel1
cannot we reuse that?

@mrx23dot
Copy link
Author

mrx23dot commented Nov 2, 2023

You can manually collapse the comment.

I assume it would be a setting that is settable per workspace folder, since only a subset of code bases have unimportant comments at the start of files, and other code bases might have important comments at the top.

In professional environment C files start with doxygen, and long license disclaimers, if we open 100s of them per day it's highly appreciated to collapse them, of course it's not for everyone, that's why it could be a setting.
Again it's a standard Eclipse function:
image

Or lets say you know the code base, and work in it daily, surely you don't want to scroll that much every time.

@mrx23dot
Copy link
Author

mrx23dot commented Nov 2, 2023

Never mind there is an addon for it
Fold on Open

@github-actions github-actions bot locked and limited conversation to collaborators Dec 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants