You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the project you are working on:
A game editor with a code generation capability.
Describe the problem or limitation you are having in your project:
Parts of my game are generated from a form of metadata, which is edited with a purpose-built Godot Editor plugin. There is a UI to create and edit code snippets within this plugin. It is implemented with TextEdit node, which has a lot of options making it "Script Editor"-lite. (And, I guess, is used internally by the Script Editor).
One of the options is syntax highlighting, but it does not provide full coverage for GDScript tokens. Most of the colors can be copied from Editor Settings, but there are several missing in theme properties:
Hoping that this is only a theme limitation, I've looked through the engine code trying to figure out if it is possible to just add those colors. Unfortunately, the highlighter that is available in TextEdit by default is just a simplified ad-hoc implementation, that has nothing to do with the Script Editor and thus does not parse these missing tokens.
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
Internal classes that use TextEdit (such as Script Editor) can set their own highlighters via interface not exposed in GDScript API. In GDScript API only the default implementation from TextEdit::_get_line_syntax_highlighting is available.
I think that at least all syntax highlighters available in engine should be present as an option for TextEdit. It may not be useful for many games, but it allows plugin creators to have more tools to naturally integrate their plugins into Godot Editor UI. Plus, having a full highlighter and a simplified one is excessive and serves no purpose in my opinion.
As a stretch goal, an ability to define custom highlighters in GDScript/GDNative API may come in handy as well.
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
I think, we either implicitly register all SyntaxHighlighter classes and access that list from TextEdit, or TextEdit has its own curated list of supported SyntaxHighlighters. Currently I see only GDScriptSyntaxHighlighter extending SyntaxHighlighter, but more can be added to support various text file formats.
If this enhancement will not be used often, can it be worked around with a few lines of script?:
Syntax highlighting is not exposed to scripts.
Is there a reason why this should be core and not an add-on in the asset library?:
It's a part of GDScript module.
The text was updated successfully, but these errors were encountered:
Describe the project you are working on:
A game editor with a code generation capability.
Describe the problem or limitation you are having in your project:
Parts of my game are generated from a form of metadata, which is edited with a purpose-built Godot Editor plugin. There is a UI to create and edit code snippets within this plugin. It is implemented with
TextEdit
node, which has a lot of options making it "Script Editor"-lite. (And, I guess, is used internally by the Script Editor).One of the options is syntax highlighting, but it does not provide full coverage for GDScript tokens. Most of the colors can be copied from Editor Settings, but there are several missing in theme properties:
Hoping that this is only a theme limitation, I've looked through the engine code trying to figure out if it is possible to just add those colors. Unfortunately, the highlighter that is available in
TextEdit
by default is just a simplified ad-hoc implementation, that has nothing to do with the Script Editor and thus does not parse these missing tokens.Describe the feature / enhancement and how it helps to overcome the problem or limitation:
Internal classes that use
TextEdit
(such as Script Editor) can set their own highlighters via interface not exposed in GDScript API. In GDScript API only the default implementation fromTextEdit::_get_line_syntax_highlighting
is available.I think that at least all syntax highlighters available in engine should be present as an option for
TextEdit
. It may not be useful for many games, but it allows plugin creators to have more tools to naturally integrate their plugins into Godot Editor UI. Plus, having a full highlighter and a simplified one is excessive and serves no purpose in my opinion.As a stretch goal, an ability to define custom highlighters in GDScript/GDNative API may come in handy as well.
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
I think, we either implicitly register all
SyntaxHighlighter
classes and access that list fromTextEdit
, orTextEdit
has its own curated list of supportedSyntaxHighlighter
s. Currently I see onlyGDScriptSyntaxHighlighter
extendingSyntaxHighlighter
, but more can be added to support various text file formats.If this enhancement will not be used often, can it be worked around with a few lines of script?:
Syntax highlighting is not exposed to scripts.
Is there a reason why this should be core and not an add-on in the asset library?:
It's a part of GDScript module.
The text was updated successfully, but these errors were encountered: