diff options
author | Eike Ziller <eike.ziller@qt.io> | 2021-08-04 15:47:06 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2021-08-04 15:47:06 +0200 |
commit | e0f7cee82f4e52be275ac3024c245d669497315d (patch) | |
tree | 028a3300e37b182261e8ebbb5a3af9a6eb908220 | |
parent | 8b03bdefcf163310c6473fe5fab3be2c89276b31 (diff) | |
parent | 309e9ef8d7cbfa0af7368677709fa6a71162a4d4 (diff) |
Merge remote-tracking branch 'origin/5.0'
Change-Id: I97a57840bd79bf031f2e5c2265982508f57d28ea
-rw-r--r-- | .github/workflows/build_cmake.yml | 28 | ||||
-rw-r--r-- | plugins/haskell/haskellbuildconfiguration.cpp | 4 | ||||
-rw-r--r-- | plugins/haskell/haskellhighlighter.cpp | 4 | ||||
-rw-r--r-- | plugins/haskell/haskellproject.cpp | 2 | ||||
-rw-r--r-- | plugins/haskell/haskelltokenizer.cpp | 18 | ||||
-rw-r--r-- | plugins/haskell/haskelltokenizer.h | 2 |
6 files changed, 33 insertions, 25 deletions
diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index 176b6b4..ffabc52 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -5,10 +5,10 @@ on: [push] env: PLUGIN_NAME: Haskell QT_VERSION: 5.15.2 - QT_CREATOR_VERSION: 4.15.0-beta1 + QT_CREATOR_VERSION: 5.0.0-rc1 QT_CREATOR_SNAPSHOT: latest - CMAKE_VERSION: 3.18.3 - NINJA_VERSION: 1.10.1 + CMAKE_VERSION: 3.21.1 + NINJA_VERSION: 1.10.2 jobs: build: @@ -45,16 +45,16 @@ jobs: if ("${{ runner.os }}" STREQUAL "Windows") set(ninja_suffix "win.zip") - set(cmake_suffix "win64-x64.zip") - set(cmake_dir "cmake-${cmake_version}-win64-x64/bin") + set(cmake_suffix "windows-x86_64.zip") + set(cmake_dir "cmake-${cmake_version}-windows-x86_64/bin") elseif ("${{ runner.os }}" STREQUAL "Linux") set(ninja_suffix "linux.zip") - set(cmake_suffix "Linux-x86_64.tar.gz") - set(cmake_dir "cmake-${cmake_version}-Linux-x86_64/bin") + set(cmake_suffix "linux-x86_64.tar.gz") + set(cmake_dir "cmake-${cmake_version}-linux-x86_64/bin") elseif ("${{ runner.os }}" STREQUAL "macOS") set(ninja_suffix "mac.zip") - set(cmake_suffix "Darwin-x86_64.tar.gz") - set(cmake_dir "cmake-${cmake_version}-Darwin-x86_64/CMake.app/Contents/bin") + set(cmake_suffix "macos-universal.tar.gz") + set(cmake_dir "cmake-${cmake_version}-macos-universal/CMake.app/Contents/bin") endif() set(ninja_url "https://github.com/ninja-build/ninja/releases/download/v${ninja_version}/ninja-${ninja_suffix}") @@ -212,10 +212,18 @@ jobs: set(ENV{NINJA_STATUS} "[%f/%t %o/sec] ") + set(build_plugin_py "scripts/build_plugin.py") + foreach(dir "share/qtcreator/scripts" "Qt Creator.app/Contents/Resources/scripts" "Contents/Resources/scripts") + if(EXISTS "${{ steps.qt_creator.outputs.qtc_dir }}/${dir}/build_plugin.py") + set(build_plugin_py "${dir}/build_plugin.py") + break() + endif() + endforeach() + execute_process( COMMAND python -u - ${{ steps.qt_creator.outputs.qtc_dir }}/scripts/build_plugin.py + ${{ steps.qt_creator.outputs.qtc_dir }}/${build_plugin_py} --name "$ENV{PLUGIN_NAME}-$ENV{QT_CREATOR_VERSION}-${{ matrix.config.artifact }}" --src . --build build diff --git a/plugins/haskell/haskellbuildconfiguration.cpp b/plugins/haskell/haskellbuildconfiguration.cpp index 160e2d1..e523572 100644 --- a/plugins/haskell/haskellbuildconfiguration.cpp +++ b/plugins/haskell/haskellbuildconfiguration.cpp @@ -100,14 +100,14 @@ HaskellBuildConfigurationWidget::HaskellBuildConfigurationWidget(HaskellBuildCon , m_buildConfiguration(bc) { setLayout(new QVBoxLayout); - layout()->setMargin(0); + layout()->setContentsMargins(0, 0, 0, 0); auto box = new Utils::DetailsWidget; box->setState(Utils::DetailsWidget::NoSummary); layout()->addWidget(box); auto details = new QWidget; box->setWidget(details); details->setLayout(new QHBoxLayout); - details->layout()->setMargin(0); + details->layout()->setContentsMargins(0, 0, 0, 0); details->layout()->addWidget(new QLabel(tr("Build directory:"))); auto buildDirectoryInput = new Utils::PathChooser; diff --git a/plugins/haskell/haskellhighlighter.cpp b/plugins/haskell/haskellhighlighter.cpp index 9899cc4..8a5b6ca 100644 --- a/plugins/haskell/haskellhighlighter.cpp +++ b/plugins/haskell/haskellhighlighter.cpp @@ -80,10 +80,10 @@ void HaskellHighlighter::highlightBlock(const QString &text) setTokenFormat(token, C_VISUAL_WHITESPACE); break; case TokenType::Keyword: - if (token.text == "::" && firstNonWS && !secondNonWS) { // toplevel declaration + if (token.text == QLatin1String("::") && firstNonWS && !secondNonWS) { // toplevel declaration setFormat(firstNonWS->startCol, firstNonWS->length, m_toplevelDeclFormat); inType = true; - } else if (token.text == "import") { + } else if (token.text == QLatin1String("import")) { inImport = true; } setTokenFormat(token, C_KEYWORD); diff --git a/plugins/haskell/haskellproject.cpp b/plugins/haskell/haskellproject.cpp index c4d4318..248f898 100644 --- a/plugins/haskell/haskellproject.cpp +++ b/plugins/haskell/haskellproject.cpp @@ -85,7 +85,7 @@ HaskellBuildSystem::HaskellBuildSystem(Target *t) auto root = std::make_unique<ProjectNode>(projectDirectory()); root->setDisplayName(target()->project()->displayName()); std::vector<std::unique_ptr<FileNode>> nodePtrs - = Utils::transform<std::vector>(m_scanner.release(), [](FileNode *fn) { + = Utils::transform<std::vector>(m_scanner.release().allFiles, [](FileNode *fn) { return std::unique_ptr<FileNode>(fn); }); root->addNestedNodes(std::move(nodePtrs)); diff --git a/plugins/haskell/haskelltokenizer.cpp b/plugins/haskell/haskelltokenizer.cpp index b59b48b..6f2556d 100644 --- a/plugins/haskell/haskelltokenizer.cpp +++ b/plugins/haskell/haskelltokenizer.cpp @@ -142,7 +142,7 @@ namespace Internal { Token token(TokenType type, std::shared_ptr<QString> line, int start, int end) { - return {type, start, end - start, line->midRef(start, end - start), line}; + return {type, start, end - start, QStringView(*line).mid(start, end - start), line}; } Tokens::Tokens(std::shared_ptr<QString> source) @@ -251,7 +251,7 @@ static QVector<Token> getSpace(std::shared_ptr<QString> line, int start) ++current; const int length = int(std::distance(tokenStart, current)); if (current > tokenStart) - return {{TokenType::Whitespace, start, length, line->midRef(start, length), line}}; + return {{TokenType::Whitespace, start, length, QStringView(*line).mid(start, length), line}}; return {}; } @@ -405,7 +405,7 @@ static int getEscape(const QString &line, int start) return 0; return count + 1; } - const QStringRef s = line.midRef(start); + const QStringView s = QStringView(line).mid(start); for (const QString &esc : *ASCII_ESCAPES) { if (s.startsWith(esc)) return esc.length(); @@ -481,7 +481,7 @@ static QVector<Token> getString(std::shared_ptr<QString> line, int start, bool * lastRef.type = TokenType::StringError; } else { --lastRef.length; - lastRef.text = line->midRef(lastRef.startCol, lastRef.length); + lastRef.text = QStringView(*line).mid(lastRef.startCol, lastRef.length); result.append(token(TokenType::StringError, line, current - 1, current)); } } @@ -496,11 +496,11 @@ static QVector<Token> getMultiLineComment(std::shared_ptr<QString> line, int sta const int length = line->length(); int current = start; do { - const QStringRef test = line->midRef(current, 2); - if (test == "{-") { + const QStringView test = QStringView(*line).mid(current, 2); + if (test == QLatin1String("{-")) { ++(*commentLevel); current += 2; - } else if (test == "-}" && *commentLevel > 0) { + } else if (test == QLatin1String("-}") && *commentLevel > 0) { --(*commentLevel); current += 2; } else if (*commentLevel > 0) { @@ -587,7 +587,7 @@ static QVector<Token> getChar(std::shared_ptr<QString> line, int start) static QVector<Token> getSpecial(std::shared_ptr<QString> line, int start) { if (SPECIAL->contains(line->at(start))) - return {{TokenType::Special, start, 1, line->midRef(start, 1), line}}; + return {{TokenType::Special, start, 1, QStringView(*line).mid(start, 1), line}}; return {}; } @@ -620,7 +620,7 @@ Tokens HaskellTokenizer::tokenize(const QString &line, int startState) tokens = {{TokenType::Unknown, currentStart, 1, - result.source->midRef(currentStart, 1), + QStringView(*result.source).mid(currentStart, 1), result.source}}; result.append(tokens); } diff --git a/plugins/haskell/haskelltokenizer.h b/plugins/haskell/haskelltokenizer.h index 29b10df..63d82d9 100644 --- a/plugins/haskell/haskelltokenizer.h +++ b/plugins/haskell/haskelltokenizer.h @@ -61,7 +61,7 @@ public: TokenType type = TokenType::Unknown; int startCol = -1; int length = -1; - QStringRef text; + QStringView text; std::shared_ptr<QString> source; // keep the string ref alive }; |