Revert "Introduced a token cache for the C++ editor."

This reverts commit c2393df023.
This commit is contained in:
Erik Verbruggen
2010-06-04 12:37:26 +02:00
parent 5f749306f1
commit 424b9724d6
23 changed files with 86 additions and 244 deletions

View File

@@ -736,8 +736,7 @@ QString cppExpressionAt(TextEditor::ITextEditor *editor, int pos,
return QString();
QString expr = plaintext->textCursor().selectedText();
CppTools::CppModelManagerInterface *modelManager = ExtensionSystem::PluginManager::instance()->getObject<CppTools::CppModelManagerInterface>();
if (expr.isEmpty() && modelManager) {
if (expr.isEmpty()) {
QTextCursor tc(plaintext->document());
tc.setPosition(pos);
@@ -746,7 +745,7 @@ QString cppExpressionAt(TextEditor::ITextEditor *editor, int pos,
tc.movePosition(QTextCursor::EndOfWord);
// Fetch the expression's code.
CPlusPlus::ExpressionUnderCursor expressionUnderCursor(modelManager->tokenCache(editor));
CPlusPlus::ExpressionUnderCursor expressionUnderCursor;
expr = expressionUnderCursor(tc);
*column = tc.columnNumber();
*line = tc.blockNumber();
@@ -758,7 +757,7 @@ QString cppExpressionAt(TextEditor::ITextEditor *editor, int pos,
if (function && !expr.isEmpty())
if (const Core::IFile *file = editor->file())
if (modelManager)
if (CppTools::CppModelManagerInterface *modelManager = ExtensionSystem::PluginManager::instance()->getObject<CppTools::CppModelManagerInterface>())
*function = CppTools::AbstractEditorSupport::functionAt(modelManager, file->fileName(), *line, *column);
return expr;