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

Improve CodeEdit to allow folding comment blocks #85453

Closed

Conversation

SeremTitus
Copy link

@SeremTitus SeremTitus commented Nov 28, 2023

folding_comments
allows foldable comments and extensible by taking prefix of a desired code block to make it foldable

@SeremTitus SeremTitus requested review from a team as code owners November 28, 2023 02:19
@Chaosus Chaosus added this to the 4.x milestone Nov 28, 2023
@Chaosus
Copy link
Member

Chaosus commented Nov 28, 2023

You need to squash the commits to a single one (see https://docs.godotengine.org/en/latest/contributing/workflow/pr_workflow.html#modifying-a-pull-request)

scene/gui/code_edit.cpp Outdated Show resolved Hide resolved
scene/gui/code_edit.cpp Outdated Show resolved Hide resolved
@SeremTitus
Copy link
Author

You need to squash the commits to a single one (see https://docs.godotengine.org/en/latest/contributing/workflow/pr_workflow.html#modifying-a-pull-request)

squashed

@SeremTitus SeremTitus force-pushed the folding-doc-comments branch 2 times, most recently from c7dd52d to 612ac90 Compare November 28, 2023 14:41
@Calinou
Copy link
Member

Calinou commented Nov 28, 2023

Thanks for opening a pull request 🙂

Feature pull requests should be associated to a feature proposal to justify the need for implementing the feature in Godot core. Please open a proposal on the Godot proposals repository (and link to this pull request in the proposal's body).

This feature looks interesting and I've seen it in a few other editors, although Visual Studio Code doesn't seem to feature this (or it's not enabled by default). It makes sense for license headers in particular, as these tend to span 10+ lines at the top of every file.

Having the collapse icon display for 2-line comments may end up looking noisy though. Perhaps we need a minimum number of consecutive comment lines before the folding icon is displayed (4 lines or so).

@AThousandShips
Copy link
Member

I'd suggest building locally to find the errors in your code instead of taxing the CI with it, at least until you've ironed out some things

@AThousandShips AThousandShips changed the title Improve CodeEdit to allow folding comments blocks Improve CodeEdit to allow folding comment blocks Nov 28, 2023
@SeremTitus SeremTitus force-pushed the folding-doc-comments branch 3 times, most recently from af04f3c to 42d3955 Compare November 28, 2023 18:33
@SeremTitus SeremTitus force-pushed the folding-doc-comments branch 5 times, most recently from 5dda796 to 6fdd3c7 Compare November 29, 2023 15:37
@AThousandShips
Copy link
Member

AThousandShips commented Nov 29, 2023

Are you unable to build locally? You will be much more able to find errors in your code that way (and you aren't still having several errors in your code that were picked up by CI that remain) 🙂

(You should be compiling locally anyway to confirm that the code actually works)

@SeremTitus
Copy link
Author

SeremTitus commented Nov 29, 2023

@AThousandShips , am adding minimum size which has come with some errors am sure I can iron them out in a couple of days...
And yes I can and do build locally it quite slow I cann't to seem to figure how to create a cache using scons, I prefer the CI but I will keep minimal use to this branch

@SeremTitus SeremTitus force-pushed the folding-doc-comments branch 2 times, most recently from eeeb1ec to 71bba4a Compare November 30, 2023 02:01
@Yagich
Copy link
Contributor

Yagich commented Nov 30, 2023

Is this not already a feature? On 4.2rc2, I have this:
image

@SeremTitus SeremTitus force-pushed the folding-doc-comments branch 3 times, most recently from a61b6d1 to c5b8c58 Compare November 30, 2023 02:37
@Yagich
Copy link
Contributor

Yagich commented Nov 30, 2023

it might be an Easter egg

How so? It works as expected, and in line with the proposal you made.

@SeremTitus
Copy link
Author

it might be an Easter egg

How so? It works as expected, and in line with the proposal you made.

It is a good mystery, I don't really know

@SeremTitus
Copy link
Author

Does this feature exist in master?

@AThousandShips
Copy link
Member

Go ahead and check in the release 🙂, see here

@SeremTitus
Copy link
Author

SeremTitus commented Nov 30, 2023

It does it was introduce some where before 4.2.beta6, I do not know how I missed it . Am not sure when where how it was implimented though

@AThousandShips
Copy link
Member

AThousandShips commented Nov 30, 2023

Already implemented by:

I would say

This can be closed as the functionality is already present, if some improvements or other details can be added from this please open a new PR with those features 🙂

Thank you for your contribution nonetheless

@AThousandShips AThousandShips removed this from the 4.x milestone Nov 30, 2023
@SeremTitus
Copy link
Author

achieved by add_comment_delimiter("#","",)

@SeremTitus SeremTitus deleted the folding-doc-comments branch November 30, 2023 15:31
@SeremTitus SeremTitus restored the folding-doc-comments branch November 30, 2023 15:31
@SeremTitus SeremTitus deleted the folding-doc-comments branch April 23, 2024 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for foldable comment blocks
5 participants