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

Enlarge special comments in minimap (like "MARK:" in Xcode and VSCode) #9742

Open
vaner-org opened this issue May 14, 2024 · 4 comments
Open

Comments

@vaner-org
Copy link

vaner-org commented May 14, 2024

Describe the project you are working on

This would be helpful for any game with a large script.

Describe the problem or limitation you are having in your project

Sometimes a script gets so long it gets difficult to navigate, requiring Ctrl+F'ing comments to get around.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Xcode and VSCode have this feature that allows certain comments to show up as normal text on the minimap. This really helps the minimap be more useful for navigation, with markers decided by the programmer. Like a giant HELP to a helicopter when you're stranded on an island.

Xcode:
58880328-ef285800-86d7-11e9-8d28-b92f98f3410a

VSCode:
261660283-96ccb921-1a35-4b20-b84f-e57d7124bd48

These screenshots were grabbed from the VSCode proposal here, PR here.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Both Xcode and VSCode use "// MARK: " to tag special comments, but I would really prefer something simpler, or have the string be user definable.
Maybe consecutive ### or ## could just do it? It would be nice if people could discover this by accident.

If this enhancement will not be used often, can it be worked around with a few lines of script?

It probably can, but I think this would benefit everyone to the point it should...

Is there a reason why this should be core and not an add-on in the asset library?

...be included in core.

@vaner-org vaner-org changed the title Enlarge special comments in minimap Enlarge special comments in minimap (like "MARK:" in Xcode and VSCode) May 14, 2024
@Calinou
Copy link
Member

Calinou commented May 15, 2024

Note that Godot already supports code folding region comments. These always have a beginning and end defined (you can't have a single-line region comment).

I didn't know VS Code even supported // MARK: comments, but I just checked and it works without needing any extensions. It needs to be exactly MARK: (case-sensitive and with the :).

Unlike XCode, it doesn't draw a line above/below in the main view if you use // - MARK: Something or // MARK: Something - though.

Both Xcode and VSCode use "// MARK: " to tag special comments, but I would really prefer something simpler, or have the string be user definable.

I don't think this string should be user-definable. It needs to be standard so it works on other people's projects without requiring specific configuration 🙂

We already have TODO and FIXME which work with a similar approach, but these are more freeform as they can be anywhere in a comment (not necessarily at the beginning).

Given we already have #region and #endregion, I'd go for a #mark Description syntax with a line always being drawn below the line in question.

Maybe consecutive ### or ## could just do it? It would be nice if people could discover this by accident.

## is already used by documentation comments in GDScript.

@vaner-org
Copy link
Author

I don't think this string should be user-definable. It needs to be standard so it works on other people's projects without requiring specific configuration 🙂

Right, of course.

Given we already have #region and #endregion, I'd go for a #mark Description syntax with a line always being drawn below the line in question.

I like this! The case sensitivity + colon on Xcode/VSCode felt like too much to do quickly and #mark is great.
Thank you for looking at my proposal.

@dalexeev
Copy link
Member

Given we already have #region and #endregion, I'd go for a #mark Description syntax with a line always being drawn below the line in question.

We could highlight regions on the minimap along with their names.

#region Region name
...
#endregion

@kitbdev
Copy link

kitbdev commented May 23, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants