forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/5.0'
Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri Change-Id: I5dd6bd7d7e71c84a43b33c0aded673f3c4a57ef8
This commit is contained in:
@@ -43,10 +43,6 @@ if(${Qt5_VERSION} VERSION_LESS "6.2.0")
|
||||
qml/tracing.qrc
|
||||
)
|
||||
else() # < Qt 6.2
|
||||
if (NOT TARGET Tracing)
|
||||
return()
|
||||
endif()
|
||||
|
||||
add_qtc_library(Tracing
|
||||
FEATURE_INFO
|
||||
DEPENDS Utils Qt5::Qml Qt5::Quick
|
||||
@@ -55,6 +51,10 @@ else() # < Qt 6.2
|
||||
${TEST_SOURCES}
|
||||
)
|
||||
|
||||
if (NOT TARGET Tracing)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(TRACING_QML_FILES
|
||||
qml/ButtonsBar.qml
|
||||
qml/CategoryLabel.qml
|
||||
|
@@ -72,6 +72,9 @@ namespace ClangCodeModel {
|
||||
namespace Internal {
|
||||
|
||||
static Q_LOGGING_CATEGORY(clangdLog, "qtc.clangcodemodel.clangd", QtWarningMsg);
|
||||
static Q_LOGGING_CATEGORY(clangdLogServer, "qtc.clangcodemodel.clangd.server", QtWarningMsg);
|
||||
static Q_LOGGING_CATEGORY(clangdLogAst, "qtc.clangcodemodel.clangd.ast", QtWarningMsg);
|
||||
static Q_LOGGING_CATEGORY(clangdLogHighlight, "qtc.clangcodemodel.clangd.highlight", QtWarningMsg);
|
||||
static QString indexingToken() { return "backgroundIndexProgress"; }
|
||||
|
||||
class AstParams : public JsonObject
|
||||
@@ -438,7 +441,7 @@ static BaseClientInterface *clientInterface(Project *project, const Utils::FileP
|
||||
cmd.addArg("-j=" + QString::number(settings.workerThreadLimit()));
|
||||
if (!jsonDbDir.isEmpty())
|
||||
cmd.addArg("--compile-commands-dir=" + jsonDbDir.toString());
|
||||
if (clangdLog().isDebugEnabled())
|
||||
if (clangdLogServer().isDebugEnabled())
|
||||
cmd.addArgs({"--log=verbose", "--pretty"});
|
||||
const auto interface = new StdIOClientInterface;
|
||||
interface->setCommandLine(cmd);
|
||||
@@ -1367,7 +1370,7 @@ void ClangdClient::gatherHelpItemForTooltip(const HoverRequest::Response &hoverR
|
||||
if (children && !children->isEmpty())
|
||||
node = children->first();
|
||||
}
|
||||
if (clangdLog().isDebugEnabled())
|
||||
if (clangdLogAst().isDebugEnabled())
|
||||
node.print(0);
|
||||
|
||||
QString type = node.type();
|
||||
@@ -1687,7 +1690,7 @@ void ClangdClient::Private::handleDeclDefSwitchReplies()
|
||||
// Find the function declaration or definition associated with the cursor.
|
||||
// For instance, the cursor could be somwehere inside a function body or
|
||||
// on a function return type, or ...
|
||||
if (clangdLog().isDebugEnabled())
|
||||
if (clangdLogAst().isDebugEnabled())
|
||||
switchDeclDefData->ast->print(0);
|
||||
const Utils::optional<AstNode> functionNode = switchDeclDefData->getFunctionNode();
|
||||
if (!functionNode) {
|
||||
@@ -1760,7 +1763,7 @@ static void collectExtraResults(QFutureInterface<TextEditor::HighlightingResult>
|
||||
return;
|
||||
const auto it = std::lower_bound(results.begin(), results.end(), result, lessThan);
|
||||
if (it == results.end() || *it != result) {
|
||||
qCDebug(clangdLog) << "adding additional highlighting result"
|
||||
qCDebug(clangdLogHighlight) << "adding additional highlighting result"
|
||||
<< result.line << result.column << result.length;
|
||||
results.insert(it, result);
|
||||
return;
|
||||
@@ -2317,7 +2320,7 @@ static void semanticHighlighter(QFutureInterface<TextEditor::HighlightingResult>
|
||||
styles.mixinStyles.push_back(TextEditor::C_DECLARATION);
|
||||
if (isOutputParameter(token))
|
||||
styles.mixinStyles.push_back(TextEditor::C_OUTPUT_ARGUMENT);
|
||||
qCDebug(clangdLog) << "adding highlighting result"
|
||||
qCDebug(clangdLogHighlight) << "adding highlighting result"
|
||||
<< token.line << token.column << token.length << int(styles.mainStyle);
|
||||
return TextEditor::HighlightingResult(token.line, token.column, token.length, styles);
|
||||
};
|
||||
@@ -2350,7 +2353,8 @@ void ClangdClient::Private::handleSemanticTokens(TextEditor::TextDocument *doc,
|
||||
{
|
||||
qCDebug(clangdLog()) << "handling LSP tokens" << tokens.size();
|
||||
for (const ExpandedSemanticToken &t : tokens)
|
||||
qCDebug(clangdLog) << '\t' << t.line << t.column << t.length << t.type << t.modifiers;
|
||||
qCDebug(clangdLogHighlight()) << '\t' << t.line << t.column << t.length << t.type
|
||||
<< t.modifiers;
|
||||
|
||||
// TODO: Cache ASTs
|
||||
AstParams params(TextDocumentIdentifier(DocumentUri::fromFilePath(doc->filePath())));
|
||||
@@ -2359,7 +2363,7 @@ void ClangdClient::Private::handleSemanticTokens(TextEditor::TextDocument *doc,
|
||||
if (!q->documentOpen(doc))
|
||||
return;
|
||||
const Utils::optional<AstNode> ast = response.result();
|
||||
if (ast && clangdLog().isDebugEnabled())
|
||||
if (ast && clangdLogAst().isDebugEnabled())
|
||||
ast->print();
|
||||
|
||||
const auto runner = [tokens, text = doc->document()->toPlainText(),
|
||||
|
@@ -734,7 +734,9 @@ void DockerDevicePrivate::tryCreateLocalFileAccess()
|
||||
LOG("RES: " << m_shell->result()
|
||||
<< " STDOUT: " << m_shell->readAllStandardOutput()
|
||||
<< " STDERR: " << m_shell->readAllStandardError());
|
||||
if (m_shell->exitCode() != 0) {
|
||||
// negative exit codes indicate problems like no docker daemon, missing permissions,
|
||||
// no shell and seem to result in exit codes 125+
|
||||
if (m_shell->exitCode() > 120) {
|
||||
m_accessible = NoDaemon;
|
||||
LOG("DOCKER DAEMON NOT RUNNING?");
|
||||
MessageManager::writeFlashing(tr("Docker Daemon appears to be not running. "
|
||||
|
@@ -48,10 +48,6 @@ if(${Qt5_VERSION} VERSION_LESS "6.2.0")
|
||||
perfprofiler.qrc
|
||||
)
|
||||
else() # < Qt 6.2
|
||||
if (NOT TARGET PerfProfiler)
|
||||
return()
|
||||
endif()
|
||||
|
||||
add_qtc_plugin(PerfProfiler
|
||||
DEPENDS Tracing Qt5::QuickWidgets
|
||||
PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport
|
||||
@@ -59,6 +55,10 @@ else() # < Qt 6.2
|
||||
${TEST_SOURCES}
|
||||
)
|
||||
|
||||
if (NOT TARGET PerfProfiler)
|
||||
return()
|
||||
endif()
|
||||
|
||||
qt_add_resources(PerfProfiler perfprofiler
|
||||
PREFIX "/perfprofiler"
|
||||
tracepoints.sh
|
||||
|
@@ -79,10 +79,6 @@ if(${Qt5_VERSION} VERSION_LESS "6.2.0")
|
||||
qml/qmlprofiler.qrc
|
||||
)
|
||||
else() # < Qt 6.2
|
||||
if (NOT TARGET QmlProfiler)
|
||||
return()
|
||||
endif()
|
||||
|
||||
add_qtc_plugin(QmlProfiler
|
||||
DEPENDS QmlDebug QmlJS Tracing Qt5::QuickWidgets
|
||||
PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport TextEditor
|
||||
@@ -90,6 +86,10 @@ else() # < Qt 6.2
|
||||
${TEST_SOURCES}
|
||||
)
|
||||
|
||||
if (NOT TARGET QmlProfiler)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(QMLPROFILER_QML_FILES
|
||||
qml/QmlProfilerFlameGraphView.qml
|
||||
)
|
||||
|
@@ -92,9 +92,9 @@ QByteArray CodeStylePoolPrivate::generateUniqueId(const QByteArray &id) const
|
||||
}
|
||||
}
|
||||
|
||||
static QString customCodeStylesPath()
|
||||
static Utils::FilePath customCodeStylesPath()
|
||||
{
|
||||
return Core::ICore::userResourcePath("codestyles").toString();
|
||||
return Core::ICore::userResourcePath("codestyles");
|
||||
}
|
||||
|
||||
CodeStylePool::CodeStylePool(ICodeStylePreferencesFactory *factory, QObject *parent)
|
||||
@@ -112,7 +112,7 @@ CodeStylePool::~CodeStylePool()
|
||||
QString CodeStylePool::settingsDir() const
|
||||
{
|
||||
const QString suffix = d->m_factory ? d->m_factory->languageId().toString() : QLatin1String("default");
|
||||
return customCodeStylesPath().append(suffix);
|
||||
return customCodeStylesPath().pathAppended(suffix).toString();
|
||||
}
|
||||
|
||||
Utils::FilePath CodeStylePool::settingsPath(const QByteArray &id) const
|
||||
@@ -261,7 +261,7 @@ void CodeStylePool::slotSaveCodeStyle()
|
||||
|
||||
void CodeStylePool::saveCodeStyle(ICodeStylePreferences *codeStyle) const
|
||||
{
|
||||
const QString codeStylesPath = customCodeStylesPath();
|
||||
const QString codeStylesPath = customCodeStylesPath().toString();
|
||||
|
||||
// Create the base directory when it doesn't exist
|
||||
if (!QFile::exists(codeStylesPath) && !QDir().mkpath(codeStylesPath)) {
|
||||
|
@@ -2964,30 +2964,31 @@ void tst_TestCore::testRewriterAddNodeTransaction()
|
||||
void tst_TestCore::testRewriterComponentId()
|
||||
{
|
||||
char qmlString[] = "import QtQuick 2.0\n"
|
||||
"Rectangle {\n"
|
||||
" Component {\n"
|
||||
" id: testComponent\n"
|
||||
" Item {\n"
|
||||
" }\n"
|
||||
" }\n"
|
||||
"}\n";
|
||||
"Rectangle {\n"
|
||||
" Component {\n"
|
||||
" id: testComponent\n"
|
||||
" Item {\n"
|
||||
" }\n"
|
||||
" }\n"
|
||||
"}\n";
|
||||
|
||||
QPlainTextEdit textEdit;
|
||||
textEdit.setPlainText(QLatin1String(qmlString));
|
||||
NotIndentingTextEditModifier textModifier(&textEdit);
|
||||
|
||||
QScopedPointer<Model> model(createModel("QtQuick.Rectangle", 2, 1));
|
||||
QScopedPointer<Model> model(Model::create("QtQuick.Item", 2, 0));
|
||||
QVERIFY(model.data());
|
||||
QVERIFY(model->hasNodeMetaInfo("QtQuick.Item", 2, 1));
|
||||
|
||||
QScopedPointer<TestView> view(new TestView(model.data()));
|
||||
QVERIFY(view.data());
|
||||
model->attachView(view.data());
|
||||
|
||||
QScopedPointer<TestRewriterView> testRewriterView(new TestRewriterView());
|
||||
QVERIFY(model->rewriterView());
|
||||
QVERIFY(!model->rewriterView());
|
||||
testRewriterView->setTextModifier(&textModifier);
|
||||
|
||||
model->attachView(testRewriterView.data());
|
||||
QVERIFY(model->rewriterView());
|
||||
|
||||
QVERIFY(model->hasNodeMetaInfo("QtQuick.Item", 2, 1));
|
||||
|
||||
@@ -3738,8 +3739,6 @@ void tst_TestCore::testCopyModelRewriter1()
|
||||
QVERIFY(insertedNode.isValid());
|
||||
childNode.nodeListProperty("data").reparentHere(insertedNode);
|
||||
|
||||
|
||||
|
||||
const QLatin1String expected(
|
||||
|
||||
"\n"
|
||||
|
Reference in New Issue
Block a user