Commit 72ad68e9 authored by Erik Verbruggen's avatar Erik Verbruggen Committed by Nikolai Kosjar

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: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
parent df22d163
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment