diff options
Diffstat (limited to 'editor/code_editor.cpp')
-rw-r--r-- | editor/code_editor.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index ed50c7914e..d5aae7b562 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -724,7 +724,7 @@ void CodeTextEditor::_code_complete_timer_timeout() { void CodeTextEditor::_complete_request() { - List<String> entries; + List<ScriptCodeCompletionOption> entries; String ctext = text_editor->get_text_for_completion(); _code_complete_script(ctext, &entries); bool forced = false; @@ -733,15 +733,16 @@ void CodeTextEditor::_complete_request() { } if (entries.size() == 0) return; - Vector<String> strs; - strs.resize(entries.size()); - int i = 0; - for (List<String>::Element *E = entries.front(); E; E = E->next()) { - strs.write[i++] = E->get(); + Vector<String> options; + options.resize(entries.size()); + size_t i = 0; + for (List<ScriptCodeCompletionOption>::Element *E = entries.front(); E; E = E->next()) { + options.write[i] = E->get().insert_text; + i++; } - text_editor->code_complete(strs, forced); + text_editor->code_complete(options, forced); } void CodeTextEditor::_font_resize_timeout() { |