Clang: Fix SOFT ASSERT: "!m_functionName.isEmpty()"

...that ocurred for e.g. "foo (<COMPLETE HERE>".

We did not handle the following cases:
 1) white space after the function name
 2) nothing before parenthesis

Change-Id: If6aedd2cc938df30516e13a860d07d7a509633ae
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2016-04-20 12:54:28 +02:00
parent 474b8ec5c0
commit 11836a14cf
3 changed files with 29 additions and 4 deletions

View File

@@ -64,7 +64,12 @@ public:
private:
ClangCompletionContextAnalyzer();
struct FunctionInfo { int functionNamePosition; QString functionName; };
struct FunctionInfo {
bool isValid() const { return functionNamePosition != -1 && !functionName.isEmpty(); }
int functionNamePosition = -1;
QString functionName;
};
FunctionInfo analyzeFunctionCall(int endOfExpression) const;
void setActionAndClangPosition(CompletionAction action, int position);