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

Expose GDScript syntax highlighter to editor plugins #10374

Closed
passivestar opened this issue Aug 6, 2024 · 0 comments · Fixed by godotengine/godot#95764
Closed

Expose GDScript syntax highlighter to editor plugins #10374

passivestar opened this issue Aug 6, 2024 · 0 comments · Fixed by godotengine/godot#95764

Comments

@passivestar
Copy link

Describe the project you are working on

A components plugin that makes it easy to selectively add external scripts to the project

Describe the problem or limitation you are having in your project

I made a quick preview popup that shows source code before you add a script to the project but it doesn't have syntax highlighting (and it would help if it did):

gc

Describe the feature / enhancement and how it helps to overcome the problem or limitation

A reference to GDScript syntax highlighter that can be used in TextEdit.syntax_highlighter

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Could be a static property on EditorSyntaxHighlighter or maybe a method on the EditorInterface to get it, or just the class itself instead of an instance. I'm not sure tbh, maybe knowing how it works internally will help deciding

If this enhancement will not be used often, can it be worked around with a few lines of script?

EditorInterface.get_script_editor().get_current_editor().get_base_editor().syntax_highlighter but it relies on some script being opened in the script editor. I thought about opening some dummy script but as far as I can tell there's no way to do it when using external editor. Even if it was possible it's way too hacky

Is there a reason why this should be core and not an add-on in the asset library?

Unavailable to addons

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants