CppTools: Fix global completion after "/// text."

Like for other comments, don't try member completion if the doxygen
comment ends with a dot.

Task-number: QTCREATORBUG-8597
Change-Id: I2d5204ba8f45fc9ee94e285a907364cc722e62c7
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2015-04-23 12:01:54 +02:00
parent 7697bd4b6f
commit cea5d886d8
3 changed files with 33 additions and 7 deletions

View File

@@ -680,6 +680,7 @@ int ClangCompletionAssistProcessor::startCompletionHelper()
return startCompletionInternal(fileName, line, column, endOfOperator);
}
// TODO: Extract duplicated logic from InternalCppCompletionAssistProcessor::startOfOperator
int ClangCompletionAssistProcessor::startOfOperator(int pos,
unsigned *kind,
bool wantFunctionCall) const
@@ -724,8 +725,9 @@ int ClangCompletionAssistProcessor::startOfOperator(int pos,
start = pos;
}
// Don't complete in comments or strings, but still check for include completion
else if (tk.is(T_COMMENT) || tk.is(T_CPP_COMMENT) ||
(tk.isLiteral() && (*kind != T_STRING_LITERAL
else if (tk.is(T_COMMENT) || tk.is(T_CPP_COMMENT)
|| tk.is(T_CPP_DOXY_COMMENT) || tk.is(T_DOXY_COMMENT)
|| (tk.isLiteral() && (*kind != T_STRING_LITERAL
&& *kind != T_ANGLE_STRING_LITERAL
&& *kind != T_SLASH))) {
*kind = T_EOF_SYMBOL;