class_codeedit.rst 118 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the CodeEdit.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_CodeEdit:
  6. CodeEdit
  7. ========
  8. **Inherits:** :ref:`TextEdit<class_TextEdit>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. Multiline text control intended for editing code.
  10. Description
  11. -----------
  12. CodeEdit is a specialised :ref:`TextEdit<class_TextEdit>` designed for editing plain text code files. It contains a bunch of features commonly found in code editors such as line numbers, line folding, code completion, indent management and string / comment management.
  13. \ **Note:** By default ``CodeEdit`` always use left-to-right text direction to correctly display source code.
  14. Properties
  15. ----------
  16. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  17. | :ref:`bool<class_bool>` | :ref:`auto_brace_completion_enabled<class_CodeEdit_property_auto_brace_completion_enabled>` | ``false`` |
  18. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  19. | :ref:`bool<class_bool>` | :ref:`auto_brace_completion_highlight_matching<class_CodeEdit_property_auto_brace_completion_highlight_matching>` | ``false`` |
  20. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  21. | :ref:`Dictionary<class_Dictionary>` | :ref:`auto_brace_completion_pairs<class_CodeEdit_property_auto_brace_completion_pairs>` | ``{ "\"": "\"", "'": "'", "(": ")", "[": "]", "{": "}" }`` |
  22. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  23. | :ref:`bool<class_bool>` | :ref:`code_completion_enabled<class_CodeEdit_property_code_completion_enabled>` | ``false`` |
  24. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  25. | :ref:`String[]<class_String>` | :ref:`code_completion_prefixes<class_CodeEdit_property_code_completion_prefixes>` | ``[]`` |
  26. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  27. | :ref:`String[]<class_String>` | :ref:`delimiter_comments<class_CodeEdit_property_delimiter_comments>` | ``[]`` |
  28. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  29. | :ref:`String[]<class_String>` | :ref:`delimiter_strings<class_CodeEdit_property_delimiter_strings>` | ``["' '", "\" \""]`` |
  30. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  31. | :ref:`bool<class_bool>` | :ref:`gutters_draw_bookmarks<class_CodeEdit_property_gutters_draw_bookmarks>` | ``false`` |
  32. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`gutters_draw_breakpoints_gutter<class_CodeEdit_property_gutters_draw_breakpoints_gutter>` | ``false`` |
  34. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  35. | :ref:`bool<class_bool>` | :ref:`gutters_draw_executing_lines<class_CodeEdit_property_gutters_draw_executing_lines>` | ``false`` |
  36. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`gutters_draw_fold_gutter<class_CodeEdit_property_gutters_draw_fold_gutter>` | ``false`` |
  38. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`gutters_draw_line_numbers<class_CodeEdit_property_gutters_draw_line_numbers>` | ``false`` |
  40. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  41. | :ref:`bool<class_bool>` | :ref:`gutters_zero_pad_line_numbers<class_CodeEdit_property_gutters_zero_pad_line_numbers>` | ``false`` |
  42. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  43. | :ref:`bool<class_bool>` | :ref:`indent_automatic<class_CodeEdit_property_indent_automatic>` | ``false`` |
  44. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  45. | :ref:`String[]<class_String>` | :ref:`indent_automatic_prefixes<class_CodeEdit_property_indent_automatic_prefixes>` | ``[":", "{", "[", "("]`` |
  46. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  47. | :ref:`int<class_int>` | :ref:`indent_size<class_CodeEdit_property_indent_size>` | ``4`` |
  48. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  49. | :ref:`bool<class_bool>` | :ref:`indent_use_spaces<class_CodeEdit_property_indent_use_spaces>` | ``false`` |
  50. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  51. | :ref:`LayoutDirection<enum_Control_LayoutDirection>` | layout_direction | ``2`` (overrides :ref:`Control<class_Control_property_layout_direction>`) |
  52. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  53. | :ref:`bool<class_bool>` | :ref:`line_folding<class_CodeEdit_property_line_folding>` | ``false`` |
  54. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  55. | :ref:`int[]<class_int>` | :ref:`line_length_guidelines<class_CodeEdit_property_line_length_guidelines>` | ``[]`` |
  56. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  57. | :ref:`bool<class_bool>` | :ref:`symbol_lookup_on_click<class_CodeEdit_property_symbol_lookup_on_click>` | ``false`` |
  58. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  59. | :ref:`TextDirection<enum_Control_TextDirection>` | text_direction | ``1`` (overrides :ref:`TextEdit<class_TextEdit_property_text_direction>`) |
  60. +------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  61. Methods
  62. -------
  63. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | void | :ref:`_confirm_code_completion<class_CodeEdit_method__confirm_code_completion>` **(** :ref:`bool<class_bool>` replace **)** |virtual| |
  65. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`Array<class_Array>` | :ref:`_filter_code_completion_candidates<class_CodeEdit_method__filter_code_completion_candidates>` **(** :ref:`Dictionary[]<class_Dictionary>` candidates **)** |virtual| |const| |
  67. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | void | :ref:`_request_code_completion<class_CodeEdit_method__request_code_completion>` **(** :ref:`bool<class_bool>` force **)** |virtual| |
  69. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | void | :ref:`add_auto_brace_completion_pair<class_CodeEdit_method_add_auto_brace_completion_pair>` **(** :ref:`String<class_String>` start_key, :ref:`String<class_String>` end_key **)** |
  71. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | void | :ref:`add_code_completion_option<class_CodeEdit_method_add_code_completion_option>` **(** :ref:`CodeCompletionKind<enum_CodeEdit_CodeCompletionKind>` type, :ref:`String<class_String>` display_text, :ref:`String<class_String>` insert_text, :ref:`Color<class_Color>` text_color=Color(1, 1, 1, 1), :ref:`Resource<class_Resource>` icon=null, :ref:`Variant<class_Variant>` value=0 **)** |
  73. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | void | :ref:`add_comment_delimiter<class_CodeEdit_method_add_comment_delimiter>` **(** :ref:`String<class_String>` start_key, :ref:`String<class_String>` end_key, :ref:`bool<class_bool>` line_only=false **)** |
  75. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | void | :ref:`add_string_delimiter<class_CodeEdit_method_add_string_delimiter>` **(** :ref:`String<class_String>` start_key, :ref:`String<class_String>` end_key, :ref:`bool<class_bool>` line_only=false **)** |
  77. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`bool<class_bool>` | :ref:`can_fold_line<class_CodeEdit_method_can_fold_line>` **(** :ref:`int<class_int>` line **)** |const| |
  79. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | void | :ref:`cancel_code_completion<class_CodeEdit_method_cancel_code_completion>` **(** **)** |
  81. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | void | :ref:`clear_bookmarked_lines<class_CodeEdit_method_clear_bookmarked_lines>` **(** **)** |
  83. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | void | :ref:`clear_breakpointed_lines<class_CodeEdit_method_clear_breakpointed_lines>` **(** **)** |
  85. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | void | :ref:`clear_comment_delimiters<class_CodeEdit_method_clear_comment_delimiters>` **(** **)** |
  87. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | void | :ref:`clear_executing_lines<class_CodeEdit_method_clear_executing_lines>` **(** **)** |
  89. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | void | :ref:`clear_string_delimiters<class_CodeEdit_method_clear_string_delimiters>` **(** **)** |
  91. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | void | :ref:`confirm_code_completion<class_CodeEdit_method_confirm_code_completion>` **(** :ref:`bool<class_bool>` replace=false **)** |
  93. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | void | :ref:`do_indent<class_CodeEdit_method_do_indent>` **(** **)** |
  95. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | void | :ref:`do_unindent<class_CodeEdit_method_do_unindent>` **(** **)** |
  97. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | void | :ref:`fold_all_lines<class_CodeEdit_method_fold_all_lines>` **(** **)** |
  99. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | void | :ref:`fold_line<class_CodeEdit_method_fold_line>` **(** :ref:`int<class_int>` line **)** |
  101. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`String<class_String>` | :ref:`get_auto_brace_completion_close_key<class_CodeEdit_method_get_auto_brace_completion_close_key>` **(** :ref:`String<class_String>` open_key **)** |const| |
  103. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | :ref:`Array<class_Array>` | :ref:`get_bookmarked_lines<class_CodeEdit_method_get_bookmarked_lines>` **(** **)** |const| |
  105. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :ref:`Array<class_Array>` | :ref:`get_breakpointed_lines<class_CodeEdit_method_get_breakpointed_lines>` **(** **)** |const| |
  107. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_code_completion_option<class_CodeEdit_method_get_code_completion_option>` **(** :ref:`int<class_int>` index **)** |const| |
  109. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :ref:`Dictionary[]<class_Dictionary>` | :ref:`get_code_completion_options<class_CodeEdit_method_get_code_completion_options>` **(** **)** |const| |
  111. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | :ref:`int<class_int>` | :ref:`get_code_completion_selected_index<class_CodeEdit_method_get_code_completion_selected_index>` **(** **)** |const| |
  113. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | :ref:`String<class_String>` | :ref:`get_delimiter_end_key<class_CodeEdit_method_get_delimiter_end_key>` **(** :ref:`int<class_int>` delimiter_index **)** |const| |
  115. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | :ref:`Vector2<class_Vector2>` | :ref:`get_delimiter_end_position<class_CodeEdit_method_get_delimiter_end_position>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const| |
  117. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | :ref:`String<class_String>` | :ref:`get_delimiter_start_key<class_CodeEdit_method_get_delimiter_start_key>` **(** :ref:`int<class_int>` delimiter_index **)** |const| |
  119. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :ref:`Vector2<class_Vector2>` | :ref:`get_delimiter_start_position<class_CodeEdit_method_get_delimiter_start_position>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const| |
  121. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | :ref:`Array<class_Array>` | :ref:`get_executing_lines<class_CodeEdit_method_get_executing_lines>` **(** **)** |const| |
  123. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | :ref:`int[]<class_int>` | :ref:`get_folded_lines<class_CodeEdit_method_get_folded_lines>` **(** **)** |const| |
  125. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | :ref:`String<class_String>` | :ref:`get_text_for_code_completion<class_CodeEdit_method_get_text_for_code_completion>` **(** **)** |const| |
  127. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | :ref:`String<class_String>` | :ref:`get_text_for_symbol_lookup<class_CodeEdit_method_get_text_for_symbol_lookup>` **(** **)** |
  129. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | :ref:`bool<class_bool>` | :ref:`has_auto_brace_completion_close_key<class_CodeEdit_method_has_auto_brace_completion_close_key>` **(** :ref:`String<class_String>` close_key **)** |const| |
  131. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | :ref:`bool<class_bool>` | :ref:`has_auto_brace_completion_open_key<class_CodeEdit_method_has_auto_brace_completion_open_key>` **(** :ref:`String<class_String>` open_key **)** |const| |
  133. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | :ref:`bool<class_bool>` | :ref:`has_comment_delimiter<class_CodeEdit_method_has_comment_delimiter>` **(** :ref:`String<class_String>` start_key **)** |const| |
  135. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | :ref:`bool<class_bool>` | :ref:`has_string_delimiter<class_CodeEdit_method_has_string_delimiter>` **(** :ref:`String<class_String>` start_key **)** |const| |
  137. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | void | :ref:`indent_lines<class_CodeEdit_method_indent_lines>` **(** **)** |
  139. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | :ref:`int<class_int>` | :ref:`is_in_comment<class_CodeEdit_method_is_in_comment>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column=-1 **)** |const| |
  141. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | :ref:`int<class_int>` | :ref:`is_in_string<class_CodeEdit_method_is_in_string>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column=-1 **)** |const| |
  143. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | :ref:`bool<class_bool>` | :ref:`is_line_bookmarked<class_CodeEdit_method_is_line_bookmarked>` **(** :ref:`int<class_int>` line **)** |const| |
  145. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | :ref:`bool<class_bool>` | :ref:`is_line_breakpointed<class_CodeEdit_method_is_line_breakpointed>` **(** :ref:`int<class_int>` line **)** |const| |
  147. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | :ref:`bool<class_bool>` | :ref:`is_line_executing<class_CodeEdit_method_is_line_executing>` **(** :ref:`int<class_int>` line **)** |const| |
  149. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | :ref:`bool<class_bool>` | :ref:`is_line_folded<class_CodeEdit_method_is_line_folded>` **(** :ref:`int<class_int>` line **)** |const| |
  151. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | void | :ref:`remove_comment_delimiter<class_CodeEdit_method_remove_comment_delimiter>` **(** :ref:`String<class_String>` start_key **)** |
  153. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | void | :ref:`remove_string_delimiter<class_CodeEdit_method_remove_string_delimiter>` **(** :ref:`String<class_String>` start_key **)** |
  155. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | void | :ref:`request_code_completion<class_CodeEdit_method_request_code_completion>` **(** :ref:`bool<class_bool>` force=false **)** |
  157. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | void | :ref:`set_code_completion_selected_index<class_CodeEdit_method_set_code_completion_selected_index>` **(** :ref:`int<class_int>` index **)** |
  159. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | void | :ref:`set_code_hint<class_CodeEdit_method_set_code_hint>` **(** :ref:`String<class_String>` code_hint **)** |
  161. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | void | :ref:`set_code_hint_draw_below<class_CodeEdit_method_set_code_hint_draw_below>` **(** :ref:`bool<class_bool>` draw_below **)** |
  163. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | void | :ref:`set_line_as_bookmarked<class_CodeEdit_method_set_line_as_bookmarked>` **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` bookmarked **)** |
  165. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | void | :ref:`set_line_as_breakpoint<class_CodeEdit_method_set_line_as_breakpoint>` **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` breakpointed **)** |
  167. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | void | :ref:`set_line_as_executing<class_CodeEdit_method_set_line_as_executing>` **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` executing **)** |
  169. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | void | :ref:`set_symbol_lookup_word_as_valid<class_CodeEdit_method_set_symbol_lookup_word_as_valid>` **(** :ref:`bool<class_bool>` valid **)** |
  171. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | void | :ref:`toggle_foldable_line<class_CodeEdit_method_toggle_foldable_line>` **(** :ref:`int<class_int>` line **)** |
  173. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | void | :ref:`unfold_all_lines<class_CodeEdit_method_unfold_all_lines>` **(** **)** |
  175. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | void | :ref:`unfold_line<class_CodeEdit_method_unfold_line>` **(** :ref:`int<class_int>` line **)** |
  177. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | void | :ref:`unindent_lines<class_CodeEdit_method_unindent_lines>` **(** **)** |
  179. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | void | :ref:`update_code_completion_options<class_CodeEdit_method_update_code_completion_options>` **(** :ref:`bool<class_bool>` force **)** |
  181. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. Theme Properties
  183. ----------------
  184. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  185. | :ref:`Color<class_Color>` | :ref:`background_color<class_CodeEdit_theme_color_background_color>` | ``Color(0, 0, 0, 0)`` |
  186. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  187. | :ref:`Color<class_Color>` | :ref:`bookmark_color<class_CodeEdit_theme_color_bookmark_color>` | ``Color(0.5, 0.64, 1, 0.8)`` |
  188. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  189. | :ref:`Color<class_Color>` | :ref:`brace_mismatch_color<class_CodeEdit_theme_color_brace_mismatch_color>` | ``Color(1, 0.2, 0.2, 1)`` |
  190. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  191. | :ref:`Color<class_Color>` | :ref:`breakpoint_color<class_CodeEdit_theme_color_breakpoint_color>` | ``Color(0.9, 0.29, 0.3, 1)`` |
  192. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  193. | :ref:`Color<class_Color>` | :ref:`caret_background_color<class_CodeEdit_theme_color_caret_background_color>` | ``Color(0, 0, 0, 1)`` |
  194. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  195. | :ref:`Color<class_Color>` | :ref:`caret_color<class_CodeEdit_theme_color_caret_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
  196. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  197. | :ref:`Color<class_Color>` | :ref:`code_folding_color<class_CodeEdit_theme_color_code_folding_color>` | ``Color(0.8, 0.8, 0.8, 0.8)`` |
  198. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  199. | :ref:`Color<class_Color>` | :ref:`completion_background_color<class_CodeEdit_theme_color_completion_background_color>` | ``Color(0.17, 0.16, 0.2, 1)`` |
  200. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  201. | :ref:`Color<class_Color>` | :ref:`completion_existing_color<class_CodeEdit_theme_color_completion_existing_color>` | ``Color(0.87, 0.87, 0.87, 0.13)`` |
  202. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  203. | :ref:`Color<class_Color>` | :ref:`completion_font_color<class_CodeEdit_theme_color_completion_font_color>` | ``Color(0.67, 0.67, 0.67, 1)`` |
  204. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  205. | :ref:`Color<class_Color>` | :ref:`completion_scroll_color<class_CodeEdit_theme_color_completion_scroll_color>` | ``Color(1, 1, 1, 0.29)`` |
  206. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  207. | :ref:`Color<class_Color>` | :ref:`completion_scroll_hovered_color<class_CodeEdit_theme_color_completion_scroll_hovered_color>` | ``Color(1, 1, 1, 0.4)`` |
  208. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  209. | :ref:`Color<class_Color>` | :ref:`completion_selected_color<class_CodeEdit_theme_color_completion_selected_color>` | ``Color(0.26, 0.26, 0.27, 1)`` |
  210. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  211. | :ref:`Color<class_Color>` | :ref:`current_line_color<class_CodeEdit_theme_color_current_line_color>` | ``Color(0.25, 0.25, 0.26, 0.8)`` |
  212. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  213. | :ref:`Color<class_Color>` | :ref:`executing_line_color<class_CodeEdit_theme_color_executing_line_color>` | ``Color(0.98, 0.89, 0.27, 1)`` |
  214. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  215. | :ref:`Color<class_Color>` | :ref:`font_color<class_CodeEdit_theme_color_font_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
  216. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  217. | :ref:`Color<class_Color>` | :ref:`font_outline_color<class_CodeEdit_theme_color_font_outline_color>` | ``Color(1, 1, 1, 1)`` |
  218. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  219. | :ref:`Color<class_Color>` | :ref:`font_placeholder_color<class_CodeEdit_theme_color_font_placeholder_color>` | ``Color(0.875, 0.875, 0.875, 0.6)`` |
  220. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  221. | :ref:`Color<class_Color>` | :ref:`font_readonly_color<class_CodeEdit_theme_color_font_readonly_color>` | ``Color(0.875, 0.875, 0.875, 0.5)`` |
  222. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  223. | :ref:`Color<class_Color>` | :ref:`font_selected_color<class_CodeEdit_theme_color_font_selected_color>` | ``Color(0, 0, 0, 1)`` |
  224. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  225. | :ref:`Color<class_Color>` | :ref:`line_length_guideline_color<class_CodeEdit_theme_color_line_length_guideline_color>` | ``Color(0.3, 0.5, 0.8, 0.1)`` |
  226. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  227. | :ref:`Color<class_Color>` | :ref:`line_number_color<class_CodeEdit_theme_color_line_number_color>` | ``Color(0.67, 0.67, 0.67, 0.4)`` |
  228. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  229. | :ref:`Color<class_Color>` | :ref:`search_result_border_color<class_CodeEdit_theme_color_search_result_border_color>` | ``Color(0.3, 0.3, 0.3, 0.4)`` |
  230. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  231. | :ref:`Color<class_Color>` | :ref:`search_result_color<class_CodeEdit_theme_color_search_result_color>` | ``Color(0.3, 0.3, 0.3, 1)`` |
  232. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  233. | :ref:`Color<class_Color>` | :ref:`selection_color<class_CodeEdit_theme_color_selection_color>` | ``Color(0.5, 0.5, 0.5, 1)`` |
  234. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  235. | :ref:`Color<class_Color>` | :ref:`word_highlighted_color<class_CodeEdit_theme_color_word_highlighted_color>` | ``Color(0.8, 0.9, 0.9, 0.15)`` |
  236. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  237. | :ref:`int<class_int>` | :ref:`completion_lines<class_CodeEdit_theme_constant_completion_lines>` | ``7`` |
  238. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  239. | :ref:`int<class_int>` | :ref:`completion_max_width<class_CodeEdit_theme_constant_completion_max_width>` | ``50`` |
  240. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  241. | :ref:`int<class_int>` | :ref:`completion_scroll_width<class_CodeEdit_theme_constant_completion_scroll_width>` | ``6`` |
  242. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  243. | :ref:`int<class_int>` | :ref:`line_spacing<class_CodeEdit_theme_constant_line_spacing>` | ``4`` |
  244. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  245. | :ref:`int<class_int>` | :ref:`outline_size<class_CodeEdit_theme_constant_outline_size>` | ``0`` |
  246. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  247. | :ref:`Font<class_Font>` | :ref:`font<class_CodeEdit_theme_font_font>` | |
  248. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  249. | :ref:`int<class_int>` | :ref:`font_size<class_CodeEdit_theme_font_size_font_size>` | |
  250. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  251. | :ref:`Texture2D<class_Texture2D>` | :ref:`bookmark<class_CodeEdit_theme_icon_bookmark>` | |
  252. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  253. | :ref:`Texture2D<class_Texture2D>` | :ref:`breakpoint<class_CodeEdit_theme_icon_breakpoint>` | |
  254. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  255. | :ref:`Texture2D<class_Texture2D>` | :ref:`can_fold<class_CodeEdit_theme_icon_can_fold>` | |
  256. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  257. | :ref:`Texture2D<class_Texture2D>` | :ref:`executing_line<class_CodeEdit_theme_icon_executing_line>` | |
  258. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  259. | :ref:`Texture2D<class_Texture2D>` | :ref:`folded<class_CodeEdit_theme_icon_folded>` | |
  260. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  261. | :ref:`Texture2D<class_Texture2D>` | :ref:`folded_eol_icon<class_CodeEdit_theme_icon_folded_eol_icon>` | |
  262. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  263. | :ref:`Texture2D<class_Texture2D>` | :ref:`space<class_CodeEdit_theme_icon_space>` | |
  264. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  265. | :ref:`Texture2D<class_Texture2D>` | :ref:`tab<class_CodeEdit_theme_icon_tab>` | |
  266. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  267. | :ref:`StyleBox<class_StyleBox>` | :ref:`completion<class_CodeEdit_theme_style_completion>` | |
  268. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  269. | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_CodeEdit_theme_style_focus>` | |
  270. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  271. | :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_CodeEdit_theme_style_normal>` | |
  272. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  273. | :ref:`StyleBox<class_StyleBox>` | :ref:`read_only<class_CodeEdit_theme_style_read_only>` | |
  274. +-----------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------+
  275. Signals
  276. -------
  277. .. _class_CodeEdit_signal_breakpoint_toggled:
  278. - **breakpoint_toggled** **(** :ref:`int<class_int>` line **)**
  279. 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.
  280. ----
  281. .. _class_CodeEdit_signal_code_completion_requested:
  282. - **code_completion_requested** **(** **)**
  283. Emitted when the user requests code completion.
  284. ----
  285. .. _class_CodeEdit_signal_symbol_lookup:
  286. - **symbol_lookup** **(** :ref:`String<class_String>` symbol, :ref:`int<class_int>` line, :ref:`int<class_int>` column **)**
  287. Emitted when the user has clicked on a valid symbol.
  288. ----
  289. .. _class_CodeEdit_signal_symbol_validate:
  290. - **symbol_validate** **(** :ref:`String<class_String>` symbol **)**
  291. Emitted when the user hovers over a symbol. The symbol should be validated and responded to, by calling :ref:`set_symbol_lookup_word_as_valid<class_CodeEdit_method_set_symbol_lookup_word_as_valid>`.
  292. Enumerations
  293. ------------
  294. .. _enum_CodeEdit_CodeCompletionKind:
  295. .. _class_CodeEdit_constant_KIND_CLASS:
  296. .. _class_CodeEdit_constant_KIND_FUNCTION:
  297. .. _class_CodeEdit_constant_KIND_SIGNAL:
  298. .. _class_CodeEdit_constant_KIND_VARIABLE:
  299. .. _class_CodeEdit_constant_KIND_MEMBER:
  300. .. _class_CodeEdit_constant_KIND_ENUM:
  301. .. _class_CodeEdit_constant_KIND_CONSTANT:
  302. .. _class_CodeEdit_constant_KIND_NODE_PATH:
  303. .. _class_CodeEdit_constant_KIND_FILE_PATH:
  304. .. _class_CodeEdit_constant_KIND_PLAIN_TEXT:
  305. enum **CodeCompletionKind**:
  306. - **KIND_CLASS** = **0** --- Marks the option as a class.
  307. - **KIND_FUNCTION** = **1** --- Marks the option as a function.
  308. - **KIND_SIGNAL** = **2** --- Marks the option as a Godot signal.
  309. - **KIND_VARIABLE** = **3** --- Marks the option as a variable.
  310. - **KIND_MEMBER** = **4** --- Marks the option as a member.
  311. - **KIND_ENUM** = **5** --- Marks the option as a enum entry.
  312. - **KIND_CONSTANT** = **6** --- Marks the option as a constant.
  313. - **KIND_NODE_PATH** = **7** --- Marks the option as a Godot node path.
  314. - **KIND_FILE_PATH** = **8** --- Marks the option as a file path.
  315. - **KIND_PLAIN_TEXT** = **9** --- Marks the option as unclassified or plain text.
  316. Property Descriptions
  317. ---------------------
  318. .. _class_CodeEdit_property_auto_brace_completion_enabled:
  319. - :ref:`bool<class_bool>` **auto_brace_completion_enabled**
  320. +-----------+------------------------------------------+
  321. | *Default* | ``false`` |
  322. +-----------+------------------------------------------+
  323. | *Setter* | set_auto_brace_completion_enabled(value) |
  324. +-----------+------------------------------------------+
  325. | *Getter* | is_auto_brace_completion_enabled() |
  326. +-----------+------------------------------------------+
  327. Sets whether brace pairs should be autocompleted.
  328. ----
  329. .. _class_CodeEdit_property_auto_brace_completion_highlight_matching:
  330. - :ref:`bool<class_bool>` **auto_brace_completion_highlight_matching**
  331. +-----------+----------------------------------------------+
  332. | *Default* | ``false`` |
  333. +-----------+----------------------------------------------+
  334. | *Setter* | set_highlight_matching_braces_enabled(value) |
  335. +-----------+----------------------------------------------+
  336. | *Getter* | is_highlight_matching_braces_enabled() |
  337. +-----------+----------------------------------------------+
  338. Highlight mismatching brace pairs.
  339. ----
  340. .. _class_CodeEdit_property_auto_brace_completion_pairs:
  341. - :ref:`Dictionary<class_Dictionary>` **auto_brace_completion_pairs**
  342. +-----------+------------------------------------------------------------+
  343. | *Default* | ``{ "\"": "\"", "'": "'", "(": ")", "[": "]", "{": "}" }`` |
  344. +-----------+------------------------------------------------------------+
  345. | *Setter* | set_auto_brace_completion_pairs(value) |
  346. +-----------+------------------------------------------------------------+
  347. | *Getter* | get_auto_brace_completion_pairs() |
  348. +-----------+------------------------------------------------------------+
  349. Sets the brace pairs to be autocompleted.
  350. ----
  351. .. _class_CodeEdit_property_code_completion_enabled:
  352. - :ref:`bool<class_bool>` **code_completion_enabled**
  353. +-----------+------------------------------------+
  354. | *Default* | ``false`` |
  355. +-----------+------------------------------------+
  356. | *Setter* | set_code_completion_enabled(value) |
  357. +-----------+------------------------------------+
  358. | *Getter* | is_code_completion_enabled() |
  359. +-----------+------------------------------------+
  360. Sets whether code completion is allowed.
  361. ----
  362. .. _class_CodeEdit_property_code_completion_prefixes:
  363. - :ref:`String[]<class_String>` **code_completion_prefixes**
  364. +-----------+-------------------------------------+
  365. | *Default* | ``[]`` |
  366. +-----------+-------------------------------------+
  367. | *Setter* | set_code_completion_prefixes(value) |
  368. +-----------+-------------------------------------+
  369. | *Getter* | get_code_comletion_prefixes() |
  370. +-----------+-------------------------------------+
  371. Sets prefixes that will trigger code completion.
  372. ----
  373. .. _class_CodeEdit_property_delimiter_comments:
  374. - :ref:`String[]<class_String>` **delimiter_comments**
  375. +-----------+-------------------------------+
  376. | *Default* | ``[]`` |
  377. +-----------+-------------------------------+
  378. | *Setter* | set_comment_delimiters(value) |
  379. +-----------+-------------------------------+
  380. | *Getter* | get_comment_delimiters() |
  381. +-----------+-------------------------------+
  382. Sets the comment delimiters. All existing comment delimiters will be removed.
  383. ----
  384. .. _class_CodeEdit_property_delimiter_strings:
  385. - :ref:`String[]<class_String>` **delimiter_strings**
  386. +-----------+------------------------------+
  387. | *Default* | ``["' '", "\" \""]`` |
  388. +-----------+------------------------------+
  389. | *Setter* | set_string_delimiters(value) |
  390. +-----------+------------------------------+
  391. | *Getter* | get_string_delimiters() |
  392. +-----------+------------------------------+
  393. Sets the string delimiters. All existing string delimiters will be removed.
  394. ----
  395. .. _class_CodeEdit_property_gutters_draw_bookmarks:
  396. - :ref:`bool<class_bool>` **gutters_draw_bookmarks**
  397. +-----------+----------------------------------+
  398. | *Default* | ``false`` |
  399. +-----------+----------------------------------+
  400. | *Setter* | set_draw_bookmarks_gutter(value) |
  401. +-----------+----------------------------------+
  402. | *Getter* | is_drawing_bookmarks_gutter() |
  403. +-----------+----------------------------------+
  404. Sets if bookmarked should be drawn in the gutter. This gutter is shared with breakpoints and executing lines.
  405. ----
  406. .. _class_CodeEdit_property_gutters_draw_breakpoints_gutter:
  407. - :ref:`bool<class_bool>` **gutters_draw_breakpoints_gutter**
  408. +-----------+------------------------------------+
  409. | *Default* | ``false`` |
  410. +-----------+------------------------------------+
  411. | *Setter* | set_draw_breakpoints_gutter(value) |
  412. +-----------+------------------------------------+
  413. | *Getter* | is_drawing_breakpoints_gutter() |
  414. +-----------+------------------------------------+
  415. Sets if breakpoints should be drawn in the gutter. This gutter is shared with bookmarks and executing lines.
  416. ----
  417. .. _class_CodeEdit_property_gutters_draw_executing_lines:
  418. - :ref:`bool<class_bool>` **gutters_draw_executing_lines**
  419. +-----------+----------------------------------------+
  420. | *Default* | ``false`` |
  421. +-----------+----------------------------------------+
  422. | *Setter* | set_draw_executing_lines_gutter(value) |
  423. +-----------+----------------------------------------+
  424. | *Getter* | is_drawing_executing_lines_gutter() |
  425. +-----------+----------------------------------------+
  426. Sets if executing lines should be marked in the gutter. This gutter is shared with breakpoints and bookmarks lines.
  427. ----
  428. .. _class_CodeEdit_property_gutters_draw_fold_gutter:
  429. - :ref:`bool<class_bool>` **gutters_draw_fold_gutter**
  430. +-----------+-----------------------------+
  431. | *Default* | ``false`` |
  432. +-----------+-----------------------------+
  433. | *Setter* | set_draw_fold_gutter(value) |
  434. +-----------+-----------------------------+
  435. | *Getter* | is_drawing_fold_gutter() |
  436. +-----------+-----------------------------+
  437. Sets if foldable lines icons should be drawn in the gutter.
  438. ----
  439. .. _class_CodeEdit_property_gutters_draw_line_numbers:
  440. - :ref:`bool<class_bool>` **gutters_draw_line_numbers**
  441. +-----------+--------------------------------+
  442. | *Default* | ``false`` |
  443. +-----------+--------------------------------+
  444. | *Setter* | set_draw_line_numbers(value) |
  445. +-----------+--------------------------------+
  446. | *Getter* | is_draw_line_numbers_enabled() |
  447. +-----------+--------------------------------+
  448. Sets if line numbers should be drawn in the gutter.
  449. ----
  450. .. _class_CodeEdit_property_gutters_zero_pad_line_numbers:
  451. - :ref:`bool<class_bool>` **gutters_zero_pad_line_numbers**
  452. +-----------+-------------------------------------+
  453. | *Default* | ``false`` |
  454. +-----------+-------------------------------------+
  455. | *Setter* | set_line_numbers_zero_padded(value) |
  456. +-----------+-------------------------------------+
  457. | *Getter* | is_line_numbers_zero_padded() |
  458. +-----------+-------------------------------------+
  459. Sets if line numbers drawn in the gutter are zero padded.
  460. ----
  461. .. _class_CodeEdit_property_indent_automatic:
  462. - :ref:`bool<class_bool>` **indent_automatic**
  463. +-----------+--------------------------------+
  464. | *Default* | ``false`` |
  465. +-----------+--------------------------------+
  466. | *Setter* | set_auto_indent_enabled(value) |
  467. +-----------+--------------------------------+
  468. | *Getter* | is_auto_indent_enabled() |
  469. +-----------+--------------------------------+
  470. Sets whether automatic indent are enabled, this will add an extra indent if a prefix or brace is found.
  471. ----
  472. .. _class_CodeEdit_property_indent_automatic_prefixes:
  473. - :ref:`String[]<class_String>` **indent_automatic_prefixes**
  474. +-----------+---------------------------------+
  475. | *Default* | ``[":", "{", "[", "("]`` |
  476. +-----------+---------------------------------+
  477. | *Setter* | set_auto_indent_prefixes(value) |
  478. +-----------+---------------------------------+
  479. | *Getter* | get_auto_indent_prefixes() |
  480. +-----------+---------------------------------+
  481. Prefixes to trigger an automatic indent.
  482. ----
  483. .. _class_CodeEdit_property_indent_size:
  484. - :ref:`int<class_int>` **indent_size**
  485. +-----------+------------------------+
  486. | *Default* | ``4`` |
  487. +-----------+------------------------+
  488. | *Setter* | set_indent_size(value) |
  489. +-----------+------------------------+
  490. | *Getter* | get_indent_size() |
  491. +-----------+------------------------+
  492. Size of tabs, if ``indent_use_spaces`` is enabled the amount of spaces to use.
  493. ----
  494. .. _class_CodeEdit_property_indent_use_spaces:
  495. - :ref:`bool<class_bool>` **indent_use_spaces**
  496. +-----------+--------------------------------+
  497. | *Default* | ``false`` |
  498. +-----------+--------------------------------+
  499. | *Setter* | set_indent_using_spaces(value) |
  500. +-----------+--------------------------------+
  501. | *Getter* | is_indent_using_spaces() |
  502. +-----------+--------------------------------+
  503. Use spaces instead of tabs for indentation.
  504. ----
  505. .. _class_CodeEdit_property_line_folding:
  506. - :ref:`bool<class_bool>` **line_folding**
  507. +-----------+---------------------------------+
  508. | *Default* | ``false`` |
  509. +-----------+---------------------------------+
  510. | *Setter* | set_line_folding_enabled(value) |
  511. +-----------+---------------------------------+
  512. | *Getter* | is_line_folding_enabled() |
  513. +-----------+---------------------------------+
  514. Sets whether line folding is allowed.
  515. ----
  516. .. _class_CodeEdit_property_line_length_guidelines:
  517. - :ref:`int[]<class_int>` **line_length_guidelines**
  518. +-----------+-----------------------------------+
  519. | *Default* | ``[]`` |
  520. +-----------+-----------------------------------+
  521. | *Setter* | set_line_length_guidelines(value) |
  522. +-----------+-----------------------------------+
  523. | *Getter* | get_line_length_guidelines() |
  524. +-----------+-----------------------------------+
  525. Draws vertical lines at the provided columns. The first entry is considered a main hard guideline and is draw more prominently
  526. ----
  527. .. _class_CodeEdit_property_symbol_lookup_on_click:
  528. - :ref:`bool<class_bool>` **symbol_lookup_on_click**
  529. +-----------+-------------------------------------------+
  530. | *Default* | ``false`` |
  531. +-----------+-------------------------------------------+
  532. | *Setter* | set_symbol_lookup_on_click_enabled(value) |
  533. +-----------+-------------------------------------------+
  534. | *Getter* | is_symbol_lookup_on_click_enabled() |
  535. +-----------+-------------------------------------------+
  536. Set when a validated word from :ref:`symbol_validate<class_CodeEdit_signal_symbol_validate>` is clicked, the :ref:`symbol_lookup<class_CodeEdit_signal_symbol_lookup>` should be emitted.
  537. Method Descriptions
  538. -------------------
  539. .. _class_CodeEdit_method__confirm_code_completion:
  540. - void **_confirm_code_completion** **(** :ref:`bool<class_bool>` replace **)** |virtual|
  541. Override this method to define how the selected entry should be inserted. If ``replace`` is true, any existing text should be replaced.
  542. ----
  543. .. _class_CodeEdit_method__filter_code_completion_candidates:
  544. - :ref:`Array<class_Array>` **_filter_code_completion_candidates** **(** :ref:`Dictionary[]<class_Dictionary>` candidates **)** |virtual| |const|
  545. Override this method to define what items in ``candidates`` should be displayed.
  546. Both ``candidates`` and the return is a :ref:`Array<class_Array>` of :ref:`Dictionary<class_Dictionary>`, see :ref:`get_code_completion_option<class_CodeEdit_method_get_code_completion_option>` for :ref:`Dictionary<class_Dictionary>` content.
  547. ----
  548. .. _class_CodeEdit_method__request_code_completion:
  549. - void **_request_code_completion** **(** :ref:`bool<class_bool>` force **)** |virtual|
  550. Override this method to define what happens when the user requests code completion. If ``force`` is true, any checks should be bypassed.
  551. ----
  552. .. _class_CodeEdit_method_add_auto_brace_completion_pair:
  553. - void **add_auto_brace_completion_pair** **(** :ref:`String<class_String>` start_key, :ref:`String<class_String>` end_key **)**
  554. Adds a brace pair.
  555. Both the start and end keys must be symbols. Only the start key has to be unique.
  556. ----
  557. .. _class_CodeEdit_method_add_code_completion_option:
  558. - void **add_code_completion_option** **(** :ref:`CodeCompletionKind<enum_CodeEdit_CodeCompletionKind>` type, :ref:`String<class_String>` display_text, :ref:`String<class_String>` insert_text, :ref:`Color<class_Color>` text_color=Color(1, 1, 1, 1), :ref:`Resource<class_Resource>` icon=null, :ref:`Variant<class_Variant>` value=0 **)**
  559. Submits an item to the queue of potential candidates for the autocomplete menu. Call :ref:`update_code_completion_options<class_CodeEdit_method_update_code_completion_options>` to update the list.
  560. \ **Note:** This list will replace all current candidates.
  561. ----
  562. .. _class_CodeEdit_method_add_comment_delimiter:
  563. - void **add_comment_delimiter** **(** :ref:`String<class_String>` start_key, :ref:`String<class_String>` end_key, :ref:`bool<class_bool>` line_only=false **)**
  564. Adds a comment delimiter.
  565. Both the start and end keys must be symbols. Only the start key has to be unique.
  566. 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``.
  567. ----
  568. .. _class_CodeEdit_method_add_string_delimiter:
  569. - void **add_string_delimiter** **(** :ref:`String<class_String>` start_key, :ref:`String<class_String>` end_key, :ref:`bool<class_bool>` line_only=false **)**
  570. Adds a string delimiter.
  571. Both the start and end keys must be symbols. Only the start key has to be unique.
  572. 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``.
  573. ----
  574. .. _class_CodeEdit_method_can_fold_line:
  575. - :ref:`bool<class_bool>` **can_fold_line** **(** :ref:`int<class_int>` line **)** |const|
  576. Returns if the given line is foldable, that is, it has indented lines right below it or a comment / string block.
  577. ----
  578. .. _class_CodeEdit_method_cancel_code_completion:
  579. - void **cancel_code_completion** **(** **)**
  580. Cancels the autocomplete menu.
  581. ----
  582. .. _class_CodeEdit_method_clear_bookmarked_lines:
  583. - void **clear_bookmarked_lines** **(** **)**
  584. Clears all bookmarked lines.
  585. ----
  586. .. _class_CodeEdit_method_clear_breakpointed_lines:
  587. - void **clear_breakpointed_lines** **(** **)**
  588. Clears all breakpointed lines.
  589. ----
  590. .. _class_CodeEdit_method_clear_comment_delimiters:
  591. - void **clear_comment_delimiters** **(** **)**
  592. Removes all comment delimiters.
  593. ----
  594. .. _class_CodeEdit_method_clear_executing_lines:
  595. - void **clear_executing_lines** **(** **)**
  596. Clears all executed lines.
  597. ----
  598. .. _class_CodeEdit_method_clear_string_delimiters:
  599. - void **clear_string_delimiters** **(** **)**
  600. Removes all string delimiters.
  601. ----
  602. .. _class_CodeEdit_method_confirm_code_completion:
  603. - void **confirm_code_completion** **(** :ref:`bool<class_bool>` replace=false **)**
  604. Inserts the selected entry into the text. If ``replace`` is true, any existing text is replaced rather then merged.
  605. ----
  606. .. _class_CodeEdit_method_do_indent:
  607. - void **do_indent** **(** **)**
  608. Perform an indent as if the user activated the "ui_text_indent" action.
  609. ----
  610. .. _class_CodeEdit_method_do_unindent:
  611. - void **do_unindent** **(** **)**
  612. Perform an unindent as if the user activated the "ui_text_unindent" action.
  613. ----
  614. .. _class_CodeEdit_method_fold_all_lines:
  615. - void **fold_all_lines** **(** **)**
  616. Folds all lines that are possible to be folded (see :ref:`can_fold_line<class_CodeEdit_method_can_fold_line>`).
  617. ----
  618. .. _class_CodeEdit_method_fold_line:
  619. - void **fold_line** **(** :ref:`int<class_int>` line **)**
  620. Folds the given line, if possible (see :ref:`can_fold_line<class_CodeEdit_method_can_fold_line>`).
  621. ----
  622. .. _class_CodeEdit_method_get_auto_brace_completion_close_key:
  623. - :ref:`String<class_String>` **get_auto_brace_completion_close_key** **(** :ref:`String<class_String>` open_key **)** |const|
  624. Gets the matching auto brace close key for ``open_key``.
  625. ----
  626. .. _class_CodeEdit_method_get_bookmarked_lines:
  627. - :ref:`Array<class_Array>` **get_bookmarked_lines** **(** **)** |const|
  628. Gets all bookmarked lines.
  629. ----
  630. .. _class_CodeEdit_method_get_breakpointed_lines:
  631. - :ref:`Array<class_Array>` **get_breakpointed_lines** **(** **)** |const|
  632. Gets all breakpointed lines.
  633. ----
  634. .. _class_CodeEdit_method_get_code_completion_option:
  635. - :ref:`Dictionary<class_Dictionary>` **get_code_completion_option** **(** :ref:`int<class_int>` index **)** |const|
  636. Gets the completion option at ``index``. The return :ref:`Dictionary<class_Dictionary>` has the following key-values:
  637. \ ``kind``: :ref:`CodeCompletionKind<enum_CodeEdit_CodeCompletionKind>`\
  638. \ ``display_text``: Text that is shown on the autocomplete menu.
  639. \ ``insert_text``: Text that is to be inserted when this item is selected.
  640. \ ``font_color``: Color of the text on the autocomplete menu.
  641. \ ``icon``: Icon to draw on the autocomplete menu.
  642. \ ``default_value``: Value of the symbol.
  643. ----
  644. .. _class_CodeEdit_method_get_code_completion_options:
  645. - :ref:`Dictionary[]<class_Dictionary>` **get_code_completion_options** **(** **)** |const|
  646. Gets all completion options, see :ref:`get_code_completion_option<class_CodeEdit_method_get_code_completion_option>` for return content.
  647. ----
  648. .. _class_CodeEdit_method_get_code_completion_selected_index:
  649. - :ref:`int<class_int>` **get_code_completion_selected_index** **(** **)** |const|
  650. Gets the index of the current selected completion option.
  651. ----
  652. .. _class_CodeEdit_method_get_delimiter_end_key:
  653. - :ref:`String<class_String>` **get_delimiter_end_key** **(** :ref:`int<class_int>` delimiter_index **)** |const|
  654. Gets the end key for a string or comment region index.
  655. ----
  656. .. _class_CodeEdit_method_get_delimiter_end_position:
  657. - :ref:`Vector2<class_Vector2>` **get_delimiter_end_position** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const|
  658. 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 :ref:`Vector2<class_Vector2>` values will be ``-1``.
  659. ----
  660. .. _class_CodeEdit_method_get_delimiter_start_key:
  661. - :ref:`String<class_String>` **get_delimiter_start_key** **(** :ref:`int<class_int>` delimiter_index **)** |const|
  662. Gets the start key for a string or comment region index.
  663. ----
  664. .. _class_CodeEdit_method_get_delimiter_start_position:
  665. - :ref:`Vector2<class_Vector2>` **get_delimiter_start_position** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const|
  666. 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 :ref:`Vector2<class_Vector2>` values will be ``-1``.
  667. ----
  668. .. _class_CodeEdit_method_get_executing_lines:
  669. - :ref:`Array<class_Array>` **get_executing_lines** **(** **)** |const|
  670. Gets all executing lines.
  671. ----
  672. .. _class_CodeEdit_method_get_folded_lines:
  673. - :ref:`int[]<class_int>` **get_folded_lines** **(** **)** |const|
  674. Returns all lines that are current folded.
  675. ----
  676. .. _class_CodeEdit_method_get_text_for_code_completion:
  677. - :ref:`String<class_String>` **get_text_for_code_completion** **(** **)** |const|
  678. Returns the full text with char ``0xFFFF`` at the caret location.
  679. ----
  680. .. _class_CodeEdit_method_get_text_for_symbol_lookup:
  681. - :ref:`String<class_String>` **get_text_for_symbol_lookup** **(** **)**
  682. Returns the full text with char ``0xFFFF`` at the cursor location.
  683. ----
  684. .. _class_CodeEdit_method_has_auto_brace_completion_close_key:
  685. - :ref:`bool<class_bool>` **has_auto_brace_completion_close_key** **(** :ref:`String<class_String>` close_key **)** |const|
  686. Returns ``true`` if close key ``close_key`` exists.
  687. ----
  688. .. _class_CodeEdit_method_has_auto_brace_completion_open_key:
  689. - :ref:`bool<class_bool>` **has_auto_brace_completion_open_key** **(** :ref:`String<class_String>` open_key **)** |const|
  690. Returns ``true`` if open key ``open_key`` exists.
  691. ----
  692. .. _class_CodeEdit_method_has_comment_delimiter:
  693. - :ref:`bool<class_bool>` **has_comment_delimiter** **(** :ref:`String<class_String>` start_key **)** |const|
  694. Returns ``true`` if comment ``start_key`` exists.
  695. ----
  696. .. _class_CodeEdit_method_has_string_delimiter:
  697. - :ref:`bool<class_bool>` **has_string_delimiter** **(** :ref:`String<class_String>` start_key **)** |const|
  698. Returns ``true`` if string ``start_key`` exists.
  699. ----
  700. .. _class_CodeEdit_method_indent_lines:
  701. - void **indent_lines** **(** **)**
  702. Indents selected lines, or in the case of no selection the caret line by one.
  703. ----
  704. .. _class_CodeEdit_method_is_in_comment:
  705. - :ref:`int<class_int>` **is_in_comment** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column=-1 **)** |const|
  706. 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``.
  707. ----
  708. .. _class_CodeEdit_method_is_in_string:
  709. - :ref:`int<class_int>` **is_in_string** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column=-1 **)** |const|
  710. 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``.
  711. ----
  712. .. _class_CodeEdit_method_is_line_bookmarked:
  713. - :ref:`bool<class_bool>` **is_line_bookmarked** **(** :ref:`int<class_int>` line **)** |const|
  714. Returns whether the line at the specified index is bookmarked or not.
  715. ----
  716. .. _class_CodeEdit_method_is_line_breakpointed:
  717. - :ref:`bool<class_bool>` **is_line_breakpointed** **(** :ref:`int<class_int>` line **)** |const|
  718. Returns whether the line at the specified index is breakpointed or not.
  719. ----
  720. .. _class_CodeEdit_method_is_line_executing:
  721. - :ref:`bool<class_bool>` **is_line_executing** **(** :ref:`int<class_int>` line **)** |const|
  722. Returns whether the line at the specified index is marked as executing or not.
  723. ----
  724. .. _class_CodeEdit_method_is_line_folded:
  725. - :ref:`bool<class_bool>` **is_line_folded** **(** :ref:`int<class_int>` line **)** |const|
  726. Returns whether the line at the specified index is folded or not.
  727. ----
  728. .. _class_CodeEdit_method_remove_comment_delimiter:
  729. - void **remove_comment_delimiter** **(** :ref:`String<class_String>` start_key **)**
  730. Removes the comment delimiter with ``start_key``.
  731. ----
  732. .. _class_CodeEdit_method_remove_string_delimiter:
  733. - void **remove_string_delimiter** **(** :ref:`String<class_String>` start_key **)**
  734. Removes the string delimiter with ``start_key``.
  735. ----
  736. .. _class_CodeEdit_method_request_code_completion:
  737. - void **request_code_completion** **(** :ref:`bool<class_bool>` force=false **)**
  738. Emits :ref:`code_completion_requested<class_CodeEdit_signal_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.
  739. ----
  740. .. _class_CodeEdit_method_set_code_completion_selected_index:
  741. - void **set_code_completion_selected_index** **(** :ref:`int<class_int>` index **)**
  742. Sets the current selected completion option.
  743. ----
  744. .. _class_CodeEdit_method_set_code_hint:
  745. - void **set_code_hint** **(** :ref:`String<class_String>` code_hint **)**
  746. Sets the code hint text. Pass an empty string to clear.
  747. ----
  748. .. _class_CodeEdit_method_set_code_hint_draw_below:
  749. - void **set_code_hint_draw_below** **(** :ref:`bool<class_bool>` draw_below **)**
  750. Sets if the code hint should draw below the text.
  751. ----
  752. .. _class_CodeEdit_method_set_line_as_bookmarked:
  753. - void **set_line_as_bookmarked** **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` bookmarked **)**
  754. Sets the line as bookmarked.
  755. ----
  756. .. _class_CodeEdit_method_set_line_as_breakpoint:
  757. - void **set_line_as_breakpoint** **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` breakpointed **)**
  758. Sets the line as breakpointed.
  759. ----
  760. .. _class_CodeEdit_method_set_line_as_executing:
  761. - void **set_line_as_executing** **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` executing **)**
  762. Sets the line as executing.
  763. ----
  764. .. _class_CodeEdit_method_set_symbol_lookup_word_as_valid:
  765. - void **set_symbol_lookup_word_as_valid** **(** :ref:`bool<class_bool>` valid **)**
  766. Sets the symbol emitted by :ref:`symbol_validate<class_CodeEdit_signal_symbol_validate>` as a valid lookup.
  767. ----
  768. .. _class_CodeEdit_method_toggle_foldable_line:
  769. - void **toggle_foldable_line** **(** :ref:`int<class_int>` line **)**
  770. Toggle the folding of the code block at the given line.
  771. ----
  772. .. _class_CodeEdit_method_unfold_all_lines:
  773. - void **unfold_all_lines** **(** **)**
  774. Unfolds all lines, folded or not.
  775. ----
  776. .. _class_CodeEdit_method_unfold_line:
  777. - void **unfold_line** **(** :ref:`int<class_int>` line **)**
  778. Unfolds all lines that were previously folded.
  779. ----
  780. .. _class_CodeEdit_method_unindent_lines:
  781. - void **unindent_lines** **(** **)**
  782. Unindents selected lines, or in the case of no selection the caret line by one.
  783. ----
  784. .. _class_CodeEdit_method_update_code_completion_options:
  785. - void **update_code_completion_options** **(** :ref:`bool<class_bool>` force **)**
  786. Submits all completion options added with :ref:`add_code_completion_option<class_CodeEdit_method_add_code_completion_option>`. Will try to force the autoccomplete menu to popup, if ``force`` is ``true``.
  787. \ **Note:** This will replace all current candidates.
  788. Theme Property Descriptions
  789. ---------------------------
  790. .. _class_CodeEdit_theme_color_background_color:
  791. - :ref:`Color<class_Color>` **background_color**
  792. +-----------+-----------------------+
  793. | *Default* | ``Color(0, 0, 0, 0)`` |
  794. +-----------+-----------------------+
  795. Sets the background :ref:`Color<class_Color>`.
  796. ----
  797. .. _class_CodeEdit_theme_color_bookmark_color:
  798. - :ref:`Color<class_Color>` **bookmark_color**
  799. +-----------+------------------------------+
  800. | *Default* | ``Color(0.5, 0.64, 1, 0.8)`` |
  801. +-----------+------------------------------+
  802. :ref:`Color<class_Color>` of the bookmark icon for bookmarked lines.
  803. ----
  804. .. _class_CodeEdit_theme_color_brace_mismatch_color:
  805. - :ref:`Color<class_Color>` **brace_mismatch_color**
  806. +-----------+---------------------------+
  807. | *Default* | ``Color(1, 0.2, 0.2, 1)`` |
  808. +-----------+---------------------------+
  809. :ref:`Color<class_Color>` of the text to highlight mismatched braces.
  810. ----
  811. .. _class_CodeEdit_theme_color_breakpoint_color:
  812. - :ref:`Color<class_Color>` **breakpoint_color**
  813. +-----------+------------------------------+
  814. | *Default* | ``Color(0.9, 0.29, 0.3, 1)`` |
  815. +-----------+------------------------------+
  816. :ref:`Color<class_Color>` of the breakpoint icon for bookmarked lines.
  817. ----
  818. .. _class_CodeEdit_theme_color_caret_background_color:
  819. - :ref:`Color<class_Color>` **caret_background_color**
  820. +-----------+-----------------------+
  821. | *Default* | ``Color(0, 0, 0, 1)`` |
  822. +-----------+-----------------------+
  823. :ref:`Color<class_Color>` of the text behind the caret when block caret is enabled.
  824. ----
  825. .. _class_CodeEdit_theme_color_caret_color:
  826. - :ref:`Color<class_Color>` **caret_color**
  827. +-----------+-----------------------------------+
  828. | *Default* | ``Color(0.875, 0.875, 0.875, 1)`` |
  829. +-----------+-----------------------------------+
  830. :ref:`Color<class_Color>` of the caret.
  831. ----
  832. .. _class_CodeEdit_theme_color_code_folding_color:
  833. - :ref:`Color<class_Color>` **code_folding_color**
  834. +-----------+-------------------------------+
  835. | *Default* | ``Color(0.8, 0.8, 0.8, 0.8)`` |
  836. +-----------+-------------------------------+
  837. :ref:`Color<class_Color>` for all icons related to line folding.
  838. ----
  839. .. _class_CodeEdit_theme_color_completion_background_color:
  840. - :ref:`Color<class_Color>` **completion_background_color**
  841. +-----------+-------------------------------+
  842. | *Default* | ``Color(0.17, 0.16, 0.2, 1)`` |
  843. +-----------+-------------------------------+
  844. Sets the background :ref:`Color<class_Color>` for the code completion popup.
  845. ----
  846. .. _class_CodeEdit_theme_color_completion_existing_color:
  847. - :ref:`Color<class_Color>` **completion_existing_color**
  848. +-----------+-----------------------------------+
  849. | *Default* | ``Color(0.87, 0.87, 0.87, 0.13)`` |
  850. +-----------+-----------------------------------+
  851. Background highlight :ref:`Color<class_Color>` for matching text in code completion options.
  852. ----
  853. .. _class_CodeEdit_theme_color_completion_font_color:
  854. - :ref:`Color<class_Color>` **completion_font_color**
  855. +-----------+--------------------------------+
  856. | *Default* | ``Color(0.67, 0.67, 0.67, 1)`` |
  857. +-----------+--------------------------------+
  858. Font :ref:`Color<class_Color>` for the code completion popup.
  859. ----
  860. .. _class_CodeEdit_theme_color_completion_scroll_color:
  861. - :ref:`Color<class_Color>` **completion_scroll_color**
  862. +-----------+--------------------------+
  863. | *Default* | ``Color(1, 1, 1, 0.29)`` |
  864. +-----------+--------------------------+
  865. :ref:`Color<class_Color>` of the scrollbar in the code completion popup.
  866. ----
  867. .. _class_CodeEdit_theme_color_completion_scroll_hovered_color:
  868. - :ref:`Color<class_Color>` **completion_scroll_hovered_color**
  869. +-----------+-------------------------+
  870. | *Default* | ``Color(1, 1, 1, 0.4)`` |
  871. +-----------+-------------------------+
  872. :ref:`Color<class_Color>` of the scrollbar in the code completion popup when hovered.
  873. ----
  874. .. _class_CodeEdit_theme_color_completion_selected_color:
  875. - :ref:`Color<class_Color>` **completion_selected_color**
  876. +-----------+--------------------------------+
  877. | *Default* | ``Color(0.26, 0.26, 0.27, 1)`` |
  878. +-----------+--------------------------------+
  879. Background highlight :ref:`Color<class_Color>` for the current selected option item in the code completion popup.
  880. ----
  881. .. _class_CodeEdit_theme_color_current_line_color:
  882. - :ref:`Color<class_Color>` **current_line_color**
  883. +-----------+----------------------------------+
  884. | *Default* | ``Color(0.25, 0.25, 0.26, 0.8)`` |
  885. +-----------+----------------------------------+
  886. Background :ref:`Color<class_Color>` of the line containing the caret.
  887. ----
  888. .. _class_CodeEdit_theme_color_executing_line_color:
  889. - :ref:`Color<class_Color>` **executing_line_color**
  890. +-----------+--------------------------------+
  891. | *Default* | ``Color(0.98, 0.89, 0.27, 1)`` |
  892. +-----------+--------------------------------+
  893. :ref:`Color<class_Color>` of the executing icon for executing lines.
  894. ----
  895. .. _class_CodeEdit_theme_color_font_color:
  896. - :ref:`Color<class_Color>` **font_color**
  897. +-----------+-----------------------------------+
  898. | *Default* | ``Color(0.875, 0.875, 0.875, 1)`` |
  899. +-----------+-----------------------------------+
  900. Sets the font :ref:`Color<class_Color>`.
  901. ----
  902. .. _class_CodeEdit_theme_color_font_outline_color:
  903. - :ref:`Color<class_Color>` **font_outline_color**
  904. +-----------+-----------------------+
  905. | *Default* | ``Color(1, 1, 1, 1)`` |
  906. +-----------+-----------------------+
  907. The tint of text outline of the ``CodeEdit``.
  908. ----
  909. .. _class_CodeEdit_theme_color_font_placeholder_color:
  910. - :ref:`Color<class_Color>` **font_placeholder_color**
  911. +-----------+-------------------------------------+
  912. | *Default* | ``Color(0.875, 0.875, 0.875, 0.6)`` |
  913. +-----------+-------------------------------------+
  914. Font color for :ref:`TextEdit.placeholder_text<class_TextEdit_property_placeholder_text>`.
  915. ----
  916. .. _class_CodeEdit_theme_color_font_readonly_color:
  917. - :ref:`Color<class_Color>` **font_readonly_color**
  918. +-----------+-------------------------------------+
  919. | *Default* | ``Color(0.875, 0.875, 0.875, 0.5)`` |
  920. +-----------+-------------------------------------+
  921. Sets the font :ref:`Color<class_Color>` when :ref:`TextEdit.editable<class_TextEdit_property_editable>` is disabled.
  922. ----
  923. .. _class_CodeEdit_theme_color_font_selected_color:
  924. - :ref:`Color<class_Color>` **font_selected_color**
  925. +-----------+-----------------------+
  926. | *Default* | ``Color(0, 0, 0, 1)`` |
  927. +-----------+-----------------------+
  928. Sets the :ref:`Color<class_Color>` of the selected text. :ref:`TextEdit.override_selected_font_color<class_TextEdit_property_override_selected_font_color>` has to be enabled.
  929. ----
  930. .. _class_CodeEdit_theme_color_line_length_guideline_color:
  931. - :ref:`Color<class_Color>` **line_length_guideline_color**
  932. +-----------+-------------------------------+
  933. | *Default* | ``Color(0.3, 0.5, 0.8, 0.1)`` |
  934. +-----------+-------------------------------+
  935. :ref:`Color<class_Color>` of the main line length guideline, secondary guidelines will have 50% alpha applied.
  936. ----
  937. .. _class_CodeEdit_theme_color_line_number_color:
  938. - :ref:`Color<class_Color>` **line_number_color**
  939. +-----------+----------------------------------+
  940. | *Default* | ``Color(0.67, 0.67, 0.67, 0.4)`` |
  941. +-----------+----------------------------------+
  942. Sets the :ref:`Color<class_Color>` of line numbers.
  943. ----
  944. .. _class_CodeEdit_theme_color_search_result_border_color:
  945. - :ref:`Color<class_Color>` **search_result_border_color**
  946. +-----------+-------------------------------+
  947. | *Default* | ``Color(0.3, 0.3, 0.3, 0.4)`` |
  948. +-----------+-------------------------------+
  949. :ref:`Color<class_Color>` of the border around text that matches the search query.
  950. ----
  951. .. _class_CodeEdit_theme_color_search_result_color:
  952. - :ref:`Color<class_Color>` **search_result_color**
  953. +-----------+-----------------------------+
  954. | *Default* | ``Color(0.3, 0.3, 0.3, 1)`` |
  955. +-----------+-----------------------------+
  956. :ref:`Color<class_Color>` behind the text that matches the search query.
  957. ----
  958. .. _class_CodeEdit_theme_color_selection_color:
  959. - :ref:`Color<class_Color>` **selection_color**
  960. +-----------+-----------------------------+
  961. | *Default* | ``Color(0.5, 0.5, 0.5, 1)`` |
  962. +-----------+-----------------------------+
  963. Sets the highlight :ref:`Color<class_Color>` of text selections.
  964. ----
  965. .. _class_CodeEdit_theme_color_word_highlighted_color:
  966. - :ref:`Color<class_Color>` **word_highlighted_color**
  967. +-----------+--------------------------------+
  968. | *Default* | ``Color(0.8, 0.9, 0.9, 0.15)`` |
  969. +-----------+--------------------------------+
  970. Sets the highlight :ref:`Color<class_Color>` of multiple occurrences. :ref:`TextEdit.highlight_all_occurrences<class_TextEdit_property_highlight_all_occurrences>` has to be enabled.
  971. ----
  972. .. _class_CodeEdit_theme_constant_completion_lines:
  973. - :ref:`int<class_int>` **completion_lines**
  974. +-----------+-------+
  975. | *Default* | ``7`` |
  976. +-----------+-------+
  977. Max number of options to display in the code completion popup at any one time.
  978. ----
  979. .. _class_CodeEdit_theme_constant_completion_max_width:
  980. - :ref:`int<class_int>` **completion_max_width**
  981. +-----------+--------+
  982. | *Default* | ``50`` |
  983. +-----------+--------+
  984. Max width of options in the code completion popup. Options longer then this will be cut off.
  985. ----
  986. .. _class_CodeEdit_theme_constant_completion_scroll_width:
  987. - :ref:`int<class_int>` **completion_scroll_width**
  988. +-----------+-------+
  989. | *Default* | ``6`` |
  990. +-----------+-------+
  991. Width of the scrollbar in the code completion popup.
  992. ----
  993. .. _class_CodeEdit_theme_constant_line_spacing:
  994. - :ref:`int<class_int>` **line_spacing**
  995. +-----------+-------+
  996. | *Default* | ``4`` |
  997. +-----------+-------+
  998. Sets the spacing between the lines.
  999. ----
  1000. .. _class_CodeEdit_theme_constant_outline_size:
  1001. - :ref:`int<class_int>` **outline_size**
  1002. +-----------+-------+
  1003. | *Default* | ``0`` |
  1004. +-----------+-------+
  1005. The size of the text outline.
  1006. ----
  1007. .. _class_CodeEdit_theme_font_font:
  1008. - :ref:`Font<class_Font>` **font**
  1009. Sets the default :ref:`Font<class_Font>`.
  1010. ----
  1011. .. _class_CodeEdit_theme_font_size_font_size:
  1012. - :ref:`int<class_int>` **font_size**
  1013. Sets default font size.
  1014. ----
  1015. .. _class_CodeEdit_theme_icon_bookmark:
  1016. - :ref:`Texture2D<class_Texture2D>` **bookmark**
  1017. Sets a custom :ref:`Texture2D<class_Texture2D>` to draw in the bookmark gutter for bookmarked lines.
  1018. ----
  1019. .. _class_CodeEdit_theme_icon_breakpoint:
  1020. - :ref:`Texture2D<class_Texture2D>` **breakpoint**
  1021. Sets a custom :ref:`Texture2D<class_Texture2D>` to draw in the breakpoint gutter for breakpointed lines.
  1022. ----
  1023. .. _class_CodeEdit_theme_icon_can_fold:
  1024. - :ref:`Texture2D<class_Texture2D>` **can_fold**
  1025. Sets a custom :ref:`Texture2D<class_Texture2D>` to draw in the line folding gutter when a line can be folded.
  1026. ----
  1027. .. _class_CodeEdit_theme_icon_executing_line:
  1028. - :ref:`Texture2D<class_Texture2D>` **executing_line**
  1029. Icon to draw in the executing gutter for executing lines.
  1030. ----
  1031. .. _class_CodeEdit_theme_icon_folded:
  1032. - :ref:`Texture2D<class_Texture2D>` **folded**
  1033. Sets a custom :ref:`Texture2D<class_Texture2D>` to draw in the line folding gutter when a line is folded and can be unfolded.
  1034. ----
  1035. .. _class_CodeEdit_theme_icon_folded_eol_icon:
  1036. - :ref:`Texture2D<class_Texture2D>` **folded_eol_icon**
  1037. Sets a custom :ref:`Texture2D<class_Texture2D>` to draw at the end of a folded line.
  1038. ----
  1039. .. _class_CodeEdit_theme_icon_space:
  1040. - :ref:`Texture2D<class_Texture2D>` **space**
  1041. Sets a custom :ref:`Texture2D<class_Texture2D>` for space text characters.
  1042. ----
  1043. .. _class_CodeEdit_theme_icon_tab:
  1044. - :ref:`Texture2D<class_Texture2D>` **tab**
  1045. Sets a custom :ref:`Texture2D<class_Texture2D>` for tab text characters.
  1046. ----
  1047. .. _class_CodeEdit_theme_style_completion:
  1048. - :ref:`StyleBox<class_StyleBox>` **completion**
  1049. :ref:`StyleBox<class_StyleBox>` for the code completion popup.
  1050. ----
  1051. .. _class_CodeEdit_theme_style_focus:
  1052. - :ref:`StyleBox<class_StyleBox>` **focus**
  1053. Sets the :ref:`StyleBox<class_StyleBox>` when in focus. The ``focus`` :ref:`StyleBox<class_StyleBox>` is displayed *over* the base :ref:`StyleBox<class_StyleBox>`, so a partially transparent :ref:`StyleBox<class_StyleBox>` should be used to ensure the base :ref:`StyleBox<class_StyleBox>` remains visible. A :ref:`StyleBox<class_StyleBox>` that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a :ref:`StyleBoxEmpty<class_StyleBoxEmpty>` resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.
  1054. ----
  1055. .. _class_CodeEdit_theme_style_normal:
  1056. - :ref:`StyleBox<class_StyleBox>` **normal**
  1057. Sets the :ref:`StyleBox<class_StyleBox>`.
  1058. ----
  1059. .. _class_CodeEdit_theme_style_read_only:
  1060. - :ref:`StyleBox<class_StyleBox>` **read_only**
  1061. Sets the :ref:`StyleBox<class_StyleBox>` when :ref:`TextEdit.editable<class_TextEdit_property_editable>` is disabled.
  1062. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  1063. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  1064. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  1065. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  1066. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  1067. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`