diff options
author | Eike Ziller <eike.ziller@qt.io> | 2024-01-30 09:00:47 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2024-01-30 09:19:06 +0100 |
commit | 30d048a256282c50e081d27dec25f37c5a5dfcd6 (patch) | |
tree | 31b6d6d1a977cad30021c91111e3ef0381f6b9d6 | |
parent | 7e8aac5f3c332bc1bc3e947dedad3157cdc43fcd (diff) | |
parent | 79e323afbfc8c4a43580a993fb668215387c9564 (diff) |
Merge remote-tracking branch 'origin/12.0'
Conflicts:
src/plugins/cppeditor/cppfilesettingspage.cpp
src/plugins/haskell/haskellplugin.h
Change-Id: I880693c2e4986853b7aa600a5b7d6c09ad14634e
-rw-r--r-- | doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc | 3 | ||||
-rw-r--r-- | src/libs/3rdparty/cplusplus/TranslationUnit.cpp | 2 | ||||
-rw-r--r-- | src/libs/cplusplus/CppDocument.cpp | 2 | ||||
-rw-r--r-- | src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp | 1 | ||||
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmakebuildstep.cpp | 2 | ||||
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp | 15 | ||||
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmakekitaspect.cpp | 2 | ||||
-rw-r--r-- | src/plugins/cmakeprojectmanager/fileapidataextractor.cpp | 3 | ||||
-rw-r--r-- | src/plugins/cppeditor/cppfilesettingspage.cpp | 4 | ||||
-rw-r--r-- | src/plugins/fakevim/fakevimplugin.cpp | 2 | ||||
-rw-r--r-- | src/plugins/projectexplorer/gcctoolchain.cpp | 3 | ||||
-rw-r--r-- | src/plugins/qnx/qnxdevice.cpp | 2 | ||||
-rw-r--r-- | src/plugins/texteditor/codeassist/genericproposalmodel.cpp | 48 | ||||
m--------- | src/shared/qbs | 0 |
14 files changed, 67 insertions, 22 deletions
diff --git a/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc b/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc index 6717a52619..3b1649d11c 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc @@ -77,7 +77,8 @@ \image qtcreator-copilot.gif {Receiving suggestions from Copilot in the editor} To manually request a suggestion at the current editor's cursor position, - select \uicontrol {Request Copilot Suggestion} in the context menu. + enter \uicontrol {t} (\uicontrol {Request Copilot Suggestion}) in the + \l{Searching with the Locator}{locator}. Hover the mouse over a suggestion to show a toolbar with \inlineimage icons/prev.png diff --git a/src/libs/3rdparty/cplusplus/TranslationUnit.cpp b/src/libs/3rdparty/cplusplus/TranslationUnit.cpp index 848f61285c..e680ee2660 100644 --- a/src/libs/3rdparty/cplusplus/TranslationUnit.cpp +++ b/src/libs/3rdparty/cplusplus/TranslationUnit.cpp @@ -27,6 +27,7 @@ #include "Literals.h" #include "DiagnosticClient.h" +#include "cppassert.h" #include <utils/textutils.h> #include <stack> @@ -87,6 +88,7 @@ int TranslationUnit::sourceLength() const void TranslationUnit::setSource(const char *source, int size) { + CPP_CHECK(source); _firstSourceChar = source; _lastSourceChar = source + size; } diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp index a45d3669d9..cdc036f177 100644 --- a/src/libs/cplusplus/CppDocument.cpp +++ b/src/libs/cplusplus/CppDocument.cpp @@ -533,7 +533,7 @@ Document::Ptr Document::create(const FilePath &filePath) void Document::setUtf8Source(const QByteArray &source) { _source = source; - _translationUnit->setSource(_source.constBegin(), _source.size()); + _translationUnit->setSource(_source.constData(), _source.size()); } LanguageFeatures Document::languageFeatures() const diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp b/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp index a1dc54db77..c38649ee99 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp @@ -93,6 +93,7 @@ class AutotoolsProjectPlugin final : public ExtensionSystem::IPlugin void initialize() final { + ProjectManager::registerProjectType<AutotoolsProject>(Utils::Constants::MAKEFILE_MIMETYPE); d = std::make_unique<AutotoolsProjectPluginPrivate>(); } diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 4bb79366fa..7d57342e39 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -233,7 +233,7 @@ CMakeBuildStep::CMakeBuildStep(BuildStepList *bsl, Id id) : stagingDir.setExpectedKind(PathChooser::Kind::Directory); Kit *kit = buildConfiguration()->kit(); - if (CMakeBuildConfiguration::isIos(kit)) { + if (CMakeBuildConfiguration::isIos(kit) && CMakeGeneratorKitAspect::generator(kit) == "Xcode") { useiOSAutomaticProvisioningUpdates.setDefaultValue(true); useiOSAutomaticProvisioningUpdates.setSettingsKey( IOS_AUTOMATIC_PROVISIONG_UPDATES_ARGUMENTS_KEY); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 2d0616e481..bd0bf3b774 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -215,10 +215,17 @@ void CMakeBuildSystem::requestDebugging() bool CMakeBuildSystem::supportsAction(Node *context, ProjectAction action, const Node *node) const { const auto cmakeTarget = dynamic_cast<CMakeTargetNode *>(context); - if (cmakeTarget && cmakeTarget->productType() != ProductType::Other) - return action == ProjectAction::AddNewFile || action == ProjectAction::AddExistingFile - || action == ProjectAction::AddExistingDirectory || action == ProjectAction::Rename - || action == ProjectAction::RemoveFile; + if (cmakeTarget) { + const auto buildTarget = Utils::findOrDefault(m_buildTargets, + [cmakeTarget](const CMakeBuildTarget &bt) { + return bt.title + == cmakeTarget->buildKey(); + }); + if (buildTarget.targetType != UtilityType) + return action == ProjectAction::AddNewFile || action == ProjectAction::AddExistingFile + || action == ProjectAction::AddExistingDirectory + || action == ProjectAction::Rename || action == ProjectAction::RemoveFile; + } return BuildSystem::supportsAction(context, action, node); } diff --git a/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp b/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp index b145566294..c297ef6838 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitaspect.cpp @@ -788,7 +788,7 @@ void CMakeGeneratorKitAspectFactory::fix(Kit *k) dv.fromVariant(defaultValue(k)); setGeneratorInfo(k, dv); } else { - const GeneratorInfo dv(isIos(k) ? QString("Xcode") : info.generator, + const GeneratorInfo dv(info.generator, it->supportsPlatform ? info.platform : QString(), it->supportsToolset ? info.toolset : QString()); setGeneratorInfo(k, dv); diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index 2d7847a45c..d573fcf6a6 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -182,8 +182,7 @@ static QVector<FolderNode::LocationInfo> extractBacktraceInformation( const size_t fileIndex = static_cast<size_t>(btNode.file); QTC_ASSERT(fileIndex < backtraces.files.size(), break); - const FilePath path = sourceDir.pathAppended(backtraces.files[fileIndex]).absoluteFilePath(); - + const FilePath path = sourceDir.resolvePath(backtraces.files[fileIndex]); if (btNode.command < 0) { // No command, skip: The file itself is already covered:-) continue; diff --git a/src/plugins/cppeditor/cppfilesettingspage.cpp b/src/plugins/cppeditor/cppfilesettingspage.cpp index 2c8fa41054..3579e0b5f2 100644 --- a/src/plugins/cppeditor/cppfilesettingspage.cpp +++ b/src/plugins/cppeditor/cppfilesettingspage.cpp @@ -518,7 +518,7 @@ void CppFileSettingsForProject::loadSettings() if (!entry.isValid()) return; - const QVariantMap data = entry.toMap(); + const QVariantMap data = mapEntryFromStoreEntry(entry).toMap(); m_useGlobalSettings = data.value(useGlobalKeyC, true).toBool(); m_customSettings.headerPrefixes = data.value(headerPrefixesKeyC, m_customSettings.headerPrefixes).toStringList(); @@ -574,6 +574,8 @@ public: m_wasGlobal(settings.useGlobalSettings()) { setGlobalSettingsId(Constants::CPP_FILE_SETTINGS_ID); + setUseGlobalSettings(settings.useGlobalSettings()); + const auto layout = new QVBoxLayout(this); layout->setContentsMargins(0, 0, 0, 0); layout->addWidget(&m_widget); diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index 41d8768697..07b5ec3b74 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -1092,7 +1092,7 @@ void FakeVimPlugin::initialize() INSTALL_HANDLER, Context(Core::Constants::C_GLOBAL), true); cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+Shift+Y,Meta+Shift+Y") : Tr::tr("Alt+Y,Alt+Y"))); - connect(cmd->action(), &QAction::triggered, [this] { settings().writeSettings(); }); + connect(cmd->action(), &QAction::triggered, [] { settings().writeSettings(); }); ActionContainer *advancedMenu = ActionManager::actionContainer(Core::Constants::M_EDIT_ADVANCED); diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 1753674999..48b00f3ef8 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -525,6 +525,7 @@ static QStringList filteredFlags(const QStringList &allFlags, bool considerSysro filtered << a << allFlags.at(i); } else if (a == "-Xclang") { filtered << a; + continue; } else if ((considerSysroot && (a == "--sysroot" || a == "-isysroot")) || a == "-D" || a == "-U" || a == "-gcc-toolchain" || a == "-target" || a == "-mllvm" || a == "-isystem") { @@ -541,6 +542,8 @@ static QStringList filteredFlags(const QStringList &allFlags, bool considerSysro || a == "-nostdinc" || a == "-nostdinc++") { filtered << a; } + if (!filtered.isEmpty() && filtered.last() == "-Xclang") + filtered.removeLast(); } return filtered; } diff --git a/src/plugins/qnx/qnxdevice.cpp b/src/plugins/qnx/qnxdevice.cpp index 3ec5131741..f5c6eff1b9 100644 --- a/src/plugins/qnx/qnxdevice.cpp +++ b/src/plugins/qnx/qnxdevice.cpp @@ -14,6 +14,7 @@ #include <projectexplorer/devicesupport/sshparameters.h> #include <remotelinux/linuxdevice.h> +#include <remotelinux/remotelinux_constants.h> #include <remotelinux/remotelinuxsignaloperation.h> #include <remotelinux/sshdevicewizard.h> @@ -72,6 +73,7 @@ public: sshParams.timeout = 10; setSshParameters(sshParams); setFreePorts(PortList::fromString("10000-10100")); + setExtraData(RemoteLinux::Constants::SourceProfile, true); addDeviceAction({Tr::tr("Deploy Qt libraries..."), [](const IDevice::Ptr &device, QWidget *parent) { QnxDeployQtLibrariesDialog dialog(device, parent); diff --git a/src/plugins/texteditor/codeassist/genericproposalmodel.cpp b/src/plugins/texteditor/codeassist/genericproposalmodel.cpp index c3ee5261bf..73f0829d09 100644 --- a/src/plugins/texteditor/codeassist/genericproposalmodel.cpp +++ b/src/plugins/texteditor/codeassist/genericproposalmodel.cpp @@ -295,16 +295,44 @@ void GenericProposalModel::filter(const QString &prefix) continue; } - if (text.startsWith(lowerPrefix, Qt::CaseInsensitive)) { - m_currentItems.append(item); - item->setProposalMatch(AssistProposalItemInterface::ProposalMatch::Prefix); - continue; - } - - if (checkInfix && text.contains(lowerPrefix, Qt::CaseInsensitive)) { - m_currentItems.append(item); - item->setProposalMatch(AssistProposalItemInterface::ProposalMatch::Infix); - continue; + switch (caseSensitivity) { + case FuzzyMatcher::CaseSensitivity::CaseInsensitive: + if (text.startsWith(lowerPrefix, Qt::CaseInsensitive)) { + m_currentItems.append(item); + item->setProposalMatch(AssistProposalItemInterface::ProposalMatch::Prefix); + continue; + } + if (checkInfix && text.contains(lowerPrefix, Qt::CaseInsensitive)) { + m_currentItems.append(item); + item->setProposalMatch(AssistProposalItemInterface::ProposalMatch::Infix); + continue; + } + break; + case FuzzyMatcher::CaseSensitivity::CaseSensitive: + if (checkInfix && text.contains(prefix)) { + m_currentItems.append(item); + item->setProposalMatch(AssistProposalItemInterface::ProposalMatch::Infix); + continue; + } + break; + case FuzzyMatcher::CaseSensitivity::FirstLetterCaseSensitive: + if (text.startsWith(prefix.at(0)) + && text.mid(1).startsWith(lowerPrefix.mid(1), Qt::CaseInsensitive)) { + m_currentItems.append(item); + item->setProposalMatch(AssistProposalItemInterface::ProposalMatch::Prefix); + continue; + } + if (checkInfix) { + for (auto index = text.indexOf(prefix.at(0)); index >= 0; + index = text.indexOf(prefix.at(0), index + 1)) { + if (text.mid(index + 1).startsWith(lowerPrefix.mid(1), Qt::CaseInsensitive)) { + m_currentItems.append(item); + item->setProposalMatch(AssistProposalItemInterface::ProposalMatch::Infix); + continue; + } + } + } + break; } // Our fuzzy matcher can become unusably slow with certain inputs, so skip it diff --git a/src/shared/qbs b/src/shared/qbs -Subproject aa044048f0b3573ddda09d1b7a4483af9eed3de +Subproject 0d589c18b570ce895cf3d6e69545439c2f68eba |