diff options
author | Jean-Michel Bernard <jmb462@gmail.com> | 2023-03-12 17:48:37 +0100 |
---|---|---|
committer | Jean-Michel Bernard <jmb462@gmail.com> | 2023-09-11 18:36:40 +0200 |
commit | 67dce301aa79448b29dc418c9122ca08c6f96413 (patch) | |
tree | baf82b27a22abd44df75198f620e7ac5d32cb205 /doc/classes | |
parent | 221884e6bc260c38f16422081b7d4efd49a71375 (diff) | |
download | redot-engine-67dce301aa79448b29dc418c9122ca08c6f96413.tar.gz |
Add code region folding to CodeEdit
Diffstat (limited to 'doc/classes')
-rw-r--r-- | doc/classes/CodeEdit.xml | 52 | ||||
-rw-r--r-- | doc/classes/EditorSettings.xml | 3 |
2 files changed, 55 insertions, 0 deletions
diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml index 0e829127f2..d9146cf604 100644 --- a/doc/classes/CodeEdit.xml +++ b/doc/classes/CodeEdit.xml @@ -137,6 +137,15 @@ Values of [code]-1[/code] convert the entire text. </description> </method> + <method name="create_code_region"> + <return type="void" /> + <description> + Creates a new code region with the selection. At least one single line comment delimiter have to be defined (see [method add_comment_delimiter]). + A code region is a part of code that is highlighted when folded and can help organize your script. + Code region start and end tags can be customized (see [method set_code_region_tags]). + Code regions are delimited using start and end tags (respectively [code]region[/code] and [code]endregion[/code] by default) preceded by one line comment delimiter. (eg. [code]#region[/code] and [code]#endregion[/code]) + </description> + </method> <method name="do_indent"> <return type="void" /> <description> @@ -200,6 +209,18 @@ Gets the index of the current selected completion option. </description> </method> + <method name="get_code_region_end_tag" qualifiers="const"> + <return type="String" /> + <description> + Returns the code region end tag (without comment delimiter). + </description> + </method> + <method name="get_code_region_start_tag" qualifiers="const"> + <return type="String" /> + <description> + Returns the code region start tag (without comment delimiter). + </description> + </method> <method name="get_delimiter_end_key" qualifiers="const"> <return type="String" /> <param index="0" name="delimiter_index" type="int" /> @@ -326,6 +347,20 @@ Returns whether the line at the specified index is breakpointed or not. </description> </method> + <method name="is_line_code_region_end" qualifiers="const"> + <return type="bool" /> + <param index="0" name="line" type="int" /> + <description> + Returns whether the line at the specified index is a code region end. + </description> + </method> + <method name="is_line_code_region_start" qualifiers="const"> + <return type="bool" /> + <param index="0" name="line" type="int" /> + <description> + Returns whether the line at the specified index is a code region start. + </description> + </method> <method name="is_line_executing" qualifiers="const"> <return type="bool" /> <param index="0" name="line" type="int" /> @@ -382,6 +417,14 @@ Sets if the code hint should draw below the text. </description> </method> + <method name="set_code_region_tags"> + <return type="void" /> + <param index="0" name="start" type="String" default=""region"" /> + <param index="1" name="end" type="String" default=""endregion"" /> + <description> + Sets the code region start and end tags (without comment delimiter). + </description> + </method> <method name="set_line_as_bookmarked"> <return type="void" /> <param index="0" name="line" type="int" /> @@ -629,6 +672,9 @@ <theme_item name="executing_line_color" data_type="color" type="Color" default="Color(0.98, 0.89, 0.27, 1)"> [Color] of the executing icon for executing lines. </theme_item> + <theme_item name="folded_code_region_color" data_type="color" type="Color" default="Color(0.68, 0.46, 0.77, 0.2)"> + [Color] of background line highlight for folded code region. + </theme_item> <theme_item name="font_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)"> Sets the font [Color]. </theme_item> @@ -693,12 +739,18 @@ <theme_item name="can_fold" data_type="icon" type="Texture2D"> Sets a custom [Texture2D] to draw in the line folding gutter when a line can be folded. </theme_item> + <theme_item name="can_fold_code_region" data_type="icon" type="Texture2D"> + Sets a custom [Texture2D] to draw in the line folding gutter when a code region can be folded. + </theme_item> <theme_item name="executing_line" data_type="icon" type="Texture2D"> Icon to draw in the executing gutter for executing lines. </theme_item> <theme_item name="folded" data_type="icon" type="Texture2D"> Sets a custom [Texture2D] to draw in the line folding gutter when a line is folded and can be unfolded. </theme_item> + <theme_item name="folded_code_region" data_type="icon" type="Texture2D"> + Sets a custom [Texture2D] to draw in the line folding gutter when a code region is folded and can be unfolded. + </theme_item> <theme_item name="folded_eol_icon" data_type="icon" type="Texture2D"> Sets a custom [Texture2D] to draw at the end of a folded line. </theme_item> diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml index aa3bf3c535..5a0cb9fc5e 100644 --- a/doc/classes/EditorSettings.xml +++ b/doc/classes/EditorSettings.xml @@ -959,6 +959,9 @@ <member name="text_editor/theme/highlighting/executing_line_color" type="Color" setter="" getter=""> The script editor's color for the debugger's executing line icon (displayed in the gutter). </member> + <member name="text_editor/theme/highlighting/folded_code_region_color" type="Color" setter="" getter=""> + The script editor's background line highlighting color for folded code region. + </member> <member name="text_editor/theme/highlighting/function_color" type="Color" setter="" getter=""> The script editor's function call color. [b]Note:[/b] When using the GDScript syntax highlighter, this is replaced by the function definition color configured in the syntax theme for function definitions (e.g. [code]func _ready():[/code]). |