-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
Your Godot version:
4.4
Issue description:
While working on a plugin that uses a CodeEdit I found the documentation of it to be a bit sparse.
-
_request_code_completiontakes a boolean argument (force), but the description for it isn't particularly helpfulIf
forceistrue, any checks should be bypassed.It does not specify what those checks entail:
- Are those checks internal, with the parameter as an implementation detail?
- Should the list of suggestions be populated with options that make no sense in the current context? (for example suggesting keywords like
class_nameandvaras parameters for a function call) - Is it only intended to be passed to
update_code_completion_optionswhich also expects a parameter namedforce?
-
set_code_hinthas an undocumented feature for aligning the hint to the caret and highlighting a part of it, similar to how the current parameter is highlighted in Godot's script editor.

It aligns the first occurrence ofchar(0xFFFF)in the hint with the caret (only on the first line). For each line it highlights all text between the first and last occurrence ofchar(0xFFFFF)on that line. The following code would replicate the hint in the screenshot:set_code_hint("type_convert(" + char(0xFFFF) + "variant: Variant" + char(0xFFFF) + ", type: int)")
Relevant Godot source code implementing this feature
-
add_comment_delimiterandadd_string_delimitermight cause some confusion about whether a similarstart_keyis allowed. For example: Godot uses quotes ('/") to denote the start (and end) of a string; three consecutive quotes are used for multi-line strings. This would indicate that only exact matches are considered.start_keymust not be shared with other delimiters. -
_filter_code_completion_candidatesalso sorts the options if no custom implementation has been provided. Users might be able to figure this out, but I feel it is worth pointing it out in the documentation. A different method (orCallableproperty) might be a more suitable location when changing the API.
URL to the documentation page (if already existing):
https://docs.godotengine.org/en/stable/classes/class_codeedit.html