Replies: 1 comment 2 replies
-
Pull request opened: |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've been writing an
EditorSyntaxHighlighter
in GDScript. Two issues have occurred to me during this process that I'd like to discuss:Godot doesn't seem to have a way to associate a file extension with a syntax highlighter. It appears the only way to use my new highlighter is to manually select
Edit -> Syntax Highlighter -> My Syntax Highlighter
after opening a file. It would also be useful to have registered file extensions appear in theFile -> Open... -> Recognized File Types
dropdown and then auto-apply my highlighter when a file with a registered extension is opened.In lieu of that, there appears to be no way to hook the
EditorInterface
when a new text file is opened (The thought being to check the file extension and then add the highlighter to the active editor). There is theScriptEditor.editor_script_changed
signal, but this only works for scripts and not for other non-script file types. For non-script file types, theScript
argument is passed asnull
.I did find EditorSyntaxHighlighter._get_supported_languages but it's not clear to me what string to return here. So that might be an area for documentation improvement.
Beta Was this translation helpful? Give feedback.
All reactions