forked from qt-creator/qt-creator
Merge "Merge remote-tracking branch 'origin/15.0'"
This commit is contained in:
@@ -87,74 +87,70 @@ jobs:
|
||||
string(REPLACE "." "" qt_version_dotless "${qt_version}")
|
||||
if ("${{ runner.os }}" STREQUAL "Windows")
|
||||
set(url_os "windows_x86")
|
||||
set(qt_package_arch_suffix "win64_msvc2022_64")
|
||||
set(qt_dir_prefix "${qt_version}/msvc_64")
|
||||
set(qt_package_suffix "-Windows-Windows_11_23H2-MSVC2022-Windows-Windows_11_23H2-X86_64")
|
||||
set(compiler_id "win64_msvc2022_64")
|
||||
elseif ("${{ runner.os }}" STREQUAL "Linux")
|
||||
set(url_os "linux_x64")
|
||||
set(qt_package_arch_suffix "linux_gcc_64")
|
||||
set(qt_dir_prefix "${qt_version}/gcc_64")
|
||||
set(qt_package_suffix "-Linux-RHEL_8_10-GCC-Linux-RHEL_8_10-X86_64")
|
||||
set(compiler_id "linux_gcc_64")
|
||||
elseif ("${{ runner.os }}" STREQUAL "macOS")
|
||||
set(url_os "mac_x64")
|
||||
set(qt_package_arch_suffix "clang_64")
|
||||
set(qt_dir_prefix "${qt_version}/macos")
|
||||
set(qt_package_suffix "-MacOS-MacOS_14-Clang-MacOS-MacOS_14-X86_64-ARM64")
|
||||
set(compiler_id "clang_64")
|
||||
endif()
|
||||
|
||||
set(qt_base_url "https://download.qt.io/online/qtsdkrepository/${url_os}/desktop/qt6_${qt_version_dotless}/qt6_${qt_version_dotless}")
|
||||
file(DOWNLOAD "${qt_base_url}/Updates.xml" ./Updates.xml SHOW_PROGRESS)
|
||||
|
||||
file(READ ./Updates.xml updates_xml)
|
||||
string(REGEX MATCH "<Name>qt.qt6.*<Version>([0-9+-.]+)</Version>" updates_xml_output "${updates_xml}")
|
||||
set(qt_package_version ${CMAKE_MATCH_1})
|
||||
# get the package sections, only for given compiler, without the "debug info" ones
|
||||
string(REGEX REPLACE "<PackageUpdate>" ";<PackageUpdate>" sections "${updates_xml}")
|
||||
list(FILTER sections EXCLUDE REGEX "<Name>.*debug.*</Name>")
|
||||
list(FILTER sections INCLUDE REGEX "<Name>.*${compiler_id}.*</Name>")
|
||||
|
||||
# Save the path for other steps
|
||||
file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/qt6/${qt_dir_prefix}" qt_dir)
|
||||
file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/qt/" qt_dir)
|
||||
file(APPEND "$ENV{GITHUB_OUTPUT}" "qt_dir=${qt_dir}")
|
||||
|
||||
function(get_sub_url outvar module)
|
||||
set(filtered ${sections})
|
||||
list(FILTER filtered INCLUDE REGEX "<DownloadableArchives>.*${module}.*</DownloadableArchives>")
|
||||
list(LENGTH filtered count)
|
||||
if (count LESS 1)
|
||||
set(${outvar} "<notfound>" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
list(GET filtered 0 section)
|
||||
string(REGEX MATCH "<Name>(.*)</Name>" match "${section}")
|
||||
set(name ${CMAKE_MATCH_1})
|
||||
string(REGEX MATCH "<Version>(.*)</Version>" match "${section}")
|
||||
set(version ${CMAKE_MATCH_1})
|
||||
string(REGEX MATCH "<DownloadableArchives>.*(${module}[^,]+).*</DownloadableArchives>" match "${section}")
|
||||
set(archive ${CMAKE_MATCH_1})
|
||||
set(${outvar} "${name}/${version}${archive}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
message("Downloading Qt to ${qt_dir}")
|
||||
function(downloadAndExtract url archive subdir)
|
||||
function(downloadAndExtract module subdir)
|
||||
file(MAKE_DIRECTORY "${qt_dir}/${subdir}")
|
||||
message("Downloading ${url}")
|
||||
set(archive "${module}.7z")
|
||||
get_sub_url(sub_url ${module})
|
||||
set(url "${qt_base_url}/${sub_url}")
|
||||
message("Downloading ${module} from ${url}")
|
||||
message("... extracting to ${qt_dir}/${subdir}")
|
||||
file(DOWNLOAD "${url}" "$ENV{GITHUB_WORKSPACE}/${archive}" SHOW_PROGRESS)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf "$ENV{GITHUB_WORKSPACE}/${archive}" WORKING_DIRECTORY "${qt_dir}/${subdir}")
|
||||
endfunction()
|
||||
|
||||
foreach(package qtbase qtdeclarative)
|
||||
downloadAndExtract(
|
||||
"${qt_base_url}/qt.qt6.${qt_version_dotless}.${qt_package_arch_suffix}/${qt_package_version}${package}${qt_package_suffix}.7z"
|
||||
${package}.7z
|
||||
""
|
||||
)
|
||||
endforeach()
|
||||
|
||||
foreach(package qt5compat qtshadertools)
|
||||
downloadAndExtract(
|
||||
"${qt_base_url}/qt.qt6.${qt_version_dotless}.addons.${package}.${qt_package_arch_suffix}/${qt_package_version}${package}${qt_package_suffix}.7z"
|
||||
${package}.7z
|
||||
""
|
||||
)
|
||||
foreach(package qtbase qtdeclarative qt5compat qtshadertools)
|
||||
downloadAndExtract(${package} "")
|
||||
endforeach()
|
||||
|
||||
# uic depends on libicu*.so
|
||||
if ("${{ runner.os }}" STREQUAL "Linux")
|
||||
if (qt_version VERSION_LESS "6.7.0")
|
||||
set(uic_suffix "Rhel7.2-x64")
|
||||
else()
|
||||
set(uic_suffix "Rhel8.6-x86_64")
|
||||
endif()
|
||||
downloadAndExtract(
|
||||
"${qt_base_url}/qt.qt6.${qt_version_dotless}.${qt_package_arch_suffix}/${qt_package_version}icu-linux-${uic_suffix}.7z"
|
||||
icu.7z
|
||||
"lib"
|
||||
)
|
||||
downloadAndExtract("icu" "lib")
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND ${qt_dir}/bin/qmake -query)
|
||||
- name: Download Qt Creator
|
||||
uses: qt-creator/install-dev-package@v1.2
|
||||
uses: qt-creator/install-dev-package@v1.6
|
||||
with:
|
||||
version: ${{ env.QT_CREATOR_VERSION }}
|
||||
unzip-to: 'qtcreator'
|
||||
|
@@ -53663,19 +53663,19 @@ Die Datei "%1" konnte nicht geöffnet werden.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Ctrl+Alt+.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Ctrl+Alt+.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Ctrl+Alt+,</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Ctrl+Alt+,</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Sort by Filenames</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Nach Dateiname sortieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Ctrl+Alt+P</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Ctrl+Alt+P</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Alt+Meta+M</source>
|
||||
@@ -54910,19 +54910,19 @@ Bestimmt das Verhalten bezüglich der Einrückung von Fortsetzungszeilen.
|
||||
</message>
|
||||
<message>
|
||||
<source>Fold Recursively</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Rekursiv einklappen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Fold All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Alle einklappen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unfold Recursively</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Rekursiv aufklappen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unfold All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Alle aufklappen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Zoom: %1%</source>
|
||||
@@ -56062,11 +56062,11 @@ Um den Stil von benutzerdefinierten Operatoren festzulegen, verwenden Sie "
|
||||
</message>
|
||||
<message>
|
||||
<source>Attribute</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Attribut</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Attributes.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Attribute.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Comment</source>
|
||||
@@ -56545,7 +56545,7 @@ Außer Leerzeichen innerhalb von Kommentaren und Zeichenketten.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Copy Hash to Clipboard</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Hash in die Zwischenablage kopieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source><b>Note:</b> "%1" or "%2" is enabled in the instant blame settings.</source>
|
||||
@@ -56598,23 +56598,23 @@ Außer Leerzeichen innerhalb von Kommentaren und Zeichenketten.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select Previous Suggestion</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Vorangehenden Vorschlag auswählen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select Next Suggestion</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Nächsten Vorschlag auswählen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Apply (%1)</source>
|
||||
<translation type="unfinished">Anwenden (%1)</translation>
|
||||
<translation>Anwenden (%1)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Apply Word (%1)</source>
|
||||
<translation type="unfinished">Wort anwenden (%1)</translation>
|
||||
<translation>Wort anwenden (%1)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Apply Line</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Zeile anwenden</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -57107,11 +57107,11 @@ Die Trace-Daten sind verloren.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add to project:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Zu Projekt hinzufügen:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Chosen project wizard does not support the build system.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Das Buildsystem wird vom gewählten Assistenten nicht unterstützt.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Directory "%1" will be created.</source>
|
||||
@@ -57368,7 +57368,7 @@ Die Trace-Daten sind verloren.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>renameFile is not implemented for "%1".</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>renameFile ist für "%1" nicht implementiert.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>fileContents is not implemented for "%1".</source>
|
||||
@@ -57388,11 +57388,11 @@ Die Trace-Daten sind verloren.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Failed to watch "%1".</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Watch für "%1" ist fehlgeschlagen.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Failed to watch "%1", it does not exist.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Watch für "%1" ist fehlgeschlagen, es existiert nicht.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Refusing to remove the standard directory "%1".</source>
|
||||
@@ -57416,7 +57416,7 @@ Die Trace-Daten sind verloren.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Failed to rename file "%1" to "%2": %3</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Die Datei "%1" konnte nicht in "%2" umbenannt werden: %3</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>File "%1" does not exist.</source>
|
||||
@@ -57448,7 +57448,7 @@ Die Trace-Daten sind verloren.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>removeFile is not implemented for "%1".</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>removeFile ist für "%1" nicht implementiert.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cannot copy "%1" to "%2": %3</source>
|
||||
@@ -57531,7 +57531,7 @@ Die Trace-Daten sind verloren.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Failed to set up scratch buffer in "%1".</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Notizbereich in "%1" konnte nicht erzeugt werden.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 on %2</source>
|
||||
@@ -57557,7 +57557,7 @@ Die Trace-Daten sind verloren.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Failed to move %1 to %2. Removing the source file failed: %3</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Das Verschieben von %1 nach %2 ist fehlgeschlagen. Das Entfernen der Quelldatei ist fehlgeschlagen: %3</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>No "localSource" device hook set.</source>
|
||||
@@ -57724,7 +57724,7 @@ Die Trace-Daten sind verloren.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Failed to expand macros in process arguments: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Das Expandieren von Makros in Prozessargumenten ist fehlgeschlagen: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1: Full path including file name.</source>
|
||||
@@ -59562,7 +59562,7 @@ Check settings or ensure Valgrind is installed and available in PATH.</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cannot commit: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Commit fehlgeschlagen: %1</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>%1 %2/%n File(s)</source>
|
||||
@@ -59922,19 +59922,19 @@ should a repository require SSH-authentication (see documentation on SSH and the
|
||||
</message>
|
||||
<message>
|
||||
<source>The chosen directory is an emsdk location.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Das gewählte Verzeichnis ist der Ort eines emsdk.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>An SDK is installed.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Ein SDK ist installiert.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>An SDK is activated.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Ein SDK ist aktiviert.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The activated SDK is usable by %1.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Das aktivierte SDK ist von %1 benutzbar.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The activated version %1 is not supported by %2. Activate version %3 or higher.</source>
|
||||
|
@@ -116,6 +116,9 @@ void TypePrettyPrinter::visit(UndefinedType *)
|
||||
_text.prepend(QLatin1String("signed"));
|
||||
else if (_fullySpecifiedType.isUnsigned())
|
||||
_text.prepend(QLatin1String("unsigned"));
|
||||
} else if (_fullySpecifiedType.isAuto()) {
|
||||
prependSpaceUnlessBracket();
|
||||
_text.prepend("auto");
|
||||
}
|
||||
|
||||
prependCv(_fullySpecifiedType);
|
||||
|
@@ -268,7 +268,7 @@ QString asciify(const QString &input)
|
||||
if (c.isPrint() && c.unicode() < 128)
|
||||
result.append(c);
|
||||
else
|
||||
result.append(QString::fromLatin1("u%1").arg(c.unicode(), 4, 16, QChar('0')));
|
||||
result.append(QString::fromLatin1("u%1").arg(int16_t(c.unicode()), 4, 16, QChar('0')));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@@ -21,17 +21,13 @@
|
||||
#include <coreplugin/icore.h>
|
||||
#include <cplusplus/AST.h>
|
||||
#include <cplusplus/ASTPath.h>
|
||||
#include <cplusplus/Icons.h>
|
||||
#include <cppeditor/compilationdb.h>
|
||||
#include <cppeditor/cppcodemodelsettings.h>
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
#include <cppeditor/cppeditorwidget.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <cppeditor/cpprefactoringchanges.h>
|
||||
#include <cppeditor/cppsemanticinfo.h>
|
||||
#include <cppeditor/cpptoolsreuse.h>
|
||||
#include <cppeditor/cppvirtualfunctionassistprovider.h>
|
||||
#include <cppeditor/cppvirtualfunctionproposalitem.h>
|
||||
#include <cppeditor/semantichighlighter.h>
|
||||
#include <languageclient/diagnosticmanager.h>
|
||||
#include <languageclient/languageclienthoverhandler.h>
|
||||
@@ -46,15 +42,12 @@
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/devicesupport/devicekitaspects.h>
|
||||
#include <projectexplorer/devicesupport/idevice.h>
|
||||
#include <projectexplorer/devicesupport/devicekitaspects.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectnodes.h>
|
||||
#include <projectexplorer/projecttree.h>
|
||||
#include <projectexplorer/projectmanager.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/taskhub.h>
|
||||
#include <texteditor/codeassist/assistinterface.h>
|
||||
#include <texteditor/codeassist/iassistprocessor.h>
|
||||
#include <texteditor/codeassist/iassistprovider.h>
|
||||
#include <texteditor/texteditor.h>
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/async.h>
|
||||
@@ -62,9 +55,7 @@
|
||||
#include <utils/environment.h>
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/mimeconstants.h>
|
||||
#include <utils/itemviews.h>
|
||||
#include <utils/theme/theme.h>
|
||||
#include <utils/utilsicons.h>
|
||||
|
||||
#include <QAction>
|
||||
#include <QElapsedTimer>
|
||||
@@ -472,8 +463,10 @@ ClangdClient::ClangdClient(Project *project, const Utils::FilePath &jsonDbDir, c
|
||||
progressManager()->setTitleForToken(
|
||||
indexingToken(), project ? Tr::tr("Indexing %1 with clangd").arg(project->displayName())
|
||||
: Tr::tr("Indexing session with clangd"));
|
||||
progressManager()->setCancelHandlerForToken(indexingToken(), [this, project]() {
|
||||
CppEditor::ClangdProjectSettings projectSettings(project);
|
||||
progressManager()->setCancelHandlerForToken(indexingToken(), [this, p = QPointer(project)]() {
|
||||
if (!p)
|
||||
return;
|
||||
CppEditor::ClangdProjectSettings projectSettings(p);
|
||||
projectSettings.blockIndexing();
|
||||
progressManager()->endProgressReport(indexingToken());
|
||||
});
|
||||
|
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "documentclangtoolrunner.h"
|
||||
|
||||
#include "clangtoolscompilationdb.h"
|
||||
#include "clangtoolsconstants.h"
|
||||
#include "clangtoolrunner.h"
|
||||
#include "clangtoolsutils.h"
|
||||
@@ -158,6 +159,18 @@ static Environment projectBuildEnvironment(Project *project)
|
||||
|
||||
void DocumentClangToolRunner::run()
|
||||
{
|
||||
for (const ClangToolType type : {ClangToolType::Tidy, ClangToolType::Clazy}) {
|
||||
ClangToolsCompilationDb &db = ClangToolsCompilationDb::getDb(type);
|
||||
db.disconnect(this);
|
||||
if (db.generateIfNecessary()) {
|
||||
connect(&db, &ClangToolsCompilationDb::generated, this, [this](bool success) {
|
||||
if (success)
|
||||
run();
|
||||
}, Qt::SingleShotConnection);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_projectSettingsUpdate)
|
||||
disconnect(m_projectSettingsUpdate);
|
||||
m_taskTreeRunner.reset();
|
||||
|
@@ -65,19 +65,24 @@ static LocatorMatcherTasks cmakeMatchers(const BuildAcceptor &acceptor)
|
||||
return AcceptResult();
|
||||
};
|
||||
}
|
||||
bool realTarget = false;
|
||||
if (!target.backtrace.isEmpty() && target.targetType != UtilityType) {
|
||||
// We want to show real targets (executables, libraries) and also
|
||||
// custom targets defined in the project via add_custom_target.
|
||||
bool targetOfInterest = false;
|
||||
if (!target.backtrace.isEmpty()) {
|
||||
const FilePath path = target.backtrace.last().path;
|
||||
const int line = target.backtrace.last().line;
|
||||
entry.linkForEditor = {path, line};
|
||||
entry.extraInfo = path.shortNativePath();
|
||||
realTarget = true;
|
||||
|
||||
if (target.targetType != UtilityType || path == projectPath
|
||||
|| path.isChildOf(projectPath))
|
||||
targetOfInterest = true;
|
||||
} else {
|
||||
entry.extraInfo = projectPath.shortNativePath();
|
||||
}
|
||||
entry.highlightInfo = ILocatorFilter::highlightInfo(match);
|
||||
entry.filePath = cmakeProject->projectFilePath();
|
||||
if (acceptor || realTarget) {
|
||||
if (acceptor || targetOfInterest) {
|
||||
if (match.capturedStart() == 0)
|
||||
entries[int(ILocatorFilter::MatchLevel::Best)].append(entry);
|
||||
else if (match.lastCapturedIndex() == 1)
|
||||
|
@@ -125,11 +125,12 @@ void addCMakePresets(FolderNode *root, const Utils::FilePath &sourceDir)
|
||||
presetFileNames << "CMakePresets.json";
|
||||
presetFileNames << "CMakeUserPresets.json";
|
||||
|
||||
const CMakeProject *cp = static_cast<const CMakeProject *>(
|
||||
const auto cmakeProject = qobject_cast<const CMakeProject *>(
|
||||
ProjectManager::projectForFile(sourceDir.pathAppended(Constants::CMAKE_LISTS_TXT)));
|
||||
QTC_ASSERT(cmakeProject, return);
|
||||
|
||||
if (cp && cp->presetsData().include)
|
||||
presetFileNames.append(cp->presetsData().include.value());
|
||||
if (cmakeProject->presetsData().include)
|
||||
presetFileNames.append(cmakeProject->presetsData().include.value());
|
||||
|
||||
std::vector<std::unique_ptr<FileNode>> presets;
|
||||
for (const auto &fileName : presetFileNames) {
|
||||
|
@@ -146,6 +146,11 @@ OpenEditorsWindow::OpenEditorsWindow(QWidget *parent)
|
||||
auto layout = new QVBoxLayout(this);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->addWidget(m_editorView);
|
||||
|
||||
// Close the popup and clear it if documents are closed behind the back of the view
|
||||
connect(DocumentModel::model(), &QAbstractItemModel::rowsAboutToBeRemoved, this, [this] {
|
||||
setVisible(false);
|
||||
});
|
||||
}
|
||||
|
||||
void OpenEditorsWindow::selectAndHide()
|
||||
@@ -159,6 +164,8 @@ void OpenEditorsWindow::setVisible(bool visible)
|
||||
QWidget::setVisible(visible);
|
||||
if (visible)
|
||||
setFocus();
|
||||
else
|
||||
m_editorView->m_model.clear();
|
||||
}
|
||||
|
||||
bool OpenEditorsWindow::eventFilter(QObject *obj, QEvent *e)
|
||||
|
@@ -35,10 +35,10 @@ namespace CppEditor {
|
||||
namespace Internal {
|
||||
namespace Tests {
|
||||
|
||||
QList<TestDocumentPtr> singleDocument(const QByteArray &original,
|
||||
const QByteArray &expected)
|
||||
QList<TestDocumentPtr> singleDocument(
|
||||
const QByteArray &original, const QByteArray &expected, const QByteArray fileName)
|
||||
{
|
||||
return {CppTestDocument::create("file.cpp", original, expected)};
|
||||
return {CppTestDocument::create(fileName, original, expected)};
|
||||
}
|
||||
|
||||
BaseQuickFixTestCase::BaseQuickFixTestCase(const QList<TestDocumentPtr> &testDocuments,
|
||||
|
@@ -86,8 +86,8 @@ public:
|
||||
int operationIndex = 0);
|
||||
};
|
||||
|
||||
QList<TestDocumentPtr> singleDocument(const QByteArray &original,
|
||||
const QByteArray &expected);
|
||||
QList<TestDocumentPtr> singleDocument(
|
||||
const QByteArray &original, const QByteArray &expected, const QByteArray fileName = "file.cpp");
|
||||
|
||||
} // namespace Tests
|
||||
} // namespace Internal
|
||||
|
@@ -1883,17 +1883,17 @@ foo::foo2::MyType<int> foo::foo2::bar()
|
||||
QByteArray original =
|
||||
"class Foo\n"
|
||||
"{\n"
|
||||
" template<class U>\n"
|
||||
" template<class U, auto N>\n"
|
||||
" void fun@c();\n"
|
||||
"};\n";
|
||||
QByteArray expected =
|
||||
"class Foo\n"
|
||||
"{\n"
|
||||
" template<class U>\n"
|
||||
" template<class U, auto N>\n"
|
||||
" void fun@c();\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"template<class U>\n"
|
||||
"template<class U, auto N>\n"
|
||||
"inline void Foo::func()\n"
|
||||
"{\n"
|
||||
"\n"
|
||||
|
@@ -107,9 +107,23 @@ public:
|
||||
Scope *scopeAtInsertPos = m_toFile->cppDocument()->scopeAt(l.line(), l.column());
|
||||
|
||||
// construct definition
|
||||
const QString funcDec = inlinePrefix(m_toFile->filePath(), [this] { return m_type == MoveOutside; })
|
||||
+ definitionSignature(m_operation, funcAST, m_fromFile, m_toFile,
|
||||
scopeAtInsertPos);
|
||||
const QString inlinePref = inlinePrefix(m_toFile->filePath(), [this] {
|
||||
return m_type == MoveOutside;
|
||||
});
|
||||
QString funcDec = definitionSignature(m_operation, funcAST, m_fromFile, m_toFile,
|
||||
scopeAtInsertPos);
|
||||
QString input = funcDec;
|
||||
int inlineIndex = 0;
|
||||
const QRegularExpression templateRegex("template\\s*<[^>]*>");
|
||||
while (input.startsWith("template")) {
|
||||
const QRegularExpressionMatch match = templateRegex.match(input);
|
||||
if (match.hasMatch()) {
|
||||
inlineIndex += match.captured().size() + 1;
|
||||
input = input.mid(match.captured().size() + 1);
|
||||
}
|
||||
}
|
||||
funcDec.insert(inlineIndex, inlinePref);
|
||||
|
||||
QString funcDef = prefix + funcDec;
|
||||
const int startPosition = m_fromFile->endOf(funcAST->declarator);
|
||||
const int endPosition = m_fromFile->endOf(funcAST);
|
||||
@@ -1182,11 +1196,11 @@ private slots:
|
||||
"class Foo { void fu@nc(); };\n"
|
||||
"\n"
|
||||
"template<class T>\n"
|
||||
"void Foo<T>::func() {}\n";
|
||||
"inline void Foo<T>::func() {}\n";
|
||||
;
|
||||
|
||||
MoveFuncDefOutside factory;
|
||||
QuickFixOperationTest(singleDocument(original, expected), &factory);
|
||||
QuickFixOperationTest(singleDocument(original, expected, "file.h"), &factory);
|
||||
}
|
||||
|
||||
void testConcept()
|
||||
|
@@ -1674,35 +1674,31 @@ bool BreakHandler::contextMenuEvent(const ItemViewEvent &ev)
|
||||
}
|
||||
);
|
||||
|
||||
QList<Breakpoint> enabledBreakpoints;
|
||||
QList<Breakpoint> disabledBreakpoints;
|
||||
forItemsAtLevel<1>([&enabledBreakpoints, &disabledBreakpoints](Breakpoint bp) {
|
||||
if (bp) {
|
||||
if (bp->isEnabled())
|
||||
enabledBreakpoints.append(bp);
|
||||
else
|
||||
disabledBreakpoints.append(bp);
|
||||
}
|
||||
bool canDisableAll = false;
|
||||
bool canEnableAll = false;
|
||||
forItemsAtLevel<1>([&canDisableAll, &canEnableAll](Breakpoint bp) {
|
||||
if (bp)
|
||||
(bp->isEnabled() ? canDisableAll : canEnableAll) = true;
|
||||
});
|
||||
|
||||
addAction(this, menu, Tr::tr("Disable All Breakpoints"),
|
||||
!enabledBreakpoints.isEmpty(),
|
||||
[this, enabledBreakpoints] {
|
||||
for (Breakpoint bp : enabledBreakpoints) {
|
||||
if (GlobalBreakpoint gbp = bp->globalBreakpoint())
|
||||
gbp->setEnabled(false, false);
|
||||
requestBreakpointEnabling(bp, false);
|
||||
}
|
||||
addAction(this, menu, Tr::tr("Disable All Breakpoints"), canDisableAll, [this] {
|
||||
forItemsAtLevel<1>([this](Breakpoint bp) {
|
||||
if (bp && bp->isEnabled()) {
|
||||
if (GlobalBreakpoint gbp = bp->globalBreakpoint())
|
||||
gbp->setEnabled(false, false);
|
||||
requestBreakpointEnabling(bp, false);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
addAction(this, menu, Tr::tr("Enable All Breakpoints"),
|
||||
!disabledBreakpoints.isEmpty(),
|
||||
[this, disabledBreakpoints] {
|
||||
for (Breakpoint bp : disabledBreakpoints) {
|
||||
if (GlobalBreakpoint gbp = bp->globalBreakpoint())
|
||||
gbp->setEnabled(true, false);
|
||||
requestBreakpointEnabling(bp, true);
|
||||
}
|
||||
addAction(this, menu, Tr::tr("Enable All Breakpoints"), canEnableAll, [this] {
|
||||
forItemsAtLevel<1>([this](Breakpoint bp) {
|
||||
if (bp && !bp->isEnabled()) {
|
||||
if (GlobalBreakpoint gbp = bp->globalBreakpoint())
|
||||
gbp->setEnabled(true, false);
|
||||
requestBreakpointEnabling(bp, true);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
addAction(this, menu,
|
||||
|
@@ -254,8 +254,8 @@ QString escapeUnprintable(const QString &str, int unprintableBase)
|
||||
QString encoded;
|
||||
|
||||
while (arrayView.size() >= 4) {
|
||||
char32_t c;
|
||||
memcpy(&c, arrayView.constData(), sizeof(char32_t));
|
||||
int32_t c;
|
||||
memcpy(&c, arrayView.constData(), sizeof(int32_t));
|
||||
|
||||
if (QChar::isPrint(c))
|
||||
encoded += toQString(arrayView.sliced(0, 4));
|
||||
|
@@ -5058,5 +5058,7 @@ void FakeVimTester::test_vim_qtcreator()
|
||||
|
||||
} // FakeVim::Internal
|
||||
|
||||
#include "fakevim_test.moc"
|
||||
#undef N
|
||||
#undef X
|
||||
|
||||
#include "fakevim_test.moc"
|
||||
|
@@ -977,7 +977,7 @@ QString quoteUnprintable(const QString &ba)
|
||||
else if (cc == '\n')
|
||||
res += "<CR>";
|
||||
else
|
||||
res += QString("\\x%1").arg(c.unicode(), 2, 16, QLatin1Char('0'));
|
||||
res += QString("\\x%1").arg(int16_t(c.unicode()), 2, 16, QLatin1Char('0'));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
@@ -514,6 +514,10 @@ void setupGuiModule()
|
||||
sol::factories([guard](const sol::table &children) {
|
||||
return constructWidgetType<PushButton>(children, guard);
|
||||
}),
|
||||
"setText",
|
||||
&PushButton::setText,
|
||||
"setIconPath",
|
||||
&PushButton::setIconPath,
|
||||
sol::base_classes,
|
||||
sol::bases<Widget, Object, Thing>());
|
||||
|
||||
|
@@ -1406,6 +1406,7 @@ static FilePaths findCompilerCandidates(OsType os,
|
||||
if (os == OsTypeWindows && fileName.endsWith(u".exe", Qt::CaseInsensitive))
|
||||
fileName.chop(4);
|
||||
|
||||
// Do not `continue`, proceed to detect further variants
|
||||
if (fileName == compilerName)
|
||||
compilerPaths << executable;
|
||||
|
||||
@@ -1426,7 +1427,7 @@ static FilePaths findCompilerCandidates(OsType os,
|
||||
// if not at the end, it must by followed by a hyphen and a digit between 1 and 9
|
||||
pos += cl;
|
||||
if (pos != fileName.size()) {
|
||||
if (pos + 2 >= fileName.size())
|
||||
if (pos + 1 >= fileName.size())
|
||||
continue;
|
||||
if (fileName.at(pos) != '-')
|
||||
continue;
|
||||
|
@@ -493,8 +493,10 @@ void TextDocument::applyFontSettings()
|
||||
block = block.next();
|
||||
}
|
||||
updateLayout();
|
||||
if (d->m_highlighter)
|
||||
if (d->m_highlighter) {
|
||||
d->m_highlighter->setFontSettings(d->m_fontSettings);
|
||||
d->m_highlighter->scheduleRehighlight();
|
||||
}
|
||||
}
|
||||
|
||||
void TextDocument::slotCodeStyleSettingsChanged() { }
|
||||
|
Reference in New Issue
Block a user