Up to date
This page is up to date for Godot 4.1
.
If you still find outdated information, please open an issue.
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¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
layout_direction |
|
|
|
||
|
||
|
||
text_direction |
|
Methods¶
Theme Properties¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
Signals¶
breakpoint_toggled ( int line )
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 ( )
Emitted when the user requests code completion.
symbol_lookup ( String symbol, int line, int column )
Emitted when the user has clicked on a valid symbol.
symbol_validate ( String symbol )
Emitted when the user hovers over a symbol. The symbol should be validated and responded to, by calling set_symbol_lookup_word_as_valid.
Enumerations¶
enum CodeCompletionKind:
CodeCompletionKind KIND_CLASS = 0
Marks the option as a class.
CodeCompletionKind KIND_FUNCTION = 1
Marks the option as a function.
CodeCompletionKind KIND_SIGNAL = 2
Marks the option as a Godot signal.
CodeCompletionKind KIND_VARIABLE = 3
Marks the option as a variable.
CodeCompletionKind KIND_MEMBER = 4
Marks the option as a member.
CodeCompletionKind KIND_ENUM = 5
Marks the option as an enum entry.
CodeCompletionKind KIND_CONSTANT = 6
Marks the option as a constant.
CodeCompletionKind KIND_NODE_PATH = 7
Marks the option as a Godot node path.
CodeCompletionKind KIND_FILE_PATH = 8
Marks the option as a file path.
CodeCompletionKind KIND_PLAIN_TEXT = 9
Marks the option as unclassified or plain text.
enum CodeCompletionLocation:
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).
CodeCompletionLocation 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.