Inheritance #
- AudioServer
- CameraServer
- ClassDB
- DisplayServer
- EditorFileSystemDirectory
- EditorInterface
- EditorPaths
- EditorSelection
- EditorUndoRedoManager
- EditorVCSInterface
- Engine
- EngineDebugger
- FramebufferCacheRD
- GDExtensionManager
- Geometry2D
- Geometry3D
- IP
- Input
- InputMap
- JNISingleton
- JSONRPC
- JavaClassWrapper
- JavaScriptBridge
- MainLoop (1)
- Marshalls
- MovieWriter
- NativeMenu
- NavigationMeshGenerator
- NavigationServer2D
- NavigationServer3D
- Node (21)
- OS
- OpenXRExtensionWrapperExtension
- OpenXRInteractionProfileMetadata
- Performance
- PhysicsDirectBodyState2D (1)
- PhysicsDirectBodyState3D (1)
- PhysicsDirectSpaceState2D (1)
- PhysicsDirectSpaceState3D (1)
- PhysicsServer2D (1)
- PhysicsServer2DManager
- PhysicsServer3D (1)
- PhysicsServer3DManager
- PhysicsServer3DRendering
ServerHandler
- ProjectSettings
- RefCounted (121)
- RenderData (2)
- RenderSceneData (2)
- RenderingDevice
- RenderingServer
- ResourceLoader
- ResourceSaver
- ResourceUID
- ScriptLanguage (1)
- ShaderIncludeDB
- TextServerManager
- ThemeDB
- TileData
- Time
- TranslationServer
- TreeItem
- UndoRedo
- UniformSetCacheRD
- WorkerThreadPool
- XRServer
- XRVRS
- AnimationMixer (2)
- AudioStreamPlayer
- CanvasItem (2)
- CanvasLayer (1)
- EditorFileSystem
- EditorPlugin (1)
- EditorResourcePreview
- HTTPRequest
- InstancePlaceholder
- MissingNode
- MultiplayerSpawner
- MultiplayerSynchronizer
- NavigationAgent2D
- NavigationAgent3D
- Node3D (31)
- ResourcePreloader
- ShaderGlobalsOverride
- StatusIndicator
- Timer
- Viewport (2)
- WorldEnvironment
- BaseButton (3)
- ColorRect
- Container (13)
- GraphEdit
- ItemList
- Label
- LineEdit
- MenuBar
- NinePatchRect
- Panel
- Range (6)
- ReferenceRect
- RichTextLabel
- Separator (2)
- TabBar
- TextEdit (1)
- TextureRect
- Tree
- VideoStreamPlayer
Table of contents
-
var auto_brace_completion_enabled: bool = false -
var auto_brace_completion_highlight_matching: bool = false -
var auto_brace_completion_pairs: Dictionary = { "\"": "\"", "'": "'", "(": ")", "[": "]", "{": "}" } -
var code_completion_enabled: bool = false -
var code_completion_prefixes: String[] = [] -
var delimiter_comments: String[] = [] -
var delimiter_strings: String[] = ["' '", "\" \""] -
var gutters_draw_bookmarks: bool = false -
var gutters_draw_breakpoints_gutter: bool = false -
var gutters_draw_executing_lines: bool = false -
var gutters_draw_fold_gutter: bool = false -
var gutters_draw_line_numbers: bool = false -
var gutters_zero_pad_line_numbers: bool = false -
var indent_automatic: bool = false -
var indent_automatic_prefixes: String[] = [":", "{", "[", "("] -
var indent_size: int = 4 -
var indent_use_spaces: bool = false -
var layout_direction = LAYOUT_DIRECTION_LTR -
var line_folding: bool = false -
var line_length_guidelines: int[] = [] -
var symbol_lookup_on_click: bool = false -
var symbol_tooltip_on_hover: bool = false -
var text_direction = TEXT_DIRECTION_LTR -
virtual func _confirm_code_completion(replace: bool) -> void -
virtual const func _filter_code_completion_candidates(candidates: Dictionary[]) -> Dictionary[] -
virtual func _request_code_completion(force: bool) -> void -
func add_auto_brace_completion_pair(end_key: String) -> void -
func add_code_completion_option(location: int = 1024) -> void -
func add_comment_delimiter(line_only: bool = false) -> void -
func add_string_delimiter(line_only: bool = false) -> void -
const func can_fold_line(line: int) -> bool -
func cancel_code_completion() -> void -
func clear_bookmarked_lines() -> void -
func clear_breakpointed_lines() -> void -
func clear_comment_delimiters() -> void -
func clear_executing_lines() -> void -
func clear_string_delimiters() -> void -
func confirm_code_completion(replace: bool = false) -> void -
func convert_indent(to_line: int = -1) -> void -
func create_code_region() -> void -
func delete_lines() -> void -
func do_indent() -> void -
func duplicate_lines() -> void -
func duplicate_selection() -> void -
func fold_all_lines() -> void -
func fold_line(line: int) -> void -
const func get_auto_brace_completion_close_key(open_key: String) -> String -
const func get_bookmarked_lines() -> PackedInt32Array -
const func get_breakpointed_lines() -> PackedInt32Array -
const func get_code_completion_option(index: int) -> Dictionary -
const func get_code_completion_options() -> Dictionary[] -
const func get_code_completion_selected_index() -> int -
const func get_code_region_end_tag() -> String -
const func get_code_region_start_tag() -> String -
const func get_delimiter_end_key(delimiter_index: int) -> String -
const func get_delimiter_end_position(column: int) -> Vector2 -
const func get_delimiter_start_key(delimiter_index: int) -> String -
const func get_delimiter_start_position(column: int) -> Vector2 -
const func get_executing_lines() -> PackedInt32Array -
const func get_folded_lines() -> int[] -
const func get_text_for_code_completion() -> String -
const func get_text_for_symbol_lookup() -> String -
const func get_text_with_cursor_char(column: int) -> String -
const func has_auto_brace_completion_close_key(close_key: String) -> bool -
const func has_auto_brace_completion_open_key(open_key: String) -> bool -
const func has_comment_delimiter(start_key: String) -> bool -
const func has_string_delimiter(start_key: String) -> bool -
func indent_lines() -> void -
const func is_in_comment(column: int = -1) -> int -
const func is_in_string(column: int = -1) -> int -
const func is_line_bookmarked(line: int) -> bool -
const func is_line_breakpointed(line: int) -> bool -
const func is_line_code_region_end(line: int) -> bool -
const func is_line_code_region_start(line: int) -> bool -
const func is_line_executing(line: int) -> bool -
const func is_line_folded(line: int) -> bool -
func move_lines_down() -> void -
func move_lines_up() -> void -
func remove_comment_delimiter(start_key: String) -> void -
func remove_string_delimiter(start_key: String) -> void -
func request_code_completion(force: bool = false) -> void -
func set_code_completion_selected_index(index: int) -> void -
func set_code_hint(code_hint: String) -> void -
func set_code_hint_draw_below(draw_below: bool) -> void -
func set_code_region_tags(end: String = "endregion") -> void -
func set_line_as_bookmarked(bookmarked: bool) -> void -
func set_line_as_breakpoint(breakpointed: bool) -> void -
func set_line_as_executing(executing: bool) -> void -
func set_symbol_lookup_word_as_valid(valid: bool) -> void -
func toggle_foldable_line(line: int) -> void -
func toggle_foldable_lines_at_carets() -> void -
func unfold_all_lines() -> void -
func unfold_line(line: int) -> void -
func unindent_lines() -> void -
func update_code_completion_options(force: bool) -> void -
const KIND_CLASS = 0 enum CodeCompletionKind -
const KIND_FUNCTION = 1 enum CodeCompletionKind -
const KIND_SIGNAL = 2 enum CodeCompletionKind -
const KIND_VARIABLE = 3 enum CodeCompletionKind -
const KIND_MEMBER = 4 enum CodeCompletionKind -
const KIND_ENUM = 5 enum CodeCompletionKind -
const KIND_CONSTANT = 6 enum CodeCompletionKind -
const KIND_NODE_PATH = 7 enum CodeCompletionKind -
const KIND_FILE_PATH = 8 enum CodeCompletionKind -
const KIND_PLAIN_TEXT = 9 enum CodeCompletionKind -
const LOCATION_LOCAL = 0 enum CodeCompletionLocation -
const LOCATION_PARENT_MASK = 256 enum CodeCompletionLocation -
const LOCATION_OTHER_USER_CODE = 512 enum CodeCompletionLocation -
const LOCATION_OTHER = 1024 enum CodeCompletionLocation -
enum CodeCompletionKind -
enum CodeCompletionLocation -
signal breakpoint_toggled(line: int) -
signal code_completion_requested() -
signal symbol_hovered(column: int) -
signal symbol_lookup(column: int) -
signal symbol_validate(symbol: String) -
self["theme_override_colors/bookmark_color"] = Color(0.5, 0.64, 1, 0.8) as Color -
self["theme_override_colors/brace_mismatch_color"] = Color(1, 0.2, 0.2, 1) as Color -
self["theme_override_colors/breakpoint_color"] = Color(0.9, 0.29, 0.3, 1) as Color -
self["theme_override_colors/code_folding_color"] = Color(0.8, 0.8, 0.8, 0.8) as Color -
self["theme_override_colors/completion_background_color"] = Color(0.17, 0.16, 0.2, 1) as Color -
self["theme_override_colors/completion_existing_color"] = Color(0.87, 0.87, 0.87, 0.13) as Color -
self["theme_override_colors/completion_scroll_color"] = Color(1, 1, 1, 0.29) as Color -
self["theme_override_colors/completion_scroll_hovered_color"] = Color(1, 1, 1, 0.4) as Color -
self["theme_override_colors/completion_selected_color"] = Color(0.26, 0.26, 0.27, 1) as Color -
self["theme_override_colors/executing_line_color"] = Color(0.98, 0.89, 0.27, 1) as Color -
self["theme_override_colors/folded_code_region_color"] = Color(0.68, 0.46, 0.77, 0.2) as Color -
self["theme_override_colors/line_length_guideline_color"] = Color(0.3, 0.5, 0.8, 0.1) as Color -
self["theme_override_colors/line_number_color"] = Color(0.67, 0.67, 0.67, 0.4) as Color -
self["theme_override_constants/completion_lines"] = 7 as int -
self["theme_override_constants/completion_max_width"] = 50 as int -
self["theme_override_constants/completion_scroll_width"] = 6 as int -
self["theme_override_icons/bookmark"] = icon as Texture2D -
self["theme_override_icons/breakpoint"] = icon as Texture2D -
self["theme_override_icons/can_fold"] = icon as Texture2D -
self["theme_override_icons/can_fold_code_region"] = icon as Texture2D -
self["theme_override_icons/completion_color_bg"] = icon as Texture2D -
self["theme_override_icons/executing_line"] = icon as Texture2D -
self["theme_override_icons/folded"] = icon as Texture2D -
self["theme_override_icons/folded_code_region"] = icon as Texture2D -
self["theme_override_icons/folded_eol_icon"] = icon as Texture2D -
self["theme_override_styles/completion"] = style as StyleBox
CodeEdit #
is_instantiable, Node, core, not_builtin_classes
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.
Members #
var auto_brace_completion_enabled: bool = 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.
var auto_brace_completion_highlight_matching: bool = 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.
var auto_brace_completion_pairs: Dictionary = { "\"": "\"", "'": "'", "(": ")", "[": "]", "{": "}" }#
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.
var code_completion_enabled: bool = 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.
var code_completion_prefixes: String[] = []#
Sets prefixes that will trigger code completion.
var delimiter_comments: String[] = []#
Sets the comment delimiters. All existing comment delimiters will be removed.
var delimiter_strings: String[] = ["' '", "\" \""]#
Sets the string delimiters. All existing string delimiters will be removed.
var gutters_draw_bookmarks: bool = false#
If true, bookmarks are drawn in the gutter. This gutter is shared with breakpoints and executing lines. See set_line_as_bookmarked.
var gutters_draw_breakpoints_gutter: bool = 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.
var gutters_draw_executing_lines: bool = false#
If true, executing lines are marked in the gutter. This gutter is shared with breakpoints and bookmarks. See set_line_as_executing.
var gutters_draw_fold_gutter: bool = 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.
var gutters_draw_line_numbers: bool = 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.
var gutters_zero_pad_line_numbers: bool = 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.
var indent_automatic: bool = 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).
var indent_automatic_prefixes: String[] = [":", "{", "[", "("]#
Prefixes to trigger an automatic indent. Used when indent_automatic is set to true.
var indent_size: int = 4#
Size of the tabulation indent (one Tab press) in characters. If indent_use_spaces is enabled the number of spaces to use.
var indent_use_spaces: bool = false#
Use spaces instead of tabs for indentation.
var layout_direction = LAYOUT_DIRECTION_LTR#
var line_folding: bool = 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.
var 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.
var symbol_lookup_on_click: bool = false#
Set when a validated word from symbol_validate is clicked, the symbol_lookup should be emitted.
var symbol_tooltip_on_hover: bool = false#
Set when a word is hovered, the symbol_hovered should be emitted.
var text_direction = TEXT_DIRECTION_LTR#
Methods #
virtual func _confirm_code_completion(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.
virtual const func _filter_code_completion_candidates(candidates: 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.
virtual func _request_code_completion(force: bool) -> void#
Override this method to define what happens when the user requests code completion. If force is true, any checks should be bypassed.
func add_auto_brace_completion_pair(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.
func add_code_completion_option(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 CodeEdit.CodeCompletionLocation for how to set this value.
Note: This list will replace all current candidates.
func add_comment_delimiter(line_only: bool = false) -> void#
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.
func add_string_delimiter(line_only: bool = false) -> void#
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.
const func can_fold_line(line: int) -> bool#
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).
func cancel_code_completion() -> void#
Cancels the autocomplete menu.
func clear_bookmarked_lines() -> void#
Clears all bookmarked lines.
func clear_breakpointed_lines() -> void#
Clears all breakpointed lines.
func clear_comment_delimiters() -> void#
Removes all comment delimiters.
func clear_executing_lines() -> void#
Clears all executed lines.
func clear_string_delimiters() -> void#
Removes all string delimiters.
func confirm_code_completion(replace: bool = false) -> void#
Inserts the selected entry into the text. If replace is true, any existing text is replaced rather than merged.
func convert_indent(to_line: int = -1) -> 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.
func 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)
func delete_lines() -> void#
Deletes all lines that are selected or have a caret on them.
func do_indent() -> void#
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.
func 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.
func duplicate_selection() -> void#
Duplicates all selected text and duplicates all lines with a caret on them.
func fold_all_lines() -> void#
Folds all lines that are possible to be folded (see can_fold_line).
func fold_line(line: int) -> void#
Folds the given line, if possible (see can_fold_line).
const func get_auto_brace_completion_close_key(open_key: String) -> String#
Gets the matching auto brace close key for open_key.
const func get_bookmarked_lines() -> PackedInt32Array#
Gets all bookmarked lines.
const func get_breakpointed_lines() -> PackedInt32Array#
Gets all breakpointed lines.
const func get_code_completion_option(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.
const func get_code_completion_options() -> Dictionary[]#
Gets all completion options, see get_code_completion_option for return content.
const func get_code_completion_selected_index() -> int#
Gets the index of the current selected completion option.
const func get_code_region_end_tag() -> String#
Returns the code region end tag (without comment delimiter).
const func get_code_region_start_tag() -> String#
Returns the code region start tag (without comment delimiter).
const func get_delimiter_end_key(delimiter_index: int) -> String#
Gets the end key for a string or comment region index.
const func get_delimiter_end_position(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.
const func get_delimiter_start_key(delimiter_index: int) -> String#
Gets the start key for a string or comment region index.
const func get_delimiter_start_position(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.
const func get_executing_lines() -> PackedInt32Array#
Gets all executing lines.
const func get_folded_lines() -> int[]#
Returns all lines that are currently folded.
const func get_text_for_code_completion() -> String#
Returns the full text with char 0xFFFF at the caret location.
const func get_text_for_symbol_lookup() -> String#
Returns the full text with char 0xFFFF at the cursor location.
const func get_text_with_cursor_char(column: int) -> String#
Returns the full text with char 0xFFFF at the specified location.
const func has_auto_brace_completion_close_key(close_key: String) -> bool#
Returns true if close key close_key exists.
const func has_auto_brace_completion_open_key(open_key: String) -> bool#
Returns true if open key open_key exists.
const func has_comment_delimiter(start_key: String) -> bool#
Returns true if comment start_key exists.
const func has_string_delimiter(start_key: String) -> bool#
Returns true if string start_key exists.
func indent_lines() -> void#
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.
const func is_in_comment(column: int = -1) -> 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.
const func is_in_string(column: int = -1) -> 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.
const func is_line_bookmarked(line: int) -> bool#
Returns true if the given line is bookmarked. See set_line_as_bookmarked.
const func is_line_breakpointed(line: int) -> bool#
Returns true if the given line is breakpointed. See set_line_as_breakpoint.
const func is_line_code_region_end(line: int) -> bool#
Returns true if the given line is a code region end. See set_code_region_tags.
const func is_line_code_region_start(line: int) -> bool#
Returns true if the given line is a code region start. See set_code_region_tags.
const func is_line_executing(line: int) -> bool#
Returns true if the given line is marked as executing. See set_line_as_executing.
const func is_line_folded(line: int) -> bool#
Returns true if the given line is folded. See fold_line.
func move_lines_down() -> void#
Moves all lines down that are selected or have a caret on them.
func move_lines_up() -> void#
Moves all lines up that are selected or have a caret on them.
func remove_comment_delimiter(start_key: String) -> void#
Removes the comment delimiter with start_key.
func remove_string_delimiter(start_key: String) -> void#
Removes the string delimiter with start_key.
func request_code_completion(force: bool = false) -> 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.
func set_code_completion_selected_index(index: int) -> void#
Sets the current selected completion option.
func set_code_hint(code_hint: String) -> void#
Sets the code hint text. Pass an empty string to clear.
func set_code_hint_draw_below(draw_below: bool) -> void#
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.
func set_code_region_tags(end: String = "endregion") -> void#
Sets the code region start and end tags (without comment delimiter).
func set_line_as_bookmarked(bookmarked: bool) -> void#
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.
func set_line_as_breakpoint(breakpointed: bool) -> void#
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.
func set_line_as_executing(executing: bool) -> void#
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.
func set_symbol_lookup_word_as_valid(valid: bool) -> void#
Sets the symbol emitted by symbol_validate as a valid lookup.
func toggle_foldable_line(line: int) -> void#
Toggle the folding of the code block at the given line.
func toggle_foldable_lines_at_carets() -> void#
Toggle the folding of the code block on all lines with a caret on them.
func unfold_all_lines() -> void#
Unfolds all lines that are folded.
func unfold_line(line: int) -> void#
Unfolds the given line if it is folded or if it is hidden under a folded line.
func unindent_lines() -> void#
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.
func update_code_completion_options(force: 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.
Annotations #
Constants #
const KIND_CLASS = 0 enum CodeCompletionKind#
Marks the option as a class.
const KIND_FUNCTION = 1 enum CodeCompletionKind#
Marks the option as a function.
const KIND_SIGNAL = 2 enum CodeCompletionKind#
Marks the option as a Godot signal.
const KIND_VARIABLE = 3 enum CodeCompletionKind#
Marks the option as a variable.
const KIND_MEMBER = 4 enum CodeCompletionKind#
Marks the option as a member.
const KIND_ENUM = 5 enum CodeCompletionKind#
Marks the option as an enum entry.
const KIND_CONSTANT = 6 enum CodeCompletionKind#
Marks the option as a constant.
const KIND_NODE_PATH = 7 enum CodeCompletionKind#
Marks the option as a Godot node path.
const KIND_FILE_PATH = 8 enum CodeCompletionKind#
Marks the option as a file path.
const KIND_PLAIN_TEXT = 9 enum CodeCompletionKind#
Marks the option as unclassified or plain text.
const LOCATION_LOCAL = 0 enum CodeCompletionLocation#
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).
const LOCATION_PARENT_MASK = 256 enum CodeCompletionLocation#
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.
const LOCATION_OTHER_USER_CODE = 512 enum CodeCompletionLocation#
The option is from user code which is not local and not in a derived class (e.g. Autoload Singletons).
const LOCATION_OTHER = 1024 enum CodeCompletionLocation#
The option is from other engine code, not covered by the other enum constants - e.g. built-in classes.
Constructors #
Enums #
CodeCompletionKind#
enum CodeCompletionKind {
KIND_CLASS = 0,
KIND_FUNCTION = 1,
KIND_SIGNAL = 2,
KIND_VARIABLE = 3,
KIND_MEMBER = 4,
KIND_ENUM = 5,
KIND_CONSTANT = 6,
KIND_NODE_PATH = 7,
KIND_FILE_PATH = 8,
KIND_PLAIN_TEXT = 9,
}CodeCompletionLocation#
enum CodeCompletionLocation {
LOCATION_LOCAL = 0,
LOCATION_PARENT_MASK = 256,
LOCATION_OTHER_USER_CODE = 512,
LOCATION_OTHER = 1024,
} Operators #
Signals #
signal breakpoint_toggled(line: int)#
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.
signal 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.
signal symbol_hovered(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.
signal symbol_lookup(column: int)#
Emitted when the user has clicked on a valid symbol.
signal 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.
Theme Items #
self["theme_override_colors/bookmark_color"] = Color(0.5, 0.64, 1, 0.8) as Color#
Color of the bookmark icon for bookmarked lines.
self["theme_override_colors/brace_mismatch_color"] = Color(1, 0.2, 0.2, 1) as Color#
Color of the text to highlight mismatched braces.
self["theme_override_colors/breakpoint_color"] = Color(0.9, 0.29, 0.3, 1) as Color#
Color of the breakpoint icon for bookmarked lines.
self["theme_override_colors/code_folding_color"] = Color(0.8, 0.8, 0.8, 0.8) as Color#
Color for all icons related to line folding.
self["theme_override_colors/completion_background_color"] = Color(0.17, 0.16, 0.2, 1) as Color#
Sets the background Color for the code completion popup.
self["theme_override_colors/completion_existing_color"] = Color(0.87, 0.87, 0.87, 0.13) as Color#
Background highlight Color for matching text in code completion options.
self["theme_override_colors/completion_scroll_color"] = Color(1, 1, 1, 0.29) as Color#
Color of the scrollbar in the code completion popup.
self["theme_override_colors/completion_scroll_hovered_color"] = Color(1, 1, 1, 0.4) as Color#
Color of the scrollbar in the code completion popup when hovered.
self["theme_override_colors/completion_selected_color"] = Color(0.26, 0.26, 0.27, 1) as Color#
Background highlight Color for the current selected option item in the code completion popup.
self["theme_override_colors/executing_line_color"] = Color(0.98, 0.89, 0.27, 1) as Color#
Color of the executing icon for executing lines.
self["theme_override_colors/folded_code_region_color"] = Color(0.68, 0.46, 0.77, 0.2) as Color#
Color of background line highlight for folded code region.
self["theme_override_colors/line_length_guideline_color"] = Color(0.3, 0.5, 0.8, 0.1) as Color#
Color of the main line length guideline, secondary guidelines will have 50% alpha applied.
self["theme_override_colors/line_number_color"] = Color(0.67, 0.67, 0.67, 0.4) as Color#
Sets the Color of line numbers.
self["theme_override_constants/completion_lines"] = 7 as int#
Max number of options to display in the code completion popup at any one time.
self["theme_override_constants/completion_max_width"] = 50 as int#
Max width of options in the code completion popup. Options longer than this will be cut off.
self["theme_override_constants/completion_scroll_width"] = 6 as int#
Width of the scrollbar in the code completion popup.
self["theme_override_icons/bookmark"] = icon as Texture2D#
Sets a custom Texture2D to draw in the bookmark gutter for bookmarked lines.
self["theme_override_icons/breakpoint"] = icon as Texture2D#
Sets a custom Texture2D to draw in the breakpoint gutter for breakpointed lines.
self["theme_override_icons/can_fold"] = icon as Texture2D#
Sets a custom Texture2D to draw in the line folding gutter when a line can be folded.
self["theme_override_icons/can_fold_code_region"] = icon as Texture2D#
Sets a custom Texture2D to draw in the line folding gutter when a code region can be folded.
self["theme_override_icons/completion_color_bg"] = icon as Texture2D#
Background panel for the color preview box in autocompletion (visible when the color is translucent).
self["theme_override_icons/executing_line"] = icon as Texture2D#
Icon to draw in the executing gutter for executing lines.
self["theme_override_icons/folded"] = icon as Texture2D#
Sets a custom Texture2D to draw in the line folding gutter when a line is folded and can be unfolded.
self["theme_override_icons/folded_code_region"] = icon as Texture2D#
Sets a custom Texture2D to draw in the line folding gutter when a code region is folded and can be unfolded.
self["theme_override_icons/folded_eol_icon"] = icon as Texture2D#
Sets a custom Texture2D to draw at the end of a folded line.
self["theme_override_styles/completion"] = style as StyleBox#
StyleBox for the code completion popup.