MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / EditorHelpHighlighter

Method EditorHelpHighlighter

editor/doc/editor_help.cpp:4837–4875  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4835}
4836
4837EditorHelpHighlighter::EditorHelpHighlighter() {
4838 const Color text_color = EDITOR_GET("text_editor/theme/highlighting/text_color");
4839
4840#ifdef MODULE_GDSCRIPT_ENABLED
4841 TextEdit *gdscript_text_edit = memnew(TextEdit);
4842 gdscript_text_edit->add_theme_color_override(SceneStringName(font_color), text_color);
4843
4844 Ref<GDScript> gdscript;
4845 gdscript.instantiate();
4846
4847 Ref<GDScriptSyntaxHighlighter> gdscript_highlighter;
4848 gdscript_highlighter.instantiate();
4849 gdscript_highlighter->set_text_edit(gdscript_text_edit);
4850 gdscript_highlighter->_set_edited_resource(gdscript);
4851
4852 text_edits[LANGUAGE_GDSCRIPT] = gdscript_text_edit;
4853 scripts[LANGUAGE_GDSCRIPT] = gdscript;
4854 highlighters[LANGUAGE_GDSCRIPT] = gdscript_highlighter;
4855#endif
4856
4857#ifdef MODULE_MONO_ENABLED
4858 TextEdit *csharp_text_edit = memnew(TextEdit);
4859 csharp_text_edit->add_theme_color_override(SceneStringName(font_color), text_color);
4860
4861 // See GH-89610.
4862 //Ref<CSharpScript> csharp;
4863 //csharp.instantiate();
4864
4865 Ref<EditorStandardSyntaxHighlighter> csharp_highlighter;
4866 csharp_highlighter.instantiate();
4867 csharp_highlighter->set_text_edit(csharp_text_edit);
4868 //csharp_highlighter->_set_edited_resource(csharp);
4869 csharp_highlighter->_set_script_language(CSharpLanguage::get_singleton());
4870
4871 text_edits[LANGUAGE_CSHARP] = csharp_text_edit;
4872 //scripts[LANGUAGE_CSHARP] = csharp;
4873 highlighters[LANGUAGE_CSHARP] = csharp_highlighter;
4874#endif
4875}
4876
4877EditorHelpHighlighter::~EditorHelpHighlighter() {
4878#ifdef MODULE_GDSCRIPT_ENABLED

Callers

nothing calls this directly

Calls 5

_set_edited_resourceMethod · 0.80
_set_script_languageMethod · 0.80
instantiateMethod · 0.45
set_text_editMethod · 0.45

Tested by

no test coverage detected