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
I'm implementing a C++ code editor in my app in combination with the LSP to support proper C++ syntax highlighting, but I cannot find a way to implement this asynchronously by subclassing SyntaxHighlighter using the current methods/properties in godot 4.4 mono.
Describe the problem or limitation you are having in your project
The problem I have is that the only way I can get _get_line_syntax_highlighting to be called after calling clear_highlighting_cache or update_cache is by waiting for the lines_edited_from signal. This works if everything runs synchronously, but I'm trying to await the semantic tokens, and this makes the SyntaxHighlighter cache old/cleared data. From what I've observed, TextEdit only seems to update the text colors when you make changes to the text.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
A way to manually trigger _get_line_syntax_highlighting from the subclass to update the syntax highlighting without relying on TextEdit text changes.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Not really sure what the best approach would be, but having a method to make the SyntaxHighlighter manually call _get_line_syntax_highlighting to update the cache could be useful, or perhaps update_cache could do that as well.
If this enhancement will not be used often, can it be worked around with a few lines of script?
A small workaround I found is setting the syntax_highlighter property to null and then reassigning it again, but it makes the text flicker, and that's not very nice to look at.
Is there a reason why this should be core and not an add-on in the asset library?
This seems like a must have.
The text was updated successfully, but these errors were encountered:
Describe the project you are working on
I'm implementing a C++ code editor in my app in combination with the LSP to support proper C++ syntax highlighting, but I cannot find a way to implement this asynchronously by subclassing
SyntaxHighlighter
using the current methods/properties in godot 4.4 mono.Describe the problem or limitation you are having in your project
The problem I have is that the only way I can get
_get_line_syntax_highlighting
to be called after callingclear_highlighting_cache
orupdate_cache
is by waiting for thelines_edited_from
signal. This works if everything runs synchronously, but I'm trying to await the semantic tokens, and this makes theSyntaxHighlighter
cache old/cleared data. From what I've observed,TextEdit
only seems to update the text colors when you make changes to the text.Describe the feature / enhancement and how it helps to overcome the problem or limitation
A way to manually trigger
_get_line_syntax_highlighting
from the subclass to update the syntax highlighting without relying onTextEdit
text changes.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Not really sure what the best approach would be, but having a method to make the
SyntaxHighlighter
manually call_get_line_syntax_highlighting
to update the cache could be useful, or perhapsupdate_cache
could do that as well.If this enhancement will not be used often, can it be worked around with a few lines of script?
A small workaround I found is setting the
syntax_highlighter
property to null and then reassigning it again, but it makes the text flicker, and that's not very nice to look at.Is there a reason why this should be core and not an add-on in the asset library?
This seems like a must have.
The text was updated successfully, but these errors were encountered: