Skip to content

Commit ca916ae

Browse files
committed
Clang format
1 parent 8a3fb67 commit ca916ae

3 files changed

Lines changed: 13 additions & 13 deletions

File tree

src/plugins/TreeSitter/TreeSitterEngine.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
extern "C" const TSLanguage *tree_sitter_cpp();
99
extern "C" const TSLanguage *tree_sitter_c();
1010

11-
TreeSitterEngine::TreeSitterEngine() {}
11+
TreeSitterEngine::TreeSitterEngine() {}
1212

1313
TreeSitterEngine::~TreeSitterEngine() {}
1414

@@ -55,7 +55,8 @@ void TreeSitterEngine::updateFile(const QString &fileName, const QByteArray &con
5555

5656
if (!newTree) {
5757
if (cancelFlag.load(std::memory_order_relaxed)) {
58-
qDebug() << "TreeSitterEngine: cancelled while parsing" << QFileInfo(fileName).fileName();
58+
qDebug() << "TreeSitterEngine: cancelled while parsing"
59+
<< QFileInfo(fileName).fileName();
5960
}
6061
return;
6162
}
@@ -67,9 +68,8 @@ void TreeSitterEngine::updateFile(const QString &fileName, const QByteArray &con
6768
fileContexts[fileName] = context;
6869
}
6970

70-
7171
QList<TreeSitterEngine::Symbol> TreeSitterEngine::getSymbols(const QString &fileName,
72-
const QByteArray &content) {
72+
const QByteArray &content) {
7373
auto context = std::shared_ptr<FileContext>{};
7474
auto fileId = quint64{};
7575
{
@@ -239,9 +239,9 @@ QList<TreeSitterEngine::Symbol> TreeSitterEngine::getSymbols(const QString &file
239239
}
240240
}
241241
if (params.id) {
242-
auto pStr = QString::fromUtf8(content.mid(
243-
ts_node_start_byte(params),
244-
ts_node_end_byte(params) - ts_node_start_byte(params)));
242+
auto pStr = QString::fromUtf8(
243+
content.mid(ts_node_start_byte(params),
244+
ts_node_end_byte(params) - ts_node_start_byte(params)));
245245
sym.signature = QString("%1 %2%3").arg(sym.type, sym.name, pStr);
246246
}
247247
}
@@ -428,7 +428,8 @@ TreeSitterEngine::findSymbolsGlobal(const QString &name, bool exactMatch, const
428428
auto lang = fileContexts[file]->language;
429429
auto localParser = ts_parser_new();
430430
ts_parser_set_language(localParser, lang);
431-
auto *t = ts_parser_parse_string(localParser, nullptr, fileContent.data(), fileContent.size());
431+
auto *t =
432+
ts_parser_parse_string(localParser, nullptr, fileContent.data(), fileContent.size());
432433
ts_parser_delete(localParser);
433434
return t;
434435
};
@@ -562,7 +563,6 @@ TreeSitterEngine::findSymbolsGlobal(const QString &name, bool exactMatch, const
562563
return results.isEmpty() ? otherProjectResults : results;
563564
}
564565

565-
566566
bool TreeSitterEngine::isFunctionOrBlock(std::string_view type) {
567567
return type == TSNodeTypes::FunctionDefinition || type == TSNodeTypes::LambdaExpression ||
568568
type == TSNodeTypes::CompoundStatement;

src/plugins/TreeSitter/TreeSitterPlugin.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ QFuture<CommandArgs> TreeSitterPlugin::doScanProjectDir(const QString &sourceDir
191191
const bool isHeader = TreeSitterEngine::isHeaderFile(filePath);
192192
const qint64 maxFileSize = isHeader ? 2 * 1024 * 1024 : 512 * 1024;
193193
if (f.size() > maxFileSize) {
194-
qDebug() << "TreeSitterPlugin: skipping large file"
195-
<< filePath << "(" << f.size() / 1024 << "KB)";
194+
qDebug() << "TreeSitterPlugin: skipping large file" << filePath << "("
195+
<< f.size() / 1024 << "KB)";
196196
processedCount.fetch_add(1, std::memory_order_relaxed);
197197
continue;
198198
}
@@ -264,7 +264,8 @@ QFuture<CommandArgs> TreeSitterPlugin::doScanProjectDir(const QString &sourceDir
264264
qDebug() << "TreeSitterPlugin:" << projectLabel << "- Found" << totalClasses.load()
265265
<< "classes/structs and" << totalFunctions.load() << "functions;"
266266
<< "wall:" << wallMs << "ms cpu:" << cpuMs << "ms"
267-
<< QString("(%1x vs sequential)").arg(cpuMs > 0 ? double(cpuMs) / wallMs : 1.0, 0, 'f', 1)
267+
<< QString("(%1x vs sequential)")
268+
.arg(cpuMs > 0 ? double(cpuMs) / wallMs : 1.0, 0, 'f', 1)
268269
<< "; slowest file" << slowestMs.load() << "ms:" << slowestFile;
269270
return CommandArgs{};
270271
});

src/widgets/qmdieditor.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ class qmdiEditor : public QWidget, public qmdiClient {
208208
QFuture<QSet<Qutepart::CompletionItem>>
209209
getTagCompletions(const QString &prefix, const QString &previousWord, const QString &separator);
210210

211-
212211
private:
213212
QString getShortFileName();
214213
void showContextMenu(const QPoint &localPosition, const QPoint &globalPosition);

0 commit comments

Comments
 (0)