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

Feature/gdscript highlighting #3223

Closed
wants to merge 2 commits into from

Conversation

DarienMC
Copy link
Contributor

@DarienMC DarienMC commented Feb 1, 2025

Pulled data from the following pages from the Godot documentation:

All Classes
@GDScript
@GlobalScope
GDScript reference

Worth noting:
markdownhighlighter.cpp
The method void MarkdownHighlighter::gdscriptHighlighter(const QString &text) on line 1717 was created to highlight three items after making use of the existing highlighting systems in place took care of most of it:

  1. Highlight $NodePath constructs. On GitHub's markdown, it is a little lazy as it only highlights the '$' symbol. My implementation is just as lazy, unfortunately. Ideally, we'd want the whole symbol $NodePath to be highlighted like we see in the latest version of Godot Engine 4.3 as seen with the $AnimationPlayer below. This likely involves seeking spaces, or periods, or newlines, etc. that I didn't do.
    image
  2. Highlight %UniqueNote constructs. Same issue as above, but with the '%' symbol.
  3. Highlight @ annotations. So this one is a little weird. I thought it would be sufficient to use the '@' symbol in the language data found in the qownlanguagedata.cpp file as an "Other" format. However, the default highlighting does not seem to highlight any {('@'), QLatin1String("@string")},. I'm not sure why, but the work-around was to simply add valid annotations in the language data without their '@' symbol, then highlight the '@' on its own.

@pbek
Copy link
Owner

pbek commented Feb 1, 2025

Thank you!
I wasn't able to push into your PR branch to fix the wrong submodule reference, so I cherry-picked your commit manually.

@pbek pbek closed this Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants