forked from qt-creator/qt-creator
Make QmlJS(Tools) build with Qt5 & Qt6
Port from QStringRef to QStringView Change-Id: I472d16f20e40ca52b8e5d481850a6bd8a1a38f3b Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
#include "qmljscompletioncontextfinder.h"
|
||||
#include "qmljsscanner.h"
|
||||
|
||||
#include <utils/porting.h>
|
||||
|
||||
#include <QTextDocument>
|
||||
#include <QStringList>
|
||||
|
||||
@@ -161,7 +163,7 @@ void CompletionContextFinder::checkBinding()
|
||||
break;
|
||||
|
||||
case Token::Identifier: {
|
||||
QStringRef tokenString = yyLine->midRef(token.begin(), token.length);
|
||||
const QStringView tokenString = Utils::midView(*yyLine, token.begin(), token.length);
|
||||
dotExpected = false;
|
||||
if (identifierExpected) {
|
||||
m_bindingPropertyName.prepend(tokenString.toString());
|
||||
@@ -231,7 +233,7 @@ void CompletionContextFinder::checkImport()
|
||||
|
||||
switch (token.kind) {
|
||||
case Token::Identifier: {
|
||||
const QStringRef tokenString = yyLine->midRef(token.begin(), token.length);
|
||||
const QStringView tokenString = Utils::midView(*yyLine, token.begin(), token.length);
|
||||
if (tokenString == QLatin1String("as")) {
|
||||
isInLibVersionImport = 0;
|
||||
if (state == Unknown) {
|
||||
@@ -270,7 +272,7 @@ void CompletionContextFinder::checkImport()
|
||||
case Token::Number:
|
||||
if (state == Unknown || (state & ExpectVersion)) {
|
||||
state = ExpectAnyTarget;
|
||||
libVersionImport.prepend(yyLine->midRef(token.begin(), token.length).toString());
|
||||
libVersionImport.prepend(yyLine->mid(token.begin(), token.length));
|
||||
libVersionImport.prepend(QLatin1String(" "));
|
||||
if (isInLibVersionImport == -1)
|
||||
isInLibVersionImport = 1;
|
||||
|
||||
Reference in New Issue
Block a user