Commit 18490596 authored by Roberto Raggi's avatar Roberto Raggi

Renamed Document::findSymbolAt().

parent 56c5c826
......@@ -406,12 +406,12 @@ Scope *Document::scopeAt(unsigned line, unsigned column)
return globalSymbols();
}
Symbol *Document::findSymbolAt(unsigned line, unsigned column) const
Symbol *Document::lastVisibleSymbolAt(unsigned line, unsigned column) const
{
return findSymbolAt(line, column, globalSymbols());
return lastVisibleSymbolAt(line, column, globalSymbols());
}
Symbol *Document::findSymbolAt(unsigned line, unsigned column, Scope *scope) const
Symbol *Document::lastVisibleSymbolAt(unsigned line, unsigned column, Scope *scope) const
{
Symbol *previousSymbol = 0;
......@@ -425,7 +425,7 @@ Symbol *Document::findSymbolAt(unsigned line, unsigned column, Scope *scope) con
if (previousSymbol) {
if (ScopedSymbol *scoped = previousSymbol->asScopedSymbol()) {
if (Symbol *member = findSymbolAt(line, column, scoped->members()))
if (Symbol *member = lastVisibleSymbolAt(line, column, scoped->members()))
return member;
}
}
......
......@@ -92,7 +92,7 @@ public:
QList<Macro> definedMacros() const
{ return _definedMacros; }
Q_DECL_DEPRECATED Symbol *findSymbolAt(unsigned line, unsigned column) const;
Symbol *lastVisibleSymbolAt(unsigned line, unsigned column) const;
Scope *scopeAt(unsigned line, unsigned column);
QByteArray source() const;
......@@ -310,7 +310,7 @@ public:
const UndefinedMacroUse *findUndefinedMacroUseAt(unsigned offset) const;
private:
Symbol *findSymbolAt(unsigned line, unsigned column, Scope *scope) const;
Symbol *lastVisibleSymbolAt(unsigned line, unsigned column, Scope *scope) const;
private:
QString _fileName;
......
......@@ -1150,7 +1150,7 @@ void CPPEditor::switchDeclarationDefinition()
convertPosition(position(), &line, &column);
Scope *scope = thisDocument->scopeAt(line, column);
Symbol *lastVisibleSymbol = thisDocument->findSymbolAt(line, column);
Symbol *lastVisibleSymbol = thisDocument->lastVisibleSymbolAt(line, column);
Scope *functionScope = 0;
if (scope->isFunctionScope())
......@@ -1351,7 +1351,7 @@ CPPEditor::Link CPPEditor::findLinkAt(const QTextCursor &cursor,
if (resolveTarget) {
def = findDefinition(symbol, snapshot);
if (def == doc->findSymbolAt(line, column))
if (def == doc->lastVisibleSymbolAt(line, column))
def = 0; // jump to declaration then.
}
......
......@@ -66,7 +66,7 @@ QString AbstractEditorSupport::functionAt(const CppModelManagerInterface *modelM
const CPlusPlus::Document::Ptr document = snapshot.document(fileName);
if (!document)
return QString();
if (const CPlusPlus::Symbol *symbol = document->findSymbolAt(line, column))
if (const CPlusPlus::Symbol *symbol = document->lastVisibleSymbolAt(line, column))
if (const CPlusPlus::Scope *scope = symbol->scope())
if (const CPlusPlus::Scope *functionScope = scope->enclosingFunctionScope())
if (const CPlusPlus::Symbol *function = functionScope->owner()) {
......
......@@ -746,7 +746,7 @@ int CppCodeCompletion::startCompletionInternal(TextEditor::BaseTextEditor *edit,
return -1;
typeOfExpression.init(thisDocument, snapshot);
Symbol *lastVisibleSymbol = thisDocument->findSymbolAt(line, column);
Symbol *lastVisibleSymbol = thisDocument->lastVisibleSymbolAt(line, column);
if (expression.isEmpty()) {
if (m_completionOperator == T_EOF_SYMBOL || m_completionOperator == T_COLON_COLON)
......@@ -1564,7 +1564,7 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item)
}
} else if (! function->isAmbiguous()) {
if (completionSettings().m_spaceAfterFunctionName)
extraChars += QLatin1Char(' ');
extraChars += QLatin1Char(' ');
extraChars += QLatin1Char('(');
// If the function doesn't return anything, automatically place the semicolon,
......
......@@ -361,7 +361,7 @@ int getUninitializedVariablesI(const CPlusPlus::Snapshot &snapshot,
const CPlusPlus::Document::Ptr doc = docIt.value();
// Look at symbol at line and find its function. Either it is the
// function itself or some expression/variable.
const CPlusPlus::Symbol *symbolAtLine = doc->findSymbolAt(line, 0);
const CPlusPlus::Symbol *symbolAtLine = doc->lastVisibleSymbolAt(line, 0);
if (!symbolAtLine)
return 4;
// First figure out the function to do a safety name check
......
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