class-description NEWS COMMUNITY STORE LABS SIGN UP LOGIN LOGOUT ROKOJORI NEWSLETTER SIGN UP LOGIN LOGOUT NEWS COMMUNITY STORE LABS TOGGLE FULLSCREEN VOLLBILD AN/AUS ObjectNodeCanvasItemControlTextEdit CodeEdit
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.

breakpoint_toggled breakpoint_toggled<>( int line=, line:int=, ):breakpoint_toggled

Emitted when a breakpoint is added or removed from a line. If the line is moved via backspace a removed is emitted at the old line.

code_completion_requested code_completion_requested<>():code_completion_requested

Emitted when the user requests code completion.

symbol_lookup symbol_lookup<>( String symbol=, symbol:String=, int line=, line:int=, int column=, column:int=, ):symbol_lookup

Emitted when the user has clicked on a valid symbol.

symbol_validate symbol_validate<>( String symbol=, symbol:String=, ):symbol_validate

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

Enum CodeCompletionKind<>():Enum

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 Godot 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_NODE_PATH = 7

Marks the option as a Godot 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.

Enum CodeCompletionLocation<>():Enum

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.

bool auto_brace_completion_enabled<>():bool

Sets whether brace pairs should be autocompleted.

bool auto_brace_completion_highlight_matching<>():bool

Highlight mismatching brace pairs.

Dictionary auto_brace_completion_pairs<>():Dictionary

Sets the brace pairs to be autocompleted.

bool code_completion_enabled<>():bool

Sets whether code completion is allowed.

String[] code_completion_prefixes<>():String[]

Sets prefixes that will trigger code completion.

String[] delimiter_comments<>():String[]

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

String[] delimiter_strings<>():String[]

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

bool gutters_draw_bookmarks<>():bool

Sets if bookmarked should be drawn in the gutter. This gutter is shared with breakpoints and executing lines.

bool gutters_draw_breakpoints_gutter<>():bool

Sets if breakpoints should be drawn in the gutter. This gutter is shared with bookmarks and executing lines.

bool gutters_draw_executing_lines<>():bool

Sets if executing lines should be marked in the gutter. This gutter is shared with breakpoints and bookmarks lines.

bool gutters_draw_fold_gutter<>():bool

Sets if foldable lines icons should be drawn in the gutter.

bool gutters_draw_line_numbers<>():bool

Sets if line numbers should be drawn in the gutter.

bool gutters_zero_pad_line_numbers<>():bool

Sets if line numbers drawn in the gutter are zero padded.

bool indent_automatic<>():bool

Sets whether automatic indent are enabled, this will add an extra indent if a prefix or brace is found.

String[] indent_automatic_prefixes<>():String[]

Prefixes to trigger an automatic indent.

int indent_size<>():int

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

bool indent_use_spaces<>():bool

Use spaces instead of tabs for indentation.

bool line_folding<>():bool

Sets whether line folding is allowed.

int[] line_length_guidelines<>():int[]

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

bool symbol_lookup_on_click<>():bool

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

void _confirm_code_completion<>( bool replace=, replace:bool=, ):void

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

Dictionary[] _filter_code_completion_candidates<>( Dictionary=, Dictionary:=, ):Dictionary[]

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

Both candidates and the return is a Array of Dictionary, see get_code_completion_option for Dictionary content.

void _request_code_completion<>( bool=, bool:=, ):void

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

void add_auto_brace_completion_pair<>( String start_key=, start_key:String=, String end_key=, end_key:String=, ):void

Adds a brace pair.

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

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

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.

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

Adds a comment delimiter.

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

line_only denotes if the region should continue until the end of the line or carry over on to the next line. If the end key is blank this is automatically set to true.

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

Adds a string delimiter.

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

line_only denotes if the region should continue until the end of the line or carry over on to the next line. If the end key is blank this is automatically set to true.

bool can_fold_line<>( int line=, line:int=, ):bool

Returns if the given line is foldable, that is, it has indented lines right below it or a comment / string block.

void cancel_code_completion<>():void

Cancels the autocomplete menu.

void clear_bookmarked_lines<>():void

Clears all bookmarked lines.

void clear_breakpointed_lines<>():void

Clears all breakpointed lines.

void clear_comment_delimiters<>():void

Removes all comment delimiters.

void clear_executing_lines<>():void

Clears all executed lines.

void clear_string_delimiters<>():void

Removes all string delimiters.

void confirm_code_completion<>( bool replace=false, replace:bool=false, ):void

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

void convert_indent<>( int=, int:=, int=, int:=, ):void

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.

void create_code_region<>():void

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)

void do_indent<>():void

Perform an indent as if the user activated the "ui_text_indent" action.

void duplicate_lines<>():void

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.

void fold_all_lines<>():void

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

void fold_line<>( int line=, line:int=, ):void

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

String get_auto_brace_completion_close_key<>( String open_key=, open_key:String=, ):String

Gets the matching auto brace close key for open_key.

PackedInt32Array get_bookmarked_lines<>():PackedInt32Array

Gets all bookmarked lines.

PackedInt32Array get_breakpointed_lines<>():PackedInt32Array

Gets all breakpointed lines.

Dictionary get_code_completion_option<>( int index=, index:int=, ):Dictionary

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.

Dictionary[] get_code_completion_options<>():Dictionary[]

Gets all completion options, see get_code_completion_option for return content.

int get_code_completion_selected_index<>():int

Gets the index of the current selected completion option.

String get_code_region_end_tag<>():String

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

String get_code_region_start_tag<>():String

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

String get_delimiter_end_key<>( int delimiter_index=, delimiter_index:int=, ):String

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

Vector2 get_delimiter_end_position<>( int line=, line:int=, int column=, column:int=, ):Vector2

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.

String get_delimiter_start_key<>( int delimiter_index=, delimiter_index:int=, ):String

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

Vector2 get_delimiter_start_position<>( int line=, line:int=, int column=, column:int=, ):Vector2

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.

PackedInt32Array get_executing_lines<>():PackedInt32Array

Gets all executing lines.

int[] get_folded_lines<>():int[]

Returns all lines that are current folded.

String get_text_for_code_completion<>():String

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

String get_text_for_symbol_lookup<>():String

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

String get_text_with_cursor_char<>( int line=, line:int=, int column=, column:int=, ):String

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

bool has_auto_brace_completion_close_key<>( String close_key=, close_key:String=, ):bool

Returns true if close key close_key exists.

bool has_auto_brace_completion_open_key<>( String open_key=, open_key:String=, ):bool

Returns true if open key open_key exists.

bool has_comment_delimiter<>( String start_key=, start_key:String=, ):bool

Returns true if comment start_key exists.

bool has_string_delimiter<>( String start_key=, start_key:String=, ):bool

Returns true if string start_key exists.

void indent_lines<>():void

Indents selected lines, or in the case of no selection the caret line by one.

int is_in_comment<>( int line=, line:int=, int=, int:=, ):int

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.

int is_in_string<>( int line=, line:int=, int=, int:=, ):int

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.

bool is_line_bookmarked<>( int line=, line:int=, ):bool

Returns whether the line at the specified index is bookmarked or not.

bool is_line_breakpointed<>( int line=, line:int=, ):bool

Returns whether the line at the specified index is breakpointed or not.

bool is_line_code_region_end<>( int line=, line:int=, ):bool

Returns whether the line at the specified index is a code region end.

bool is_line_code_region_start<>( int line=, line:int=, ):bool

Returns whether the line at the specified index is a code region start.

bool is_line_executing<>( int line=, line:int=, ):bool

Returns whether the line at the specified index is marked as executing or not.

bool is_line_folded<>( int line=, line:int=, ):bool

Returns whether the line at the specified index is folded or not.

void remove_comment_delimiter<>( String start_key=, start_key:String=, ):void

Removes the comment delimiter with start_key.

void remove_string_delimiter<>( String start_key=, start_key:String=, ):void

Removes the string delimiter with start_key.

void request_code_completion<>( bool=, bool:=, ):void

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.

void set_code_completion_selected_index<>( int index=, index:int=, ):void

Sets the current selected completion option.

void set_code_hint<>( String code_hint=, code_hint:String=, ):void

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

void set_code_hint_draw_below<>( bool draw_below=, draw_below:bool=, ):void

Sets if the code hint should draw below the text.

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

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

void set_line_as_bookmarked<>( int line=, line:int=, bool bookmarked=, bookmarked:bool=, ):void

Sets the line as bookmarked.

void set_line_as_breakpoint<>( int line=, line:int=, bool=, bool:=, ):void

Sets the line as breakpointed.

void set_line_as_executing<>( int line=, line:int=, bool executing=, executing:bool=, ):void

Sets the line as executing.

void set_symbol_lookup_word_as_valid<>( bool valid=, valid:bool=, ):void

Sets the symbol emitted by symbol_validate as a valid lookup.

void toggle_foldable_line<>( int line=, line:int=, ):void

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

void unfold_all_lines<>():void

Unfolds all lines, folded or not.

void unfold_line<>( int line=, line:int=, ):void

Unfolds all lines that were previously folded.

void unindent_lines<>():void

Unindents selected lines, or in the case of no selection the caret line by one. Same as performing "ui_text_unindent" action.

void update_code_completion_options<>( bool=, bool:=, ):void

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.




All social media brands are registrated trademarks and belong to their respective owners.





CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
We are using cookies on this site. Read more... Wir benutzen Cookies auf dieser Seite. Mehr lesen...