Skip to content

CodeEdit

Inherits: TextEdit < Control < CanvasItem < Entity < Object

A multiline text editor designed for editing code.

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.

Note: Regardless of locale, CodeEdit will by default always use left-to-right text direction to correctly display source code.

[note]Being a subclass of TextEdit, line and column numbers are zero-based, like elements of an array. For example, the first line of text can be retrieved by get_line(0), the second line by get_line(1), and so on.[/note]

Type Name Default
bool auto_brace_completion_enabled false
bool auto_brace_completion_highlight_matching false
Dictionary auto_brace_completion_pairs { "\"": "\"", "'": "'", "(": ")", "[": "]", "{": "}" }
bool code_completion_enabled false
Array[String] code_completion_prefixes []
Array[String] delimiter_comments []
Array[String] delimiter_strings ["' '", "\" \""]
bool gutters_draw_bookmarks false
bool gutters_draw_breakpoints_gutter false
bool gutters_draw_executing_lines false
bool gutters_draw_fold_gutter false
bool gutters_draw_line_numbers false
int gutters_line_numbers_min_digits 3
bool gutters_zero_pad_line_numbers false
bool indent_automatic false
Array[String] indent_automatic_prefixes [":", "{", "[", "("]
int indent_size 4
bool indent_use_spaces false
Control.LayoutDirection layout_direction 2 (overrides Control)
bool line_folding false
Array[int] line_length_guidelines []
bool symbol_lookup_on_click false
bool symbol_tooltip_on_hover false
Control.TextDirection text_direction 1 (overrides TextEdit)
Returns Method
void _confirm_code_completion(replace: bool) virtual
Array[Dictionary] _filter_code_completion_candidates(candidates: Array[Dictionary]) virtual const
void _request_code_completion(force: bool) virtual
void add_auto_brace_completion_pair(start_key: String, end_key: String)
void add_code_completion_option(type: CodeCompletionKind, display_text: String, insert_text: String, text_color: Color = Color(1, 1, 1, 1), icon: Resource = null, value: Variant = null, location: int = 1024)
void add_comment_delimiter(start_key: String, end_key: String, line_only: bool = false)
void add_string_delimiter(start_key: String, end_key: String, line_only: bool = false)
bool can_fold_line(line: int) const
void cancel_code_completion()
void clear_bookmarked_lines()
void clear_breakpointed_lines()
void clear_comment_delimiters()
void clear_executing_lines()
void clear_string_delimiters()
void confirm_code_completion(replace: bool = false)
void convert_indent(from_line: int = -1, to_line: int = -1)
void create_code_region()
void delete_lines()
void do_indent()
void duplicate_lines()
void duplicate_selection()
void fold_all_lines()
void fold_line(line: int)
String get_auto_brace_completion_close_key(open_key: String) const
PackedInt32Array get_bookmarked_lines() const
PackedInt32Array get_breakpointed_lines() const
Dictionary get_code_completion_option(index: int) const
Array[Dictionary] get_code_completion_options() const
int get_code_completion_selected_index() const
String get_code_region_end_tag() const
String get_code_region_start_tag() const
String get_delimiter_end_key(delimiter_index: int) const
Vector2 get_delimiter_end_position(line: int, column: int) const
String get_delimiter_start_key(delimiter_index: int) const
Vector2 get_delimiter_start_position(line: int, column: int) const
PackedInt32Array get_executing_lines() const
Array[int] get_folded_lines() const
String get_text_for_code_completion() const
String get_text_for_symbol_lookup() const
String get_text_with_cursor_char(line: int, column: int) const
bool has_auto_brace_completion_close_key(close_key: String) const
bool has_auto_brace_completion_open_key(open_key: String) const
bool has_comment_delimiter(start_key: String) const
bool has_string_delimiter(start_key: String) const
void indent_lines()
int is_in_comment(line: int, column: int = -1) const
int is_in_string(line: int, column: int = -1) const
bool is_line_bookmarked(line: int) const
bool is_line_breakpointed(line: int) const
bool is_line_code_region_end(line: int) const
bool is_line_code_region_start(line: int) const
bool is_line_executing(line: int) const
bool is_line_folded(line: int) const
void join_lines(line_ending: String = " ")
void move_lines_down()
void move_lines_up()
void remove_comment_delimiter(start_key: String)
void remove_string_delimiter(start_key: String)
void request_code_completion(force: bool = false)
void set_code_completion_selected_index(index: int)
void set_code_hint(code_hint: String)
void set_code_hint_draw_below(draw_below: bool)
void set_code_region_tags(start: String = "region", end: String = "endregion")
void set_line_as_bookmarked(line: int, bookmarked: bool)
void set_line_as_breakpoint(line: int, breakpointed: bool)
void set_line_as_executing(line: int, executing: bool)
void set_symbol_lookup_word_as_valid(valid: bool)
void toggle_foldable_line(line: int)
void toggle_foldable_lines_at_carets()
void unfold_all_lines()
void unfold_line(line: int)
void unindent_lines()
void update_code_completion_options(force: bool)

breakpoint_toggled

breakpoint_toggled(line: int)

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.

code_completion_requested

code_completion_requested()

Emitted when the user requests code completion. This signal will not be sent if _request_code_completion() is overridden or code_completion_enabled is false.

symbol_hovered

symbol_hovered(symbol: String, line: int, column: int)

Emitted when the user hovers over a symbol. Unlike Control.mouse_entered, this signal is not emitted immediately, but when the cursor is over the symbol for ProjectSettings.gui/timers/tooltip_delay_sec seconds.

Note: symbol_tooltip_on_hover must be true for this signal to be emitted.

symbol_lookup

symbol_lookup(symbol: String, line: int, column: int)

Emitted when the user has clicked on a valid symbol.

symbol_validate

symbol_validate(symbol: String)

Emitted when the user hovers over a symbol. The symbol should be validated and responded to, by calling set_symbol_lookup_word_as_valid().

Note: symbol_lookup_on_click must be true for this signal to be emitted.

CodeCompletionKind

enum CodeCompletionKind

KIND_CLASS = 0

Marks the option as a class.

KIND_FUNCTION = 1

Marks the option as a function.

KIND_SIGNAL = 2

Marks the option as a Orblit signal.

KIND_VARIABLE = 3

Marks the option as a variable.

KIND_MEMBER = 4

Marks the option as a member.

KIND_ENUM = 5

Marks the option as an enum entry.

KIND_CONSTANT = 6

Marks the option as a constant.

KIND_ENTITY_PATH = 7

Marks the option as a Orblit node path.

KIND_FILE_PATH = 8

Marks the option as a file path.

KIND_PLAIN_TEXT = 9

Marks the option as unclassified or plain text.

KIND_KEYWORD = 10

Marks the option as a keyword.

CodeCompletionLocation

enum CodeCompletionLocation

LOCATION_LOCAL = 0

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).

LOCATION_PARENT_MASK = 256

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. 0 for the local class, 1 for the parent, 2 for the grandparent, etc.) to store the depth of an option in the class or a parent class.

LOCATION_OTHER_USER_CODE = 512

The option is from user code which is not local and not in a derived class (e.g. Autoload Singletons).

LOCATION_OTHER = 1024

The option is from other engine code, not covered by the other enum constants - e.g. built-in classes.

bookmark_color

Color bookmark_color (color) = Color(0.5, 0.64, 1, 0.8)

brace_mismatch_color

Color brace_mismatch_color (color) = Color(1, 0.2, 0.2, 1)

breakpoint_color

Color breakpoint_color (color) = Color(0.9, 0.29, 0.3, 1)

code_folding_color

Color code_folding_color (color) = Color(0.8, 0.8, 0.8, 0.8)

completion_background_color

Color completion_background_color (color) = Color(0.17, 0.16, 0.2, 1)

completion_existing_color

Color completion_existing_color (color) = Color(0.87, 0.87, 0.87, 0.13)

completion_scroll_color

Color completion_scroll_color (color) = Color(1, 1, 1, 0.29)

completion_scroll_hovered_color

Color completion_scroll_hovered_color (color) = Color(1, 1, 1, 0.4)

completion_selected_color

Color completion_selected_color (color) = Color(0.26, 0.26, 0.27, 1)

executing_line_color

Color executing_line_color (color) = Color(0.98, 0.89, 0.27, 1)

folded_code_region_color

Color folded_code_region_color (color) = Color(0.68, 0.46, 0.77, 0.2)

line_length_guideline_color

Color line_length_guideline_color (color) = Color(0.3, 0.5, 0.8, 0.1)

line_number_color

Color line_number_color (color) = Color(0.67, 0.67, 0.67, 0.4)

completion_lines

int completion_lines (constant) = 7

completion_max_width

int completion_max_width (constant) = 50

completion_scroll_width

int completion_scroll_width (constant) = 6

bookmark

Texture2D bookmark (icon)

breakpoint

Texture2D breakpoint (icon)

can_fold

Texture2D can_fold (icon)

can_fold_code_region

Texture2D can_fold_code_region (icon)

completion_color_bg

Texture2D completion_color_bg (icon)

executing_line

Texture2D executing_line (icon)

folded

Texture2D folded (icon)

folded_code_region

Texture2D folded_code_region (icon)

folded_eol_icon

Texture2D folded_eol_icon (icon)

completion

StyleBox completion (style)

auto_brace_completion_enabled

bool auto_brace_completion_enabled = false

If true, uses 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.

auto_brace_completion_highlight_matching

bool auto_brace_completion_highlight_matching = false

If true, highlights brace pairs when the caret is on either one, using auto_brace_completion_pairs. If matching, the pairs will be underlined. If a brace is unmatched, it is colored with brace_mismatch_color.

auto_brace_completion_pairs

Dictionary auto_brace_completion_pairs = { "\"": "\"", "'": "'", "(": ")", "[": "]", "{": "}" }

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 auto_brace_completion_enabled and auto_brace_completion_highlight_matching.

code_completion_enabled

bool code_completion_enabled = false

If true, the ProjectSettings.input/ui_text_completion_query action requests code completion. To handle it, see _request_code_completion() or code_completion_requested.

code_completion_prefixes

Array[String] code_completion_prefixes = []

Sets prefixes that will trigger code completion.

delimiter_comments

Array[String] delimiter_comments = []

Sets the comment delimiters. All existing comment delimiters will be removed.

delimiter_strings

Array[String] delimiter_strings = ["' '", "\" \""]

Sets the string delimiters. All existing string delimiters will be removed.

gutters_draw_bookmarks

bool gutters_draw_bookmarks = false

If true, bookmarks are drawn in the gutter. This gutter is shared with breakpoints and executing lines. See set_line_as_bookmarked().

gutters_draw_breakpoints_gutter

bool gutters_draw_breakpoints_gutter = false

If true, 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 set_line_as_breakpoint().

gutters_draw_executing_lines

bool gutters_draw_executing_lines = false

If true, executing lines are marked in the gutter. This gutter is shared with breakpoints and bookmarks. See set_line_as_executing().

gutters_draw_fold_gutter

bool gutters_draw_fold_gutter = false

If true, the fold gutter is drawn. In this gutter, the can_fold_code_region icon is drawn for each foldable line (see can_fold_line()) and the folded_code_region icon is drawn for each folded line (see is_line_folded()). These icons can be clicked to toggle the fold state, see toggle_foldable_line(). line_folding must be true to show icons.

gutters_draw_line_numbers

bool gutters_draw_line_numbers = false

If true, the line number gutter is drawn. Line numbers start at 1 and are incremented for each line of text. Clicking and dragging in the line number gutter will select entire lines of text.

gutters_line_numbers_min_digits

int gutters_line_numbers_min_digits = 3

The minimum width in digits reserved for the line number gutter.

gutters_zero_pad_line_numbers

bool gutters_zero_pad_line_numbers = false

If true, line numbers drawn in the gutter are zero padded based on the total line count. Requires gutters_draw_line_numbers to be set to true.

indent_automatic

bool indent_automatic = false

If true, an extra indent is automatically inserted when a new line is added and a prefix in 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 auto_brace_completion_pairs).

indent_automatic_prefixes

Array[String] indent_automatic_prefixes = [":", "{", "[", "("]

Prefixes to trigger an automatic indent. Used when indent_automatic is set to true.

indent_size

int indent_size = 4

Size of the tabulation indent (one Tab press) in characters. If indent_use_spaces is enabled the number of spaces to use.

indent_use_spaces

bool indent_use_spaces = false

Use spaces instead of tabs for indentation.

line_folding

bool line_folding = false

If true, lines can be folded. Otherwise, line folding methods like fold_line() will not work and can_fold_line() will always return false. See gutters_draw_fold_gutter.

line_length_guidelines

Array[int] line_length_guidelines = []

Draws vertical lines at the provided columns. The first entry is considered a main hard guideline and is drawn more prominently.

symbol_lookup_on_click

bool symbol_lookup_on_click = false

Set when a validated word from symbol_validate is clicked, the symbol_lookup should be emitted.

symbol_tooltip_on_hover

bool symbol_tooltip_on_hover = false

If true, the symbol_hovered signal is emitted when hovering over a word.

_confirm_code_completion

void _confirm_code_completion(replace: bool) virtual

Override this method to define how the selected entry should be inserted. If replace is true, any existing text should be replaced.

_filter_code_completion_candidates

Array[Dictionary] _filter_code_completion_candidates(candidates: Array[Dictionary]) virtual const

Override this method to define what items in candidates should be displayed.

Both candidates and the return is an Array of Dictionary, see get_code_completion_option() for Dictionary content.

_request_code_completion

void _request_code_completion(force: bool) virtual

Override this method to define what happens when the user requests code completion. If force is true, any checks should be bypassed.

add_auto_brace_completion_pair

void add_auto_brace_completion_pair(start_key: String, end_key: String)

Adds a brace pair.

Both the start and end keys must be symbols. Only the start key has to be unique.

add_code_completion_option

void add_code_completion_option(type: CodeCompletionKind, display_text: String, insert_text: String, text_color: Color = Color(1, 1, 1, 1), icon: Resource = null, value: Variant = null, location: int = 1024)

Submits an item to the queue of potential candidates for the autocomplete menu. Call update_code_completion_options() to update the list.

location indicates location of the option relative to the location of the code completion query. See CodeCompletionLocation for how to set this value.

Note: This list will replace all current candidates.

add_comment_delimiter

void add_comment_delimiter(start_key: String, end_key: String, line_only: bool = false)

Adds a comment delimiter from start_key to end_key. Both keys should be symbols, and start_key must not be shared with other delimiters.

If line_only is true or end_key is an empty String, the region does not carry over to the next line.

add_string_delimiter

void add_string_delimiter(start_key: String, end_key: String, line_only: bool = false)

Defines a string delimiter from start_key to end_key. Both keys should be symbols, and start_key must not be shared with other delimiters.

If line_only is true or end_key is an empty String, the region does not carry over to the next line.

can_fold_line

bool can_fold_line(line: int) const

Returns true if the given line is foldable. A line is foldable if it is the start of a valid code region (see 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 TextEdit.get_indent_level()).

cancel_code_completion

void cancel_code_completion()

Cancels the autocomplete menu.

clear_bookmarked_lines

void clear_bookmarked_lines()

Clears all bookmarked lines.

clear_breakpointed_lines

void clear_breakpointed_lines()

Clears all breakpointed lines.

clear_comment_delimiters

void clear_comment_delimiters()

Removes all comment delimiters.

clear_executing_lines

void clear_executing_lines()

Clears all executed lines.

clear_string_delimiters

void clear_string_delimiters()

Removes all string delimiters.

confirm_code_completion

void confirm_code_completion(replace: bool = false)

Inserts the selected entry into the text. If replace is true, any existing text is replaced rather than merged.

convert_indent

void convert_indent(from_line: int = -1, to_line: int = -1)

Converts the indents of lines between from_line and to_line to tabs or spaces as set by indent_use_spaces.

Values of -1 convert the entire text.

create_code_region

void create_code_region()

Creates a new code region with the selection. At least one single line comment delimiter have to be defined (see 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 set_code_region_tags()).

Code regions are delimited using start and end tags (respectively region and endregion by default) preceded by one line comment delimiter. (eg. #region and #endregion)

delete_lines

void delete_lines()

Deletes all lines that are selected or have a caret on them.

do_indent

void do_indent()

If there is no selection, indentation is inserted at the caret. Otherwise, the selected lines are indented like indent_lines(). Equivalent to the ProjectSettings.input/ui_text_indent action. The indentation characters used depend on indent_use_spaces and indent_size.

duplicate_lines

void duplicate_lines()

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.

duplicate_selection

void duplicate_selection()

Duplicates all selected text and duplicates all lines with a caret on them.

fold_all_lines

void fold_all_lines()

Folds all lines that are possible to be folded (see can_fold_line()).

fold_line

void fold_line(line: int)

Folds the given line, if possible (see can_fold_line()).

get_auto_brace_completion_close_key

String get_auto_brace_completion_close_key(open_key: String) const

Gets the matching auto brace close key for open_key.

get_bookmarked_lines

PackedInt32Array get_bookmarked_lines() const

Gets all bookmarked lines.

get_breakpointed_lines

PackedInt32Array get_breakpointed_lines() const

Gets all breakpointed lines.

get_code_completion_option

Dictionary get_code_completion_option(index: int) const

Gets the completion option at index. The return Dictionary has the following key-values:

kind: CodeCompletionKind

display_text: Text that is shown on the autocomplete menu.

insert_text: Text that is to be inserted when this item is selected.

font_color: Color of the text on the autocomplete menu.

icon: Icon to draw on the autocomplete menu.

default_value: Value of the symbol.

get_code_completion_options

Array[Dictionary] get_code_completion_options() const

Gets all completion options, see get_code_completion_option() for return content.

get_code_completion_selected_index

int get_code_completion_selected_index() const

Gets the index of the current selected completion option.

get_code_region_end_tag

String get_code_region_end_tag() const

Returns the code region end tag (without comment delimiter).

get_code_region_start_tag

String get_code_region_start_tag() const

Returns the code region start tag (without comment delimiter).

get_delimiter_end_key

String get_delimiter_end_key(delimiter_index: int) const

Gets the end key for a string or comment region index.

get_delimiter_end_position

Vector2 get_delimiter_end_position(line: int, column: int) const

If line 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 -1.

get_delimiter_start_key

String get_delimiter_start_key(delimiter_index: int) const

Gets the start key for a string or comment region index.

get_delimiter_start_position

Vector2 get_delimiter_start_position(line: int, column: int) const

If line 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 -1.

get_executing_lines

PackedInt32Array get_executing_lines() const

Gets all executing lines.

get_folded_lines

Array[int] get_folded_lines() const

Returns all lines that are currently folded.

get_text_for_code_completion

String get_text_for_code_completion() const

Returns the full text with char 0xFFFF at the caret location.

get_text_for_symbol_lookup

String get_text_for_symbol_lookup() const

Returns the full text with char 0xFFFF at the cursor location.

get_text_with_cursor_char

String get_text_with_cursor_char(line: int, column: int) const

Returns the full text with char 0xFFFF at the specified location.

has_auto_brace_completion_close_key

bool has_auto_brace_completion_close_key(close_key: String) const

Returns true if close key close_key exists.

has_auto_brace_completion_open_key

bool has_auto_brace_completion_open_key(open_key: String) const

Returns true if open key open_key exists.

has_comment_delimiter

bool has_comment_delimiter(start_key: String) const

Returns true if comment start_key exists.

has_string_delimiter

bool has_string_delimiter(start_key: String) const

Returns true if string start_key exists.

indent_lines

void indent_lines()

Indents all lines that are selected or have a caret on them. Uses spaces or a tab depending on indent_use_spaces. See unindent_lines().

is_in_comment

int is_in_comment(line: int, column: int = -1) const

Returns delimiter index if line column is in a comment. If column is not provided, will return delimiter index if the entire line is a comment. Otherwise -1.

is_in_string

int is_in_string(line: int, column: int = -1) const

Returns the delimiter index if line column is in a string. If column is not provided, will return the delimiter index if the entire line is a string. Otherwise -1.

is_line_bookmarked

bool is_line_bookmarked(line: int) const

Returns true if the given line is bookmarked. See set_line_as_bookmarked().

is_line_breakpointed

bool is_line_breakpointed(line: int) const

Returns true if the given line is breakpointed. See set_line_as_breakpoint().

is_line_code_region_end

bool is_line_code_region_end(line: int) const

Returns true if the given line is a code region end. See set_code_region_tags().

is_line_code_region_start

bool is_line_code_region_start(line: int) const

Returns true if the given line is a code region start. See set_code_region_tags().

is_line_executing

bool is_line_executing(line: int) const

Returns true if the given line is marked as executing. See set_line_as_executing().

is_line_folded

bool is_line_folded(line: int) const

Returns true if the given line is folded. See fold_line().

join_lines

void join_lines(line_ending: String = " ")

Joins all selected lines or lines containing a caret with their next line. Whitespace in between will be removed. If the next line has content, the line_ending will be inserted in between.

move_lines_down

void move_lines_down()

Moves all lines down that are selected or have a caret on them.

move_lines_up

void move_lines_up()

Moves all lines up that are selected or have a caret on them.

remove_comment_delimiter

void remove_comment_delimiter(start_key: String)

Removes the comment delimiter with start_key.

remove_string_delimiter

void remove_string_delimiter(start_key: String)

Removes the string delimiter with start_key.

request_code_completion

void request_code_completion(force: bool = false)

Emits code_completion_requested, if force is true 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.

set_code_completion_selected_index

void set_code_completion_selected_index(index: int)

Sets the current selected completion option.

set_code_hint

void set_code_hint(code_hint: String)

Sets the code hint text. Pass an empty string to clear.

set_code_hint_draw_below

void set_code_hint_draw_below(draw_below: bool)

If true, the code hint will draw below the main caret. If false, the code hint will draw above the main caret. See set_code_hint().

set_code_region_tags

void set_code_region_tags(start: String = "region", end: String = "endregion")

Sets the code region start and end tags (without comment delimiter).

set_line_as_bookmarked

void set_line_as_bookmarked(line: int, bookmarked: bool)

Sets the given line as bookmarked. If true and gutters_draw_bookmarks is true, draws the bookmark icon in the gutter for this line. See get_bookmarked_lines() and is_line_bookmarked().

set_line_as_breakpoint

void set_line_as_breakpoint(line: int, breakpointed: bool)

Sets the given line as a breakpoint. If true and gutters_draw_breakpoints_gutter is true, draws the breakpoint icon in the gutter for this line. See get_breakpointed_lines() and is_line_breakpointed().

set_line_as_executing

void set_line_as_executing(line: int, executing: bool)

Sets the given line as executing. If true and gutters_draw_executing_lines is true, draws the executing_line icon in the gutter for this line. See get_executing_lines() and is_line_executing().

set_symbol_lookup_word_as_valid

void set_symbol_lookup_word_as_valid(valid: bool)

Sets the symbol emitted by symbol_validate as a valid lookup.

toggle_foldable_line

void toggle_foldable_line(line: int)

Toggle the folding of the code block at the given line.

toggle_foldable_lines_at_carets

void toggle_foldable_lines_at_carets()

Toggle the folding of the code block on all lines with a caret on them.

unfold_all_lines

void unfold_all_lines()

Unfolds all lines that are folded.

unfold_line

void unfold_line(line: int)

Unfolds the given line if it is folded or if it is hidden under a folded line.

unindent_lines

void unindent_lines()

Unindents all lines that are selected or have a caret on them. Uses spaces or a tab depending on indent_use_spaces. Equivalent to the ProjectSettings.input/ui_text_dedent action. See indent_lines().

update_code_completion_options

void update_code_completion_options(force: bool)

Submits all completion options added with add_code_completion_option(). Will try to force the autocomplete menu to popup, if force is true.

Note: This will replace all current candidates.