diff options
author | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2018-10-24 10:05:53 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2018-10-25 12:13:57 +0000 |
commit | d946ff540312210f1da8cc509c474a39da45117c (patch) | |
tree | d0c5fda0396b8946015e937d293d13d798804dd9 /src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp | |
parent | 7d3686359aeba2b5ce4abac8fa18b81021e71ea0 (diff) | |
download | qt-creator-d946ff540312210f1da8cc509c474a39da45117c.tar.gz |
Clang: Fix adding completion snippets after {
...e.g. as in "void f() {".
The criteria whether to change snippets got invalidated with
commit 8d0391a4f9b91fb15ee3d20db725c7a37c4646aa
Clang: Treat brace initialization as constructor completion
as the completion operator might be T_LBRACE now instead of T_EOF_SYMBOL
for normal completions.
This fixes the plugin test ClangCodeCompletionTest::testCompleteGlobals.
Add also unit tests.
Change-Id: I85cf522b9b307359c5c3e25198dd228cbb68ded0
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Diffstat (limited to 'src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp')
-rw-r--r-- | src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp b/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp index b16f458ca5..fec7b69dab 100644 --- a/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp +++ b/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp @@ -262,6 +262,7 @@ IAssistProposal *ClangCompletionAssistProcessor::startCompletionHelper() analyzer.analyze(); m_completionOperator = analyzer.completionOperator(); m_positionForProposal = analyzer.positionForProposal(); + m_addSnippets = analyzer.addSnippets(); QByteArray modifiedFileContent; @@ -285,7 +286,6 @@ IAssistProposal *ClangCompletionAssistProcessor::startCompletionHelper() analyzer.positionEndOfExpression()); Q_FALLTHROUGH(); case ClangCompletionContextAnalyzer::PassThroughToLibClang: { - m_addSnippets = m_completionOperator == T_EOF_SYMBOL; m_sentRequestType = NormalCompletion; m_requestSent = sendCompletionRequest(analyzer.positionForClang(), modifiedFileContent); |