CodeEdit

Inherits: TextEdit < Control < CanvasItem < Node < Object

A multiline text editor designed for editing code.

Description

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.

Properties

bool

auto_brace_completion_enabled

false

bool

auto_brace_completion_highlight_matching

false

Dictionary

auto_brace_completion_pairs

{ "\"": "\"", "'": "'", "(": ")", "[": "]", "{": "}" }

bool

code_completion_enabled

false

String[]

code_completion_prefixes

[]

String[]

delimiter_comments

[]

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

bool

gutters_zero_pad_line_numbers

false

bool

indent_automatic

false

String[]

indent_automatic_prefixes

[":", "{", "[", "("]

int

indent_size

4

bool

indent_use_spaces

false

LayoutDirection

layout_direction

2 (overrides Control)

bool

line_folding

false

int[]

line_length_guidelines

[]

bool

symbol_lookup_on_click

false

TextDirection

text_direction

1 (overrides TextEdit)

Methods

void

_confirm_code_completion ( bool replace ) virtual

Dictionary[]

_filter_code_completion_candidates ( Dictionary[] candidates ) virtual const

void

_request_code_completion ( bool force ) virtual

void

add_auto_brace_completion_pair ( String start_key, String end_key )

void

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

void

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

void

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

bool

can_fold_line ( int line )