forked from qt-creator/qt-creator
C++: show function declarations in the locator.
When searching for functions/methods in the locator, also show function and method declarations. Task-number: QTCREATORBUG-8862 Change-Id: Ie86bfe82403d79a903d769860a472e2a20a2b9d0 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
committed by
Nikolai Kosjar
parent
df22d163fb
commit
72ad68e913
@@ -138,8 +138,15 @@ bool SearchSymbols::visit(Namespace *symbol)
|
||||
|
||||
bool SearchSymbols::visit(Declaration *symbol)
|
||||
{
|
||||
if (!(symbolsToSearchFor & SymbolSearcher::Declarations))
|
||||
return false;
|
||||
if (!(symbolsToSearchFor & SymbolSearcher::Declarations)) {
|
||||
// if we're searching for functions, still allow function declarations to show up.
|
||||
if (symbolsToSearchFor & SymbolSearcher::Functions) {
|
||||
if (!symbol->type()->asFunctionType())
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
QString name = symbolName(symbol);
|
||||
QString scopedName = scopedSymbolName(name);
|
||||
@@ -147,7 +154,9 @@ bool SearchSymbols::visit(Declaration *symbol)
|
||||
separateScope ? symbol->unqualifiedName() : 0);
|
||||
appendItem(separateScope ? type : scopedName,
|
||||
separateScope ? _scope : type,
|
||||
ModelItemInfo::Declaration, symbol);
|
||||
symbol->type()->asFunctionType() ? ModelItemInfo::Method
|
||||
: ModelItemInfo::Declaration,
|
||||
symbol);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user