MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / get_text_for_code_completion

Method get_text_for_code_completion

scene/gui/code_edit.cpp:2180–2200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2178}
2179
2180String CodeEdit::get_text_for_code_completion() const {
2181 StringBuilder completion_text;
2182 const int text_size = get_line_count();
2183 for (int i = 0; i < text_size; i++) {
2184 String line = get_line(i);
2185
2186 if (i == get_caret_line()) {
2187 completion_text += line.substr(0, get_caret_column());
2188 /* Not unicode, represents the caret. */
2189 completion_text += String::chr(0xFFFF);
2190 completion_text += line.substr(get_caret_column());
2191 } else {
2192 completion_text += line;
2193 }
2194
2195 if (i != text_size - 1) {
2196 completion_text += "\n";
2197 }
2198 }
2199 return completion_text.as_string();
2200}
2201
2202void CodeEdit::request_code_completion(bool p_force) {
2203 if (GDVIRTUAL_CALL(_request_code_completion, p_force)) {

Callers 2

_complete_requestMethod · 0.80
test_code_edit.hFile · 0.80

Calls 2

substrMethod · 0.80
as_stringMethod · 0.45

Tested by

no test coverage detected