Merge "Merge remote-tracking branch 'origin/11.0' into work"

This commit is contained in:
The Qt Project
2023-06-26 11:25:55 +00:00
27 changed files with 137 additions and 85 deletions

View File

@@ -118,7 +118,7 @@ Editing
* Fixed that generated functions did not have a `const` qualifier when
required
([QTCREATORBUG-29274](https://bugreports.qt.io/browse/QTCREATORBUG-29274))
* Fixed that locator showed both the declaration and the definition of symbols
* Fixed that the locator showed both the declaration and the definition of symbols
([QTCREATORBUG-13894](https://bugreports.qt.io/browse/QTCREATORBUG-13894))
* Fixed the handling of C++20 keywords and concepts
* Clangd
@@ -154,8 +154,9 @@ Editing
### Python
* Added the option to create a virtual environment (`venv`) to the Python
interpreter selector and the wizard
* Added the `Create Virtual Environment` option to the Python interpreter
selector on the editor toolbar and to the wizards in `File > New Project >
> Application (Qt for Python)`
([PYSIDE-2152](https://bugreports.qt.io/browse/PYSIDE-2152))
* Fixed that too many progress indicators could be created
([QTCREATORBUG-29224](https://bugreports.qt.io/browse/QTCREATORBUG-29224))
@@ -167,10 +168,11 @@ Projects
* Made it possible to add devices in `Preferences > Devices > Add` without going
through the wizard
([Documentation](https://doc.qt.io/qtcreator/creator-developing-b2qt.html))
([Documentation](https://doc.qt.io/qtcreator/creator-developing-generic-linux.html))
* Added support for moving files to a different directory when renaming them in
the `File System` view
([QTCREATORBUG-15981](https://bugreports.qt.io/browse/QTCREATORBUG-15981))
([Documentation](https://doc.qt.io/qtcreator/creator-file-system-view.html))
### CMake
@@ -184,10 +186,13 @@ Projects
[QTCREATORBUG-28904](https://bugreports.qt.io/browse/QTCREATORBUG-28904),
[QTCREATORBUG-28985](https://bugreports.qt.io/browse/QTCREATORBUG-28985),
[QTCREATORBUG-29006](https://bugreports.qt.io/browse/QTCREATORBUG-29006))
([Documentation](https://doc.qt.io/qtcreator/creator-project-cmake.html))
* Added `Build > Reload CMake Presets` to reload CMake presets after making
changes to them
* Added support for `block()` and `endblock()`
* Fixed that CMake Presets were not visible in `Projects` view
([Documentation](https://doc-snapshots.qt.io/qtcreator-11.0/creator-build-settings-cmake-presets.html))
* Added support for the `block()` and `endblock()` CMake commands
([CMake documentation](https://cmake.org/cmake/help/latest/command/block.html#command:block))
* Fixed that CMake Presets were not visible in the `Projects` view
([QTCREATORBUG-28966](https://bugreports.qt.io/browse/QTCREATORBUG-28966))
* Fixed issues with detecting a configured Qt version when importing a build
([QTCREATORBUG-29075](https://bugreports.qt.io/browse/QTCREATORBUG-29075))
@@ -196,6 +201,7 @@ Projects
* Added an option for selecting the interpreter to the wizards in
`File > New Project > Application (Qt for Python)`
([Documentation](https://doc.qt.io/qtcreator/creator-project-creating.html))
Debugging
---------
@@ -203,6 +209,7 @@ Debugging
* Improved the UI for enabling and disabling debuggers in `Projects > Run >
Debugger settings`
([QTCREATORBUG-28627](https://bugreports.qt.io/browse/QTCREATORBUG-28627))
([Documentation](https://doc.qt.io/qtcreator/creator-debugging-qml.html))
* Fixed the automatic source mapping for Qt versions from an installer
([QTCREATORBUG-28950](https://bugreports.qt.io/browse/QTCREATORBUG-28950))
* Fixed pretty printer for `std::string` for recent `libc++`
@@ -210,8 +217,8 @@ Debugging
### C++
* Added an option for the default number of array elements to show
(`Preferences > Debugger > Locals & Expressions > Default array size`)
* Added the `Default array size` option for setting the default number of array
elements to show in `Preferences > Debugger > Locals & Expressions`
* Fixed debugging in a terminal as the root user
([QTCREATORBUG-27519](https://bugreports.qt.io/browse/QTCREATORBUG-27519))
* CDB
@@ -225,11 +232,12 @@ Debugging
### Qt Quick
* Improved the auto-detection if QML debugging is required
* Improved the auto-detection of whether QML debugging is required
([QTCREATORBUG-28627](https://bugreports.qt.io/browse/QTCREATORBUG-28627))
* Added an option for disabling static analyzer messages to
`Qt Quick > QML/JS Editing`
* Added the `Use customized static analyzer` option for disabling static analyzer
messages to `Preferences > Qt Quick > QML/JS Editing`
([QTCREATORBUG-29095](https://bugreports.qt.io/browse/QTCREATORBUG-29095))
([Documentation](https://doc.qt.io/qtcreator/creator-checking-code-syntax.html))
Analyzer
--------

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -842,6 +842,11 @@
extensions. It uses this deeper understanding to present objects of such
classes in a useful way.
To change the number of array elements that are
requested when expanding entries, select \uicontrol Edit >
\uicontrol Preferences > \uicontrol {Debugger} >
\uicontrol {Locals & Expressions} > \uicontrol {Default array size}.
\section1 Stepping Through Code
The following table summarizes the functions that you can use to step through
@@ -984,7 +989,7 @@
> \uicontrol {Debugger} > \uicontrol {Locals & Expressions} >
\uicontrol {Use Debugging Helpers}.
\image qtcreator-debugging-helper-options.png "Locals & Expressions preferences"
\image qtcreator-debugging-helper-options.webp {Locals & Expressions preferences}
In the \uicontrol Locals view, expand the object's entry and open the slot
in the \e slots subitem. The view shows the objects connected to this slot
@@ -1365,7 +1370,7 @@
\uicontrol Debugger > \uicontrol GDB > \uicontrol {Load system GDB pretty
printers}. For more information, see \l{Specifying GDB Settings}.
\image qtcreator-gdb-options.png "GDB preferences"
\image qtcreator-gdb-options.png {GDB preferences}
\section2 Customizing Built-In Debugging Helpers
@@ -1375,7 +1380,7 @@
\uicontrol Debugger > \uicontrol {Locals & Expressions}, and enter the
commands in the \uicontrol {Debugging Helper Customization} field.
\image qtcreator-debugging-helper-options.png "Locals & Expressions preferences"
\image qtcreator-debugging-helper-options.webp {Locals & Expressions preferences}
If you receive error messages about receiving signals when using GDB, you
can specify \l{https://sourceware.org/gdb/onlinedocs/gdb/Signals.html}
@@ -1586,7 +1591,7 @@
selecting \uicontrol Edit > \uicontrol Preferences > \uicontrol Debugger >
\uicontrol CDB > \uicontrol {Use Python dumper}.
\image qtcreator-cdb-options.png "CDB preferences"
\image qtcreator-cdb-options.png {CDB preferences}
The following sections describe some of the widely-used Dumper classes and
members specified in \c qtcreator\share\qtcreator\debugger\dumper.py.
@@ -2036,7 +2041,7 @@
> \uicontrol Preferences > \uicontrol Debugger > \uicontrol GDB >
\uicontrol {Use automatic symbol cache}.
\image qtcreator-gdb-options.png "GDB preferences"
\image qtcreator-gdb-options.png {GDB preferences}
\section2 Minimizing Number of Breakpoints

View File

@@ -16,15 +16,14 @@
While Linux, \macos, and Windows hosts are supported in principle, Linux is
the recommended platform.
Currently, only CMake is supported for building applications in the Docker
container.
To build, run, and debug applications on Docker devices, you must install and
configure \c docker-cli on the development host. \QC automatically detects
\l{Adding Kits}{build and run kit} items, such \l{Adding Debuggers}
{debuggers} and \l{Adding Qt Versions}{Qt versions}, in the Docker container
and creates kits for the devices.
You can use CMake or qmake to build applications in the Docker container.
To pull images from Docker hub or other registries, use the
\l{https://docs.docker.com/engine/reference/commandline/pull/}{docker pull}
command.

View File

@@ -1,4 +1,4 @@
// Copyright (C) 2022 The Qt Company Ltd.
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
@@ -699,6 +699,19 @@
\endtable
\section1 Enabling and Disabling Messages
To enable and disable QML and JavaScript messages, select \uicontrol Edit >
\uicontrol Preferences > \uicontrol {Qt Quick} > \uicontrol {QML/JS Editing}
> \uicontrol {Use customized static analyzer}.
\image qtcreator-preferences-qtquick-qmljs-editing.webp {QML/JS Editing tab in Qt Quick preferences}
In \uicontrol Enabled, select the messages that you want to see.
To disable messages for non-Qt Quick UI files, select them in
\uicontrol {Disable messages for non Qt Quick UI}. You cannot
enable messages just for non-Qt Quick UI files.
\section1 Resetting the Code Model
If you change the build and run kit when you have QML files open in the code

View File

@@ -70,14 +70,14 @@
\li When developing on Linux, the \key {Ctrl+Shift+U} keyboard shortcut
might not work because it conflicts with a shortcut of the
Intelligent Input Bus (ibus). You can change the shortcut for finding
references to the symbol under the cursor either in \QC or in ibus.
Intelligent Input Bus (ibus). You can change either the shortcut in
\QC or the conflicting shortcut in ibus.
To set another \l {Keyboard Shortcuts}{keyboard shortcut}
in \QC, select \uicontrol Edit > \uicontrol Preferences >
\uicontrol Environment > \uicontrol Keyboard.
To change the shortcut in ibus, enter the following command on the
To change the ibus shortcut, enter the following command on the
command line to start ibus setup:
\badcode
ibus-setup

View File

@@ -26,8 +26,8 @@
\image studio-live-preview.png
\endif
To preview any QML file that belongs to the project, right-click the project
name in the \l Projects view, and select \uicontrol {Preview File}.
To preview any QML file that belongs to the project, right-click the
filename in the \l Projects view, and select \uicontrol {Preview File}.
\if defined(qtdesignstudio)
To preview the whole UI, select \uicontrol {Show Live Preview}

View File

@@ -755,15 +755,15 @@ class Dumper(DumperBase):
qtVersionAndNamespace = None
try:
qtVersionAndNamespace = self.fetchQtVersionAndNamespace()
DumperBase.warn("Detected Qt Version: 0x%0x (namespace='%s')" %
(qtVersionAndNamespace[1], qtVersionAndNamespace[0] or "no namespace"))
self.report("Detected Qt Version: 0x%0x (namespace='%s')" %
(qtVersionAndNamespace[1], qtVersionAndNamespace[0] or "no namespace"))
except Exception as e:
DumperBase.warn('[lldb] Error detecting Qt version: %s' % e)
try:
self.fetchInternalFunctions()
DumperBase.warn('Found function QObject::property: 0x%0x' % self.qtPropertyFunc)
DumperBase.warn('Found function QObject::customEvent: 0x%0x' % self.qtCustomEventFunc)
self.report('Found function QObject::property: 0x%0x' % self.qtPropertyFunc)
self.report('Found function QObject::customEvent: 0x%0x' % self.qtCustomEventFunc)
except Exception as e:
DumperBase.warn('[lldb] Error fetching internal Qt functions: %s' % e)

View File

@@ -5,7 +5,7 @@ add_qtc_library(Tasking OBJECT
SOURCES
barrier.cpp barrier.h
concurrentcall.h
networkquery.cpp
networkquery.cpp networkquery.h
tasking_global.h
tasktree.cpp tasktree.h
EXPLICIT_MOC

View File

@@ -263,15 +263,17 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packa
if (target->buildConfigurations().first()->buildType() != BuildConfiguration::BuildType::Release)
m_extraAppParams = runControl->commandLine().arguments();
if (auto aspect = runControl->aspect(Constants::ANDROID_AM_START_ARGS)) {
QTC_CHECK(aspect->value.typeId() == QVariant::String);
const QString startArgs = aspect->value.toString();
if (const QVariantMap sd = runControl->settingsData(Constants::ANDROID_AM_START_ARGS);
!sd.values().isEmpty()) {
QTC_CHECK(sd.first().type() == QVariant::String);
const QString startArgs = sd.first().toString();
m_amStartExtraArgs = ProcessArgs::splitArgs(startArgs, OsTypeOtherUnix);
}
if (auto aspect = runControl->aspect(Constants::ANDROID_PRESTARTSHELLCMDLIST)) {
QTC_CHECK(aspect->value.typeId() == QVariant::String);
const QStringList commands = aspect->value.toString().split('\n', Qt::SkipEmptyParts);
if (const QVariantMap sd = runControl->settingsData(Constants::ANDROID_PRESTARTSHELLCMDLIST);
!sd.values().isEmpty()) {
QTC_CHECK(sd.first().type() == QVariant::String);
const QStringList commands = sd.first().toString().split('\n', Qt::SkipEmptyParts);
for (const QString &shellCmd : commands)
m_beforeStartAdbCommands.append(QString("shell %1").arg(shellCmd));
}
@@ -279,9 +281,10 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packa
for (const QString &shellCmd : preStartCmdList.toStringList())
m_beforeStartAdbCommands.append(QString("shell %1").arg(shellCmd));
if (auto aspect = runControl->aspect(Constants::ANDROID_POSTFINISHSHELLCMDLIST)) {
QTC_CHECK(aspect->value.typeId() == QVariant::String);
const QStringList commands = aspect->value.toString().split('\n', Qt::SkipEmptyParts);
if (const QVariantMap sd = runControl->settingsData(Constants::ANDROID_POSTFINISHSHELLCMDLIST);
!sd.values().isEmpty()) {
QTC_CHECK(sd.first().type() == QVariant::String);
const QStringList commands = sd.first().toString().split('\n', Qt::SkipEmptyParts);
for (const QString &shellCmd : commands)
m_afterFinishAdbCommands.append(QString("shell %1").arg(shellCmd));
}

View File

@@ -57,9 +57,10 @@ FilePath ITestConfiguration::executableFilePath() const
if (!hasExecutable())
return {};
const Environment env = m_runnable.environment.hasChanges()
? m_runnable.environment : Environment::systemEnvironment();
return env.searchInPath(m_runnable.command.executable().path());
const Environment env = m_runnable.environment.appliedToEnvironment(
m_runnable.command.executable().deviceEnvironment());
return m_runnable.command.executable().searchInDirectories(env.path());
}
Environment ITestConfiguration::filteredEnvironment(const Environment &original) const

View File

@@ -350,8 +350,8 @@ static RunSettings runSettings()
return ClangToolsSettings::instance()->runSettings();
}
ClangTool::ClangTool(const QString &name, Utils::Id id)
: m_name(name), m_perspective{id.toString(), name}
ClangTool::ClangTool(const QString &name, Utils::Id id, ClangToolType type)
: m_name(name), m_perspective{id.toString(), name}, m_type(type)
{
setObjectName(name);
m_diagnosticModel = new ClangToolsDiagnosticModel(this);
@@ -830,8 +830,7 @@ static bool canAnalyzeProject(Project *project)
struct CheckResult {
enum {
InvalidTidyExecutable,
InvalidClazyExecutable,
InvalidExecutable,
ProjectNotOpen,
ProjectNotSuitable,
ReadyToAnalyze,
@@ -839,20 +838,13 @@ struct CheckResult {
QString errorText;
};
static CheckResult canAnalyze()
static CheckResult canAnalyze(ClangToolType type, const QString &name)
{
const ClangDiagnosticConfig config = diagnosticConfig(runSettings().diagnosticConfigId());
if (toolEnabled(ClangToolType::Tidy, config, runSettings())
&& !toolExecutable(ClangToolType::Tidy).isExecutableFile()) {
return {CheckResult::InvalidTidyExecutable,
Tr::tr("Set a valid Clang-Tidy executable.")};
}
if (toolEnabled(ClangToolType::Clazy, config, runSettings())
&& !toolExecutable(ClangToolType::Clazy).isExecutableFile()) {
return {CheckResult::InvalidClazyExecutable,
Tr::tr("Set a valid Clazy-Standalone executable.")};
if (toolEnabled(type, config, runSettings())
&& !toolExecutable(type).isExecutableFile()) {
return {CheckResult::InvalidExecutable, Tr::tr("Set a valid %1 executable.").arg(name)};
}
if (Project *project = ProjectManager::startupProject()) {
@@ -876,10 +868,9 @@ void ClangTool::updateForInitialState()
m_infoBarWidget->reset();
const CheckResult result = canAnalyze();
const CheckResult result = canAnalyze(m_type, m_name);
switch (result.kind)
case CheckResult::InvalidTidyExecutable: {
case CheckResult::InvalidClazyExecutable:
case CheckResult::InvalidExecutable: {
m_infoBarWidget->setError(InfoBarWidget::Warning, makeLink(result.errorText),
[] { ICore::showOptionsDialog(Constants::SETTINGS_PAGE_ID); });
break;
@@ -1084,7 +1075,7 @@ void ClangTool::updateForCurrentState()
QString startActionToolTip = m_startAction->text();
QString startOnCurrentToolTip = m_startOnCurrentFileAction->text();
if (!isRunning) {
const CheckResult result = canAnalyze();
const CheckResult result = canAnalyze(m_type, m_name);
canStart = result.kind == CheckResult::ReadyToAnalyze;
if (!canStart) {
startActionToolTip = result.errorText;
@@ -1171,11 +1162,12 @@ void ClangTool::updateForCurrentState()
m_infoBarWidget->setDiagText(diagText);
}
ClangTidyTool::ClangTidyTool() : ClangTool(Tr::tr("Clang-Tidy"), "ClangTidy.Perspective")
ClangTidyTool::ClangTidyTool() : ClangTool(Tr::tr("Clang-Tidy"), "ClangTidy.Perspective",
ClangToolType::Tidy)
{
m_instance = this;
}
ClazyTool::ClazyTool() : ClangTool(Tr::tr("Clazy"), "Clazy.Perspective")
ClazyTool::ClazyTool() : ClangTool(Tr::tr("Clazy"), "Clazy.Perspective", ClangToolType::Clazy)
{
m_instance = this;
}

View File

@@ -82,7 +82,7 @@ signals:
void finished(const QString &errorText); // For testing.
protected:
ClangTool(const QString &name, Utils::Id id);
ClangTool(const QString &name, Utils::Id id, CppEditor::ClangToolType type);
private:
enum class State {
@@ -154,6 +154,7 @@ private:
QAction *m_expandCollapse = nullptr;
Utils::Perspective m_perspective;
const CppEditor::ClangToolType m_type;
};
class ClangTidyTool : public ClangTool

View File

@@ -218,11 +218,11 @@ GroupItem clangToolTask(const AnalyzeInputData &input,
};
const Group group {
finishAllAndDone,
Storage(storage),
onGroupSetup(onSetup),
Group {
sequential,
finishAllAndDone,
ProcessTask(onProcessSetup, onProcessDone, onProcessError),
AsyncTask<expected_str<Diagnostics>>(onReadSetup, onReadDone, onReadError)
}

View File

@@ -15,6 +15,7 @@
#include <QAction>
using namespace TextEditor;
using namespace Utils;
namespace ClangTools {
namespace Internal {
@@ -22,37 +23,35 @@ namespace Internal {
DiagnosticMark::DiagnosticMark(const Diagnostic &diagnostic, TextDocument *document)
: TextMark(document,
diagnostic.location.line,
{Tr::tr("Clang Tools"), Utils::Id(Constants::DIAGNOSTIC_MARK_ID)})
{Tr::tr("Clang Tools"), Id(Constants::DIAGNOSTIC_MARK_ID)})
, m_diagnostic(diagnostic)
{
setSettingsPage(Constants::SETTINGS_PAGE_ID);
if (diagnostic.type == "error" || diagnostic.type == "fatal")
setColor(Utils::Theme::CodeModel_Error_TextMarkColor);
else
setColor(Utils::Theme::CodeModel_Warning_TextMarkColor);
setPriority(TextEditor::TextMark::HighPriority);
const bool isError = diagnostic.type == "error" || diagnostic.type == "fatal";
setColor(isError ? Theme::CodeModel_Error_TextMarkColor : Theme::CodeModel_Warning_TextMarkColor);
setPriority(isError ? TextEditor::TextMark::HighPriority : TextEditor::TextMark::NormalPriority);
QIcon markIcon = diagnostic.icon();
setIcon(markIcon.isNull() ? Utils::Icons::CODEMODEL_WARNING.icon() : markIcon);
setIcon(markIcon.isNull() ? Icons::CODEMODEL_WARNING.icon() : markIcon);
setToolTip(createDiagnosticToolTipString(diagnostic, std::nullopt, true));
setLineAnnotation(diagnostic.description);
setActionsProvider([diagnostic] {
// Copy to clipboard action
QList<QAction *> actions;
QAction *action = new QAction();
action->setIcon(QIcon::fromTheme("edit-copy", Utils::Icons::COPY.icon()));
action->setIcon(QIcon::fromTheme("edit-copy", Icons::COPY.icon()));
action->setToolTip(Tr::tr("Copy to Clipboard"));
QObject::connect(action, &QAction::triggered, [diagnostic] {
const QString text = createFullLocationString(diagnostic.location)
+ ": "
+ diagnostic.description;
Utils::setClipboardAndSelection(text);
setClipboardAndSelection(text);
});
actions << action;
// Disable diagnostic action
action = new QAction();
action->setIcon(Utils::Icons::BROKEN.icon());
action->setIcon(Icons::BROKEN.icon());
action->setToolTip(Tr::tr("Disable Diagnostic"));
QObject::connect(action, &QAction::triggered, [diagnostic] { disableChecks({diagnostic}); });
actions << action;
@@ -70,10 +69,10 @@ void DiagnosticMark::disable()
return;
m_enabled = false;
if (m_diagnostic.type == "error" || m_diagnostic.type == "fatal")
setIcon(Utils::Icons::CODEMODEL_DISABLED_ERROR.icon());
setIcon(Icons::CODEMODEL_DISABLED_ERROR.icon());
else
setIcon(Utils::Icons::CODEMODEL_DISABLED_WARNING.icon());
setColor(Utils::Theme::Color::IconsDisabledColor);
setIcon(Icons::CODEMODEL_DISABLED_WARNING.icon());
setColor(Theme::Color::IconsDisabledColor);
}
bool DiagnosticMark::enabled() const

View File

@@ -27,9 +27,22 @@ public:
{
using namespace Layouting;
auto warningLabel = new QLabel;
warningLabel->setWordWrap(true);
warningLabel->setTextInteractionFlags(Qt::LinksAccessibleByMouse
| Qt::LinksAccessibleByKeyboard
| Qt::TextSelectableByMouse);
warningLabel->setText(Tr::tr(
"Enabling %1 is subject to your agreement and abidance with your applicable "
"%1 terms. It is your responsibility to know and accept the requirements and "
"parameters of using tools like %1. This may include, but is not limited to, "
"ensuring you have the rights to allow %1 access to your code, as well as "
"understanding any implications of your use of %1 and suggestions produced "
"(like copyright, accuracy, etc.)." ).arg("Copilot"));
auto authWidget = new AuthWidget();
QLabel *helpLabel = new QLabel();
auto helpLabel = new QLabel();
helpLabel->setTextFormat(Qt::MarkdownText);
helpLabel->setWordWrap(true);
helpLabel->setTextInteractionFlags(Qt::LinksAccessibleByMouse
@@ -52,8 +65,10 @@ public:
.arg("[agent.js](https://github.com/github/copilot.vim/tree/release/copilot/dist)"));
Column {
authWidget, br,
QString("<b>" + Tr::tr("Note:") + "</b>"), br,
warningLabel, br,
CopilotSettings::instance().enableCopilot, br,
authWidget, br,
CopilotSettings::instance().nodeJsPath, br,
CopilotSettings::instance().distPath, br,
CopilotSettings::instance().autoComplete, br,

View File

@@ -20,7 +20,7 @@ static void initEnableAspect(BoolAspect &enableCopilot)
enableCopilot.setDisplayName(Tr::tr("Enable Copilot"));
enableCopilot.setLabelText(Tr::tr("Enable Copilot"));
enableCopilot.setToolTip(Tr::tr("Enables the Copilot integration."));
enableCopilot.setDefaultValue(true);
enableCopilot.setDefaultValue(false);
}
CopilotSettings &CopilotSettings::instance()
@@ -52,6 +52,7 @@ CopilotSettings::CopilotSettings()
nodeJsPath.setLabelText(Tr::tr("Node.js path:"));
nodeJsPath.setHistoryCompleter("Copilot.NodePath.History");
nodeJsPath.setDisplayName(Tr::tr("Node.js Path"));
nodeJsPath.setEnabler(&enableCopilot);
nodeJsPath.setToolTip(
Tr::tr("Select path to node.js executable. See https://nodejs.org/en/download/"
"for installation instructions."));
@@ -62,6 +63,7 @@ CopilotSettings::CopilotSettings()
distPath.setLabelText(Tr::tr("Path to agent.js:"));
distPath.setHistoryCompleter("Copilot.DistPath.History");
distPath.setDisplayName(Tr::tr("Agent.js path"));
distPath.setEnabler(&enableCopilot);
distPath.setToolTip(Tr::tr(
"Select path to agent.js in Copilot Neovim plugin. See "
"https://github.com/github/copilot.vim#getting-started for installation instructions."));
@@ -70,6 +72,7 @@ CopilotSettings::CopilotSettings()
autoComplete.setSettingsKey("Copilot.Autocomplete");
autoComplete.setLabelText(Tr::tr("Request completions automatically"));
autoComplete.setDefaultValue(true);
autoComplete.setEnabler(&enableCopilot);
autoComplete.setToolTip(Tr::tr("Automatically request suggestions for the current text cursor "
"position after changes to the document."));

View File

@@ -61,7 +61,7 @@ QString DoxygenGenerator::generate(QTextCursor cursor,
const QString &text = block.text();
const Tokens &tks = lexer(text);
for (const Token &tk : tks) {
if (tk.is(T_SEMICOLON) || tk.is(T_LBRACE)) {
if (tk.is(T_SEMICOLON)) {
// No need to continue beyond this, we might already have something meaningful.
cursor.setPosition(block.position() + tk.utf16charsEnd(), QTextCursor::KeepAnchor);
break;
@@ -74,6 +74,11 @@ QString DoxygenGenerator::generate(QTextCursor cursor,
block = block.next();
}
// For the edge case of no semicolons at all, which can e.g. happen if the file
// consists only of empty function definitions.
if (!cursor.hasSelection())
cursor.setPosition(cursor.document()->characterCount() - 1, QTextCursor::KeepAnchor);
if (!cursor.hasSelection())
return QString();

View File

@@ -13,6 +13,7 @@ QtcPlugin {
Depends { name: "ProjectExplorer" }
Depends { name: "Debugger" }
Depends { name: "CMakeProjectManager" }
Depends { name: "QmlJS" }
Depends { name: "QtSupport" }
Depends { name: "qtc_gtest_gmock"; condition: qtc.testsEnabled; required: false }

View File

@@ -87,6 +87,9 @@ void MesonBuildSystem::parsingCompleted(bool success)
UNLOCK(false);
emitBuildSystemUpdated();
}
emitParsingFinished(success);
emit buildConfiguration()->enabledChanged(); // HACK. Should not be needed.
}
ProjectExplorer::Kit *MesonBuildSystem::MesonBuildSystem::kit()

View File

@@ -1107,7 +1107,7 @@ static FilePaths findCompilerCandidates(const ToolchainDetector &detector,
FilePaths compilerPaths;
if (!device.isNull()) {
if (device && device->type() != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
// FIXME: Merge with block below
FilePaths searchPaths = detector.searchPaths;
if (searchPaths.isEmpty())

View File

@@ -138,6 +138,8 @@ void TextMark::paintAnnotation(QPainter &painter,
painter.fontMetrics(),
fadeInOffset,
fadeOutOffset);
if (m_staticAnnotationText.text() != rects.text)
m_staticAnnotationText.setText(rects.text);
annotationRect->setRight(rects.fadeOutRect.right());
const QRectF eventRectF(eventRect);
if (!(rects.fadeInRect.intersects(eventRectF) || rects.annotationRect.intersects(eventRectF)
@@ -161,7 +163,7 @@ void TextMark::paintAnnotation(QPainter &painter,
painter.fillRect(rects.annotationRect, colors.rectColor);
painter.setPen(colors.textColor);
paintIcon(&painter, rects.iconRect.toAlignedRect());
painter.drawText(rects.textRect, Qt::AlignLeft, rects.text);
painter.drawStaticText(rects.textRect.topLeft(), m_staticAnnotationText);
if (rects.fadeOutRect.isValid()) {
grad = QLinearGradient(rects.fadeOutRect.topLeft() - contentOffset,
rects.fadeOutRect.topRight() - contentOffset);

View File

@@ -11,6 +11,7 @@
#include <QCoreApplication>
#include <QIcon>
#include <QStaticText>
#include <QVector>
#include <optional>
@@ -139,6 +140,7 @@ private:
bool m_visible = false;
TextMarkCategory m_category;
QString m_lineAnnotation;
mutable QStaticText m_staticAnnotationText;
QString m_toolTip;
std::function<QString()> m_toolTipProvider;
QString m_defaultToolTip;