diff options
author | Erik Verbruggen <erik.verbruggen@nokia.com> | 2010-07-06 10:57:39 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@nokia.com> | 2010-07-06 10:57:56 +0200 |
commit | 69a74abf26581a897b37fe2ccc6d523f10fe7f5e (patch) | |
tree | fac672e6c4aeb6c4289395fc4fba39d6ee77403e /src/plugins/cpptools/cppcodecompletion.cpp | |
parent | 6d8ecb762f2b178086a3009cc8a61d5de19a0230 (diff) | |
download | qt-creator-69a74abf26581a897b37fe2ccc6d523f10fe7f5e.tar.gz |
Fixed completion for doxygen comments.
Diffstat (limited to 'src/plugins/cpptools/cppcodecompletion.cpp')
-rw-r--r-- | src/plugins/cpptools/cppcodecompletion.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/cpptools/cppcodecompletion.cpp b/src/plugins/cpptools/cppcodecompletion.cpp index f4794d4886..733671fa51 100644 --- a/src/plugins/cpptools/cppcodecompletion.cpp +++ b/src/plugins/cpptools/cppcodecompletion.cpp @@ -554,9 +554,10 @@ static int startOfOperator(TextEditor::ITextEditable *editor, SimpleLexer tokenize; tokenize.setQtMocRunEnabled(true); + tokenize.setObjCEnabled(true); tokenize.setSkipComments(false); - const QList<Token> &tokens = tokenize(tc.block().text()); - const int tokenIdx = SimpleLexer::tokenAt(tokens, qMax(0, tc.positionInBlock() - 1)); // get the token at the left of the cursor + const QList<Token> &tokens = tokenize(tc.block().text(), BackwardsScanner::previousBlockState(tc.block())); + const int tokenIdx = SimpleLexer::tokenBefore(tokens, qMax(0, tc.positionInBlock() - 1)); // get the token at the left of the cursor const Token tk = (tokenIdx == -1) ? Token() : tokens.at(tokenIdx); if (completionKind == T_DOXY_COMMENT && !(tk.is(T_DOXY_COMMENT) || tk.is(T_CPP_DOXY_COMMENT))) { |