From 7aa075c71bfed21eb201ca4fec4b4099d18a3902 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Mon, 24 Oct 2011 12:29:21 +0200 Subject: [PATCH] QmlJS: Remove soft assert that could trigger for multi-line strings. Change-Id: I54f451677d78d6aefe0f567888b9bbcec426fc72 Reviewed-by: Christian Kamm --- 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 c25f0077a3a..67daa0d8bea 100644 --- a/src/plugins/qmljseditor/qmljscompletionassist.cpp +++ b/src/plugins/qmljseditor/qmljscompletionassist.cpp @@ -571,9 +571,15 @@ IAssistProposal *QmlJSCompletionAssistProcessor::perform(const IAssistInterface QmlExpressionUnderCursor expressionUnderCursor; expressionUnderCursor(tc); QString literalText = expressionUnderCursor.text(); - QTC_ASSERT(!literalText.isEmpty() && ( - literalText.at(0) == QLatin1Char('"') - || literalText.at(0) == QLatin1Char('\'')), return 0); + + // expression under cursor only looks at one line, so multi-line strings + // are handled incorrectly and are recognizable by don't starting with ' or " + if (!literalText.isEmpty() + && literalText.at(0) != QLatin1Char('"') + && literalText.at(0) != QLatin1Char('\'')) { + return 0; + } + literalText = literalText.mid(1); if (contextFinder.isInImport()) {