Merge remote-tracking branch 'origin/15.0' into qds/dev
Change-Id: I3efa0431a428c7c0736f3f6ac67e84c3eeac3247
26
dist/changelog/changes-15.0.0.md
vendored
@@ -21,18 +21,18 @@ General
|
||||
([Blog Post](https://www.qt.io/blog/review-new-themes-for-qt-creator))
|
||||
* Added `Tools > Scripting > New Script` for creating Lua based Qt Creator
|
||||
scripts
|
||||
([Documentation](https://doc-snapshots.qt.io/qtcreator-15.0/creator-how-to-create-lua-scripts.html))
|
||||
([Documentation](https://doc.qt.io/qtcreator/creator-how-to-create-lua-scripts.html))
|
||||
* Plugins
|
||||
* Added `DocumentationUrl` and new mandatory fields `Id` and `VendorId`
|
||||
to the plugin meta data
|
||||
* Changed the plugin descriptions to Markdown in
|
||||
`Help > About Plugins > Details` and `Extensions` mode
|
||||
* Extended the API available to Lua plugins
|
||||
([Documentation](https://doc-snapshots.qt.io/qtcreator-extending/lua-extensions.html))
|
||||
([Documentation](https://doc.qt.io/qtcreator-extending/lua-extensions.html))
|
||||
* Prebuilt binaries
|
||||
* Added opt-in crash reporting to
|
||||
`Edit > Preferences > Environment > System`
|
||||
([Documentation](https://doc-snapshots.qt.io/qtcreator-15.0/creator-how-to-turn-on-crash-reports.html))
|
||||
([Documentation](https://doc.qt.io/qtcreator/creator-how-to-turn-on-crash-reports.html))
|
||||
|
||||
Editing
|
||||
-------
|
||||
@@ -157,6 +157,7 @@ Projects
|
||||
([QTCREATORBUG-31141](https://bugreports.qt.io/browse/QTCREATORBUG-31141))
|
||||
* Fixed a focus issue when renaming files
|
||||
([QTCREATORBUG-30926](https://bugreports.qt.io/browse/QTCREATORBUG-30926))
|
||||
* Fixed that the `default` session could be renamed and deleted
|
||||
|
||||
### CMake
|
||||
|
||||
@@ -183,6 +184,10 @@ Projects
|
||||
* Added the option of opening `CMakeCache.txt` to open the project
|
||||
([QTCREATORBUG-24439](https://bugreports.qt.io/browse/QTCREATORBUG-24439),
|
||||
[QTCREATORBUG-30507](https://bugreports.qt.io/browse/QTCREATORBUG-30507))
|
||||
* Made `conanfile.py` and `vcpkg.json` visible in the project tree when used
|
||||
([QTCREATORBUG-32041](https://bugreports.qt.io/browse/QTCREATORBUG-32041),
|
||||
[Conan Package Manager](https://doc.qt.io/qtcreator/creator-project-conan.html),
|
||||
[vcpkg Package Manager](https://doc.qt.io/qtcreator/creator-vcpkg.html))
|
||||
* Fixed the option `Build Only the Application to Be Run` for the
|
||||
`Build before deploying` preferences
|
||||
([QTCREATORBUG-31416](https://bugreports.qt.io/browse/QTCREATORBUG-31416))
|
||||
@@ -245,6 +250,12 @@ Analyzer
|
||||
* Added column sorting to the list of issues
|
||||
* Added a `Reload` button
|
||||
|
||||
Terminal
|
||||
--------
|
||||
|
||||
* Fixed the flushing of output after a process terminates
|
||||
([QTCREATORBUG-30733](https://bugreports.qt.io/browse/QTCREATORBUG-30733))
|
||||
|
||||
Version Control Systems
|
||||
-----------------------
|
||||
|
||||
@@ -256,8 +267,10 @@ Version Control Systems
|
||||
|
||||
* Added actions for blame at the revision, blame of the parent, the file
|
||||
from the revision, and the log for the line to the tooltip for `Instant Blame`
|
||||
([Documentation](https://doc-snapshots.qt.io/qtcreator-15.0/creator-vcs-git.html#using-instant-blame))
|
||||
([Documentation](https://doc.qt.io/qtcreator/creator-vcs-git.html#using-instant-blame))
|
||||
* Added visual indications that files are modified to the `Projects` view
|
||||
(when you select
|
||||
`Preferences > Version Control > General > Show VCS file status`)
|
||||
([QTCREATORBUG-8857](https://bugreports.qt.io/browse/QTCREATORBUG-8857))
|
||||
* Added the option to include all local branches in the log
|
||||
* Gerrit
|
||||
@@ -269,6 +282,9 @@ Test Integration
|
||||
|
||||
* Added test duration information for test frameworks that support it
|
||||
([QTCREATORBUG-31242](https://bugreports.qt.io/browse/QTCREATORBUG-31242))
|
||||
* Added support for running auto tests on Android for Qt 6.8.1 and later
|
||||
* Fixed the execution of tests with multiple test classes
|
||||
([QTCREATORBUG-31935](https://bugreports.qt.io/browse/QTCREATORBUG-31935))
|
||||
|
||||
Extension Manager
|
||||
-----------------
|
||||
@@ -317,7 +333,7 @@ Platforms
|
||||
### VxWorks
|
||||
|
||||
* Added support for VxWorks 24.03
|
||||
([Documentation](https://doc-snapshots.qt.io/qtcreator-15.0/creator-how-to-create-vxworks-kits.html))
|
||||
([Documentation](https://doc.qt.io/qtcreator/creator-how-to-create-vxworks-kits.html))
|
||||
|
||||
Credits for these changes go to:
|
||||
--------------------------------
|
||||
|
Before Width: | Height: | Size: 9.9 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 3.2 KiB |
BIN
doc/qtcreator/images/qtcreator-preferences-compilers-custom.webp
Normal file
After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 19 KiB |
@@ -165,8 +165,14 @@
|
||||
\section2 Add or remove CMake tools
|
||||
|
||||
To add a path to a CMake executable that \QC does not detect automatically,
|
||||
and to specify settings for it, select \uicontrol Add. To make changes to
|
||||
automatically detected installations, select \uicontrol Clone.
|
||||
and to specify settings for it, select \uicontrol Add.
|
||||
|
||||
To add a CMake executable on a remote Linux device or in Docker, select
|
||||
\uicontrol Remote in the dropdown menu in \uicontrol Browse
|
||||
(\uicontrol Choose on \macos) in the \uicontrol Path field.
|
||||
|
||||
To make changes to automatically detected installations, select
|
||||
\uicontrol Clone.
|
||||
|
||||
To remove the selected CMake executable from the list, select
|
||||
\uicontrol Remove.
|
||||
@@ -186,7 +192,8 @@
|
||||
|
||||
\image qtcreator-kits-cmake.png {Kits preferences}
|
||||
|
||||
\sa {Build with CMake}{How To: Build with CMake},
|
||||
\sa {Build applications on remote Linux devices}, {Build on Docker devices},
|
||||
{Build with CMake}{How To: Build with CMake},
|
||||
{Manage Kits}{How To: Manage Kits}, {CMake}, {Kits}
|
||||
*/
|
||||
|
||||
|
@@ -199,3 +199,22 @@
|
||||
\sa {Enable and disable plugins}, {Docker}{How To: Develop for Docker},
|
||||
{Manage Kits}{How To: Manage Kits}
|
||||
*/
|
||||
|
||||
/*!
|
||||
\page creator-how-to-build-on-docker.html
|
||||
\previouspage creator-how-tos.html
|
||||
|
||||
\ingroup creator-how-to-docker
|
||||
|
||||
\title Build on Docker devices
|
||||
|
||||
In addition to building applications \e {for} Docker, you can use the
|
||||
toolchain in Docker to build the applications \e {in} Docker.
|
||||
|
||||
\note Enable the Docker plugin to use it.
|
||||
|
||||
\include linux-mobile/creator-how-to-build-on-remote-devices.qdocinc {build on remote devices} {Docker device}
|
||||
|
||||
\sa {Add CMake tools}, {Enable and disable plugins},
|
||||
{Docker}{How To: Develop for Docker}, {Manage Kits}{How To: Manage Kits}
|
||||
*/
|
||||
|
@@ -45,5 +45,6 @@
|
||||
{#qt-creator} channel on Libera.Chat IRC, go to \uicontrol Help >
|
||||
\uicontrol Contact.
|
||||
|
||||
\sa {Paste and fetch code snippets}, {Technical Support}
|
||||
\sa {Paste and fetch code snippets}, {Technical Support},
|
||||
{Turn on crash reports}
|
||||
*/
|
||||
|
@@ -24,6 +24,20 @@
|
||||
\li Select \uicontrol {Enable crash reporting}.
|
||||
\endlist
|
||||
|
||||
Crash reports are sent automatically if they don't exceed the file size
|
||||
limit that Sentry sets for accepting them. You are not notified about
|
||||
sending the reports or whether it succeeded or failed.
|
||||
|
||||
\section1 Clear local crash reports
|
||||
|
||||
\QC stores crash reports on the computer in the following directories:
|
||||
|
||||
\list
|
||||
\li On Windows: \c {%APPDATA%\QtProject\qtcreator\crashpad_reports}
|
||||
\li On Linux and \macos:
|
||||
\c {$HOME/.config/QtProject/qtcreator/crashpad_reports}
|
||||
\endlist
|
||||
|
||||
To free up disk space that crash reports reserve on the computer,
|
||||
select \uicontrol {Clear Local Crash Reports}. You can see the
|
||||
size of the crash reports next to the button.
|
||||
@@ -31,5 +45,8 @@
|
||||
Select \uicontrol ? to view more information about Crashpad and the security
|
||||
policy.
|
||||
|
||||
\note The best way to report a crash is to create a bug report where you
|
||||
paste the corresponding stack trace.
|
||||
|
||||
\sa {Contact Qt}
|
||||
*/
|
||||
|
@@ -0,0 +1,60 @@
|
||||
// Copyright (C) 2024 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||
|
||||
//! [build on remote devices]
|
||||
|
||||
To build applications on a \1:
|
||||
|
||||
\list 1
|
||||
|
||||
\li Go to \preferences > \uicontrol Devices > \uicontrol Devices, and
|
||||
then select \uicontrol Add to add a \1.
|
||||
|
||||
\li Go to \uicontrol {Preferences} > \uicontrol CMake >
|
||||
\uicontrol Tools, and then select \uicontrol Add.
|
||||
|
||||
\li In \uicontrol Path, select \uicontrol Remote in the dropdown
|
||||
menu in \uicontrol Browse (\uicontrol Choose on \macos) to
|
||||
add the path to the CMake executable on the \1.
|
||||
|
||||
\li Go to \uicontrol {Preferences} > \uicontrol Kits >
|
||||
\uicontrol {Qt Versions}, and then press \key Shift and click the
|
||||
\uicontrol Add button to add the Qt version on the \1.
|
||||
|
||||
\li Go to \uicontrol {Preferences} > \uicontrol Kits >
|
||||
\uicontrol Compilers, and then select the compiler
|
||||
type in \uicontrol Add.
|
||||
|
||||
\li In \uicontrol {C compiler path}, select \uicontrol Remote in the
|
||||
dropdown menu in \uicontrol Browse (\uicontrol Choose on \macos) to
|
||||
add the path to the compiler on the \1.
|
||||
|
||||
\li Go to \uicontrol {Preferences} > \uicontrol Kits
|
||||
to add a kit for building on the device.
|
||||
|
||||
\li Select the device, CMake tool, Qt version, and compiler that you
|
||||
added above.
|
||||
|
||||
\li In \uicontrol {Run device type} and \uicontrol {Build device}, select
|
||||
\uicontrol {\1}.
|
||||
|
||||
\li To specify build settings:
|
||||
|
||||
\list 1
|
||||
|
||||
\li Open a project for an application you want to develop for the
|
||||
device.
|
||||
|
||||
\li Select \uicontrol Projects > \uicontrol {Build & Run} to activate
|
||||
the kit that you specified above.
|
||||
|
||||
\endlist
|
||||
|
||||
\li Select \uicontrol Run to specify run settings. Usually, you can use
|
||||
the default settings.
|
||||
|
||||
When you run the project, \QC deploys the application as specified by
|
||||
the deploy steps.
|
||||
|
||||
\endlist
|
||||
//! [build on remote devices]
|
@@ -75,16 +75,18 @@
|
||||
|
||||
\li Select \uicontrol Add to add the Qt version for embedded Linux.
|
||||
|
||||
\li Go to \preferences > \uicontrol Kits > \uicontrol Compilers.
|
||||
\li Go to \uicontrol {Preferences} > \uicontrol Kits >
|
||||
\uicontrol Compilers.
|
||||
|
||||
\li Select \uicontrol Add to add the compiler for building the
|
||||
applications.
|
||||
|
||||
\li Go to \preferences > \uicontrol Devices > \uicontrol Devices.
|
||||
\li Go to \uicontrol {Preferences} > \uicontrol Devices >
|
||||
\uicontrol Devices.
|
||||
|
||||
\li Select \uicontrol Add to add a remote Linux device.
|
||||
|
||||
\li Go to \preferences > \uicontrol Kits.
|
||||
\li Go to \uicontrol {Preferences} > \uicontrol Kits.
|
||||
|
||||
\li Select \uicontrol Add to add a kit for building for the device.
|
||||
|
||||
@@ -150,56 +152,9 @@
|
||||
In addition to building applications \e {for} a generic Linux device, you can
|
||||
use the toolchain on the device to build the applications \e {on} the device.
|
||||
|
||||
To build applications on a remote Linux device:
|
||||
|
||||
\list 1
|
||||
|
||||
\li Go to \preferences > \uicontrol Devices > \uicontrol Devices, and
|
||||
then select \uicontrol Add to add a remote Linux device.
|
||||
|
||||
\li Go to \preferences > \uicontrol CMake > \uicontrol {CMake Tools}, and
|
||||
then select \uicontrol Add to add the path to the CMake executable
|
||||
on the remote Linux device.
|
||||
|
||||
\li Go to \preferences > \uicontrol Kits > \uicontrol {Qt Versions},
|
||||
and then select \uicontrol Add to add the Qt version on the remote
|
||||
Linux device
|
||||
|
||||
\li Go to \preferences > \uicontrol Kits > \uicontrol Compilers, and
|
||||
then select \uicontrol Add to add the the compiler on the remote
|
||||
Linux device.
|
||||
|
||||
\li Go to \preferences > \uicontrol Kits, and then select \uicontrol Add
|
||||
to add a kit for building for the device.
|
||||
|
||||
\li Select the device, CMake tool, Qt version, and compiler that you
|
||||
added above.
|
||||
|
||||
\li In \uicontrol {Run device type} and \uicontrol {Build device}, select
|
||||
\uicontrol {Remote Linux Device}.
|
||||
|
||||
\li To specify build settings:
|
||||
|
||||
\list 1
|
||||
|
||||
\li Open a project for an application you want to develop for the
|
||||
device.
|
||||
|
||||
\li Select \uicontrol Projects > \uicontrol {Build & Run} to activate
|
||||
the kit that you specified above.
|
||||
|
||||
\endlist
|
||||
|
||||
\li Select \uicontrol Run to specify run settings. Usually, you can use
|
||||
the default settings.
|
||||
|
||||
When you run the project, \QC deploys the application as specified by
|
||||
the deploy steps.
|
||||
|
||||
\endlist
|
||||
\include creator-how-to-build-on-remote-devices.qdocinc {build on remote devices} {remote Linux device}
|
||||
|
||||
\sa {Add CMake tools}, {Remote Linux}{How To: Develop for remote Linux},
|
||||
{Manage Kits}{How To: Manage Kits}, {Developing for Remote Linux Devices},
|
||||
{Remote Linux Deploy Configuration}, {Remote Linux Run Settings}
|
||||
*/
|
||||
|
||||
|
@@ -217,10 +217,16 @@
|
||||
\li In \uicontrol {C compiler path}, enter the path to the
|
||||
directory where the C compiler is located.
|
||||
|
||||
\li In \uicontrol {C++ compiler path}, enter the path
|
||||
to the directory where the C++ compiler is located. Select
|
||||
\uicontrol {Derive from C compiler} to derive the C++ compiler
|
||||
name from the C compiler name.
|
||||
Select \uicontrol Remote in the dropdown menu in \uicontrol Browse
|
||||
(\uicontrol Choose on \macos) to add the path to the compiler on a
|
||||
remote Linux device or in Docker.
|
||||
|
||||
\li In \uicontrol {C++ compiler path}, select
|
||||
\uicontrol {Provide manually} to enter the path
|
||||
to the directory where the C++ compiler is located.
|
||||
|
||||
Select \uicontrol Remote to add the path to the compiler on a
|
||||
remote Linux device or in Docker.
|
||||
|
||||
\li In \uicontrol Initialization, select the
|
||||
\c {vcvarsall.bat} file for setting up the command
|
||||
@@ -274,20 +280,30 @@
|
||||
\uicontrol Custom option. Specify the paths to the directories where the
|
||||
compiler and make tool are located and set preferences for the compiler.
|
||||
|
||||
\image creator-compilers-custom.png
|
||||
\image qtcreator-preferences-compilers-custom.webp {Compilers in Kit Preferences}
|
||||
|
||||
To add other compilers:
|
||||
|
||||
\list 1
|
||||
|
||||
\li Select \preferences > \uicontrol Kits >
|
||||
\uicontrol Compilers > \uicontrol Add > \uicontrol Custom >
|
||||
\uicontrol C or \uicontrol C++.
|
||||
\uicontrol Compilers > \uicontrol Add > \uicontrol Custom.
|
||||
|
||||
\li In \uicontrol Name, enter a name for the compiler.
|
||||
|
||||
\li In \uicontrol {Compiler path}, enter the path to the directory
|
||||
where the compiler is located.
|
||||
\li In \uicontrol {C compiler path}, enter the path to the
|
||||
directory where the C compiler is located.
|
||||
|
||||
Select \uicontrol Remote in the dropdown menu in \uicontrol Browse
|
||||
(\uicontrol Choose on \macos) to add the path to the compiler on a
|
||||
remote Linux device or in Docker.
|
||||
|
||||
\li In \uicontrol {C++ compiler path}, select
|
||||
\uicontrol {Provide manually} to enter the path
|
||||
to the directory where the C++ compiler is located.
|
||||
|
||||
Select \uicontrol Remote to add the path to the compiler on a
|
||||
remote Linux device or in Docker.
|
||||
|
||||
\li In \uicontrol {Make path}, enter the path to the directory where
|
||||
the make tool is located.
|
||||
|
@@ -71,6 +71,9 @@
|
||||
\li Select \preferences > \uicontrol Kits >
|
||||
\uicontrol {Qt Versions} > \uicontrol Add.
|
||||
|
||||
To add a Qt version on a remote Linux device or in Docker,
|
||||
press \key Shift and click \uicontrol Add.
|
||||
|
||||
\li Select the qmake executable for the Qt version to add.
|
||||
|
||||
\li Select the Qt version to view and edit it.
|
||||
|
@@ -965,6 +965,9 @@ class DumperBase():
|
||||
raise error
|
||||
children = [('error', error)]
|
||||
self.putSpecialValue("notcallable", children=children)
|
||||
else:
|
||||
if result is None:
|
||||
self.putSpecialValue("notcallable")
|
||||
else:
|
||||
self.putItem(result)
|
||||
|
||||
|
@@ -737,11 +737,11 @@ class Dumper(DumperBase):
|
||||
return None if val is None else self.fromNativeValue(val)
|
||||
|
||||
def nativeParseAndEvaluate(self, exp):
|
||||
#self.warn('EVALUATE "%s"' % exp)
|
||||
try:
|
||||
# FIXME: This breaks symbol discovery
|
||||
if not self.allowInferiorCalls:
|
||||
return None
|
||||
|
||||
#self.warn('EVALUATE "%s"' % exp)
|
||||
try:
|
||||
val = gdb.parse_and_eval(exp)
|
||||
return val
|
||||
except RuntimeError as error:
|
||||
@@ -1041,6 +1041,10 @@ class Dumper(DumperBase):
|
||||
except:
|
||||
return 0
|
||||
|
||||
def symbolAddress(self, symbolName):
|
||||
res = self.findSymbol(symbolName)
|
||||
return res
|
||||
|
||||
def handleNewObjectFile(self, objfile):
|
||||
name = objfile.filename
|
||||
if self.isWindowsTarget():
|
||||
|
@@ -120,6 +120,7 @@ struct TerminalSurfacePrivate
|
||||
};
|
||||
m_vtermScreenCallbacks.sb_clear = [](void *user) {
|
||||
auto p = static_cast<TerminalSurfacePrivate *>(user);
|
||||
emit p->q->cleared();
|
||||
return p->sb_clear();
|
||||
};
|
||||
m_vtermScreenCallbacks.bell = [](void *user) {
|
||||
|
@@ -111,6 +111,7 @@ signals:
|
||||
void cursorChanged(Cursor oldCursor, Cursor newCursor);
|
||||
void altscreenChanged(bool altScreen);
|
||||
void unscroll();
|
||||
void cleared();
|
||||
|
||||
private:
|
||||
std::unique_ptr<TerminalSurfacePrivate> d;
|
||||
|
@@ -176,6 +176,7 @@ TerminalSurface *TerminalView::surface() const
|
||||
void TerminalView::setupSurface()
|
||||
{
|
||||
d->m_surface = std::make_unique<TerminalSurface>(QSize{80, 60});
|
||||
connect(d->m_surface.get(), &TerminalSurface::cleared, this, &TerminalView::cleared);
|
||||
|
||||
if (d->m_surfaceIntegration)
|
||||
d->m_surface->setSurfaceIntegration(d->m_surfaceIntegration);
|
||||
|
@@ -224,6 +224,9 @@ protected:
|
||||
private:
|
||||
void scheduleViewportUpdate();
|
||||
|
||||
signals:
|
||||
void cleared();
|
||||
|
||||
private:
|
||||
std::unique_ptr<TerminalViewPrivate> d;
|
||||
};
|
||||
|
@@ -228,6 +228,9 @@ QTCREATOR_UTILS_EXPORT int parseUsedPortFromNetstatOutput(const QByteArray &line
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (columnToParse.size() > 0 && columnToParse.back() == '*')
|
||||
return -1; // Valid case, no warning. See QNX udp case.
|
||||
|
||||
const int port = trailingNumber(columnToParse, base);
|
||||
if (port == -1) {
|
||||
qWarning("%s: Unexpected string '%s' is not a port. Tried to read from '%s'",
|
||||
|
@@ -5,6 +5,7 @@
|
||||
#include "tooltip.h"
|
||||
|
||||
#include "../qtcassert.h"
|
||||
#include "../hostosinfo.h"
|
||||
|
||||
#include <QColor>
|
||||
#include <QFontMetrics>
|
||||
@@ -249,6 +250,7 @@ void WidgetTip::configure(const QPoint &pos)
|
||||
move(pos);
|
||||
m_layout->addWidget(m_widget);
|
||||
m_layout->setSizeConstraint(QLayout::SetFixedSize);
|
||||
if (!HostOsInfo::isMacHost()) // work around QTBUG-131479
|
||||
adjustSize();
|
||||
}
|
||||
|
||||
|
@@ -24,5 +24,29 @@
|
||||
],
|
||||
"Url" : "https://www.qt.io",
|
||||
"DocumentationUrl" : "https://doc.qt.io/qtcreator/creator-projects-autotools.html",
|
||||
${IDE_PLUGIN_DEPENDENCIES}
|
||||
${IDE_PLUGIN_DEPENDENCIES},
|
||||
|
||||
"Mimetypes" : [
|
||||
"<?xml version='1.0' encoding='UTF-8'?>",
|
||||
"<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>",
|
||||
" <mime-type type='text/x-makefile'>",
|
||||
" <comment>Makefile build file</comment>",
|
||||
" <magic priority='20'>",
|
||||
" <!-- Only magic for default autoconf/automake produced ones -->",
|
||||
" <match value='# Makefile.in generated by' type='string' offset='0'/>",
|
||||
" <!-- Not exhaustive, and most people don't set this! -->",
|
||||
" <match value='#!make' type='string' offset='0'/>",
|
||||
" <match value='#!/usr/bin/make' type='string' offset='0'/>",
|
||||
" <match value='#!/usr/local/bin/make' type='string' offset='0'/>",
|
||||
" <match value='#!/usr/bin/env make' type='string' offset='0'/>",
|
||||
" </magic>",
|
||||
" <glob pattern='Makefile'/>",
|
||||
" <glob pattern='GNUMakefile'/>",
|
||||
" <glob pattern='*.mk'/>",
|
||||
" <glob pattern='*.mak'/>",
|
||||
" <glob weight='10' pattern='Makefile.*'/>",
|
||||
" <sub-class-of type='text/plain'/>",
|
||||
" </mime-type>",
|
||||
"</mime-info>"
|
||||
]
|
||||
}
|
||||
|
@@ -5,7 +5,6 @@ add_qtc_plugin(AutotoolsProjectManager
|
||||
autogenstep.cpp autogenstep.h
|
||||
autoreconfstep.cpp autoreconfstep.h
|
||||
autotoolsbuildconfiguration.cpp autotoolsbuildconfiguration.h
|
||||
autotoolsbuildsystem.cpp autotoolsbuildsystem.h
|
||||
autotoolsprojectconstants.h
|
||||
autotoolsprojectmanagertr.h
|
||||
autotoolsprojectplugin.cpp
|
||||
|
@@ -5,29 +5,191 @@
|
||||
|
||||
#include "autotoolsprojectconstants.h"
|
||||
#include "autotoolsprojectmanagertr.h"
|
||||
#include "makefileparser.h"
|
||||
|
||||
#include <projectexplorer/buildinfo.h>
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/buildsystem.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/projectexplorertr.h>
|
||||
#include <projectexplorer/projectupdater.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <qtsupport/qtcppkitinfo.h>
|
||||
|
||||
#include <solutions/tasking/tasktreerunner.h>
|
||||
|
||||
#include <utils/async.h>
|
||||
#include <utils/mimeconstants.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Tasking;
|
||||
using namespace Utils;
|
||||
|
||||
namespace AutotoolsProjectManager::Internal {
|
||||
|
||||
// AutotoolsBuildConfiguration
|
||||
// AutotoolsBuildSystem
|
||||
class AutotoolsBuildSystem final : public BuildSystem
|
||||
{
|
||||
public:
|
||||
explicit AutotoolsBuildSystem(BuildConfiguration *bc);
|
||||
|
||||
private:
|
||||
void triggerParsing() final;
|
||||
QString name() const final { return QLatin1String("autotools"); }
|
||||
|
||||
/**
|
||||
* Is invoked when the makefile parsing by m_makefileParserThread has
|
||||
* been finished. Adds all sources and files into the project tree and
|
||||
* takes care listen to file changes for Makefile.am and configure.ac
|
||||
* files.
|
||||
*/
|
||||
void makefileParsingFinished(const MakefileParserOutputData &outputData);
|
||||
|
||||
/// Return value for AutotoolsProject::files()
|
||||
QStringList m_files;
|
||||
|
||||
/// Responsible for parsing the makefiles asynchronously in a thread
|
||||
Tasking::TaskTreeRunner m_parserRunner;
|
||||
|
||||
std::unique_ptr<ProjectUpdater> m_cppCodeModelUpdater;
|
||||
};
|
||||
|
||||
AutotoolsBuildSystem::AutotoolsBuildSystem(BuildConfiguration *bc)
|
||||
: BuildSystem(bc)
|
||||
, m_cppCodeModelUpdater(ProjectUpdaterFactory::createCppProjectUpdater())
|
||||
{
|
||||
connect(project(), &Project::projectFileIsDirty, this, [this] { requestParse(); });
|
||||
}
|
||||
|
||||
static void parseMakefileImpl(QPromise<MakefileParserOutputData> &promise, const QString &makefile)
|
||||
{
|
||||
const auto result = parseMakefile(makefile, QFuture<void>(promise.future()));
|
||||
if (result)
|
||||
promise.addResult(*result);
|
||||
else
|
||||
promise.future().cancel();
|
||||
}
|
||||
|
||||
void AutotoolsBuildSystem::triggerParsing()
|
||||
{
|
||||
const Storage<std::optional<ParseGuard>> storage;
|
||||
|
||||
const auto onSetup = [this, storage](Async<MakefileParserOutputData> &async) {
|
||||
*storage = guardParsingRun();
|
||||
async.setConcurrentCallData(parseMakefileImpl, projectFilePath().path());
|
||||
};
|
||||
const auto onDone = [this, storage](const Async<MakefileParserOutputData> &async) {
|
||||
(*storage)->markAsSuccess();
|
||||
makefileParsingFinished(async.result());
|
||||
};
|
||||
|
||||
const Group recipe {
|
||||
storage,
|
||||
AsyncTask<MakefileParserOutputData>(onSetup, onDone, CallDoneIf::Success)
|
||||
};
|
||||
m_parserRunner.start(recipe);
|
||||
}
|
||||
|
||||
static QStringList filterIncludes(const QString &absSrc, const QString &absBuild,
|
||||
const QStringList &in)
|
||||
{
|
||||
QStringList result;
|
||||
for (const QString &i : in) {
|
||||
QString out = i;
|
||||
out.replace(QLatin1String("$(top_srcdir)"), absSrc);
|
||||
out.replace(QLatin1String("$(abs_top_srcdir)"), absSrc);
|
||||
|
||||
out.replace(QLatin1String("$(top_builddir)"), absBuild);
|
||||
out.replace(QLatin1String("$(abs_top_builddir)"), absBuild);
|
||||
|
||||
result << out;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void AutotoolsBuildSystem::makefileParsingFinished(const MakefileParserOutputData &outputData)
|
||||
{
|
||||
m_files.clear();
|
||||
|
||||
QSet<FilePath> filesToWatch;
|
||||
|
||||
// Apply sources to m_files, which are returned at AutotoolsBuildSystem::files()
|
||||
const QFileInfo fileInfo = projectFilePath().toFileInfo();
|
||||
const QDir dir = fileInfo.absoluteDir();
|
||||
const QStringList files = outputData.m_sources;
|
||||
for (const QString& file : files)
|
||||
m_files.append(dir.absoluteFilePath(file));
|
||||
|
||||
// Watch for changes of Makefile.am files. If a Makefile.am file
|
||||
// has been changed, the project tree must be reparsed.
|
||||
const QStringList makefiles = outputData.m_makefiles;
|
||||
for (const QString &makefile : makefiles) {
|
||||
const QString absMakefile = dir.absoluteFilePath(makefile);
|
||||
|
||||
m_files.append(absMakefile);
|
||||
|
||||
filesToWatch.insert(FilePath::fromString(absMakefile));
|
||||
}
|
||||
|
||||
// Add configure.ac file to project and watch for changes.
|
||||
const QLatin1String configureAc(QLatin1String("configure.ac"));
|
||||
const QFile configureAcFile(fileInfo.absolutePath() + QLatin1Char('/') + configureAc);
|
||||
if (configureAcFile.exists()) {
|
||||
const QString absConfigureAc = dir.absoluteFilePath(configureAc);
|
||||
m_files.append(absConfigureAc);
|
||||
|
||||
filesToWatch.insert(FilePath::fromString(absConfigureAc));
|
||||
}
|
||||
|
||||
auto newRoot = std::make_unique<ProjectNode>(project()->projectDirectory());
|
||||
for (const QString &f : std::as_const(m_files)) {
|
||||
const FilePath path = FilePath::fromString(f);
|
||||
newRoot->addNestedNode(std::make_unique<FileNode>(path,
|
||||
FileNode::fileTypeForFileName(path)));
|
||||
}
|
||||
setRootProjectNode(std::move(newRoot));
|
||||
project()->setExtraProjectFiles(filesToWatch);
|
||||
|
||||
QtSupport::CppKitInfo kitInfo(kit());
|
||||
QTC_ASSERT(kitInfo.isValid(), return );
|
||||
|
||||
RawProjectPart rpp;
|
||||
rpp.setDisplayName(project()->displayName());
|
||||
rpp.setProjectFileLocation(projectFilePath());
|
||||
rpp.setQtVersion(kitInfo.projectPartQtVersion);
|
||||
const QStringList cflags = outputData.m_cflags;
|
||||
QStringList cxxflags = outputData.m_cxxflags;
|
||||
if (cxxflags.isEmpty())
|
||||
cxxflags = cflags;
|
||||
|
||||
const FilePath includeFileBaseDir = projectDirectory();
|
||||
rpp.setFlagsForC({kitInfo.cToolchain, cflags, includeFileBaseDir});
|
||||
rpp.setFlagsForCxx({kitInfo.cxxToolchain, cxxflags, includeFileBaseDir});
|
||||
|
||||
const QString absSrc = project()->projectDirectory().path();
|
||||
BuildConfiguration *bc = target()->activeBuildConfiguration();
|
||||
|
||||
const QString absBuild = bc ? bc->buildDirectory().path() : QString();
|
||||
|
||||
rpp.setIncludePaths(filterIncludes(absSrc, absBuild, outputData.m_includePaths));
|
||||
rpp.setMacros(outputData.m_macros);
|
||||
rpp.setFiles(m_files);
|
||||
|
||||
m_cppCodeModelUpdater->update({project(), kitInfo, activeParseEnvironment(), {rpp}});
|
||||
|
||||
emitBuildSystemUpdated();
|
||||
}
|
||||
|
||||
// AutotoolsBuildConfiguration
|
||||
class AutotoolsBuildConfiguration final : public BuildConfiguration
|
||||
{
|
||||
public:
|
||||
AutotoolsBuildConfiguration(Target *target, Id id)
|
||||
: BuildConfiguration(target, id)
|
||||
, m_buildSystem(new AutotoolsBuildSystem(this))
|
||||
{
|
||||
// /<foobar> is used so the un-changed check in setBuildDirectory() works correctly.
|
||||
// The leading / is to avoid the relative the path expansion in BuildConfiguration::buildDirectory.
|
||||
@@ -48,6 +210,13 @@ public:
|
||||
// ### Build Steps Clean ###
|
||||
appendInitialCleanStep(Constants::MAKE_STEP_ID); // make clean
|
||||
}
|
||||
|
||||
~AutotoolsBuildConfiguration() override { delete m_buildSystem; }
|
||||
|
||||
private:
|
||||
BuildSystem *buildSystem() const override { return m_buildSystem; }
|
||||
|
||||
AutotoolsBuildSystem * const m_buildSystem;
|
||||
};
|
||||
|
||||
class AutotoolsBuildConfigurationFactory final : public BuildConfigurationFactory
|
||||
|
@@ -1,187 +0,0 @@
|
||||
// Copyright (C) 2016 Openismus GmbH.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include "autotoolsbuildsystem.h"
|
||||
|
||||
#include "makefileparser.h"
|
||||
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/projectupdater.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <qtsupport/qtcppkitinfo.h>
|
||||
|
||||
#include <solutions/tasking/tasktreerunner.h>
|
||||
|
||||
#include <utils/async.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Tasking;
|
||||
using namespace Utils;
|
||||
|
||||
namespace AutotoolsProjectManager::Internal {
|
||||
|
||||
class AutotoolsBuildSystem final : public BuildSystem
|
||||
{
|
||||
public:
|
||||
explicit AutotoolsBuildSystem(Target *target);
|
||||
~AutotoolsBuildSystem() final;
|
||||
|
||||
private:
|
||||
void triggerParsing() final;
|
||||
QString name() const final { return QLatin1String("autotools"); }
|
||||
|
||||
/**
|
||||
* Is invoked when the makefile parsing by m_makefileParserThread has
|
||||
* been finished. Adds all sources and files into the project tree and
|
||||
* takes care listen to file changes for Makefile.am and configure.ac
|
||||
* files.
|
||||
*/
|
||||
void makefileParsingFinished(const MakefileParserOutputData &outputData);
|
||||
|
||||
/// Return value for AutotoolsProject::files()
|
||||
QStringList m_files;
|
||||
|
||||
/// Responsible for parsing the makefiles asynchronously in a thread
|
||||
Tasking::TaskTreeRunner m_parserRunner;
|
||||
|
||||
std::unique_ptr<ProjectUpdater> m_cppCodeModelUpdater;
|
||||
};
|
||||
|
||||
AutotoolsBuildSystem::AutotoolsBuildSystem(Target *target)
|
||||
: BuildSystem(target)
|
||||
, m_cppCodeModelUpdater(ProjectUpdaterFactory::createCppProjectUpdater())
|
||||
{
|
||||
connect(target, &Target::activeBuildConfigurationChanged, this, [this] { requestParse(); });
|
||||
connect(target->project(), &Project::projectFileIsDirty, this, [this] { requestParse(); });
|
||||
}
|
||||
|
||||
AutotoolsBuildSystem::~AutotoolsBuildSystem() = default;
|
||||
|
||||
static void parseMakefileImpl(QPromise<MakefileParserOutputData> &promise, const QString &makefile)
|
||||
{
|
||||
const auto result = parseMakefile(makefile, QFuture<void>(promise.future()));
|
||||
if (result)
|
||||
promise.addResult(*result);
|
||||
else
|
||||
promise.future().cancel();
|
||||
}
|
||||
|
||||
void AutotoolsBuildSystem::triggerParsing()
|
||||
{
|
||||
const Storage<std::optional<ParseGuard>> storage;
|
||||
|
||||
const auto onSetup = [this, storage](Async<MakefileParserOutputData> &async) {
|
||||
*storage = guardParsingRun();
|
||||
async.setConcurrentCallData(parseMakefileImpl, projectFilePath().path());
|
||||
};
|
||||
const auto onDone = [this, storage](const Async<MakefileParserOutputData> &async) {
|
||||
(*storage)->markAsSuccess();
|
||||
makefileParsingFinished(async.result());
|
||||
};
|
||||
|
||||
const Group recipe {
|
||||
storage,
|
||||
AsyncTask<MakefileParserOutputData>(onSetup, onDone, CallDoneIf::Success)
|
||||
};
|
||||
m_parserRunner.start(recipe);
|
||||
}
|
||||
|
||||
static QStringList filterIncludes(const QString &absSrc, const QString &absBuild,
|
||||
const QStringList &in)
|
||||
{
|
||||
QStringList result;
|
||||
for (const QString &i : in) {
|
||||
QString out = i;
|
||||
out.replace(QLatin1String("$(top_srcdir)"), absSrc);
|
||||
out.replace(QLatin1String("$(abs_top_srcdir)"), absSrc);
|
||||
|
||||
out.replace(QLatin1String("$(top_builddir)"), absBuild);
|
||||
out.replace(QLatin1String("$(abs_top_builddir)"), absBuild);
|
||||
|
||||
result << out;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void AutotoolsBuildSystem::makefileParsingFinished(const MakefileParserOutputData &outputData)
|
||||
{
|
||||
m_files.clear();
|
||||
|
||||
QSet<FilePath> filesToWatch;
|
||||
|
||||
// Apply sources to m_files, which are returned at AutotoolsBuildSystem::files()
|
||||
const QFileInfo fileInfo = projectFilePath().toFileInfo();
|
||||
const QDir dir = fileInfo.absoluteDir();
|
||||
const QStringList files = outputData.m_sources;
|
||||
for (const QString& file : files)
|
||||
m_files.append(dir.absoluteFilePath(file));
|
||||
|
||||
// Watch for changes of Makefile.am files. If a Makefile.am file
|
||||
// has been changed, the project tree must be reparsed.
|
||||
const QStringList makefiles = outputData.m_makefiles;
|
||||
for (const QString &makefile : makefiles) {
|
||||
const QString absMakefile = dir.absoluteFilePath(makefile);
|
||||
|
||||
m_files.append(absMakefile);
|
||||
|
||||
filesToWatch.insert(FilePath::fromString(absMakefile));
|
||||
}
|
||||
|
||||
// Add configure.ac file to project and watch for changes.
|
||||
const QLatin1String configureAc(QLatin1String("configure.ac"));
|
||||
const QFile configureAcFile(fileInfo.absolutePath() + QLatin1Char('/') + configureAc);
|
||||
if (configureAcFile.exists()) {
|
||||
const QString absConfigureAc = dir.absoluteFilePath(configureAc);
|
||||
m_files.append(absConfigureAc);
|
||||
|
||||
filesToWatch.insert(FilePath::fromString(absConfigureAc));
|
||||
}
|
||||
|
||||
auto newRoot = std::make_unique<ProjectNode>(project()->projectDirectory());
|
||||
for (const QString &f : std::as_const(m_files)) {
|
||||
const FilePath path = FilePath::fromString(f);
|
||||
newRoot->addNestedNode(std::make_unique<FileNode>(path,
|
||||
FileNode::fileTypeForFileName(path)));
|
||||
}
|
||||
setRootProjectNode(std::move(newRoot));
|
||||
project()->setExtraProjectFiles(filesToWatch);
|
||||
|
||||
QtSupport::CppKitInfo kitInfo(kit());
|
||||
QTC_ASSERT(kitInfo.isValid(), return );
|
||||
|
||||
RawProjectPart rpp;
|
||||
rpp.setDisplayName(project()->displayName());
|
||||
rpp.setProjectFileLocation(projectFilePath());
|
||||
rpp.setQtVersion(kitInfo.projectPartQtVersion);
|
||||
const QStringList cflags = outputData.m_cflags;
|
||||
QStringList cxxflags = outputData.m_cxxflags;
|
||||
if (cxxflags.isEmpty())
|
||||
cxxflags = cflags;
|
||||
|
||||
const FilePath includeFileBaseDir = projectDirectory();
|
||||
rpp.setFlagsForC({kitInfo.cToolchain, cflags, includeFileBaseDir});
|
||||
rpp.setFlagsForCxx({kitInfo.cxxToolchain, cxxflags, includeFileBaseDir});
|
||||
|
||||
const QString absSrc = project()->projectDirectory().path();
|
||||
BuildConfiguration *bc = target()->activeBuildConfiguration();
|
||||
|
||||
const QString absBuild = bc ? bc->buildDirectory().path() : QString();
|
||||
|
||||
rpp.setIncludePaths(filterIncludes(absSrc, absBuild, outputData.m_includePaths));
|
||||
rpp.setMacros(outputData.m_macros);
|
||||
rpp.setFiles(m_files);
|
||||
|
||||
m_cppCodeModelUpdater->update({project(), kitInfo, activeParseEnvironment(), {rpp}});
|
||||
|
||||
emitBuildSystemUpdated();
|
||||
}
|
||||
|
||||
BuildSystem *createAutotoolsBuildSystem(Target *target)
|
||||
{
|
||||
return new AutotoolsBuildSystem(target);
|
||||
}
|
||||
|
||||
} // AutotoolsProjectManager::Internal
|
@@ -1,12 +0,0 @@
|
||||
// Copyright (C) 2016 Openismus GmbH.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <projectexplorer/buildsystem.h>
|
||||
|
||||
namespace AutotoolsProjectManager::Internal {
|
||||
|
||||
ProjectExplorer::BuildSystem *createAutotoolsBuildSystem(ProjectExplorer::Target *target);
|
||||
|
||||
} // AutotoolsProjectManager::Internal
|
@@ -17,8 +17,6 @@ QtcPlugin {
|
||||
"autoreconfstep.h",
|
||||
"autotoolsbuildconfiguration.cpp",
|
||||
"autotoolsbuildconfiguration.h",
|
||||
"autotoolsbuildsystem.cpp",
|
||||
"autotoolsbuildsystem.h",
|
||||
"autotoolsprojectconstants.h",
|
||||
"autotoolsprojectmanagertr.h",
|
||||
"autotoolsprojectplugin.cpp",
|
||||
|
@@ -4,7 +4,6 @@
|
||||
#include "autogenstep.h"
|
||||
#include "autoreconfstep.h"
|
||||
#include "autotoolsbuildconfiguration.h"
|
||||
#include "autotoolsbuildsystem.h"
|
||||
#include "autotoolsprojectconstants.h"
|
||||
#include "configurestep.h"
|
||||
#include "makestep.h"
|
||||
@@ -41,7 +40,6 @@ public:
|
||||
setProjectLanguages(Core::Context(ProjectExplorer::Constants::CXX_LANGUAGE_ID));
|
||||
setDisplayName(projectDirectory().fileName());
|
||||
setHasMakeInstallEquivalent(true);
|
||||
setBuildSystemCreator(&createAutotoolsBuildSystem);
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -47,6 +47,18 @@ void TerminalSearch::setSearchString(const QString &searchString, FindFlags find
|
||||
}
|
||||
}
|
||||
|
||||
void TerminalSearch::clearAndSearchAgain()
|
||||
{
|
||||
if (!m_hits.isEmpty()) {
|
||||
m_hits.clear();
|
||||
m_currentHit = -1;
|
||||
emit hitsChanged();
|
||||
emit currentHitChanged();
|
||||
}
|
||||
|
||||
m_debounceTimer.start();
|
||||
}
|
||||
|
||||
void TerminalSearch::nextHit()
|
||||
{
|
||||
if (m_hits.isEmpty())
|
||||
@@ -67,13 +79,6 @@ void TerminalSearch::previousHit()
|
||||
|
||||
void TerminalSearch::updateHits()
|
||||
{
|
||||
if (!m_hits.isEmpty()) {
|
||||
m_hits.clear();
|
||||
m_currentHit = -1;
|
||||
emit hitsChanged();
|
||||
emit currentHitChanged();
|
||||
}
|
||||
|
||||
m_debounceTimer.start();
|
||||
}
|
||||
|
||||
@@ -282,6 +287,10 @@ SearchableTerminal::SearchableTerminal(QWidget *parent)
|
||||
m_aggregate->add(this);
|
||||
|
||||
surfaceChanged();
|
||||
|
||||
connect(this, &TerminalSolution::TerminalView::cleared, this, [this] {
|
||||
m_search->clearAndSearchAgain();
|
||||
});
|
||||
}
|
||||
|
||||
SearchableTerminal::~SearchableTerminal() = default;
|
||||
|
@@ -25,6 +25,7 @@ public:
|
||||
|
||||
void setCurrentSelection(std::optional<SearchHitWithText> selection);
|
||||
void setSearchString(const QString &searchString, Utils::FindFlags findFlags);
|
||||
void clearAndSearchAgain();
|
||||
void nextHit();
|
||||
void previousHit();
|
||||
|
||||
|
@@ -54,6 +54,7 @@
|
||||
#include <qtsupport/qtkitaspect.h>
|
||||
|
||||
#include <QTcpServer>
|
||||
#include <QTextCodec>
|
||||
#include <QTimer>
|
||||
|
||||
using namespace Core;
|
||||
@@ -104,6 +105,9 @@ public:
|
||||
|
||||
// DebugServer
|
||||
Process debuggerServerProc;
|
||||
QTextCodec *debuggerServerCodec = QTextCodec::codecForName("utf8");
|
||||
QTextCodec::ConverterState outputCodecState; // FIXME: Handle on Process side.
|
||||
QTextCodec::ConverterState errorCodecState;
|
||||
ProcessHandle serverAttachPid;
|
||||
bool serverUseMulti = true;
|
||||
bool serverEssential = true;
|
||||
@@ -1136,8 +1140,29 @@ void DebuggerRunTool::startDebugServerIfNeededAndContinueStartup()
|
||||
}
|
||||
}
|
||||
|
||||
if (auto terminalAspect = runControl()->aspectData<TerminalAspect>()) {
|
||||
const bool useTerminal = terminalAspect->useTerminal;
|
||||
d->debuggerServerProc.setTerminalMode(useTerminal ? TerminalMode::Run : TerminalMode::Off);
|
||||
}
|
||||
|
||||
d->debuggerServerProc.setCommand(cmd);
|
||||
|
||||
connect(&d->debuggerServerProc, &Process::readyReadStandardOutput,
|
||||
this, [this] {
|
||||
const QByteArray data = d->debuggerServerProc.readAllRawStandardOutput();
|
||||
const QString msg = d->debuggerServerCodec->toUnicode(
|
||||
data.constData(), data.length(), &d->outputCodecState);
|
||||
runControl()->postMessage(msg, StdOutFormat, false);
|
||||
});
|
||||
|
||||
connect(&d->debuggerServerProc, &Process::readyReadStandardError,
|
||||
this, [this] {
|
||||
const QByteArray data = d->debuggerServerProc.readAllRawStandardError();
|
||||
const QString msg = d->debuggerServerCodec->toUnicode(
|
||||
data.constData(), data.length(), &d->errorCodecState);
|
||||
runControl()->postMessage(msg, StdErrFormat, false);
|
||||
});
|
||||
|
||||
connect(&d->debuggerServerProc, &Process::started, this, [this] {
|
||||
continueAfterDebugServerStart();
|
||||
});
|
||||
|
@@ -463,6 +463,7 @@ DebuggerToolTipWidget::DebuggerToolTipWidget(DebuggerEngine *engine,
|
||||
auto mainLayout = new QVBoxLayout(this);
|
||||
mainLayout->setSizeConstraint(QLayout::SetFixedSize);
|
||||
mainLayout->setContentsMargins(0, 0, 0, 0);
|
||||
mainLayout->setSpacing(0);
|
||||
mainLayout->addWidget(toolBar);
|
||||
mainLayout->addWidget(treeView);
|
||||
|
||||
|
@@ -87,6 +87,22 @@ void LanguageClientQuickFixAssistProcessor::cancel()
|
||||
}
|
||||
}
|
||||
|
||||
QuickFixOperations LanguageClientQuickFixAssistProcessor::resultToOperations(const LanguageServerProtocol::CodeActionResult &result)
|
||||
{
|
||||
auto list = std::get_if<QList<std::variant<Command, CodeAction>>>(&result);
|
||||
if (!list)
|
||||
return {};
|
||||
|
||||
QuickFixOperations ops;
|
||||
for (const std::variant<Command, CodeAction> &item : *list) {
|
||||
if (auto action = std::get_if<CodeAction>(&item))
|
||||
ops << new CodeActionQuickFixOperation(*action, m_client);
|
||||
else if (auto command = std::get_if<Command>(&item))
|
||||
ops << new CommandQuickFixOperation(*command, m_client);
|
||||
}
|
||||
return ops;
|
||||
}
|
||||
|
||||
void LanguageClientQuickFixAssistProcessor::handleCodeActionResponse(const CodeActionRequest::Response &response)
|
||||
{
|
||||
m_currentRequest.reset();
|
||||
@@ -101,17 +117,7 @@ void LanguageClientQuickFixAssistProcessor::handleCodeActionResponse(const CodeA
|
||||
|
||||
GenericProposal *LanguageClientQuickFixAssistProcessor::handleCodeActionResult(const CodeActionResult &result)
|
||||
{
|
||||
if (auto list = std::get_if<QList<std::variant<Command, CodeAction>>>(&result)) {
|
||||
QuickFixOperations ops;
|
||||
for (const std::variant<Command, CodeAction> &item : *list) {
|
||||
if (auto action = std::get_if<CodeAction>(&item))
|
||||
ops << new CodeActionQuickFixOperation(*action, m_client);
|
||||
else if (auto command = std::get_if<Command>(&item))
|
||||
ops << new CommandQuickFixOperation(*command, m_client);
|
||||
}
|
||||
return GenericProposal::createProposal(interface(), ops);
|
||||
}
|
||||
return nullptr;
|
||||
return GenericProposal::createProposal(interface(), resultToOperations(result));
|
||||
}
|
||||
|
||||
LanguageClientQuickFixProvider::LanguageClientQuickFixProvider(Client *client)
|
||||
|
@@ -67,6 +67,8 @@ public:
|
||||
void cancel() override;
|
||||
|
||||
protected:
|
||||
TextEditor::QuickFixOperations resultToOperations(
|
||||
const LanguageServerProtocol::CodeActionResult &result);
|
||||
void setOnlyKinds(const QList<LanguageServerProtocol::CodeActionKind> &only);
|
||||
Client *client() { return m_client; }
|
||||
|
||||
|
@@ -490,7 +490,6 @@ public:
|
||||
m_initializationOptions = options.as<QString>();
|
||||
|
||||
emit optionsChanged();
|
||||
LanguageClientManager::applySettings();
|
||||
m_isUpdatingAsyncOptions = false;
|
||||
});
|
||||
|
||||
|
@@ -242,6 +242,7 @@ ExtraCompiler *BuildSystem::extraCompilerForTarget(const Utils::FilePath &target
|
||||
MakeInstallCommand BuildSystem::makeInstallCommand(const FilePath &installRoot) const
|
||||
{
|
||||
QTC_ASSERT(target()->project()->hasMakeInstallEquivalent(), return {});
|
||||
QTC_ASSERT(buildConfiguration(), return {});
|
||||
|
||||
BuildStepList *buildSteps = buildConfiguration()->buildSteps();
|
||||
QTC_ASSERT(buildSteps, return {});
|
||||
|
@@ -6,12 +6,16 @@
|
||||
#include "qmljseditorconstants.h"
|
||||
#include "qmljseditortr.h"
|
||||
#include "qmljseditorsettings.h"
|
||||
#include "qmljsquickfix.h"
|
||||
|
||||
#include <languageclient/languageclientinterface.h>
|
||||
#include <languageclient/languageclientmanager.h>
|
||||
#include <languageclient/languageclientquickfix.h>
|
||||
|
||||
#include <projectexplorer/buildmanager.h>
|
||||
|
||||
#include <texteditor/codeassist/genericproposal.h>
|
||||
#include <texteditor/codeassist/iassistprovider.h>
|
||||
#include <texteditor/textdocument.h>
|
||||
#include <texteditor/texteditor.h>
|
||||
#include <texteditor/texteditorconstants.h>
|
||||
@@ -107,6 +111,41 @@ void QmllsClient::updateQmllsSemanticHighlightingCapability()
|
||||
}
|
||||
}
|
||||
|
||||
class QmllsQuickFixAssistProcessor : public LanguageClientQuickFixAssistProcessor
|
||||
{
|
||||
public:
|
||||
using LanguageClientQuickFixAssistProcessor::LanguageClientQuickFixAssistProcessor;
|
||||
private:
|
||||
TextEditor::GenericProposal *perform() override
|
||||
{
|
||||
// Step 1: Collect qmlls code actions asynchronously
|
||||
LanguageClientQuickFixAssistProcessor::perform();
|
||||
|
||||
// Step 2: Collect built-in quickfixes synchronously
|
||||
m_builtinOps = findQmlJSQuickFixes(interface());
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TextEditor::GenericProposal *handleCodeActionResult(const LanguageServerProtocol::CodeActionResult &result) override
|
||||
{
|
||||
return TextEditor::GenericProposal::createProposal(
|
||||
interface(), resultToOperations(result) + m_builtinOps);
|
||||
}
|
||||
|
||||
QuickFixOperations m_builtinOps;
|
||||
};
|
||||
|
||||
class QmllsQuickFixAssistProvider : public LanguageClientQuickFixProvider
|
||||
{
|
||||
public:
|
||||
using LanguageClientQuickFixProvider::LanguageClientQuickFixProvider;
|
||||
TextEditor::IAssistProcessor *createProcessor(const TextEditor::AssistInterface *) const override
|
||||
{
|
||||
return new QmllsQuickFixAssistProcessor(client());
|
||||
}
|
||||
};
|
||||
|
||||
QmllsClient::QmllsClient(StdIOClientInterface *interface)
|
||||
: Client(interface)
|
||||
{
|
||||
@@ -178,6 +217,7 @@ QmllsClient::QmllsClient(StdIOClientInterface *interface)
|
||||
}
|
||||
return std::nullopt;
|
||||
});
|
||||
setQuickFixAssistProvider(new QmllsQuickFixAssistProvider(this));
|
||||
}
|
||||
|
||||
QmllsClient::~QmllsClient()
|
||||
|