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

Editor: Document comment marker editor settings #96566

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dalexeev
Copy link
Member

@dalexeev dalexeev commented Sep 4, 2024

The text_editor/theme/highlighting/comment_markers/* editor settings are intended to be language independent, but are currently only used in GDScript. Moving the initialization to editor/editor_settings.cpp allows the documentation system to find these settings.

Comment on lines +1200 to +1205
<member name="text_editor/theme/highlighting/comment_markers/critical_color" type="Color" setter="" getter="">
The script editor's critical comment marker color.
</member>
<member name="text_editor/theme/highlighting/comment_markers/critical_list" type="String" setter="" getter="">
Comma-separated list of critical comment markers. Each marker must be a valid Unicode identifier.
</member>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would appreciate assistance in writing better descriptions.

@Mickeon
Copy link
Contributor

Mickeon commented Nov 12, 2024

Does a codeblock's syntax highlighting take these colors into account in the built-in class reference? If yes, we could use them as basic examples. As a general clue, it's most unlikely users are going to remove "NOTE", "FIXME", and "HACK".

@dalexeev
Copy link
Member Author

Does a codeblock's syntax highlighting take these colors into account in the built-in class reference? If yes, we could use them as basic examples. As a general clue, it's most unlikely users are going to remove "NOTE", "FIXME", and "HACK".

Yes, comment markers are taken into account when highlighting code in the built-in doc viewer. The same editor settings are used as in the script editor. But as you said, we can assume that users do not delete the default comment markers in most cases.

Copy link
Contributor

@Mickeon Mickeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this but what I've done for myself is shifting these markers around to distinguish between FIXME, HACK, and TODO better.

The script editor's critical comment marker color.
</member>
<member name="text_editor/theme/highlighting/comment_markers/critical_list" type="String" setter="" getter="">
Comma-separated list of critical comment markers. Each marker must be a valid Unicode identifier.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Comma-separated list of critical comment markers. Each marker must be a valid Unicode identifier.
Comma-separated list of terms highlighted inside comments to denote critical messages. Each marker must be a valid Unicode identifier.
[codeblock]
# CAUTION: A single change, and everything goes kaboom.
# CRITICAL: Pretty much broken on Linux.
# How can this code be so bad, it poses an actual DANGER?
[/codeblock]

@@ -1197,6 +1197,24 @@
The script editor's comment color.
[b]Note:[/b] In GDScript, unlike Python, multiline strings are not considered to be comments, and will use the string highlighting color instead.
</member>
<member name="text_editor/theme/highlighting/comment_markers/critical_color" type="Color" setter="" getter="">
The script editor's critical comment marker color.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change this, but it's consistent with the surrounding descriptions, and consistency is better.

The script editor's notice comment marker color.
</member>
<member name="text_editor/theme/highlighting/comment_markers/notice_list" type="String" setter="" getter="">
Comma-separated list of notice comment markers. Each marker must be a valid Unicode identifier.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Comma-separated list of notice comment markers. Each marker must be a valid Unicode identifier.
Comma-separated list of terms used in comments to denote noteworthy messages. Each marker must be a valid Unicode identifier.
[codeblock]
# NOTE: Despite the name, this function always returns a Node.
# INFO: This does not work with vectors.
[/codeblock]

The script editor's warning comment marker color.
</member>
<member name="text_editor/theme/highlighting/comment_markers/warning_list" type="String" setter="" getter="">
Comma-separated list of warning comment markers. Each marker must be a valid Unicode identifier.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Comma-separated list of warning comment markers. Each marker must be a valid Unicode identifier.
Comma-separated list of terms used in comments to denote warning messages. Each marker must be a valid Unicode identifier.
[codeblock]
# FIXME: Remove the comment below.
# TODO: Explain the comment above.
# HACK: I can't be bothered cleaning this up.
[/codeblock]

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.

Impossible to use symbols as a comment marker
2 participants