Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Eidsness2014-01-28 06:48:14 -0500
committerDoug Schaefer2014-01-28 11:08:31 -0500
commit69e866058d4fc5186bdd90b4955498d8cf855403 (patch)
tree8bf05a3fce8d82731a0022b8505b2ac58ae96bdd
parentf9bdf28321e73b23261b956bcffa003af7faf0d4 (diff)
downloadorg.eclipse.cdt-69e866058d4fc5186bdd90b4955498d8cf855403.tar.gz
org.eclipse.cdt-69e866058d4fc5186bdd90b4955498d8cf855403.tar.xz
org.eclipse.cdt-69e866058d4fc5186bdd90b4955498d8cf855403.zip
Bug 426781: Qt content assist is too aggressive
In Content Assist cases like: q-> (when the cursor is to the right of the arrow operator) the name that is returned by the content assist context is the empty string. This was used to check if the QObject::connect function applied. Since the empt string matches all bindings the Qt assistant incorrectly continued. I've added a check to stop processing when the current name is the empty string. Change-Id: I4e5bf52f4ca1ddc33d88a48917213adbbeb81836 Signed-off-by: Andrew Eidsness <eclipse@jfront.com> Reviewed-on: https://git.eclipse.org/r/21188 Reviewed-by: Doug Schaefer <dschaefer@qnx.com> IP-Clean: Doug Schaefer <dschaefer@qnx.com> Tested-by: Doug Schaefer <dschaefer@qnx.com>
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtFunctionCallUtil.java12
1 files changed, 3 insertions, 9 deletions
diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtFunctionCallUtil.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtFunctionCallUtil.java
index 7b652028aee..1e050cb51e5 100644
--- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtFunctionCallUtil.java
+++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtFunctionCallUtil.java
@@ -66,7 +66,9 @@ public class QtFunctionCallUtil {
* and false otherwise.
*/
public static boolean isQObjectFunctionCall(IASTCompletionContext astContext, boolean isPrefix, IASTName name) {
- if (name == null)
+ if (name == null
+ || name.getSimpleID() == null
+ || name.getSimpleID().length <= 0)
return false;
// Bug332201: Qt content assist should always be applied to the most specific part of
@@ -81,14 +83,6 @@ public class QtFunctionCallUtil {
}
/**
- * Returns true if the given function call argument is a SIGNAL or SLOT expansion
- * and false otherwise.
- public static boolean isQtMethodExpansion(IASTInitializerClause arg) {
- return MethodRegex.matcher(arg.getRawSignature()).matches();
- }
- */
-
- /**
* If the given argument is a SIGNAL or SLOT expansion then find and return the node in the AST
* that will be used for this method. Returns null if the argument is not a Qt method call or
* if the associated node cannot be found.

Back to the top