summaryrefslogtreecommitdiff
path: root/doc/classes/CodeEdit.xml
blob: c7dbd86c55dd943f0a66bab5518221b146e2a56d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
<?xml version="1.0" encoding="UTF-8" ?>
<class name="CodeEdit" inherits="TextEdit" version="4.0">
	<brief_description>
	</brief_description>
	<description>
		[b]Note[/b]: By default [CodeEdit] always use left-to-right text direction to correctly display source code.
	</description>
	<tutorials>
	</tutorials>
	<methods>
		<method name="_confirm_code_completion" qualifiers="virtual">
			<return type="void">
			</return>
			<argument index="0" name="replace" type="bool">
			</argument>
			<description>
				Override this method to define how the selected entry should be inserted. If [code]replace[/code] is true, any existing text should be replaced.
			</description>
		</method>
		<method name="_filter_code_completion_candidates" qualifiers="virtual">
			<return type="Array">
			</return>
			<argument index="0" name="candidates" type="Array">
			</argument>
			<description>
				Override this method to define what items in [code]candidates[/code] should be displayed.
				Both [code]candidates[/code] and the return is a [Array] of [Dictionary], see [method get_code_completion_option] for [Dictionary] content.
			</description>
		</method>
		<method name="_request_code_completion" qualifiers="virtual">
			<return type="void">
			</return>
			<argument index="0" name="force" type="bool">
			</argument>
			<description>
				Override this method to define what happens when the user requests code completion. If [code]force[/code] is true, any checks should be bypassed.
			</description>
		</method>
		<method name="add_code_completion_option">
			<return type="void">
			</return>
			<argument index="0" name="type" type="int" enum="CodeEdit.CodeCompletionKind">
			</argument>
			<argument index="1" name="display_text" type="String">
			</argument>
			<argument index="2" name="insert_text" type="String">
			</argument>
			<argument index="3" name="text_color" type="Color" default="Color(1, 1, 1, 1)">
			</argument>
			<argument index="4" name="icon" type="Resource" default="null">
			</argument>
			<argument index="5" name="value" type="Variant" default="0">
			</argument>
			<description>
				Submits an item to the queue of potential candidates for the autocomplete menu. Call [method update_code_completion_options] to update the list.
				[b]Note[/b]: This list will replace all current candidates.
			</description>
		</method>
		<method name="add_comment_delimiter">
			<return type="void">
			</return>
			<argument index="0" name="start_key" type="String">
			</argument>
			<argument index="1" name="end_key" type="String">
			</argument>
			<argument index="2" name="line_only" type="bool" default="false">
			</argument>
			<description>
				Adds a comment delimiter.
				Both the start and end keys must be symbols. Only the start key has to be unique.
				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 [code]true[/code].
			</description>
		</method>
		<method name="add_string_delimiter">
			<return type="void">
			</return>
			<argument index="0" name="start_key" type="String">
			</argument>
			<argument index="1" name="end_key" type="String">
			</argument>
			<argument index="2" name="line_only" type="bool" default="false">
			</argument>
			<description>
				Adds a string delimiter.
				Both the start and end keys must be symbols. Only the start key has to be unique.
				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 [code]true[/code].
			</description>
		</method>
		<method name="can_fold_line" qualifiers="const">
			<return type="bool">
			</return>
			<argument index="0" name="line" type="int">
			</argument>
			<description>
				Returns if the given line is foldable, that is, it has indented lines right below it or a comment / string block.
			</description>
		</method>
		<method name="cancel_code_completion">
			<return type="void">
			</return>
			<description>
				Cancels the autocomplete menu.
			</description>
		</method>
		<method name="clear_bookmarked_lines">
			<return type="void">
			</return>
			<description>
			</description>
		</method>
		<method name="clear_breakpointed_lines">
			<return type="void">
			</return>
			<description>
			</description>
		</method>
		<method name="clear_comment_delimiters">
			<return type="void">
			</return>
			<description>
				Removes all comment delimiters.
			</description>
		</method>
		<method name="clear_executing_lines">
			<return type="void">
			</return>
			<description>
			</description>
		</method>
		<method name="clear_string_delimiters">
			<return type="void">
			</return>
			<description>
				Removes all string delimiters.
			</description>
		</method>
		<method name="confirm_code_completion">
			<return type="void">
			</return>
			<argument index="0" name="replace" type="bool" default="false">
			</argument>
			<description>
				Inserts the selected entry into the text. If [code]replace[/code] is true, any existing text is replaced rather then merged.
			</description>
		</method>
		<method name="fold_all_lines">
			<return type="void">
			</return>
			<description>
				Folds all lines that are possible to be folded (see [method can_fold_line]).
			</description>
		</method>
		<method name="fold_line">
			<return type="void">
			</return>
			<argument index="0" name="line" type="int">
			</argument>
			<description>
				Folds the given line, if possible (see [method can_fold_line]).
			</description>
		</method>
		<method name="get_bookmarked_lines" qualifiers="const">
			<return type="Array">
			</return>
			<description>
			</description>
		</method>
		<method name="get_breakpointed_lines" qualifiers="const">
			<return type="Array">
			</return>
			<description>
			</description>
		</method>
		<method name="get_code_completion_option" qualifiers="const">
			<return type="Dictionary">
			</return>
			<argument index="0" name="index" type="int">
			</argument>
			<description>
				Gets the completion option at [code]index[/code]. The return [Dictionary] has the following key-values:
				[code]kind[/code]: [enum CodeCompletionKind]
				[code]display_text[/code]: Text that is shown on the autocomplete menu.
				[code]insert_text[/code]: Text that is to be inserted when this item is selected.
				[code]font_color[/code]: Color of the text on the autocomplete menu.
				[code]icon[/code]: Icon to draw on the autocomplete menu.
				[code]default_value[/code]: Value of the symbol.
			</description>
		</method>
		<method name="get_code_completion_options" qualifiers="const">
			<return type="Dictionary[]">
			</return>
			<description>
				Gets all completion options, see [method get_code_completion_option] for return content.
			</description>
		</method>
		<method name="get_code_completion_selected_index" qualifiers="const">
			<return type="int">
			</return>
			<description>
				Gets the index of the current selected completion option.
			</description>
		</method>
		<method name="get_delimiter_end_key" qualifiers="const">
			<return type="String">
			</return>
			<argument index="0" name="delimiter_index" type="int">
			</argument>
			<description>
				Gets the end key for a string or comment region index.
			</description>
		</method>
		<method name="get_delimiter_end_position" qualifiers="const">
			<return type="Vector2">
			</return>
			<argument index="0" name="line" type="int">
			</argument>
			<argument index="1" name="column" type="int">
			</argument>
			<description>
				If [code]line[/code] [code]column[/code] is in a string or comment, returns the end position of the region. If not or no end could be found, both [Vector2] values will be [code]-1[/code].
			</description>
		</method>
		<method name="get_delimiter_start_key" qualifiers="const">
			<return type="String">
			</return>
			<argument index="0" name="delimiter_index" type="int">
			</argument>
			<description>
				Gets the start key for a string or comment region index.
			</description>
		</method>
		<method name="get_delimiter_start_position" qualifiers="const">
			<return type="Vector2">
			</return>
			<argument index="0" name="line" type="int">
			</argument>
			<argument index="1" name="column" type="int">
			</argument>
			<description>
				If [code]line[/code] [code]column[/code] is in a string or comment, returns the start position of the region. If not or no start could be found, both [Vector2] values will be [code]-1[/code].
			</description>
		</method>
		<method name="get_executing_lines" qualifiers="const">
			<return type="Array">
			</return>
			<description>
			</description>
		</method>
		<method name="get_folded_lines" qualifiers="const">
			<return type="int[]">
			</return>
			<description>
				Return all lines that are current folded.
			</description>
		</method>
		<method name="get_text_for_code_completion" qualifiers="const">
			<return type="String">
			</return>
			<description>
				Returns the full text with char [code]0xFFFF[/code] at the caret location.
			</description>
		</method>
		<method name="has_comment_delimiter" qualifiers="const">
			<return type="bool">
			</return>
			<argument index="0" name="start_key" type="String">
			</argument>
			<description>
				Returns [code]true[/code] if comment [code]start_key[/code] exists.
			</description>
		</method>
		<method name="has_string_delimiter" qualifiers="const">
			<return type="bool">
			</return>
			<argument index="0" name="start_key" type="String">
			</argument>
			<description>
				Returns [code]true[/code] if string [code]start_key[/code] exists.
			</description>
		</method>
		<method name="is_in_comment" qualifiers="const">
			<return type="int">
			</return>
			<argument index="0" name="line" type="int">
			</argument>
			<argument index="1" name="column" type="int" default="-1">
			</argument>
			<description>
				Return delimiter index if [code]line[/code] [code]column[/code] is in a comment. If [code]column[/code] is not provided, will return delimiter index if the entire [code]line[/code] is a comment. Otherwise [code]-1[/code].
			</description>
		</method>
		<method name="is_in_string" qualifiers="const">
			<return type="int">
			</return>
			<argument index="0" name="line" type="int">
			</argument>
			<argument index="1" name="column" type="int" default="-1">
			</argument>
			<description>
				Return the delimiter index if [code]line[/code] [code]column[/code] is in a string. If [code]column[/code] is not provided, will return the delimiter index if the entire [code]line[/code] is a string. Otherwise [code]-1[/code].
			</description>
		</method>
		<method name="is_line_bookmarked" qualifiers="const">
			<return type="bool">
			</return>
			<argument index="0" name="line" type="int">
			</argument>
			<description>
			</description>
		</method>
		<method name="is_line_breakpointed" qualifiers="const">
			<return type="bool">
			</return>
			<argument index="0" name="line" type="int">
			</argument>
			<description>
			</description>
		</method>
		<method name="is_line_executing" qualifiers="const">
			<return type="bool">
			</return>
			<argument index="0" name="line" type="int">
			</argument>
			<description>
			</description>
		</method>
		<method name="is_line_folded" qualifiers="const">
			<return type="bool">
			</return>
			<argument index="0" name="line" type="int">
			</argument>
			<description>
				Returns whether the line at the specified index is folded or not.
			</description>
		</method>
		<method name="remove_comment_delimiter">
			<return type="void">
			</return>
			<argument index="0" name="start_key" type="String">
			</argument>
			<description>
				Removes the comment delimiter with [code]start_key[/code].
			</description>
		</method>
		<method name="remove_string_delimiter">
			<return type="void">
			</return>
			<argument index="0" name="start_key" type="String">
			</argument>
			<description>
				Removes the string delimiter with [code]start_key[/code].
			</description>
		</method>
		<method name="request_code_completion">
			<return type="void">
			</return>
			<argument index="0" name="force" type="bool" default="false">
			</argument>
			<description>
				Emits [signal request_code_completion], if [code]force[/code] 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.
			</description>
		</method>
		<method name="set_code_completion_selected_index">
			<return type="void">
			</return>
			<argument index="0" name="index" type="int">
			</argument>
			<description>
				Sets the current selected completion option.
			</description>
		</method>
		<method name="set_code_hint">
			<return type="void">
			</return>
			<argument index="0" name="code_hint" type="String">
			</argument>
			<description>
				Sets the code hint text. Pass an empty string to clear.
			</description>
		</method>
		<method name="set_code_hint_draw_below">
			<return type="void">
			</return>
			<argument index="0" name="draw_below" type="bool">
			</argument>
			<description>
				Sets if the code hint should draw below the text.
			</description>
		</method>
		<method name="set_line_as_bookmarked">
			<return type="void">
			</return>
			<argument index="0" name="line" type="int">
			</argument>
			<argument index="1" name="bookmarked" type="bool">
			</argument>
			<description>
			</description>
		</method>
		<method name="set_line_as_breakpoint">
			<return type="void">
			</return>
			<argument index="0" name="line" type="int">
			</argument>
			<argument index="1" name="breakpointed" type="bool">
			</argument>
			<description>
			</description>
		</method>
		<method name="set_line_as_executing">
			<return type="void">
			</return>
			<argument index="0" name="line" type="int">
			</argument>
			<argument index="1" name="executing" type="bool">
			</argument>
			<description>
			</description>
		</method>
		<method name="toggle_foldable_line">
			<return type="void">
			</return>
			<argument index="0" name="line" type="int">
			</argument>
			<description>
				Toggle the folding of the code block at the given line.
			</description>
		</method>
		<method name="unfold_all_lines">
			<return type="void">
			</return>
			<description>
			</description>
		</method>
		<method name="unfold_line">
			<return type="void">
			</return>
			<argument index="0" name="line" type="int">
			</argument>
			<description>
				Unfolds all lines that were previously folded.
			</description>
		</method>
		<method name="update_code_completion_options">
			<return type="void">
			</return>
			<argument index="0" name="force" type="bool">
			</argument>
			<description>
				Submits all completion options added with [method add_code_completion_option]. Will try to force the autoccomplete menu to popup, if [code]force[/code] is [code]true[/code].
				[b]Note[/b]: This will replace all current candidates.
			</description>
		</method>
	</methods>
	<members>
		<member name="code_completion_enabled" type="bool" setter="set_code_completion_enabled" getter="is_code_completion_enabled" default="false">
			Sets whether code completion is allowed.
		</member>
		<member name="code_completion_prefixes" type="String[]" setter="set_code_completion_prefixes" getter="get_code_comletion_prefixes" default="[]">
			Sets prefixes that will trigger code completion.
		</member>
		<member name="delimiter_comments" type="String[]" setter="set_comment_delimiters" getter="get_comment_delimiters" default="[]">
			Sets the comment delimiters. All existing comment delimiters will be removed.
		</member>
		<member name="delimiter_strings" type="String[]" setter="set_string_delimiters" getter="get_string_delimiters" default="[]">
			Sets the string delimiters. All existing string delimiters will be removed.
		</member>
		<member name="draw_bookmarks" type="bool" setter="set_draw_bookmarks_gutter" getter="is_drawing_bookmarks_gutter" default="false">
		</member>
		<member name="draw_breakpoints_gutter" type="bool" setter="set_draw_breakpoints_gutter" getter="is_drawing_breakpoints_gutter" default="false">
		</member>
		<member name="draw_executing_lines" type="bool" setter="set_draw_executing_lines_gutter" getter="is_drawing_executing_lines_gutter" default="false">
		</member>
		<member name="draw_fold_gutter" type="bool" setter="set_draw_fold_gutter" getter="is_drawing_fold_gutter" default="false">
		</member>
		<member name="draw_line_numbers" type="bool" setter="set_draw_line_numbers" getter="is_draw_line_numbers_enabled" default="false">
		</member>
		<member name="layout_direction" type="int" setter="set_layout_direction" getter="get_layout_direction" override="true" enum="Control.LayoutDirection" default="2" />
		<member name="line_folding" type="bool" setter="set_line_folding_enabled" getter="is_line_folding_enabled" default="true">
			Sets whether line folding is allowed.
		</member>
		<member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" override="true" default="[]" />
		<member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" override="true" enum="Control.TextDirection" default="1" />
		<member name="zero_pad_line_numbers" type="bool" setter="set_line_numbers_zero_padded" getter="is_line_numbers_zero_padded" default="false">
		</member>
	</members>
	<signals>
		<signal name="breakpoint_toggled">
			<argument index="0" name="line" type="int">
			</argument>
			<description>
			</description>
		</signal>
		<signal name="request_code_completion">
			<description>
				Emitted when the user requests code completion.
			</description>
		</signal>
	</signals>
	<constants>
		<constant name="KIND_CLASS" value="0" enum="CodeCompletionKind">
		</constant>
		<constant name="KIND_FUNCTION" value="1" enum="CodeCompletionKind">
		</constant>
		<constant name="KIND_SIGNAL" value="2" enum="CodeCompletionKind">
		</constant>
		<constant name="KIND_VARIABLE" value="3" enum="CodeCompletionKind">
		</constant>
		<constant name="KIND_MEMBER" value="4" enum="CodeCompletionKind">
		</constant>
		<constant name="KIND_ENUM" value="5" enum="CodeCompletionKind">
		</constant>
		<constant name="KIND_CONSTANT" value="6" enum="CodeCompletionKind">
		</constant>
		<constant name="KIND_NODE_PATH" value="7" enum="CodeCompletionKind">
		</constant>
		<constant name="KIND_FILE_PATH" value="8" enum="CodeCompletionKind">
		</constant>
		<constant name="KIND_PLAIN_TEXT" value="9" enum="CodeCompletionKind">
		</constant>
	</constants>
	<theme_items>
		<theme_item name="background_color" type="Color" default="Color(0, 0, 0, 0)">
		</theme_item>
		<theme_item name="bookmark" type="Texture2D">
		</theme_item>
		<theme_item name="bookmark_color" type="Color" default="Color(0.5, 0.64, 1, 0.8)">
		</theme_item>
		<theme_item name="brace_mismatch_color" type="Color" default="Color(1, 0.2, 0.2, 1)">
		</theme_item>
		<theme_item name="breakpoint" type="Texture2D">
		</theme_item>
		<theme_item name="breakpoint_color" type="Color" default="Color(0.9, 0.29, 0.3, 1)">
		</theme_item>
		<theme_item name="can_fold" type="Texture2D">
		</theme_item>
		<theme_item name="caret_background_color" type="Color" default="Color(0, 0, 0, 1)">
		</theme_item>
		<theme_item name="caret_color" type="Color" default="Color(0.88, 0.88, 0.88, 1)">
		</theme_item>
		<theme_item name="code_folding_color" type="Color" default="Color(0.8, 0.8, 0.8, 0.8)">
		</theme_item>
		<theme_item name="completion" type="StyleBox">
		</theme_item>
		<theme_item name="completion_background_color" type="Color" default="Color(0.17, 0.16, 0.2, 1)">
		</theme_item>
		<theme_item name="completion_existing_color" type="Color" default="Color(0.87, 0.87, 0.87, 0.13)">
		</theme_item>
		<theme_item name="completion_font_color" type="Color" default="Color(0.67, 0.67, 0.67, 1)">
		</theme_item>
		<theme_item name="completion_lines" type="int" default="7">
		</theme_item>
		<theme_item name="completion_max_width" type="int" default="50">
		</theme_item>
		<theme_item name="completion_scroll_color" type="Color" default="Color(1, 1, 1, 1)">
		</theme_item>
		<theme_item name="completion_scroll_width" type="int" default="3">
		</theme_item>
		<theme_item name="completion_selected_color" type="Color" default="Color(0.26, 0.26, 0.27, 1)">
		</theme_item>
		<theme_item name="current_line_color" type="Color" default="Color(0.25, 0.25, 0.26, 0.8)">
		</theme_item>
		<theme_item name="executing_line" type="Texture2D">
		</theme_item>
		<theme_item name="executing_line_color" type="Color" default="Color(0.98, 0.89, 0.27, 1)">
		</theme_item>
		<theme_item name="focus" type="StyleBox">
		</theme_item>
		<theme_item name="folded" type="Texture2D">
		</theme_item>
		<theme_item name="folded_eol_icon" type="Texture2D">
		</theme_item>
		<theme_item name="font" type="Font">
		</theme_item>
		<theme_item name="font_color" type="Color" default="Color(0.88, 0.88, 0.88, 1)">
		</theme_item>
		<theme_item name="font_outline_color" type="Color" default="Color(1, 1, 1, 1)">
			The tint of text outline of the [CodeEdit].
		</theme_item>
		<theme_item name="font_readonly_color" type="Color" default="Color(0.88, 0.88, 0.88, 0.5)">
		</theme_item>
		<theme_item name="font_selected_color" type="Color" default="Color(0, 0, 0, 1)">
		</theme_item>
		<theme_item name="font_size" type="int">
			Font size of the [CodeEdit]'s text.
		</theme_item>
		<theme_item name="line_number_color" type="Color" default="Color(0.67, 0.67, 0.67, 0.4)">
		</theme_item>
		<theme_item name="line_spacing" type="int" default="4">
		</theme_item>
		<theme_item name="normal" type="StyleBox">
		</theme_item>
		<theme_item name="outline_size" type="int" default="0">
			The size of the text outline.
		</theme_item>
		<theme_item name="read_only" type="StyleBox">
		</theme_item>
		<theme_item name="safe_line_number_color" type="Color" default="Color(0.67, 0.78, 0.67, 0.6)">
		</theme_item>
		<theme_item name="selection_color" type="Color" default="Color(0.49, 0.49, 0.49, 1)">
		</theme_item>
		<theme_item name="space" type="Texture2D">
		</theme_item>
		<theme_item name="tab" type="Texture2D">
		</theme_item>
		<theme_item name="word_highlighted_color" type="Color" default="Color(0.8, 0.9, 0.9, 0.15)">
		</theme_item>
	</theme_items>
</class>