Fix: Console auto-completion should take into account parent classes' prototypes

fixes #9843
This commit is contained in:
Gunnar Beutner 2015-08-26 09:02:31 +02:00
parent f8a26d810c
commit 2109944580
1 changed files with 10 additions and 6 deletions

View File

@ -128,14 +128,18 @@ static char *ConsoleCompleteHelper(const char *word, int state)
AddSuggestion(matches, word, pword + "." + field.Name);
}
Object::Ptr prototype = type->GetPrototype();
Dictionary::Ptr dict = dynamic_pointer_cast<Dictionary>(prototype);
while (type) {
Object::Ptr prototype = type->GetPrototype();
Dictionary::Ptr dict = dynamic_pointer_cast<Dictionary>(prototype);
if (dict) {
ObjectLock olock(dict);
BOOST_FOREACH(const Dictionary::Pair& kv, dict) {
AddSuggestion(matches, word, pword + "." + kv.first);
if (dict) {
ObjectLock olock(dict);
BOOST_FOREACH(const Dictionary::Pair& kv, dict) {
AddSuggestion(matches, word, pword + "." + kv.first);
}
}
type = type->GetBaseType();
}
} catch (...) { /* Ignore the exception */ }
}