Debian Codegraph @

scene/resources/syntax_highlighter.cpp

raw symbols SCIP
1 /**************************************************************************/
2 /* syntax_highlighter.cpp */
3 /**************************************************************************/
4 /* This file is part of: */
5 /* GODOT ENGINE */
6 /* https://godotengine.org */
7 /**************************************************************************/
8 /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
9 /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
10 /* */
11 /* Permission is hereby granted, free of charge, to any person obtaining */
12 /* a copy of this software and associated documentation files (the */
13 /* "Software"), to deal in the Software without restriction, including */
14 /* without limitation the rights to use, copy, modify, merge, publish, */
15 /* distribute, sublicense, and/or sell copies of the Software, and to */
16 /* permit persons to whom the Software is furnished to do so, subject to */
17 /* the following conditions: */
18 /* */
19 /* The above copyright notice and this permission notice shall be */
20 /* included in all copies or substantial portions of the Software. */
21 /* */
22 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
23 /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
24 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
25 /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
26 /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
27 /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
28 /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
29 /**************************************************************************/
30
31 #include "syntax_highlighter.h"
32
33 #include "scene/gui/text_edit.h"
34
35 Dictionary SyntaxHighlighter::get_line_syntax_highlighting(int p_line) {
36 if (highlighting_cache.has(p_line)) {
37 return highlighting_cache[p_line];
38 }
39
40 Dictionary color_map;
41 if (text_edit == nullptr) {
42 return color_map;
43 }
44
45 if (!GDVIRTUAL_CALL(_get_line_syntax_highlighting, p_line, color_map)) {
46 color_map = _get_line_syntax_highlighting_impl(p_line);
47 }
48
49 highlighting_cache[p_line] = color_map;
50 return color_map;
51 }
52
53 void SyntaxHighlighter::_lines_edited_from(int p_from_line, int p_to_line) {
54 if (highlighting_cache.size() < 1) {
55 return;
56 }
57
58 int cache_size = highlighting_cache.back()->key();
59 for (int i = MIN(p_from_line, p_to_line) - 1; i <= cache_size; i++) {
60 if (highlighting_cache.has(i)) {
61 highlighting_cache.erase(i);
62 }
63 }
64 }
65
66 void SyntaxHighlighter::clear_highlighting_cache() {
67 highlighting_cache.clear();
68
69 if (GDVIRTUAL_CALL(_clear_highlighting_cache)) {
70 return;
71 }
72 _clear_highlighting_cache();
73 }
74
75 void SyntaxHighlighter::update_cache() {
76 clear_highlighting_cache();
77
78 if (text_edit == nullptr) {
79 return;
80 }
81 if (GDVIRTUAL_CALL(_update_cache)) {
82 return;
83 }
84 _update_cache();
85 }
86
87 void SyntaxHighlighter::set_text_edit(TextEdit *p_text_edit) {
88 if (text_edit && ObjectDB::get_instance(text_edit_instance_id)) {
89 text_edit->disconnect("lines_edited_from", callable_mp(this, &SyntaxHighlighter::_lines_edited_from));
90 }
91
92 text_edit = p_text_edit;
93 if (p_text_edit == nullptr) {
94 return;
95 }
96 text_edit_instance_id = text_edit->get_instance_id();
97 text_edit->connect("lines_edited_from", callable_mp(this, &SyntaxHighlighter::_lines_edited_from));
98 update_cache();
99 }
100
101 TextEdit *SyntaxHighlighter::get_text_edit() const {
102 return text_edit;
103 }
104
105 void SyntaxHighlighter::_bind_methods() {
106 ClassDB::bind_method(D_METHOD("get_line_syntax_highlighting", "line"), &SyntaxHighlighter::get_line_syntax_highlighting);
107 ClassDB::bind_method(D_METHOD("update_cache"), &SyntaxHighlighter::update_cache);
108 ClassDB::bind_method(D_METHOD("clear_highlighting_cache"), &SyntaxHighlighter::clear_highlighting_cache);
109 ClassDB::bind_method(D_METHOD("get_text_edit"), &SyntaxHighlighter::get_text_edit);
110
111 GDVIRTUAL_BIND(_get_line_syntax_highlighting, "line")
112 GDVIRTUAL_BIND(_clear_highlighting_cache)
113 GDVIRTUAL_BIND(_update_cache)
114 }
115
116 ////////////////////////////////////////////////////////////////////////////////
117
118 Dictionary CodeHighlighter::_get_line_syntax_highlighting_impl(int p_line) {
119 Dictionary color_map;
120
121 bool prev_is_char = false;
122 bool prev_is_number = false;
123 bool in_keyword = false;
124 bool in_word = false;
125 bool in_function_name = false;
126 bool in_member_variable = false;
127 bool is_hex_notation = false;
128 Color keyword_color;
129 Color color;
130
131 color_region_cache[p_line] = -1;
132 int in_region = -1;
133 if (p_line != 0) {
134 int prev_region_line = p_line - 1;
135 while (prev_region_line > 0 && !color_region_cache.has(prev_region_line)) {
136 prev_region_line--;
137 }
138 for (int i = prev_region_line; i < p_line - 1; i++) {
139 get_line_syntax_highlighting(i);
140 }
141 if (!color_region_cache.has(p_line - 1)) {
142 get_line_syntax_highlighting(p_line - 1);
143 }
144 in_region = color_region_cache[p_line - 1];
145 }
146
147 const String &str = text_edit->get_line_with_ime(p_line);
148 const int line_length = str.length();
149 Color prev_color;
150
151 if (in_region != -1 && str.length() == 0) {
152 color_region_cache[p_line] = in_region;
153 }
154 for (int j = 0; j < line_length; j++) {
155 Dictionary highlighter_info;
156
157 color = font_color;
158 bool is_char = !is_symbol(str[j]);
159 bool is_a_symbol = is_symbol(str[j]);
160 bool is_number = is_digit(str[j]);
161
162 /* color regions */
163 if (is_a_symbol || in_region != -1) {
164 int from = j;
165
166 if (in_region == -1) {
167 for (; from < line_length; from++) {
168 if (str[from] == '\\') {
169 from++;
170 continue;
171 }
172 break;
173 }
174 }
175
176 if (from != line_length) {
177 /* check if we are in entering a region */
178 if (in_region == -1) {
179 for (int c = 0; c < color_regions.size(); c++) {
180 /* check there is enough room */
181 int chars_left = line_length - from;
182 int start_key_length = color_regions[c].start_key.length();
183 int end_key_length = color_regions[c].end_key.length();
184 if (chars_left < start_key_length) {
185 continue;
186 }
187
188 /* search the line */
189 bool match = true;
190 const char32_t *start_key = color_regions[c].start_key.get_data();
191 for (int k = 0; k < start_key_length; k++) {
192 if (start_key[k] != str[from + k]) {
193 match = false;
194 break;
195 }
196 }
197 if (!match) {
198 continue;
199 }
200 in_region = c;
201 from += start_key_length;
202
203 /* check if it's the whole line */
204 if (end_key_length == 0 || color_regions[c].line_only || from + end_key_length > line_length) {
205 if (from + end_key_length > line_length && (color_regions[in_region].start_key == "\"" || color_regions[in_region].start_key == "\'")) {
206 // If it's key length and there is a '\', dont skip to highlight esc chars.
207 if (str.find_char('\\', from) >= 0) {
208 break;
209 }
210 }
211 prev_color = color_regions[in_region].color;
212 highlighter_info["color"] = color_regions[c].color;
213 color_map[j] = highlighter_info;
214
215 j = line_length;
216 if (!color_regions[c].line_only) {
217 color_region_cache[p_line] = c;
218 }
219 }
220 break;
221 }
222
223 if (j == line_length) {
224 continue;
225 }
226 }
227
228 /* if we are in one find the end key */
229 if (in_region != -1) {
230 bool is_string = (color_regions[in_region].start_key == "\"" || color_regions[in_region].start_key == "\'");
231
232 Color region_color = color_regions[in_region].color;
233 prev_color = region_color;
234 highlighter_info["color"] = region_color;
235 color_map[j] = highlighter_info;
236
237 /* search the line */
238 int region_end_index = -1;
239 int end_key_length = color_regions[in_region].end_key.length();
240 const char32_t *end_key = color_regions[in_region].end_key.get_data();
241 for (; from < line_length; from++) {
242 if (line_length - from < end_key_length) {
243 // Don't break if '\' to highlight esc chars.
244 if (!is_string || str.find_char('\\', from) < 0) {
245 break;
246 }
247 }
248
249 if (!is_symbol(str[from])) {
250 continue;
251 }
252
253 if (str[from] == '\\') {
254 if (is_string) {
255 Dictionary escape_char_highlighter_info;
256 escape_char_highlighter_info["color"] = symbol_color;
257 color_map[from] = escape_char_highlighter_info;
258 }
259
260 from++;
261
262 if (is_string) {
263 Dictionary region_continue_highlighter_info;
264 prev_color = region_color;
265 region_continue_highlighter_info["color"] = region_color;
266 color_map[from + 1] = region_continue_highlighter_info;
267 }
268 continue;
269 }
270
271 region_end_index = from;
272 for (int k = 0; k < end_key_length; k++) {
273 if (end_key[k] != str[from + k]) {
274 region_end_index = -1;
275 break;
276 }
277 }
278
279 if (region_end_index != -1) {
280 break;
281 }
282 }
283
284 j = from + (end_key_length - 1);
285 if (region_end_index == -1) {
286 color_region_cache[p_line] = in_region;
287 }
288
289 in_region = -1;
290 prev_is_char = false;
291 prev_is_number = false;
292 continue;
293 }
294 }
295 }
296
297 // Allow ABCDEF in hex notation.
298 if (is_hex_notation && (is_hex_digit(str[j]) || is_number)) {
299 is_number = true;
300 } else {
301 is_hex_notation = false;
302 }
303
304 // Check for dot or underscore or 'x' for hex notation in floating point number or 'e' for scientific notation.
305 if ((str[j] == '.' || str[j] == 'x' || str[j] == 'X' || str[j] == '_' || str[j] == 'f' || str[j] == 'e' || str[j] == 'E' || (uint_suffix_enabled && str[j] == 'u')) && !in_word && prev_is_number && !is_number) {
306 is_number = true;
307 is_a_symbol = false;
308 is_char = false;
309
310 if ((str[j] == 'x' || str[j] == 'X') && str[j - 1] == '0') {
311 is_hex_notation = true;
312 }
313 }
314
315 if (!in_word && (is_ascii_alphabet_char(str[j]) || is_underscore(str[j])) && !is_number) {
316 in_word = true;
317 }
318
319 if ((in_keyword || in_word) && !is_hex_notation) {
320 is_number = false;
321 }
322
323 if (is_a_symbol && str[j] != '.' && in_word) {
324 in_word = false;
325 }
326
327 if (!is_char) {
328 in_keyword = false;
329 }
330
331 if (!in_keyword && is_char && !prev_is_char) {
332 int to = j;
333 while (to < line_length && !is_symbol(str[to])) {
334 to++;
335 }
336
337 String word = str.substr(j, to - j);
338 Color col;
339 if (keywords.has(word)) {
340 col = keywords[word];
341 } else if (member_keywords.has(word)) {
342 col = member_keywords[word];
343 for (int k = j - 1; k >= 0; k--) {
344 if (str[k] == '.') {
345 col = Color(); //member indexing not allowed
346 break;
347 } else if (str[k] > 32) {
348 break;
349 }
350 }
351 }
352
353 if (col != Color()) {
354 in_keyword = true;
355 keyword_color = col;
356 }
357 }
358
359 if (!in_function_name && in_word && !in_keyword) {
360 int k = j;
361 while (k < line_length && !is_symbol(str[k]) && str[k] != '\t' && str[k] != ' ') {
362 k++;
363 }
364
365 // Check for space between name and bracket.
366 while (k < line_length && (str[k] == '\t' || str[k] == ' ')) {
367 k++;
368 }
369
370 if (str[k] == '(') {
371 in_function_name = true;
372 }
373 }
374
375 if (!in_function_name && !in_member_variable && !in_keyword && !is_number && in_word) {
376 int k = j;
377 while (k > 0 && !is_symbol(str[k]) && str[k] != '\t' && str[k] != ' ') {
378 k--;
379 }
380
381 if (str[k] == '.') {
382 in_member_variable = true;
383 }
384 }
385
386 if (is_a_symbol) {
387 in_function_name = false;
388 in_member_variable = false;
389 }
390
391 if (in_keyword) {
392 color = keyword_color;
393 } else if (in_member_variable) {
394 color = member_color;
395 } else if (in_function_name) {
396 color = function_color;
397 } else if (is_a_symbol) {
398 color = symbol_color;
399 } else if (is_number) {
400 color = number_color;
401 }
402
403 prev_is_char = is_char;
404 prev_is_number = is_number;
405
406 if (color != prev_color) {
407 prev_color = color;
408 highlighter_info["color"] = color;
409 color_map[j] = highlighter_info;
410 }
411 }
412
413 return color_map;
414 }
415
416 void CodeHighlighter::_clear_highlighting_cache() {
417 color_region_cache.clear();
418 }
419
420 void CodeHighlighter::_update_cache() {
421 font_color = text_edit->get_font_color();
422 }
423
424 void CodeHighlighter::add_keyword_color(const String &p_keyword, const Color &p_color) {
425 keywords[p_keyword] = p_color;
426 clear_highlighting_cache();
427 }
428
429 void CodeHighlighter::remove_keyword_color(const String &p_keyword) {
430 keywords.erase(p_keyword);
431 clear_highlighting_cache();
432 }
433
434 bool CodeHighlighter::has_keyword_color(const String &p_keyword) const {
435 return keywords.has(p_keyword);
436 }
437
438 Color CodeHighlighter::get_keyword_color(const String &p_keyword) const {
439 ERR_FAIL_COND_V(!keywords.has(p_keyword), Color());
440 return keywords[p_keyword];
441 }
442
443 void CodeHighlighter::set_keyword_colors(const Dictionary p_keywords) {
444 keywords = p_keywords;
445 clear_highlighting_cache();
446 }
447
448 void CodeHighlighter::clear_keyword_colors() {
449 keywords.clear();
450 clear_highlighting_cache();
451 }
452
453 Dictionary CodeHighlighter::get_keyword_colors() const {
454 return keywords;
455 }
456
457 void CodeHighlighter::add_member_keyword_color(const String &p_member_keyword, const Color &p_color) {
458 member_keywords[p_member_keyword] = p_color;
459 clear_highlighting_cache();
460 }
461
462 void CodeHighlighter::remove_member_keyword_color(const String &p_member_keyword) {
463 member_keywords.erase(p_member_keyword);
464 clear_highlighting_cache();
465 }
466
467 bool CodeHighlighter::has_member_keyword_color(const String &p_member_keyword) const {
468 return member_keywords.has(p_member_keyword);
469 }
470
471 Color CodeHighlighter::get_member_keyword_color(const String &p_member_keyword) const {
472 ERR_FAIL_COND_V(!member_keywords.has(p_member_keyword), Color());
473 return member_keywords[p_member_keyword];
474 }
475
476 void CodeHighlighter::set_member_keyword_colors(const Dictionary &p_member_keywords) {
477 member_keywords = p_member_keywords;
478 clear_highlighting_cache();
479 }
480
481 void CodeHighlighter::clear_member_keyword_colors() {
482 member_keywords.clear();
483 clear_highlighting_cache();
484 }
485
486 Dictionary CodeHighlighter::get_member_keyword_colors() const {
487 return member_keywords;
488 }
489
490 void CodeHighlighter::add_color_region(const String &p_start_key, const String &p_end_key, const Color &p_color, bool p_line_only) {
491 for (int i = 0; i < p_start_key.length(); i++) {
492 ERR_FAIL_COND_MSG(!is_symbol(p_start_key[i]), "color regions must start with a symbol");
493 }
494
495 if (p_end_key.length() > 0) {
496 for (int i = 0; i < p_end_key.length(); i++) {
497 ERR_FAIL_COND_MSG(!is_symbol(p_end_key[i]), "color regions must end with a symbol");
498 }
499 }
500
501 int at = 0;
502 for (int i = 0; i < color_regions.size(); i++) {
503 ERR_FAIL_COND_MSG(color_regions[i].start_key == p_start_key, "color region with start key '" + p_start_key + "' already exists.");
504 if (p_start_key.length() < color_regions[i].start_key.length()) {
505 at++;
506 }
507 }
508
509 ColorRegion color_region;
510 color_region.color = p_color;
511 color_region.start_key = p_start_key;
512 color_region.end_key = p_end_key;
513 color_region.line_only = p_line_only || p_end_key.is_empty();
514 color_regions.insert(at, color_region);
515 clear_highlighting_cache();
516 }
517
518 void CodeHighlighter::remove_color_region(const String &p_start_key) {
519 for (int i = 0; i < color_regions.size(); i++) {
520 if (color_regions[i].start_key == p_start_key) {
521 color_regions.remove_at(i);
522 break;
523 }
524 }
525 clear_highlighting_cache();
526 }
527
528 bool CodeHighlighter::has_color_region(const String &p_start_key) const {
529 for (int i = 0; i < color_regions.size(); i++) {
530 if (color_regions[i].start_key == p_start_key) {
531 return true;
532 }
533 }
534 return false;
535 }
536
537 void CodeHighlighter::set_color_regions(const Dictionary &p_color_regions) {
538 color_regions.clear();
539
540 for (const KeyValue<Variant, Variant> &kv : p_color_regions) {
541 String key = kv.key;
542
543 String start_key = key.get_slicec(' ', 0);
544 String end_key = key.get_slice_count(" ") > 1 ? key.get_slicec(' ', 1) : String();
545
546 add_color_region(start_key, end_key, kv.value, end_key.is_empty());
547 }
548 clear_highlighting_cache();
549 }
550
551 void CodeHighlighter::clear_color_regions() {
552 color_regions.clear();
553 clear_highlighting_cache();
554 }
555
556 Dictionary CodeHighlighter::get_color_regions() const {
557 Dictionary r_color_regions;
558 for (int i = 0; i < color_regions.size(); i++) {
559 ColorRegion region = color_regions[i];
560 r_color_regions[region.start_key + (region.end_key.is_empty() ? "" : " " + region.end_key)] = region.color;
561 }
562 return r_color_regions;
563 }
564
565 void CodeHighlighter::_bind_methods() {
566 ClassDB::bind_method(D_METHOD("add_keyword_color", "keyword", "color"), &CodeHighlighter::add_keyword_color);
567 ClassDB::bind_method(D_METHOD("remove_keyword_color", "keyword"), &CodeHighlighter::remove_keyword_color);
568 ClassDB::bind_method(D_METHOD("has_keyword_color", "keyword"), &CodeHighlighter::has_keyword_color);
569 ClassDB::bind_method(D_METHOD("get_keyword_color", "keyword"), &CodeHighlighter::get_keyword_color);
570
571 ClassDB::bind_method(D_METHOD("set_keyword_colors", "keywords"), &CodeHighlighter::set_keyword_colors);
572 ClassDB::bind_method(D_METHOD("clear_keyword_colors"), &CodeHighlighter::clear_keyword_colors);
573 ClassDB::bind_method(D_METHOD("get_keyword_colors"), &CodeHighlighter::get_keyword_colors);
574
575 ClassDB::bind_method(D_METHOD("add_member_keyword_color", "member_keyword", "color"), &CodeHighlighter::add_member_keyword_color);
576 ClassDB::bind_method(D_METHOD("remove_member_keyword_color", "member_keyword"), &CodeHighlighter::remove_member_keyword_color);
577 ClassDB::bind_method(D_METHOD("has_member_keyword_color", "member_keyword"), &CodeHighlighter::has_member_keyword_color);
578 ClassDB::bind_method(D_METHOD("get_member_keyword_color", "member_keyword"), &CodeHighlighter::get_member_keyword_color);
579
580 ClassDB::bind_method(D_METHOD("set_member_keyword_colors", "member_keyword"), &CodeHighlighter::set_member_keyword_colors);
581 ClassDB::bind_method(D_METHOD("clear_member_keyword_colors"), &CodeHighlighter::clear_member_keyword_colors);
582 ClassDB::bind_method(D_METHOD("get_member_keyword_colors"), &CodeHighlighter::get_member_keyword_colors);
583
584 ClassDB::bind_method(D_METHOD("add_color_region", "start_key", "end_key", "color", "line_only"), &CodeHighlighter::add_color_region, DEFVAL(false));
585 ClassDB::bind_method(D_METHOD("remove_color_region", "start_key"), &CodeHighlighter::remove_color_region);
586 ClassDB::bind_method(D_METHOD("has_color_region", "start_key"), &CodeHighlighter::has_color_region);
587
588 ClassDB::bind_method(D_METHOD("set_color_regions", "color_regions"), &CodeHighlighter::set_color_regions);
589 ClassDB::bind_method(D_METHOD("clear_color_regions"), &CodeHighlighter::clear_color_regions);
590 ClassDB::bind_method(D_METHOD("get_color_regions"), &CodeHighlighter::get_color_regions);
591
592 ClassDB::bind_method(D_METHOD("set_function_color", "color"), &CodeHighlighter::set_function_color);
593 ClassDB::bind_method(D_METHOD("get_function_color"), &CodeHighlighter::get_function_color);
594
595 ClassDB::bind_method(D_METHOD("set_number_color", "color"), &CodeHighlighter::set_number_color);
596 ClassDB::bind_method(D_METHOD("get_number_color"), &CodeHighlighter::get_number_color);
597
598 ClassDB::bind_method(D_METHOD("set_symbol_color", "color"), &CodeHighlighter::set_symbol_color);
599 ClassDB::bind_method(D_METHOD("get_symbol_color"), &CodeHighlighter::get_symbol_color);
600
601 ClassDB::bind_method(D_METHOD("set_member_variable_color", "color"), &CodeHighlighter::set_member_variable_color);
602 ClassDB::bind_method(D_METHOD("get_member_variable_color"), &CodeHighlighter::get_member_variable_color);
603
604 ADD_PROPERTY(PropertyInfo(Variant::COLOR, "number_color"), "set_number_color", "get_number_color");
605 ADD_PROPERTY(PropertyInfo(Variant::COLOR, "symbol_color"), "set_symbol_color", "get_symbol_color");
606 ADD_PROPERTY(PropertyInfo(Variant::COLOR, "function_color"), "set_function_color", "get_function_color");
607 ADD_PROPERTY(PropertyInfo(Variant::COLOR, "member_variable_color"), "set_member_variable_color", "get_member_variable_color");
608
609 ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "keyword_colors", PROPERTY_HINT_TYPE_STRING, "String;Color"), "set_keyword_colors", "get_keyword_colors");
610 ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "member_keyword_colors", PROPERTY_HINT_TYPE_STRING, "String;Color"), "set_member_keyword_colors", "get_member_keyword_colors");
611 ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "color_regions", PROPERTY_HINT_TYPE_STRING, "String;Color"), "set_color_regions", "get_color_regions");
612 }
613
614 void CodeHighlighter::set_uint_suffix_enabled(bool p_enabled) {
615 uint_suffix_enabled = p_enabled;
616 }
617
618 void CodeHighlighter::set_number_color(Color p_color) {
619 number_color = p_color;
620 clear_highlighting_cache();
621 }
622
623 Color CodeHighlighter::get_number_color() const {
624 return number_color;
625 }
626
627 void CodeHighlighter::set_symbol_color(Color p_color) {
628 symbol_color = p_color;
629 clear_highlighting_cache();
630 }
631
632 Color CodeHighlighter::get_symbol_color() const {
633 return symbol_color;
634 }
635
636 void CodeHighlighter::set_function_color(Color p_color) {
637 function_color = p_color;
638 clear_highlighting_cache();
639 }
640
641 Color CodeHighlighter::get_function_color() const {
642 return function_color;
643 }
644
645 void CodeHighlighter::set_member_variable_color(Color p_color) {
646 member_color = p_color;
647 clear_highlighting_cache();
648 }
649
650 Color CodeHighlighter::get_member_variable_color() const {
651 return member_color;
652 }