| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="CodeEdit" inherits="TextEdit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | A multiline text editor designed for editing code. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | CodeEdit is a specialized [TextEdit] designed for editing plain text code files. It has many features commonly found in code editors such as line numbers, line folding, code completion, indent management, and string/comment management. |
| 8 | [b]Note:[/b] Regardless of locale, [CodeEdit] will by default always use left-to-right text direction to correctly display source code. |
| 9 | </description> |
| 10 | <tutorials> |
| 11 | </tutorials> |
| 12 | <methods> |
| 13 | <method name="_confirm_code_completion" qualifiers="virtual"> |
| 14 | <return type="void" /> |
| 15 | <param index="0" name="replace" type="bool" /> |
| 16 | <description> |
| 17 | Override this method to define how the selected entry should be inserted. If [param replace] is [code]true[/code], any existing text should be replaced. |
| 18 | </description> |
| 19 | </method> |
| 20 | <method name="_filter_code_completion_candidates" qualifiers="virtual const"> |
| 21 | <return type="Dictionary[]" /> |
| 22 | <param index="0" name="candidates" type="Dictionary[]" /> |
| 23 | <description> |
| 24 | Override this method to define what items in [param candidates] should be displayed. |
| 25 | Both [param candidates] and the return is an [Array] of [Dictionary], see [method get_code_completion_option] for [Dictionary] content. |
| 26 | </description> |
| 27 | </method> |
| 28 | <method name="_request_code_completion" qualifiers="virtual"> |
| 29 | <return type="void" /> |
| 30 | <param index="0" name="force" type="bool" /> |
| 31 | <description> |
| 32 | Override this method to define what happens when the user requests code completion. If [param force] is [code]true[/code], any checks should be bypassed. |
| 33 | </description> |
| 34 | </method> |
| 35 | <method name="add_auto_brace_completion_pair"> |
| 36 | <return type="void" /> |
| 37 | <param index="0" name="start_key" type="String" /> |
| 38 | <param index="1" name="end_key" type="String" /> |
| 39 | <description> |
| 40 | Adds a brace pair. |
| 41 | Both the start and end keys must be symbols. Only the start key has to be unique. |
| 42 | </description> |
| 43 | </method> |
| 44 | <method name="add_code_completion_option"> |
| 45 | <return type="void" /> |
| 46 | <param index="0" name="type" type="int" enum="CodeEdit.CodeCompletionKind" /> |
| 47 | <param index="1" name="display_text" type="String" /> |
| 48 | <param index="2" name="insert_text" type="String" /> |
| 49 | <param index="3" name="text_color" type="Color" default="Color(1, 1, 1, 1)" /> |
| 50 | <param index="4" name="icon" type="Resource" default="null" /> |
| 51 | <param index="5" name="value" type="Variant" default="null" /> |
| 52 | <param index="6" name="location" type="int" default="1024" /> |
| 53 | <description> |
| 54 | Submits an item to the queue of potential candidates for the autocomplete menu. Call [method update_code_completion_options] to update the list. |
| 55 | [param location] indicates location of the option relative to the location of the code completion query. See [enum CodeEdit.CodeCompletionLocation] for how to set this value. |
| 56 | [b]Note:[/b] This list will replace all current candidates. |
| 57 | </description> |
| 58 | </method> |
| 59 | <method name="add_comment_delimiter"> |
| 60 | <return type="void" /> |
| 61 | <param index="0" name="start_key" type="String" /> |
| 62 | <param index="1" name="end_key" type="String" /> |
| 63 | <param index="2" name="line_only" type="bool" default="false" /> |
| 64 | <description> |
| 65 | Adds a comment delimiter from [param start_key] to [param end_key]. Both keys should be symbols, and [param start_key] must not be shared with other delimiters. |
| 66 | If [param line_only] is [code]true[/code] or [param end_key] is an empty [String], the region does not carry over to the next line. |
| 67 | </description> |
| 68 | </method> |
| 69 | <method name="add_string_delimiter"> |
| 70 | <return type="void" /> |
| 71 | <param index="0" name="start_key" type="String" /> |
| 72 | <param index="1" name="end_key" type="String" /> |
| 73 | <param index="2" name="line_only" type="bool" default="false" /> |
| 74 | <description> |
| 75 | Defines a string delimiter from [param start_key] to [param end_key]. Both keys should be symbols, and [param start_key] must not be shared with other delimiters. |
| 76 | If [param line_only] is [code]true[/code] or [param end_key] is an empty [String], the region does not carry over to the next line. |
| 77 | </description> |
| 78 | </method> |
| 79 | <method name="can_fold_line" qualifiers="const"> |
| 80 | <return type="bool" /> |
| 81 | <param index="0" name="line" type="int" /> |
| 82 | <description> |
| 83 | Returns [code]true[/code] if the given line is foldable. A line is foldable if it is the start of a valid code region (see [method get_code_region_start_tag]), if it is the start of a comment or string block, or if the next non-empty line is more indented (see [method TextEdit.get_indent_level]). |
| 84 | </description> |
| 85 | </method> |
| 86 | <method name="cancel_code_completion"> |
| 87 | <return type="void" /> |
| 88 | <description> |
| 89 | Cancels the autocomplete menu. |
| 90 | </description> |
| 91 | </method> |
| 92 | <method name="clear_bookmarked_lines"> |
| 93 | <return type="void" /> |
| 94 | <description> |
| 95 | Clears all bookmarked lines. |
| 96 | </description> |
| 97 | </method> |
| 98 | <method name="clear_breakpointed_lines"> |
| 99 | <return type="void" /> |
| 100 | <description> |
| 101 | Clears all breakpointed lines. |
| 102 | </description> |
| 103 | </method> |
| 104 | <method name="clear_comment_delimiters"> |
| 105 | <return type="void" /> |
| 106 | <description> |
| 107 | Removes all comment delimiters. |
| 108 | </description> |
| 109 | </method> |
| 110 | <method name="clear_executing_lines"> |
| 111 | <return type="void" /> |
| 112 | <description> |
| 113 | Clears all executed lines. |
| 114 | </description> |
| 115 | </method> |
| 116 | <method name="clear_string_delimiters"> |
| 117 | <return type="void" /> |
| 118 | <description> |
| 119 | Removes all string delimiters. |
| 120 | </description> |
| 121 | </method> |
| 122 | <method name="confirm_code_completion"> |
| 123 | <return type="void" /> |
| 124 | <param index="0" name="replace" type="bool" default="false" /> |
| 125 | <description> |
| 126 | Inserts the selected entry into the text. If [param replace] is [code]true[/code], any existing text is replaced rather than merged. |
| 127 | </description> |
| 128 | </method> |
| 129 | <method name="convert_indent"> |
| 130 | <return type="void" /> |
| 131 | <param index="0" name="from_line" type="int" default="-1" /> |
| 132 | <param index="1" name="to_line" type="int" default="-1" /> |
| 133 | <description> |
| 134 | Converts the indents of lines between [param from_line] and [param to_line] to tabs or spaces as set by [member indent_use_spaces]. |
| 135 | Values of [code]-1[/code] convert the entire text. |
| 136 | </description> |
| 137 | </method> |
| 138 | <method name="create_code_region"> |
| 139 | <return type="void" /> |
| 140 | <description> |
| 141 | Creates a new code region with the selection. At least one single line comment delimiter have to be defined (see [method add_comment_delimiter]). |
| 142 | A code region is a part of code that is highlighted when folded and can help organize your script. |
| 143 | Code region start and end tags can be customized (see [method set_code_region_tags]). |
| 144 | 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]) |
| 145 | </description> |
| 146 | </method> |
| 147 | <method name="delete_lines"> |
| 148 | <return type="void" /> |
| 149 | <description> |
| 150 | Deletes all lines that are selected or have a caret on them. |
| 151 | </description> |
| 152 | </method> |
| 153 | <method name="do_indent"> |
| 154 | <return type="void" /> |
| 155 | <description> |
| 156 | If there is no selection, indentation is inserted at the caret. Otherwise, the selected lines are indented like [method indent_lines]. Equivalent to the [member ProjectSettings.input/ui_text_indent] action. The indentation characters used depend on [member indent_use_spaces] and [member indent_size]. |
| 157 | </description> |
| 158 | </method> |
| 159 | <method name="duplicate_lines"> |
| 160 | <return type="void" /> |
| 161 | <description> |
| 162 | Duplicates all lines currently selected with any caret. Duplicates the entire line beneath the current one no matter where the caret is within the line. |
| 163 | </description> |
| 164 | </method> |
| 165 | <method name="duplicate_selection"> |
| 166 | <return type="void" /> |
| 167 | <description> |
| 168 | Duplicates all selected text and duplicates all lines with a caret on them. |
| 169 | </description> |
| 170 | </method> |
| 171 | <method name="fold_all_lines"> |
| 172 | <return type="void" /> |
| 173 | <description> |
| 174 | Folds all lines that are possible to be folded (see [method can_fold_line]). |
| 175 | </description> |
| 176 | </method> |
| 177 | <method name="fold_line"> |
| 178 | <return type="void" /> |
| 179 | <param index="0" name="line" type="int" /> |
| 180 | <description> |
| 181 | Folds the given line, if possible (see [method can_fold_line]). |
| 182 | </description> |
| 183 | </method> |
| 184 | <method name="get_auto_brace_completion_close_key" qualifiers="const"> |
| 185 | <return type="String" /> |
| 186 | <param index="0" name="open_key" type="String" /> |
| 187 | <description> |
| 188 | Gets the matching auto brace close key for [param open_key]. |
| 189 | </description> |
| 190 | </method> |
| 191 | <method name="get_bookmarked_lines" qualifiers="const"> |
| 192 | <return type="PackedInt32Array" /> |
| 193 | <description> |
| 194 | Gets all bookmarked lines. |
| 195 | </description> |
| 196 | </method> |
| 197 | <method name="get_breakpointed_lines" qualifiers="const"> |
| 198 | <return type="PackedInt32Array" /> |
| 199 | <description> |
| 200 | Gets all breakpointed lines. |
| 201 | </description> |
| 202 | </method> |
| 203 | <method name="get_code_completion_option" qualifiers="const"> |
| 204 | <return type="Dictionary" /> |
| 205 | <param index="0" name="index" type="int" /> |
| 206 | <description> |
| 207 | Gets the completion option at [param index]. The return [Dictionary] has the following key-values: |
| 208 | [code]kind[/code]: [enum CodeCompletionKind] |
| 209 | [code]display_text[/code]: Text that is shown on the autocomplete menu. |
| 210 | [code]insert_text[/code]: Text that is to be inserted when this item is selected. |
| 211 | [code]font_color[/code]: Color of the text on the autocomplete menu. |
| 212 | [code]icon[/code]: Icon to draw on the autocomplete menu. |
| 213 | [code]default_value[/code]: Value of the symbol. |
| 214 | </description> |
| 215 | </method> |
| 216 | <method name="get_code_completion_options" qualifiers="const"> |
| 217 | <return type="Dictionary[]" /> |
| 218 | <description> |
| 219 | Gets all completion options, see [method get_code_completion_option] for return content. |
| 220 | </description> |
| 221 | </method> |
| 222 | <method name="get_code_completion_selected_index" qualifiers="const"> |
| 223 | <return type="int" /> |
| 224 | <description> |
| 225 | Gets the index of the current selected completion option. |
| 226 | </description> |
| 227 | </method> |
| 228 | <method name="get_code_region_end_tag" qualifiers="const"> |
| 229 | <return type="String" /> |
| 230 | <description> |
| 231 | Returns the code region end tag (without comment delimiter). |
| 232 | </description> |
| 233 | </method> |
| 234 | <method name="get_code_region_start_tag" qualifiers="const"> |
| 235 | <return type="String" /> |
| 236 | <description> |
| 237 | Returns the code region start tag (without comment delimiter). |
| 238 | </description> |
| 239 | </method> |
| 240 | <method name="get_delimiter_end_key" qualifiers="const"> |
| 241 | <return type="String" /> |
| 242 | <param index="0" name="delimiter_index" type="int" /> |
| 243 | <description> |
| 244 | Gets the end key for a string or comment region index. |
| 245 | </description> |
| 246 | </method> |
| 247 | <method name="get_delimiter_end_position" qualifiers="const"> |
| 248 | <return type="Vector2" /> |
| 249 | <param index="0" name="line" type="int" /> |
| 250 | <param index="1" name="column" type="int" /> |
| 251 | <description> |
| 252 | If [param line] [param column] is in a string or comment, returns the end position of the region. If not or no end could be found, both [Vector2] values will be [code]-1[/code]. |
| 253 | </description> |
| 254 | </method> |
| 255 | <method name="get_delimiter_start_key" qualifiers="const"> |
| 256 | <return type="String" /> |
| 257 | <param index="0" name="delimiter_index" type="int" /> |
| 258 | <description> |
| 259 | Gets the start key for a string or comment region index. |
| 260 | </description> |
| 261 | </method> |
| 262 | <method name="get_delimiter_start_position" qualifiers="const"> |
| 263 | <return type="Vector2" /> |
| 264 | <param index="0" name="line" type="int" /> |
| 265 | <param index="1" name="column" type="int" /> |
| 266 | <description> |
| 267 | If [param line] [param column] is in a string or comment, returns the start position of the region. If not or no start could be found, both [Vector2] values will be [code]-1[/code]. |
| 268 | </description> |
| 269 | </method> |
| 270 | <method name="get_executing_lines" qualifiers="const"> |
| 271 | <return type="PackedInt32Array" /> |
| 272 | <description> |
| 273 | Gets all executing lines. |
| 274 | </description> |
| 275 | </method> |
| 276 | <method name="get_folded_lines" qualifiers="const"> |
| 277 | <return type="int[]" /> |
| 278 | <description> |
| 279 | Returns all lines that are currently folded. |
| 280 | </description> |
| 281 | </method> |
| 282 | <method name="get_text_for_code_completion" qualifiers="const"> |
| 283 | <return type="String" /> |
| 284 | <description> |
| 285 | Returns the full text with char [code]0xFFFF[/code] at the caret location. |
| 286 | </description> |
| 287 | </method> |
| 288 | <method name="get_text_for_symbol_lookup" qualifiers="const"> |
| 289 | <return type="String" /> |
| 290 | <description> |
| 291 | Returns the full text with char [code]0xFFFF[/code] at the cursor location. |
| 292 | </description> |
| 293 | </method> |
| 294 | <method name="get_text_with_cursor_char" qualifiers="const"> |
| 295 | <return type="String" /> |
| 296 | <param index="0" name="line" type="int" /> |
| 297 | <param index="1" name="column" type="int" /> |
| 298 | <description> |
| 299 | Returns the full text with char [code]0xFFFF[/code] at the specified location. |
| 300 | </description> |
| 301 | </method> |
| 302 | <method name="has_auto_brace_completion_close_key" qualifiers="const"> |
| 303 | <return type="bool" /> |
| 304 | <param index="0" name="close_key" type="String" /> |
| 305 | <description> |
| 306 | Returns [code]true[/code] if close key [param close_key] exists. |
| 307 | </description> |
| 308 | </method> |
| 309 | <method name="has_auto_brace_completion_open_key" qualifiers="const"> |
| 310 | <return type="bool" /> |
| 311 | <param index="0" name="open_key" type="String" /> |
| 312 | <description> |
| 313 | Returns [code]true[/code] if open key [param open_key] exists. |
| 314 | </description> |
| 315 | </method> |
| 316 | <method name="has_comment_delimiter" qualifiers="const"> |
| 317 | <return type="bool" /> |
| 318 | <param index="0" name="start_key" type="String" /> |
| 319 | <description> |
| 320 | Returns [code]true[/code] if comment [param start_key] exists. |
| 321 | </description> |
| 322 | </method> |
| 323 | <method name="has_string_delimiter" qualifiers="const"> |
| 324 | <return type="bool" /> |
| 325 | <param index="0" name="start_key" type="String" /> |
| 326 | <description> |
| 327 | Returns [code]true[/code] if string [param start_key] exists. |
| 328 | </description> |
| 329 | </method> |
| 330 | <method name="indent_lines"> |
| 331 | <return type="void" /> |
| 332 | <description> |
| 333 | Indents all lines that are selected or have a caret on them. Uses spaces or a tab depending on [member indent_use_spaces]. See [method unindent_lines]. |
| 334 | </description> |
| 335 | </method> |
| 336 | <method name="is_in_comment" qualifiers="const"> |
| 337 | <return type="int" /> |
| 338 | <param index="0" name="line" type="int" /> |
| 339 | <param index="1" name="column" type="int" default="-1" /> |
| 340 | <description> |
| 341 | Returns delimiter index if [param line] [param column] is in a comment. If [param column] is not provided, will return delimiter index if the entire [param line] is a comment. Otherwise [code]-1[/code]. |
| 342 | </description> |
| 343 | </method> |
| 344 | <method name="is_in_string" qualifiers="const"> |
| 345 | <return type="int" /> |
| 346 | <param index="0" name="line" type="int" /> |
| 347 | <param index="1" name="column" type="int" default="-1" /> |
| 348 | <description> |
| 349 | Returns the delimiter index if [param line] [param column] is in a string. If [param column] is not provided, will return the delimiter index if the entire [param line] is a string. Otherwise [code]-1[/code]. |
| 350 | </description> |
| 351 | </method> |
| 352 | <method name="is_line_bookmarked" qualifiers="const"> |
| 353 | <return type="bool" /> |
| 354 | <param index="0" name="line" type="int" /> |
| 355 | <description> |
| 356 | Returns [code]true[/code] if the given line is bookmarked. See [method set_line_as_bookmarked]. |
| 357 | </description> |
| 358 | </method> |
| 359 | <method name="is_line_breakpointed" qualifiers="const"> |
| 360 | <return type="bool" /> |
| 361 | <param index="0" name="line" type="int" /> |
| 362 | <description> |
| 363 | Returns [code]true[/code] if the given line is breakpointed. See [method set_line_as_breakpoint]. |
| 364 | </description> |
| 365 | </method> |
| 366 | <method name="is_line_code_region_end" qualifiers="const"> |
| 367 | <return type="bool" /> |
| 368 | <param index="0" name="line" type="int" /> |
| 369 | <description> |
| 370 | Returns [code]true[/code] if the given line is a code region end. See [method set_code_region_tags]. |
| 371 | </description> |
| 372 | </method> |
| 373 | <method name="is_line_code_region_start" qualifiers="const"> |
| 374 | <return type="bool" /> |
| 375 | <param index="0" name="line" type="int" /> |
| 376 | <description> |
| 377 | Returns [code]true[/code] if the given line is a code region start. See [method set_code_region_tags]. |
| 378 | </description> |
| 379 | </method> |
| 380 | <method name="is_line_executing" qualifiers="const"> |
| 381 | <return type="bool" /> |
| 382 | <param index="0" name="line" type="int" /> |
| 383 | <description> |
| 384 | Returns [code]true[/code] if the given line is marked as executing. See [method set_line_as_executing]. |
| 385 | </description> |
| 386 | </method> |
| 387 | <method name="is_line_folded" qualifiers="const"> |
| 388 | <return type="bool" /> |
| 389 | <param index="0" name="line" type="int" /> |
| 390 | <description> |
| 391 | Returns [code]true[/code] if the given line is folded. See [method fold_line]. |
| 392 | </description> |
| 393 | </method> |
| 394 | <method name="move_lines_down"> |
| 395 | <return type="void" /> |
| 396 | <description> |
| 397 | Moves all lines down that are selected or have a caret on them. |
| 398 | </description> |
| 399 | </method> |
| 400 | <method name="move_lines_up"> |
| 401 | <return type="void" /> |
| 402 | <description> |
| 403 | Moves all lines up that are selected or have a caret on them. |
| 404 | </description> |
| 405 | </method> |
| 406 | <method name="remove_comment_delimiter"> |
| 407 | <return type="void" /> |
| 408 | <param index="0" name="start_key" type="String" /> |
| 409 | <description> |
| 410 | Removes the comment delimiter with [param start_key]. |
| 411 | </description> |
| 412 | </method> |
| 413 | <method name="remove_string_delimiter"> |
| 414 | <return type="void" /> |
| 415 | <param index="0" name="start_key" type="String" /> |
| 416 | <description> |
| 417 | Removes the string delimiter with [param start_key]. |
| 418 | </description> |
| 419 | </method> |
| 420 | <method name="request_code_completion"> |
| 421 | <return type="void" /> |
| 422 | <param index="0" name="force" type="bool" default="false" /> |
| 423 | <description> |
| 424 | Emits [signal code_completion_requested], if [param force] is [code]true[/code] will bypass all checks. Otherwise will check that the caret is in a word or in front of a prefix. Will ignore the request if all current options are of type file path, node path, or signal. |
| 425 | </description> |
| 426 | </method> |
| 427 | <method name="set_code_completion_selected_index"> |
| 428 | <return type="void" /> |
| 429 | <param index="0" name="index" type="int" /> |
| 430 | <description> |
| 431 | Sets the current selected completion option. |
| 432 | </description> |
| 433 | </method> |
| 434 | <method name="set_code_hint"> |
| 435 | <return type="void" /> |
| 436 | <param index="0" name="code_hint" type="String" /> |
| 437 | <description> |
| 438 | Sets the code hint text. Pass an empty string to clear. |
| 439 | </description> |
| 440 | </method> |
| 441 | <method name="set_code_hint_draw_below"> |
| 442 | <return type="void" /> |
| 443 | <param index="0" name="draw_below" type="bool" /> |
| 444 | <description> |
| 445 | If [code]true[/code], the code hint will draw below the main caret. If [code]false[/code], the code hint will draw above the main caret. See [method set_code_hint]. |
| 446 | </description> |
| 447 | </method> |
| 448 | <method name="set_code_region_tags"> |
| 449 | <return type="void" /> |
| 450 | <param index="0" name="start" type="String" default=""region"" /> |
| 451 | <param index="1" name="end" type="String" default=""endregion"" /> |
| 452 | <description> |
| 453 | Sets the code region start and end tags (without comment delimiter). |
| 454 | </description> |
| 455 | </method> |
| 456 | <method name="set_line_as_bookmarked"> |
| 457 | <return type="void" /> |
| 458 | <param index="0" name="line" type="int" /> |
| 459 | <param index="1" name="bookmarked" type="bool" /> |
| 460 | <description> |
| 461 | Sets the given line as bookmarked. If [code]true[/code] and [member gutters_draw_bookmarks] is [code]true[/code], draws the [theme_item bookmark] icon in the gutter for this line. See [method get_bookmarked_lines] and [method is_line_bookmarked]. |
| 462 | </description> |
| 463 | </method> |
| 464 | <method name="set_line_as_breakpoint"> |
| 465 | <return type="void" /> |
| 466 | <param index="0" name="line" type="int" /> |
| 467 | <param index="1" name="breakpointed" type="bool" /> |
| 468 | <description> |
| 469 | Sets the given line as a breakpoint. If [code]true[/code] and [member gutters_draw_breakpoints_gutter] is [code]true[/code], draws the [theme_item breakpoint] icon in the gutter for this line. See [method get_breakpointed_lines] and [method is_line_breakpointed]. |
| 470 | </description> |
| 471 | </method> |
| 472 | <method name="set_line_as_executing"> |
| 473 | <return type="void" /> |
| 474 | <param index="0" name="line" type="int" /> |
| 475 | <param index="1" name="executing" type="bool" /> |
| 476 | <description> |
| 477 | Sets the given line as executing. If [code]true[/code] and [member gutters_draw_executing_lines] is [code]true[/code], draws the [theme_item executing_line] icon in the gutter for this line. See [method get_executing_lines] and [method is_line_executing]. |
| 478 | </description> |
| 479 | </method> |
| 480 | <method name="set_symbol_lookup_word_as_valid"> |
| 481 | <return type="void" /> |
| 482 | <param index="0" name="valid" type="bool" /> |
| 483 | <description> |
| 484 | Sets the symbol emitted by [signal symbol_validate] as a valid lookup. |
| 485 | </description> |
| 486 | </method> |
| 487 | <method name="toggle_foldable_line"> |
| 488 | <return type="void" /> |
| 489 | <param index="0" name="line" type="int" /> |
| 490 | <description> |
| 491 | Toggle the folding of the code block at the given line. |
| 492 | </description> |
| 493 | </method> |
| 494 | <method name="toggle_foldable_lines_at_carets"> |
| 495 | <return type="void" /> |
| 496 | <description> |
| 497 | Toggle the folding of the code block on all lines with a caret on them. |
| 498 | </description> |
| 499 | </method> |
| 500 | <method name="unfold_all_lines"> |
| 501 | <return type="void" /> |
| 502 | <description> |
| 503 | Unfolds all lines that are folded. |
| 504 | </description> |
| 505 | </method> |
| 506 | <method name="unfold_line"> |
| 507 | <return type="void" /> |
| 508 | <param index="0" name="line" type="int" /> |
| 509 | <description> |
| 510 | Unfolds the given line if it is folded or if it is hidden under a folded line. |
| 511 | </description> |
| 512 | </method> |
| 513 | <method name="unindent_lines"> |
| 514 | <return type="void" /> |
| 515 | <description> |
| 516 | Unindents all lines that are selected or have a caret on them. Uses spaces or a tab depending on [member indent_use_spaces]. Equivalent to the [member ProjectSettings.input/ui_text_dedent] action. See [method indent_lines]. |
| 517 | </description> |
| 518 | </method> |
| 519 | <method name="update_code_completion_options"> |
| 520 | <return type="void" /> |
| 521 | <param index="0" name="force" type="bool" /> |
| 522 | <description> |
| 523 | Submits all completion options added with [method add_code_completion_option]. Will try to force the autocomplete menu to popup, if [param force] is [code]true[/code]. |
| 524 | [b]Note:[/b] This will replace all current candidates. |
| 525 | </description> |
| 526 | </method> |
| 527 | </methods> |
| 528 | <members> |
| 529 | <member name="auto_brace_completion_enabled" type="bool" setter="set_auto_brace_completion_enabled" getter="is_auto_brace_completion_enabled" default="false"> |
| 530 | If [code]true[/code], uses [member auto_brace_completion_pairs] to automatically insert the closing brace when the opening brace is inserted by typing or autocompletion. Also automatically removes the closing brace when using backspace on the opening brace. |
| 531 | </member> |
| 532 | <member name="auto_brace_completion_highlight_matching" type="bool" setter="set_highlight_matching_braces_enabled" getter="is_highlight_matching_braces_enabled" default="false"> |
| 533 | If [code]true[/code], highlights brace pairs when the caret is on either one, using [member auto_brace_completion_pairs]. If matching, the pairs will be underlined. If a brace is unmatched, it is colored with [theme_item brace_mismatch_color]. |
| 534 | </member> |
| 535 | <member name="auto_brace_completion_pairs" type="Dictionary" setter="set_auto_brace_completion_pairs" getter="get_auto_brace_completion_pairs" default="{ "\"": "\"", "'": "'", "(": ")", "[": "]", "{": "}" }"> |
| 536 | Sets the brace pairs to be autocompleted. For each entry in the dictionary, the key is the opening brace and the value is the closing brace that matches it. A brace is a [String] made of symbols. See [member auto_brace_completion_enabled] and [member auto_brace_completion_highlight_matching]. |
| 537 | </member> |
| 538 | <member name="code_completion_enabled" type="bool" setter="set_code_completion_enabled" getter="is_code_completion_enabled" default="false"> |
| 539 | If [code]true[/code], the [member ProjectSettings.input/ui_text_completion_query] action requests code completion. To handle it, see [method _request_code_completion] or [signal code_completion_requested]. |
| 540 | </member> |
| 541 | <member name="code_completion_prefixes" type="String[]" setter="set_code_completion_prefixes" getter="get_code_completion_prefixes" default="[]"> |
| 542 | Sets prefixes that will trigger code completion. |
| 543 | </member> |
| 544 | <member name="delimiter_comments" type="String[]" setter="set_comment_delimiters" getter="get_comment_delimiters" default="[]"> |
| 545 | Sets the comment delimiters. All existing comment delimiters will be removed. |
| 546 | </member> |
| 547 | <member name="delimiter_strings" type="String[]" setter="set_string_delimiters" getter="get_string_delimiters" default="["' '", "\" \""]"> |
| 548 | Sets the string delimiters. All existing string delimiters will be removed. |
| 549 | </member> |
| 550 | <member name="gutters_draw_bookmarks" type="bool" setter="set_draw_bookmarks_gutter" getter="is_drawing_bookmarks_gutter" default="false"> |
| 551 | If [code]true[/code], bookmarks are drawn in the gutter. This gutter is shared with breakpoints and executing lines. See [method set_line_as_bookmarked]. |
| 552 | </member> |
| 553 | <member name="gutters_draw_breakpoints_gutter" type="bool" setter="set_draw_breakpoints_gutter" getter="is_drawing_breakpoints_gutter" default="false"> |
| 554 | If [code]true[/code], breakpoints are drawn in the gutter. This gutter is shared with bookmarks and executing lines. Clicking the gutter will toggle the breakpoint for the line, see [method set_line_as_breakpoint]. |
| 555 | </member> |
| 556 | <member name="gutters_draw_executing_lines" type="bool" setter="set_draw_executing_lines_gutter" getter="is_drawing_executing_lines_gutter" default="false"> |
| 557 | If [code]true[/code], executing lines are marked in the gutter. This gutter is shared with breakpoints and bookmarks. See [method set_line_as_executing]. |
| 558 | </member> |
| 559 | <member name="gutters_draw_fold_gutter" type="bool" setter="set_draw_fold_gutter" getter="is_drawing_fold_gutter" default="false"> |
| 560 | If [code]true[/code], the fold gutter is drawn. In this gutter, the [theme_item can_fold_code_region] icon is drawn for each foldable line (see [method can_fold_line]) and the [theme_item folded_code_region] icon is drawn for each folded line (see [method is_line_folded]). These icons can be clicked to toggle the fold state, see [method toggle_foldable_line]. [member line_folding] must be [code]true[/code] to show icons. |
| 561 | </member> |
| 562 | <member name="gutters_draw_line_numbers" type="bool" setter="set_draw_line_numbers" getter="is_draw_line_numbers_enabled" default="false"> |
| 563 | If [code]true[/code], the line number gutter is drawn. Line numbers start at [code]1[/code] and are incremented for each line of text. Clicking and dragging in the line number gutter will select entire lines of text. |
| 564 | </member> |
| 565 | <member name="gutters_line_numbers_min_digits" type="int" setter="set_line_numbers_min_digits" getter="get_line_numbers_min_digits" default="3"> |
| 566 | The minimum width in digits reserved for the line number gutter. |
| 567 | </member> |
| 568 | <member name="gutters_zero_pad_line_numbers" type="bool" setter="set_line_numbers_zero_padded" getter="is_line_numbers_zero_padded" default="false"> |
| 569 | If [code]true[/code], line numbers drawn in the gutter are zero padded based on the total line count. Requires [member gutters_draw_line_numbers] to be set to [code]true[/code]. |
| 570 | </member> |
| 571 | <member name="indent_automatic" type="bool" setter="set_auto_indent_enabled" getter="is_auto_indent_enabled" default="false"> |
| 572 | If [code]true[/code], an extra indent is automatically inserted when a new line is added and a prefix in [member indent_automatic_prefixes] is found. If a brace pair opening key is found, the matching closing brace will be moved to another new line (see [member auto_brace_completion_pairs]). |
| 573 | </member> |
| 574 | <member name="indent_automatic_prefixes" type="String[]" setter="set_auto_indent_prefixes" getter="get_auto_indent_prefixes" default="[":", "{", "[", "("]"> |
| 575 | Prefixes to trigger an automatic indent. Used when [member indent_automatic] is set to [code]true[/code]. |
| 576 | </member> |
| 577 | <member name="indent_size" type="int" setter="set_indent_size" getter="get_indent_size" default="4"> |
| 578 | Size of the tabulation indent (one [kbd]Tab[/kbd] press) in characters. If [member indent_use_spaces] is enabled the number of spaces to use. |
| 579 | </member> |
| 580 | <member name="indent_use_spaces" type="bool" setter="set_indent_using_spaces" getter="is_indent_using_spaces" default="false"> |
| 581 | Use spaces instead of tabs for indentation. |
| 582 | </member> |
| 583 | <member name="layout_direction" type="int" setter="set_layout_direction" getter="get_layout_direction" overrides="Control" enum="Control.LayoutDirection" default="2" /> |
| 584 | <member name="line_folding" type="bool" setter="set_line_folding_enabled" getter="is_line_folding_enabled" default="false"> |
| 585 | If [code]true[/code], lines can be folded. Otherwise, line folding methods like [method fold_line] will not work and [method can_fold_line] will always return [code]false[/code]. See [member gutters_draw_fold_gutter]. |
| 586 | </member> |
| 587 | <member name="line_length_guidelines" type="int[]" setter="set_line_length_guidelines" getter="get_line_length_guidelines" default="[]"> |
| 588 | Draws vertical lines at the provided columns. The first entry is considered a main hard guideline and is drawn more prominently. |
| 589 | </member> |
| 590 | <member name="symbol_lookup_on_click" type="bool" setter="set_symbol_lookup_on_click_enabled" getter="is_symbol_lookup_on_click_enabled" default="false"> |
| 591 | Set when a validated word from [signal symbol_validate] is clicked, the [signal symbol_lookup] should be emitted. |
| 592 | </member> |
| 593 | <member name="symbol_tooltip_on_hover" type="bool" setter="set_symbol_tooltip_on_hover_enabled" getter="is_symbol_tooltip_on_hover_enabled" default="false"> |
| 594 | If [code]true[/code], the [signal symbol_hovered] signal is emitted when hovering over a word. |
| 595 | </member> |
| 596 | <member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" overrides="TextEdit" enum="Control.TextDirection" default="1" /> |
| 597 | </members> |
| 598 | <signals> |
| 599 | <signal name="breakpoint_toggled"> |
| 600 | <param index="0" name="line" type="int" /> |
| 601 | <description> |
| 602 | Emitted when a breakpoint is added or removed from a line. If the line is removed via backspace, a signal is emitted at the old line. |
| 603 | </description> |
| 604 | </signal> |
| 605 | <signal name="code_completion_requested"> |
| 606 | <description> |
| 607 | Emitted when the user requests code completion. This signal will not be sent if [method _request_code_completion] is overridden or [member code_completion_enabled] is [code]false[/code]. |
| 608 | </description> |
| 609 | </signal> |
| 610 | <signal name="symbol_hovered"> |
| 611 | <param index="0" name="symbol" type="String" /> |
| 612 | <param index="1" name="line" type="int" /> |
| 613 | <param index="2" name="column" type="int" /> |
| 614 | <description> |
| 615 | Emitted when the user hovers over a symbol. Unlike [signal Control.mouse_entered], this signal is not emitted immediately, but when the cursor is over the symbol for [member ProjectSettings.gui/timers/tooltip_delay_sec] seconds. |
| 616 | [b]Note:[/b] [member symbol_tooltip_on_hover] must be [code]true[/code] for this signal to be emitted. |
| 617 | </description> |
| 618 | </signal> |
| 619 | <signal name="symbol_lookup"> |
| 620 | <param index="0" name="symbol" type="String" /> |
| 621 | <param index="1" name="line" type="int" /> |
| 622 | <param index="2" name="column" type="int" /> |
| 623 | <description> |
| 624 | Emitted when the user has clicked on a valid symbol. |
| 625 | </description> |
| 626 | </signal> |
| 627 | <signal name="symbol_validate"> |
| 628 | <param index="0" name="symbol" type="String" /> |
| 629 | <description> |
| 630 | Emitted when the user hovers over a symbol. The symbol should be validated and responded to, by calling [method set_symbol_lookup_word_as_valid]. |
| 631 | [b]Note:[/b] [member symbol_lookup_on_click] must be [code]true[/code] for this signal to be emitted. |
| 632 | </description> |
| 633 | </signal> |
| 634 | </signals> |
| 635 | <constants> |
| 636 | <constant name="KIND_CLASS" value="0" enum="CodeCompletionKind"> |
| 637 | Marks the option as a class. |
| 638 | </constant> |
| 639 | <constant name="KIND_FUNCTION" value="1" enum="CodeCompletionKind"> |
| 640 | Marks the option as a function. |
| 641 | </constant> |
| 642 | <constant name="KIND_SIGNAL" value="2" enum="CodeCompletionKind"> |
| 643 | Marks the option as a Godot signal. |
| 644 | </constant> |
| 645 | <constant name="KIND_VARIABLE" value="3" enum="CodeCompletionKind"> |
| 646 | Marks the option as a variable. |
| 647 | </constant> |
| 648 | <constant name="KIND_MEMBER" value="4" enum="CodeCompletionKind"> |
| 649 | Marks the option as a member. |
| 650 | </constant> |
| 651 | <constant name="KIND_ENUM" value="5" enum="CodeCompletionKind"> |
| 652 | Marks the option as an enum entry. |
| 653 | </constant> |
| 654 | <constant name="KIND_CONSTANT" value="6" enum="CodeCompletionKind"> |
| 655 | Marks the option as a constant. |
| 656 | </constant> |
| 657 | <constant name="KIND_NODE_PATH" value="7" enum="CodeCompletionKind"> |
| 658 | Marks the option as a Godot node path. |
| 659 | </constant> |
| 660 | <constant name="KIND_FILE_PATH" value="8" enum="CodeCompletionKind"> |
| 661 | Marks the option as a file path. |
| 662 | </constant> |
| 663 | <constant name="KIND_PLAIN_TEXT" value="9" enum="CodeCompletionKind"> |
| 664 | Marks the option as unclassified or plain text. |
| 665 | </constant> |
| 666 | <constant name="LOCATION_LOCAL" value="0" enum="CodeCompletionLocation"> |
| 667 | The option is local to the location of the code completion query - e.g. a local variable. Subsequent value of location represent options from the outer class, the exact value represent how far they are (in terms of inner classes). |
| 668 | </constant> |
| 669 | <constant name="LOCATION_PARENT_MASK" value="256" enum="CodeCompletionLocation"> |
| 670 | The option is from the containing class or a parent class, relative to the location of the code completion query. Perform a bitwise OR with the class depth (e.g. [code]0[/code] for the local class, [code]1[/code] for the parent, [code]2[/code] for the grandparent, etc.) to store the depth of an option in the class or a parent class. |
| 671 | </constant> |
| 672 | <constant name="LOCATION_OTHER_USER_CODE" value="512" enum="CodeCompletionLocation"> |
| 673 | The option is from user code which is not local and not in a derived class (e.g. Autoload Singletons). |
| 674 | </constant> |
| 675 | <constant name="LOCATION_OTHER" value="1024" enum="CodeCompletionLocation"> |
| 676 | The option is from other engine code, not covered by the other enum constants - e.g. built-in classes. |
| 677 | </constant> |
| 678 | </constants> |
| 679 | <theme_items> |
| 680 | <theme_item name="bookmark_color" data_type="color" type="Color" default="Color(0.5, 0.64, 1, 0.8)"> |
| 681 | [Color] of the bookmark icon for bookmarked lines. |
| 682 | </theme_item> |
| 683 | <theme_item name="brace_mismatch_color" data_type="color" type="Color" default="Color(1, 0.2, 0.2, 1)"> |
| 684 | [Color] of the text to highlight mismatched braces. |
| 685 | </theme_item> |
| 686 | <theme_item name="breakpoint_color" data_type="color" type="Color" default="Color(0.9, 0.29, 0.3, 1)"> |
| 687 | [Color] of the breakpoint icon for bookmarked lines. |
| 688 | </theme_item> |
| 689 | <theme_item name="code_folding_color" data_type="color" type="Color" default="Color(0.8, 0.8, 0.8, 0.8)"> |
| 690 | [Color] for all icons related to line folding. |
| 691 | </theme_item> |
| 692 | <theme_item name="completion_background_color" data_type="color" type="Color" default="Color(0.17, 0.16, 0.2, 1)"> |
| 693 | Sets the background [Color] for the code completion popup. |
| 694 | </theme_item> |
| 695 | <theme_item name="completion_existing_color" data_type="color" type="Color" default="Color(0.87, 0.87, 0.87, 0.13)"> |
| 696 | Background highlight [Color] for matching text in code completion options. |
| 697 | </theme_item> |
| 698 | <theme_item name="completion_scroll_color" data_type="color" type="Color" default="Color(1, 1, 1, 0.29)"> |
| 699 | [Color] of the scrollbar in the code completion popup. |
| 700 | </theme_item> |
| 701 | <theme_item name="completion_scroll_hovered_color" data_type="color" type="Color" default="Color(1, 1, 1, 0.4)"> |
| 702 | [Color] of the scrollbar in the code completion popup when hovered. |
| 703 | </theme_item> |
| 704 | <theme_item name="completion_selected_color" data_type="color" type="Color" default="Color(0.26, 0.26, 0.27, 1)"> |
| 705 | Background highlight [Color] for the current selected option item in the code completion popup. |
| 706 | </theme_item> |
| 707 | <theme_item name="executing_line_color" data_type="color" type="Color" default="Color(0.98, 0.89, 0.27, 1)"> |
| 708 | [Color] of the executing icon for executing lines. |
| 709 | </theme_item> |
| 710 | <theme_item name="folded_code_region_color" data_type="color" type="Color" default="Color(0.68, 0.46, 0.77, 0.2)"> |
| 711 | [Color] of background line highlight for folded code region. |
| 712 | </theme_item> |
| 713 | <theme_item name="line_length_guideline_color" data_type="color" type="Color" default="Color(0.3, 0.5, 0.8, 0.1)"> |
| 714 | [Color] of the main line length guideline, secondary guidelines will have 50% alpha applied. |
| 715 | </theme_item> |
| 716 | <theme_item name="line_number_color" data_type="color" type="Color" default="Color(0.67, 0.67, 0.67, 0.4)"> |
| 717 | Sets the [Color] of line numbers. |
| 718 | </theme_item> |
| 719 | <theme_item name="completion_lines" data_type="constant" type="int" default="7"> |
| 720 | Max number of options to display in the code completion popup at any one time. |
| 721 | </theme_item> |
| 722 | <theme_item name="completion_max_width" data_type="constant" type="int" default="50"> |
| 723 | Max width of options in the code completion popup. Options longer than this will be cut off. |
| 724 | </theme_item> |
| 725 | <theme_item name="completion_scroll_width" data_type="constant" type="int" default="6"> |
| 726 | Width of the scrollbar in the code completion popup. |
| 727 | </theme_item> |
| 728 | <theme_item name="bookmark" data_type="icon" type="Texture2D"> |
| 729 | Sets a custom [Texture2D] to draw in the bookmark gutter for bookmarked lines. |
| 730 | </theme_item> |
| 731 | <theme_item name="breakpoint" data_type="icon" type="Texture2D"> |
| 732 | Sets a custom [Texture2D] to draw in the breakpoint gutter for breakpointed lines. |
| 733 | </theme_item> |
| 734 | <theme_item name="can_fold" data_type="icon" type="Texture2D"> |
| 735 | Sets a custom [Texture2D] to draw in the line folding gutter when a line can be folded. |
| 736 | </theme_item> |
| 737 | <theme_item name="can_fold_code_region" data_type="icon" type="Texture2D"> |
| 738 | Sets a custom [Texture2D] to draw in the line folding gutter when a code region can be folded. |
| 739 | </theme_item> |
| 740 | <theme_item name="completion_color_bg" data_type="icon" type="Texture2D"> |
| 741 | Background panel for the color preview box in autocompletion (visible when the color is translucent). |
| 742 | </theme_item> |
| 743 | <theme_item name="executing_line" data_type="icon" type="Texture2D"> |
| 744 | Icon to draw in the executing gutter for executing lines. |
| 745 | </theme_item> |
| 746 | <theme_item name="folded" data_type="icon" type="Texture2D"> |
| 747 | Sets a custom [Texture2D] to draw in the line folding gutter when a line is folded and can be unfolded. |
| 748 | </theme_item> |
| 749 | <theme_item name="folded_code_region" data_type="icon" type="Texture2D"> |
| 750 | Sets a custom [Texture2D] to draw in the line folding gutter when a code region is folded and can be unfolded. |
| 751 | </theme_item> |
| 752 | <theme_item name="folded_eol_icon" data_type="icon" type="Texture2D"> |
| 753 | Sets a custom [Texture2D] to draw at the end of a folded line. |
| 754 | </theme_item> |
| 755 | <theme_item name="completion" data_type="style" type="StyleBox"> |
| 756 | [StyleBox] for the code completion popup. |
| 757 | </theme_item> |
| 758 | </theme_items> |
| 759 | </class> |