-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Highlight TODO, FIXME and similar keywords in comments in the script editor #4942
Comments
Another way to implement this would be to add an editor setting of an array of strings to highlight. The default value would have TODO, FIXME, NOTE, and HACK, but then users could add or remove other words if they want. That would solve the same problem but in a more flexible way. |
I don't think the keywords should be made configurable, so that they can also be reliably highlighted by external editors (most importantly, VS Code). External editors generally won't bother reading the I know this isn't ideal for people writing comments in non-English languages, but I would prefer people to use consistent syntax whenever possible. |
Can't we do both (if possible)?
if it will be too much work then 4 defaults are totally fine. |
We can use this list as a basis. |
Describe the project you are working on
Related to #602 and #3845.
The Godot editor 🙂
Describe the problem or limitation you are having in your project
Not a particular limitation, but a quality of life feature for the script editor.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Other editors such as Visual Studio Code highlight keywords commonly used for important notes and todos. Here's an example with commonly used keywords in the Python language:
:
:
Some editors will also highlight the entire line, but this is more complex to implement, especially if you want to handle continuation lines like this:
File contents - Copy-paste this in various editors for testing purposes
Note: Unlike #602, this proposal does not suggest adding a bottom panel to track all TODOs/FIXMEs within the project. It only suggests highlighting those keywords in comments in the script editor. Project management tools such as issue trackers or Kanban boards are usually more suited for long-term TODO/FIXME tracking.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Highlight specific keywords in comments only, but probably don't bother with highlighting the entire line (as handling multiline comments is difficult).
I'd suggest supporting the following keywords for highlighting:
TODO
,FIXME
,NOTE
andHACK
(all case-sensitive). Like in Visual Studio Code, these do not have to be at the beginning of a comment line, and these do not have to be followed by a:
symbol.XXX
("dirty hack") is rarely used nowadays, so there's probably not much point in supporting it. I haven't seen it in years myself 🙂From an implementation perspective, I haven't found a way to add a keyword highlight that works within a color region (i.e. comments). Let me know if you can find a way to work around this.
If this enhancement will not be used often, can it be worked around with a few lines of script?
No.
Is there a reason why this should be core and not an add-on in the asset library?
This is about improving the script editor usability and bringing its functionality on par with popular IDEs.
The text was updated successfully, but these errors were encountered: