C++: Offer only signals when completing in a connect() call

... at the second argument.
The logic is as follows: The clang code model checks whether the set of
completions contains any signals. If so, it instructs the built-in code
model to analyze the AST to find out whether the completion location was
at the second argument of a call to QObject::connect(). In that case, we
filter out all non-signals, because they are not valid at that location.

Fixes: QTCREATORBUG-13558
Change-Id: I9c7d0bd16161c723aef822280626cd06ece7df93
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2020-08-25 14:32:56 +02:00
parent b938764820
commit a79b0c6558
6 changed files with 266 additions and 17 deletions

View File

@@ -169,6 +169,9 @@ public:
SymbolFinder *symbolFinder,
bool inNextSplit) const final;
bool positionRequiresSignal(const QString &filePath, const QByteArray &content,
int position) const;
void renameUsages(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context,
const QString &replacement = QString());
void findUsages(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context);