summaryrefslogtreecommitdiff
path: root/src/plugins/clangcodemodel/clangcompletioncontextanalyzer.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2015-07-23 16:06:48 +0200
committerNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2015-07-27 13:19:02 +0000
commit91429aa7521dff2006451577514c8954fcc3f793 (patch)
treeaaa7bcdc1b44b78a9696f254d04fc7892f7a6833 /src/plugins/clangcodemodel/clangcompletioncontextanalyzer.cpp
parent49b1d357789e4920245bf15d7f1d5cc727657000 (diff)
downloadqt-creator-91429aa7521dff2006451577514c8954fcc3f793.tar.gz
Clang: Fix completion position for clang and proposal
* Rename some members/functions to clarify their meaning. * Ensure that the position for the proposal widget is at start of the identifer, so that the filter prefix will be found correctly in the GenericProposalWidget. For certain cases the completion were calculated but the widget was never shown: Case 1: void f() { <COMPLETION_CURSOR> } Case 2: void f() { st<COMPLETION_CURSOR> } Case 3: if (true) <COMPLETION_CURSOR> Case 4: foo. mem<COMPLETION_CURSOR> Change-Id: Ie79e01e8a22f8ec306136ec4ccbfffd544edd573 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Diffstat (limited to 'src/plugins/clangcodemodel/clangcompletioncontextanalyzer.cpp')
-rw-r--r--src/plugins/clangcodemodel/clangcompletioncontextanalyzer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/clangcodemodel/clangcompletioncontextanalyzer.cpp b/src/plugins/clangcodemodel/clangcompletioncontextanalyzer.cpp
index 99a75f9b84..63fd840878 100644
--- a/src/plugins/clangcodemodel/clangcompletioncontextanalyzer.cpp
+++ b/src/plugins/clangcodemodel/clangcompletioncontextanalyzer.cpp
@@ -86,9 +86,9 @@ void ClangCompletionContextAnalyzer::analyze()
ActivationSequenceContextProcessor activationSequenceContextProcessor(m_interface);
m_completionOperator = activationSequenceContextProcessor.completionKind();
- int afterOperatorPosition = activationSequenceContextProcessor.positionAfterOperator();
- m_positionEndOfExpression = activationSequenceContextProcessor.positionBeforeOperator();
- m_positionForProposal = activationSequenceContextProcessor.positionAfterOperator();
+ int afterOperatorPosition = activationSequenceContextProcessor.startOfNamePosition();
+ m_positionEndOfExpression = activationSequenceContextProcessor.operatorStartPosition();
+ m_positionForProposal = activationSequenceContextProcessor.startOfNamePosition();
const bool actionIsSet = handleNonFunctionCall(afterOperatorPosition);
if (!actionIsSet) {