From 23b5e1ce42be83d2e5bcddf6e008158af11c5bb9 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Wed, 7 Dec 2011 10:11:31 +0100 Subject: [PATCH] QmlJS: Disable unhelpful completion in imports. Change-Id: I06773d4f1e4805d9d611f520c0a5e63ff6b226c6 Reviewed-by: Leandro Melo --- src/plugins/qmljseditor/qmljscompletionassist.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/plugins/qmljseditor/qmljscompletionassist.cpp b/src/plugins/qmljseditor/qmljscompletionassist.cpp index ac594e9770d..75aa81cc739 100644 --- a/src/plugins/qmljseditor/qmljscompletionassist.cpp +++ b/src/plugins/qmljseditor/qmljscompletionassist.cpp @@ -646,9 +646,14 @@ IAssistProposal *QmlJSCompletionAssistProcessor::perform(const IAssistInterface return 0; } + + // currently path-in-stringliteral is the only completion available in imports + if (contextFinder.isInImport()) + return 0; + // member "a.bc" or function "foo(" completion - else if (completionOperator == QLatin1Char('.') - || (completionOperator == QLatin1Char('(') && !onIdentifier)) { + if (completionOperator == QLatin1Char('.') + || (completionOperator == QLatin1Char('(') && !onIdentifier)) { // Look at the expression under cursor. //QTextCursor tc = textWidget->textCursor(); QTextCursor tc(qmlInterface->document()); @@ -699,8 +704,9 @@ IAssistProposal *QmlJSCompletionAssistProcessor::perform(const IAssistInterface return createContentProposal(); return 0; } + // global completion - else if (onIdentifier || assistInterface->reason() == ExplicitlyInvoked) { + if (onIdentifier || assistInterface->reason() == ExplicitlyInvoked) { bool doGlobalCompletion = true; bool doQmlKeywordCompletion = true;