| 2178 | } |
| 2179 | |
| 2180 | String 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 | |
| 2202 | void CodeEdit::request_code_completion(bool p_force) { |
| 2203 | if (GDVIRTUAL_CALL(_request_code_completion, p_force)) { |
no test coverage detected