Revert "Introduced a token cache for the C++ editor."
This reverts commit c2393df0.
... | ... | @@ -65,6 +65,7 @@ |
#include <utils/faketooltip.h> | ||
#include <utils/qtcassert.h> | ||
#include <QtCore/QDebug> | ||
#include <QtCore/QMap> | ||
#include <QtCore/QFile> | ||
#include <QtGui/QAction> | ||
... | ... | @@ -453,8 +454,7 @@ QIcon CppCodeCompletion::iconForSymbol(Symbol *symbol) const |
/* | ||
Searches backwards for an access operator. | ||
*/ | ||
static int startOfOperator(TokenCache *tokenCache, | ||
TextEditor::ITextEditable *editor, | ||
static int startOfOperator(TextEditor::ITextEditable *editor, | ||
int pos, unsigned *kind, | ||
bool wantFunctionCall) | ||
{ | ||
... | ... | @@ -547,7 +547,7 @@ static int startOfOperator(TokenCache *tokenCache, |
} | ||
if (completionKind == T_COMMA) { | ||
ExpressionUnderCursor expressionUnderCursor(tokenCache); | ||
ExpressionUnderCursor expressionUnderCursor; | ||
if (expressionUnderCursor.startOfFunctionCall(tc) == -1) { | ||
completionKind = T_EOF_SYMBOL; | ||
start = pos; | ||
... | ... | @@ -555,7 +555,7 @@ static int startOfOperator(TokenCache *tokenCache, |
} | ||
static CPlusPlus::TokenUnderCursor tokenUnderCursor; | ||
const SimpleToken tk = tokenUnderCursor(tokenCache, tc); | ||
const SimpleToken tk = tokenUnderCursor(tc); | ||
if (completionKind == T_DOXY_COMMENT && !(tk.is(T_DOXY_COMMENT) || tk.is(T_CPP_DOXY_COMMENT))) { | ||
completionKind = T_EOF_SYMBOL; | ||
... | ... | @@ -634,10 +634,9 @@ int CppCodeCompletion::startPosition() const |
bool CppCodeCompletion::triggersCompletion(TextEditor::ITextEditable *editor) | ||
{ | ||
const int pos = editor->position(); | ||
TokenCache *tokenCache = m_manager->tokenCache(editor); | ||
unsigned token = T_EOF_SYMBOL; | ||
if (startOfOperator(tokenCache, editor, pos, &token, /*want function call=*/ true) != pos) { | ||
if (startOfOperator(editor, pos, &token, /*want function call=*/ true) != pos) { | ||
if (token == T_POUND) { | ||
if (TextEditor::BaseTextEditor *edit = qobject_cast<TextEditor::BaseTextEditor *>(editor->widget())) { | ||
QTextCursor tc(edit->document()); | ||
... | ... | @@ -685,8 +684,7 @@ int CppCodeCompletion::startCompletionHelper(TextEditor::ITextEditable *editor) |
while (editor->characterAt(endOfOperator - 1).isSpace()) | ||
< |