diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-07-04 08:38:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-04 08:38:27 +0200 |
commit | 14d1cfd0daf6db8fdffc0e57540619eff81ac240 (patch) | |
tree | 914511435507d93e8cfafa1f395c5e96d8ae3eb0 /editor/code_editor.cpp | |
parent | 2293c612e6c0913b6999080c9f2fa77227348818 (diff) | |
parent | ed7ed52151a9eca2a60a418881bd7065529acb66 (diff) | |
download | redot-engine-14d1cfd0daf6db8fdffc0e57540619eff81ac240.tar.gz |
Merge pull request #29626 from GodotExplorer/script_more_complete_info
More information for code completion 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() { |