forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/15.0'
Change-Id: I13e6beb4741be5aa79b2798aa6b674e45ad109f2
This commit is contained in:
@@ -45,5 +45,6 @@
|
|||||||
{#qt-creator} channel on Libera.Chat IRC, go to \uicontrol Help >
|
{#qt-creator} channel on Libera.Chat IRC, go to \uicontrol Help >
|
||||||
\uicontrol Contact.
|
\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}.
|
\li Select \uicontrol {Enable crash reporting}.
|
||||||
\endlist
|
\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,
|
To free up disk space that crash reports reserve on the computer,
|
||||||
select \uicontrol {Clear Local Crash Reports}. You can see the
|
select \uicontrol {Clear Local Crash Reports}. You can see the
|
||||||
size of the crash reports next to the button.
|
size of the crash reports next to the button.
|
||||||
@@ -31,5 +45,8 @@
|
|||||||
Select \uicontrol ? to view more information about Crashpad and the security
|
Select \uicontrol ? to view more information about Crashpad and the security
|
||||||
policy.
|
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}
|
\sa {Contact Qt}
|
||||||
*/
|
*/
|
||||||
|
16
src/libs/3rdparty/cplusplus/Parser.cpp
vendored
16
src/libs/3rdparty/cplusplus/Parser.cpp
vendored
@@ -487,15 +487,17 @@ int Parser::find(int token, int stopAt)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Parser::match(int kind, int *token)
|
bool Parser::match(int kind, int *token)
|
||||||
{
|
{
|
||||||
if (LA() == kind)
|
if (LA() == kind) {
|
||||||
*token = consumeToken();
|
*token = consumeToken();
|
||||||
else {
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
*token = 0;
|
*token = 0;
|
||||||
error(_tokenIndex, "expected token `%s' got `%s'",
|
error(_tokenIndex, "expected token `%s' got `%s'",
|
||||||
Token::name(kind), tok().spell());
|
Token::name(kind), tok().spell());
|
||||||
}
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Parser::parseClassOrNamespaceName(NameAST *&node)
|
bool Parser::parseClassOrNamespaceName(NameAST *&node)
|
||||||
@@ -3503,7 +3505,8 @@ bool Parser::parseExpressionStatement(StatementAST *&node)
|
|||||||
DEBUG_THIS_RULE();
|
DEBUG_THIS_RULE();
|
||||||
if (LA() == T_SEMICOLON) {
|
if (LA() == T_SEMICOLON) {
|
||||||
ExpressionStatementAST *ast = new (_pool) ExpressionStatementAST;
|
ExpressionStatementAST *ast = new (_pool) ExpressionStatementAST;
|
||||||
match(T_SEMICOLON, &ast->semicolon_token);
|
if (!match(T_SEMICOLON, &ast->semicolon_token))
|
||||||
|
return false;
|
||||||
node = ast;
|
node = ast;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -3524,10 +3527,11 @@ bool Parser::parseExpressionStatement(StatementAST *&node)
|
|||||||
ExpressionStatementAST *ast = new (previousPool) ExpressionStatementAST;
|
ExpressionStatementAST *ast = new (previousPool) ExpressionStatementAST;
|
||||||
if (expression)
|
if (expression)
|
||||||
ast->expression = expression->clone(previousPool);
|
ast->expression = expression->clone(previousPool);
|
||||||
match(T_SEMICOLON, &ast->semicolon_token);
|
if (match(T_SEMICOLON, &ast->semicolon_token)) {
|
||||||
node = ast;
|
node = ast;
|
||||||
parsed = true;
|
parsed = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_inExpressionStatement = wasInExpressionStatement;
|
_inExpressionStatement = wasInExpressionStatement;
|
||||||
|
|
||||||
|
2
src/libs/3rdparty/cplusplus/Parser.h
vendored
2
src/libs/3rdparty/cplusplus/Parser.h
vendored
@@ -273,7 +273,7 @@ public:
|
|||||||
const Identifier *className(ClassSpecifierAST *ast) const;
|
const Identifier *className(ClassSpecifierAST *ast) const;
|
||||||
const Identifier *identifier(NameAST *name) const;
|
const Identifier *identifier(NameAST *name) const;
|
||||||
|
|
||||||
void match(int kind, int *token);
|
bool match(int kind, int *token);
|
||||||
|
|
||||||
bool maybeAmbiguousStatement(DeclarationStatementAST *ast, StatementAST *&node);
|
bool maybeAmbiguousStatement(DeclarationStatementAST *ast, StatementAST *&node);
|
||||||
bool maybeForwardOrClassDeclaration(SpecifierListAST *decl_specifier_seq) const;
|
bool maybeForwardOrClassDeclaration(SpecifierListAST *decl_specifier_seq) const;
|
||||||
|
@@ -120,6 +120,7 @@ struct TerminalSurfacePrivate
|
|||||||
};
|
};
|
||||||
m_vtermScreenCallbacks.sb_clear = [](void *user) {
|
m_vtermScreenCallbacks.sb_clear = [](void *user) {
|
||||||
auto p = static_cast<TerminalSurfacePrivate *>(user);
|
auto p = static_cast<TerminalSurfacePrivate *>(user);
|
||||||
|
emit p->q->cleared();
|
||||||
return p->sb_clear();
|
return p->sb_clear();
|
||||||
};
|
};
|
||||||
m_vtermScreenCallbacks.bell = [](void *user) {
|
m_vtermScreenCallbacks.bell = [](void *user) {
|
||||||
|
@@ -111,6 +111,7 @@ signals:
|
|||||||
void cursorChanged(Cursor oldCursor, Cursor newCursor);
|
void cursorChanged(Cursor oldCursor, Cursor newCursor);
|
||||||
void altscreenChanged(bool altScreen);
|
void altscreenChanged(bool altScreen);
|
||||||
void unscroll();
|
void unscroll();
|
||||||
|
void cleared();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<TerminalSurfacePrivate> d;
|
std::unique_ptr<TerminalSurfacePrivate> d;
|
||||||
|
@@ -176,6 +176,7 @@ TerminalSurface *TerminalView::surface() const
|
|||||||
void TerminalView::setupSurface()
|
void TerminalView::setupSurface()
|
||||||
{
|
{
|
||||||
d->m_surface = std::make_unique<TerminalSurface>(QSize{80, 60});
|
d->m_surface = std::make_unique<TerminalSurface>(QSize{80, 60});
|
||||||
|
connect(d->m_surface.get(), &TerminalSurface::cleared, this, &TerminalView::cleared);
|
||||||
|
|
||||||
if (d->m_surfaceIntegration)
|
if (d->m_surfaceIntegration)
|
||||||
d->m_surface->setSurfaceIntegration(d->m_surfaceIntegration);
|
d->m_surface->setSurfaceIntegration(d->m_surfaceIntegration);
|
||||||
|
@@ -224,6 +224,9 @@ protected:
|
|||||||
private:
|
private:
|
||||||
void scheduleViewportUpdate();
|
void scheduleViewportUpdate();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void cleared();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<TerminalViewPrivate> d;
|
std::unique_ptr<TerminalViewPrivate> d;
|
||||||
};
|
};
|
||||||
|
@@ -228,6 +228,9 @@ QTCREATOR_UTILS_EXPORT int parseUsedPortFromNetstatOutput(const QByteArray &line
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (columnToParse.size() > 0 && columnToParse.back() == '*')
|
||||||
|
return -1; // Valid case, no warning. See QNX udp case.
|
||||||
|
|
||||||
const int port = trailingNumber(columnToParse, base);
|
const int port = trailingNumber(columnToParse, base);
|
||||||
if (port == -1) {
|
if (port == -1) {
|
||||||
qWarning("%s: Unexpected string '%s' is not a port. Tried to read from '%s'",
|
qWarning("%s: Unexpected string '%s' is not a port. Tried to read from '%s'",
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
#include "tooltip.h"
|
#include "tooltip.h"
|
||||||
|
|
||||||
#include "../qtcassert.h"
|
#include "../qtcassert.h"
|
||||||
|
#include "../hostosinfo.h"
|
||||||
|
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
#include <QFontMetrics>
|
#include <QFontMetrics>
|
||||||
@@ -249,6 +250,7 @@ void WidgetTip::configure(const QPoint &pos)
|
|||||||
move(pos);
|
move(pos);
|
||||||
m_layout->addWidget(m_widget);
|
m_layout->addWidget(m_widget);
|
||||||
m_layout->setSizeConstraint(QLayout::SetFixedSize);
|
m_layout->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
|
if (!HostOsInfo::isMacHost()) // work around QTBUG-131479
|
||||||
adjustSize();
|
adjustSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -25,5 +25,29 @@
|
|||||||
],
|
],
|
||||||
"Url" : "https://www.qt.io",
|
"Url" : "https://www.qt.io",
|
||||||
"DocumentationUrl" : "https://doc.qt.io/qtcreator/creator-projects-autotools.html",
|
"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
|
autogenstep.cpp autogenstep.h
|
||||||
autoreconfstep.cpp autoreconfstep.h
|
autoreconfstep.cpp autoreconfstep.h
|
||||||
autotoolsbuildconfiguration.cpp autotoolsbuildconfiguration.h
|
autotoolsbuildconfiguration.cpp autotoolsbuildconfiguration.h
|
||||||
autotoolsbuildsystem.cpp autotoolsbuildsystem.h
|
|
||||||
autotoolsprojectconstants.h
|
autotoolsprojectconstants.h
|
||||||
autotoolsprojectmanagertr.h
|
autotoolsprojectmanagertr.h
|
||||||
autotoolsprojectplugin.cpp
|
autotoolsprojectplugin.cpp
|
||||||
|
@@ -5,29 +5,191 @@
|
|||||||
|
|
||||||
#include "autotoolsprojectconstants.h"
|
#include "autotoolsprojectconstants.h"
|
||||||
#include "autotoolsprojectmanagertr.h"
|
#include "autotoolsprojectmanagertr.h"
|
||||||
|
#include "makefileparser.h"
|
||||||
|
|
||||||
#include <projectexplorer/buildinfo.h>
|
#include <projectexplorer/buildinfo.h>
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
|
#include <projectexplorer/buildsystem.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/projectexplorertr.h>
|
#include <projectexplorer/projectexplorertr.h>
|
||||||
|
#include <projectexplorer/projectupdater.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
|
||||||
|
#include <qtsupport/qtcppkitinfo.h>
|
||||||
|
|
||||||
|
#include <solutions/tasking/tasktreerunner.h>
|
||||||
|
|
||||||
|
#include <utils/async.h>
|
||||||
#include <utils/mimeconstants.h>
|
#include <utils/mimeconstants.h>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
using namespace Tasking;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
namespace AutotoolsProjectManager::Internal {
|
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
|
class AutotoolsBuildConfiguration final : public BuildConfiguration
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AutotoolsBuildConfiguration(Target *target, Id id)
|
AutotoolsBuildConfiguration(Target *target, Id id)
|
||||||
: BuildConfiguration(target, id)
|
: BuildConfiguration(target, id)
|
||||||
|
, m_buildSystem(new AutotoolsBuildSystem(this))
|
||||||
{
|
{
|
||||||
// /<foobar> is used so the un-changed check in setBuildDirectory() works correctly.
|
// /<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.
|
// The leading / is to avoid the relative the path expansion in BuildConfiguration::buildDirectory.
|
||||||
@@ -48,6 +210,13 @@ public:
|
|||||||
// ### Build Steps Clean ###
|
// ### Build Steps Clean ###
|
||||||
appendInitialCleanStep(Constants::MAKE_STEP_ID); // make 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
|
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",
|
"autoreconfstep.h",
|
||||||
"autotoolsbuildconfiguration.cpp",
|
"autotoolsbuildconfiguration.cpp",
|
||||||
"autotoolsbuildconfiguration.h",
|
"autotoolsbuildconfiguration.h",
|
||||||
"autotoolsbuildsystem.cpp",
|
|
||||||
"autotoolsbuildsystem.h",
|
|
||||||
"autotoolsprojectconstants.h",
|
"autotoolsprojectconstants.h",
|
||||||
"autotoolsprojectmanagertr.h",
|
"autotoolsprojectmanagertr.h",
|
||||||
"autotoolsprojectplugin.cpp",
|
"autotoolsprojectplugin.cpp",
|
||||||
|
@@ -4,7 +4,6 @@
|
|||||||
#include "autogenstep.h"
|
#include "autogenstep.h"
|
||||||
#include "autoreconfstep.h"
|
#include "autoreconfstep.h"
|
||||||
#include "autotoolsbuildconfiguration.h"
|
#include "autotoolsbuildconfiguration.h"
|
||||||
#include "autotoolsbuildsystem.h"
|
|
||||||
#include "autotoolsprojectconstants.h"
|
#include "autotoolsprojectconstants.h"
|
||||||
#include "configurestep.h"
|
#include "configurestep.h"
|
||||||
#include "makestep.h"
|
#include "makestep.h"
|
||||||
@@ -41,7 +40,6 @@ public:
|
|||||||
setProjectLanguages(Core::Context(ProjectExplorer::Constants::CXX_LANGUAGE_ID));
|
setProjectLanguages(Core::Context(ProjectExplorer::Constants::CXX_LANGUAGE_ID));
|
||||||
setDisplayName(projectDirectory().fileName());
|
setDisplayName(projectDirectory().fileName());
|
||||||
setHasMakeInstallEquivalent(true);
|
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()
|
void TerminalSearch::nextHit()
|
||||||
{
|
{
|
||||||
if (m_hits.isEmpty())
|
if (m_hits.isEmpty())
|
||||||
@@ -67,13 +79,6 @@ void TerminalSearch::previousHit()
|
|||||||
|
|
||||||
void TerminalSearch::updateHits()
|
void TerminalSearch::updateHits()
|
||||||
{
|
{
|
||||||
if (!m_hits.isEmpty()) {
|
|
||||||
m_hits.clear();
|
|
||||||
m_currentHit = -1;
|
|
||||||
emit hitsChanged();
|
|
||||||
emit currentHitChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_debounceTimer.start();
|
m_debounceTimer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,6 +287,10 @@ SearchableTerminal::SearchableTerminal(QWidget *parent)
|
|||||||
m_aggregate->add(this);
|
m_aggregate->add(this);
|
||||||
|
|
||||||
surfaceChanged();
|
surfaceChanged();
|
||||||
|
|
||||||
|
connect(this, &TerminalSolution::TerminalView::cleared, this, [this] {
|
||||||
|
m_search->clearAndSearchAgain();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
SearchableTerminal::~SearchableTerminal() = default;
|
SearchableTerminal::~SearchableTerminal() = default;
|
||||||
|
@@ -25,6 +25,7 @@ public:
|
|||||||
|
|
||||||
void setCurrentSelection(std::optional<SearchHitWithText> selection);
|
void setCurrentSelection(std::optional<SearchHitWithText> selection);
|
||||||
void setSearchString(const QString &searchString, Utils::FindFlags findFlags);
|
void setSearchString(const QString &searchString, Utils::FindFlags findFlags);
|
||||||
|
void clearAndSearchAgain();
|
||||||
void nextHit();
|
void nextHit();
|
||||||
void previousHit();
|
void previousHit();
|
||||||
|
|
||||||
|
@@ -54,6 +54,7 @@
|
|||||||
#include <qtsupport/qtkitaspect.h>
|
#include <qtsupport/qtkitaspect.h>
|
||||||
|
|
||||||
#include <QTcpServer>
|
#include <QTcpServer>
|
||||||
|
#include <QTextCodec>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
@@ -104,6 +105,9 @@ public:
|
|||||||
|
|
||||||
// DebugServer
|
// DebugServer
|
||||||
Process debuggerServerProc;
|
Process debuggerServerProc;
|
||||||
|
QTextCodec *debuggerServerCodec = QTextCodec::codecForName("utf8");
|
||||||
|
QTextCodec::ConverterState outputCodecState; // FIXME: Handle on Process side.
|
||||||
|
QTextCodec::ConverterState errorCodecState;
|
||||||
ProcessHandle serverAttachPid;
|
ProcessHandle serverAttachPid;
|
||||||
bool serverUseMulti = true;
|
bool serverUseMulti = true;
|
||||||
bool serverEssential = true;
|
bool serverEssential = true;
|
||||||
@@ -1142,8 +1146,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);
|
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] {
|
connect(&d->debuggerServerProc, &Process::started, this, [this] {
|
||||||
continueAfterDebugServerStart();
|
continueAfterDebugServerStart();
|
||||||
});
|
});
|
||||||
|
@@ -464,6 +464,7 @@ DebuggerToolTipWidget::DebuggerToolTipWidget(DebuggerEngine *engine,
|
|||||||
auto mainLayout = new QVBoxLayout(this);
|
auto mainLayout = new QVBoxLayout(this);
|
||||||
mainLayout->setSizeConstraint(QLayout::SetFixedSize);
|
mainLayout->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
mainLayout->setContentsMargins(0, 0, 0, 0);
|
mainLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
mainLayout->setSpacing(0);
|
||||||
mainLayout->addWidget(toolBar);
|
mainLayout->addWidget(toolBar);
|
||||||
mainLayout->addWidget(treeView);
|
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)
|
void LanguageClientQuickFixAssistProcessor::handleCodeActionResponse(const CodeActionRequest::Response &response)
|
||||||
{
|
{
|
||||||
m_currentRequest.reset();
|
m_currentRequest.reset();
|
||||||
@@ -101,17 +117,7 @@ void LanguageClientQuickFixAssistProcessor::handleCodeActionResponse(const CodeA
|
|||||||
|
|
||||||
GenericProposal *LanguageClientQuickFixAssistProcessor::handleCodeActionResult(const CodeActionResult &result)
|
GenericProposal *LanguageClientQuickFixAssistProcessor::handleCodeActionResult(const CodeActionResult &result)
|
||||||
{
|
{
|
||||||
if (auto list = std::get_if<QList<std::variant<Command, CodeAction>>>(&result)) {
|
return GenericProposal::createProposal(interface(), resultToOperations(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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LanguageClientQuickFixProvider::LanguageClientQuickFixProvider(Client *client)
|
LanguageClientQuickFixProvider::LanguageClientQuickFixProvider(Client *client)
|
||||||
|
@@ -67,6 +67,8 @@ public:
|
|||||||
void cancel() override;
|
void cancel() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
TextEditor::QuickFixOperations resultToOperations(
|
||||||
|
const LanguageServerProtocol::CodeActionResult &result);
|
||||||
void setOnlyKinds(const QList<LanguageServerProtocol::CodeActionKind> &only);
|
void setOnlyKinds(const QList<LanguageServerProtocol::CodeActionKind> &only);
|
||||||
Client *client() { return m_client; }
|
Client *client() { return m_client; }
|
||||||
|
|
||||||
|
@@ -490,7 +490,6 @@ public:
|
|||||||
m_initializationOptions = options.as<QString>();
|
m_initializationOptions = options.as<QString>();
|
||||||
|
|
||||||
emit optionsChanged();
|
emit optionsChanged();
|
||||||
LanguageClientManager::applySettings();
|
|
||||||
m_isUpdatingAsyncOptions = false;
|
m_isUpdatingAsyncOptions = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -242,6 +242,7 @@ ExtraCompiler *BuildSystem::extraCompilerForTarget(const Utils::FilePath &target
|
|||||||
MakeInstallCommand BuildSystem::makeInstallCommand(const FilePath &installRoot) const
|
MakeInstallCommand BuildSystem::makeInstallCommand(const FilePath &installRoot) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(target()->project()->hasMakeInstallEquivalent(), return {});
|
QTC_ASSERT(target()->project()->hasMakeInstallEquivalent(), return {});
|
||||||
|
QTC_ASSERT(buildConfiguration(), return {});
|
||||||
|
|
||||||
BuildStepList *buildSteps = buildConfiguration()->buildSteps();
|
BuildStepList *buildSteps = buildConfiguration()->buildSteps();
|
||||||
QTC_ASSERT(buildSteps, return {});
|
QTC_ASSERT(buildSteps, return {});
|
||||||
|
@@ -6,12 +6,16 @@
|
|||||||
#include "qmljseditorconstants.h"
|
#include "qmljseditorconstants.h"
|
||||||
#include "qmljseditortr.h"
|
#include "qmljseditortr.h"
|
||||||
#include "qmljseditorsettings.h"
|
#include "qmljseditorsettings.h"
|
||||||
|
#include "qmljsquickfix.h"
|
||||||
|
|
||||||
#include <languageclient/languageclientinterface.h>
|
#include <languageclient/languageclientinterface.h>
|
||||||
#include <languageclient/languageclientmanager.h>
|
#include <languageclient/languageclientmanager.h>
|
||||||
|
#include <languageclient/languageclientquickfix.h>
|
||||||
|
|
||||||
#include <projectexplorer/buildmanager.h>
|
#include <projectexplorer/buildmanager.h>
|
||||||
|
|
||||||
|
#include <texteditor/codeassist/genericproposal.h>
|
||||||
|
#include <texteditor/codeassist/iassistprovider.h>
|
||||||
#include <texteditor/textdocument.h>
|
#include <texteditor/textdocument.h>
|
||||||
#include <texteditor/texteditor.h>
|
#include <texteditor/texteditor.h>
|
||||||
#include <texteditor/texteditorconstants.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)
|
QmllsClient::QmllsClient(StdIOClientInterface *interface)
|
||||||
: Client(interface)
|
: Client(interface)
|
||||||
{
|
{
|
||||||
@@ -178,6 +217,7 @@ QmllsClient::QmllsClient(StdIOClientInterface *interface)
|
|||||||
}
|
}
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
});
|
});
|
||||||
|
setQuickFixAssistProvider(new QmllsQuickFixAssistProvider(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
QmllsClient::~QmllsClient()
|
QmllsClient::~QmllsClient()
|
||||||
|
@@ -70,7 +70,7 @@ WebAssemblySettings::WebAssemblySettings()
|
|||||||
"or %3 version that you plan to develop against.")
|
"or %3 version that you plan to develop against.")
|
||||||
.arg(R"(<a href="https://emscripten.org/docs/getting_started/downloads.html">Emscripten SDK</a>)")
|
.arg(R"(<a href="https://emscripten.org/docs/getting_started/downloads.html">Emscripten SDK</a>)")
|
||||||
.arg(R"(<a href="https://doc.qt.io/qt-5/wasm.html#install-emscripten">Qt 5</a>)")
|
.arg(R"(<a href="https://doc.qt.io/qt-5/wasm.html#install-emscripten">Qt 5</a>)")
|
||||||
.arg(R"(<a href="https://doc.qt.io/qt-6/wasm.html#install-emscripten">Qt 6</a>)"));
|
.arg(R"(<a href="https://doc.qt.io/qt-6/wasm.html#installing-emscripten">Qt 6</a>)"));
|
||||||
instruction->setOpenExternalLinks(true);
|
instruction->setOpenExternalLinks(true);
|
||||||
instruction->setWordWrap(true);
|
instruction->setWordWrap(true);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user