From 083ea37eb0f44c31f2ecc1011a3a0c99f0c94971 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Tue, 13 Oct 2009 14:38:37 +0200 Subject: Rename the given enumerator. (cherry picked from commit c33a8e94981f6b1acf2b11aaf04c3e86f6ceea12) --- src/plugins/cpptools/cppfindreferences.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp index 03397a655a..a78087d6a3 100644 --- a/src/plugins/cpptools/cppfindreferences.cpp +++ b/src/plugins/cpptools/cppfindreferences.cpp @@ -168,10 +168,10 @@ protected: bool isDeclSymbol(Symbol *symbol) const { - if (! symbol) + if (! symbol) { return false; - else if (symbol == _declSymbol) { + } else if (symbol == _declSymbol) { return true; } else if (symbol->line() == _declSymbol->line() && symbol->column() == _declSymbol->column()) { @@ -349,6 +349,20 @@ protected: return false; } + virtual bool visit(EnumeratorAST *ast) + { + Identifier *id = identifier(ast->identifier_token); + if (id == _id) { + LookupContext context = currentContext(ast); + const QList candidates = context.resolve(control()->nameId(id)); + reportResult(ast->identifier_token, candidates); + } + + accept(ast->expression); + + return false; + } + virtual bool visit(SimpleNameAST *ast) { Identifier *id = identifier(ast->identifier_token); -- cgit v1.2.1