From 91429aa7521dff2006451577514c8954fcc3f793 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Thu, 23 Jul 2015 16:06:48 +0200 Subject: 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() { } Case 2: void f() { st } Case 3: if (true) Case 4: foo. mem Change-Id: Ie79e01e8a22f8ec306136ec4ccbfffd544edd573 Reviewed-by: Erik Verbruggen --- src/plugins/clangcodemodel/clangcompletioncontextanalyzer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/clangcodemodel/clangcompletioncontextanalyzer.cpp') 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) { -- cgit v1.2.1