diff options
author | Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> | 2016-03-30 10:35:17 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> | 2016-03-31 07:12:49 +0000 |
commit | da5309cbc62db905ed8f5c58401f814baf26d269 (patch) | |
tree | 43c13d58dc838e3a48e9587dbd51a26227e9f45e /src/plugins/cpptools/cppcompletion_test.cpp | |
parent | 4de62a7349a55776d81d21a73a567c731fc5cf9b (diff) | |
download | qt-creator-da5309cbc62db905ed8f5c58401f814baf26d269.tar.gz |
C++: Fix completion for doxygen tags II
For assist processors that run in a worker thread, the QTextDocument is
recreated with AssistInterface::prepareForAsyncUse and
AssistInterface::recreateTextDocument.
Since some assist processors (C++, QmlJS) rely on the user states of the
QTextBlocks, these must be recreated, too.
In the referenced bug report the lexer state (user state) of the
previous QTextBlock was invalid and thus the "Doxygen tag completion"
failed.
Task-number: QTCREATORBUG-9373
Change-Id: If668e98aa6f9fe9fc107c7476fc831e92a0d7572
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Diffstat (limited to 'src/plugins/cpptools/cppcompletion_test.cpp')
-rw-r--r-- | src/plugins/cpptools/cppcompletion_test.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp index e761004e8b..27cb35739e 100644 --- a/src/plugins/cpptools/cppcompletion_test.cpp +++ b/src/plugins/cpptools/cppcompletion_test.cpp @@ -111,6 +111,8 @@ public: ExplicitlyInvoked, m_snapshot, ProjectPartHeaderPaths(), languageFeatures); + ai->prepareForAsyncUse(); + ai->recreateTextDocument(); InternalCppCompletionAssistProcessor processor; const Tests::IAssistProposalScopedPointer proposal(processor.perform(ai)); @@ -405,6 +407,11 @@ void CppToolsPlugin::test_doxygen_tag_completion_data() QTest::newRow("C comment single line") << _("/*! @ */"); + + QTest::newRow("C comment multi line") + << _("/*! text\n" + " * @\n" + " */\n"); } void CppToolsPlugin::test_doxygen_tag_completion() |